@@ -91,14 +91,27 @@ class ImportDeclaration extends Stmt, Import, @import_declaration {
91
91
override PathExpr getImportedPath ( ) { result = this .getChildExpr ( - 1 ) }
92
92
93
93
/**
94
- * Gets the object literal passed as part of the `assert` clause in this import declaration.
94
+ * Gets the object literal passed as part of the `with` (or ` assert`) clause in this import declaration.
95
95
*
96
96
* For example, this gets the `{ type: "json" }` object literal in the following:
97
97
* ```js
98
+ * import foo from "foo" with { type: "json" };
98
99
* import foo from "foo" assert { type: "json" };
99
100
* ```
100
101
*/
101
- ObjectExpr getImportAssertion ( ) { result = this .getChildExpr ( - 10 ) }
102
+ ObjectExpr getImportAttributes ( ) { result = this .getChildExpr ( - 10 ) }
103
+
104
+ /**
105
+ * DEPRECATED: use `getImportAttributes` instead.
106
+ * Gets the object literal passed as part of the `with` (or `assert`) clause in this import declaration.
107
+ *
108
+ * For example, this gets the `{ type: "json" }` object literal in the following:
109
+ * ```js
110
+ * import foo from "foo" with { type: "json" };
111
+ * import foo from "foo" assert { type: "json" };
112
+ * ```
113
+ */
114
+ deprecated ObjectExpr getImportAssertion ( ) { result = this .getImportAttributes ( ) }
102
115
103
116
/** Gets the `i`th import specifier of this import declaration. */
104
117
ImportSpecifier getSpecifier ( int i ) { result = this .getChildExpr ( i ) }
@@ -322,17 +335,33 @@ abstract class ExportDeclaration extends Stmt, @export_declaration {
322
335
override string getAPrimaryQlClass ( ) { result = "ExportDeclaration" }
323
336
324
337
/**
325
- * Gets the object literal passed as part of the `assert` clause, if this is
338
+ * Gets the object literal passed as part of the `with` (or `assert`) clause, if this is
339
+ * a re-export declaration.
340
+ *
341
+ * For example, this gets the `{ type: "json" }` expression in each of the following:
342
+ * ```js
343
+ * export { x } from 'foo' with { type: "json" };
344
+ * export * from 'foo' with { type: "json" };
345
+ * export * as x from 'foo' with { type: "json" };
346
+ * export * from 'foo' assert { type: "json" };
347
+ * ```
348
+ */
349
+ ObjectExpr getImportAttributes ( ) { result = this .getChildExpr ( - 10 ) }
350
+
351
+ /**
352
+ * DEPRECATED: use `getImportAttributes` instead.
353
+ * Gets the object literal passed as part of the `with` (or `assert`) clause, if this is
326
354
* a re-export declaration.
327
355
*
328
356
* For example, this gets the `{ type: "json" }` expression in each of the following:
329
357
* ```js
330
- * export { x } from 'foo' assert { type: "json" };
358
+ * export { x } from 'foo' with { type: "json" };
359
+ * export * from 'foo' with { type: "json" };
360
+ * export * as x from 'foo' with { type: "json" };
331
361
* export * from 'foo' assert { type: "json" };
332
- * export * as x from 'foo' assert { type: "json" };
333
362
* ```
334
363
*/
335
- ObjectExpr getImportAssertion ( ) { result = this .getChildExpr ( - 10 ) }
364
+ deprecated ObjectExpr getImportAssertion ( ) { result = this .getImportAttributes ( ) }
336
365
}
337
366
338
367
/**
0 commit comments