@openrewrite/rewrite 8.55.1 → 8.55.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/javascript/comparator.d.ts.map +1 -1
- package/dist/src/javascript/comparator.js +10 -13
- package/dist/src/javascript/comparator.js.map +1 -1
- package/dist/src/javascript/format.d.ts +0 -2
- package/dist/src/javascript/format.d.ts.map +1 -1
- package/dist/src/javascript/format.js +4 -33
- package/dist/src/javascript/format.js.map +1 -1
- package/dist/src/javascript/parser.d.ts +3 -3
- package/dist/src/javascript/parser.d.ts.map +1 -1
- package/dist/src/javascript/parser.js +92 -62
- package/dist/src/javascript/parser.js.map +1 -1
- package/dist/src/javascript/print.d.ts.map +1 -1
- package/dist/src/javascript/print.js +5 -22
- package/dist/src/javascript/print.js.map +1 -1
- package/dist/src/javascript/rpc.js +2 -2
- package/dist/src/javascript/rpc.js.map +1 -1
- package/dist/src/javascript/tree.d.ts +2 -11
- package/dist/src/javascript/tree.d.ts.map +1 -1
- package/dist/src/javascript/tree.js.map +1 -1
- package/dist/src/javascript/visitor.d.ts.map +1 -1
- package/dist/src/javascript/visitor.js +2 -2
- package/dist/src/javascript/visitor.js.map +1 -1
- package/package.json +1 -1
- package/src/javascript/comparator.ts +10 -15
- package/src/javascript/format.ts +4 -25
- package/src/javascript/parser.ts +94 -77
- package/src/javascript/print.ts +6 -24
- package/src/javascript/rpc.ts +2 -2
- package/src/javascript/tree.ts +2 -12
- package/src/javascript/visitor.ts +2 -2
package/src/javascript/tree.ts
CHANGED
|
@@ -223,8 +223,9 @@ export namespace JS {
|
|
|
223
223
|
export interface Import extends JS, Statement {
|
|
224
224
|
readonly kind: typeof Kind.Import;
|
|
225
225
|
readonly importClause?: ImportClause;
|
|
226
|
-
readonly moduleSpecifier
|
|
226
|
+
readonly moduleSpecifier?: J.LeftPadded<Expression>;
|
|
227
227
|
readonly attributes?: ImportAttributes;
|
|
228
|
+
readonly initializer?: J.LeftPadded<Expression>;
|
|
228
229
|
}
|
|
229
230
|
|
|
230
231
|
/**
|
|
@@ -418,20 +419,9 @@ export namespace JS {
|
|
|
418
419
|
export interface ScopedVariableDeclarations extends JS, Statement {
|
|
419
420
|
readonly kind: typeof Kind.ScopedVariableDeclarations;
|
|
420
421
|
readonly modifiers: J.Modifier[];
|
|
421
|
-
readonly scope?: J.LeftPadded<ScopedVariableDeclarations.Scope>;
|
|
422
422
|
readonly variables: J.RightPadded<J>[];
|
|
423
423
|
}
|
|
424
424
|
|
|
425
|
-
export namespace ScopedVariableDeclarations {
|
|
426
|
-
export const enum Scope {
|
|
427
|
-
Const = "Const",
|
|
428
|
-
Let = "Let",
|
|
429
|
-
Var = "Var",
|
|
430
|
-
Using = "Using",
|
|
431
|
-
Import = "Import"
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
|
|
435
425
|
/**
|
|
436
426
|
* Represents a statement used as an expression. The example shows a function expressions.
|
|
437
427
|
* @example const greet = function (name: string) : string { return name; };
|
|
@@ -279,8 +279,9 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
279
279
|
|
|
280
280
|
return this.produceJavaScript<JS.Import>(jsImport, p, async draft => {
|
|
281
281
|
draft.importClause = jsImport.importClause && await this.visitDefined<JS.ImportClause>(jsImport.importClause, p);
|
|
282
|
-
draft.moduleSpecifier = await this.visitLeftPadded(jsImport.moduleSpecifier, p);
|
|
282
|
+
draft.moduleSpecifier = jsImport.moduleSpecifier && await this.visitLeftPadded(jsImport.moduleSpecifier, p);
|
|
283
283
|
draft.attributes = jsImport.attributes && await this.visitDefined<JS.ImportAttributes>(jsImport.attributes, p);
|
|
284
|
+
draft.initializer = jsImport.initializer && await this.visitLeftPadded(jsImport.initializer, p);
|
|
284
285
|
});
|
|
285
286
|
}
|
|
286
287
|
|
|
@@ -451,7 +452,6 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
451
452
|
|
|
452
453
|
return this.produceJavaScript<JS.ScopedVariableDeclarations>(scopedVariableDeclarations, p, async draft => {
|
|
453
454
|
draft.modifiers = await mapAsync(scopedVariableDeclarations.modifiers, item => this.visitDefined<J.Modifier>(item, p));
|
|
454
|
-
draft.scope = scopedVariableDeclarations.scope && await this.visitLeftPadded(scopedVariableDeclarations.scope, p);
|
|
455
455
|
draft.variables = await mapAsync(scopedVariableDeclarations.variables, item => this.visitRightPadded(item, p));
|
|
456
456
|
});
|
|
457
457
|
}
|