@openrewrite/rewrite 8.55.0 → 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.
@@ -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: J.LeftPadded<Expression>;
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
  }