@babel/generator
Advanced tools
Comparing version 7.17.3 to 7.17.7
@@ -174,4 +174,5 @@ "use strict"; | ||
this.space(); | ||
const isTypeKind = node.importKind === "type" || node.importKind === "typeof"; | ||
if (node.importKind === "type" || node.importKind === "typeof") { | ||
if (isTypeKind) { | ||
this.word(node.importKind); | ||
@@ -182,27 +183,31 @@ this.space(); | ||
const specifiers = node.specifiers.slice(0); | ||
const hasSpecifiers = !!specifiers.length; | ||
if (specifiers != null && specifiers.length) { | ||
for (;;) { | ||
const first = specifiers[0]; | ||
while (hasSpecifiers) { | ||
const first = specifiers[0]; | ||
if (isImportDefaultSpecifier(first) || isImportNamespaceSpecifier(first)) { | ||
this.print(specifiers.shift(), node); | ||
if (isImportDefaultSpecifier(first) || isImportNamespaceSpecifier(first)) { | ||
this.print(specifiers.shift(), node); | ||
if (specifiers.length) { | ||
this.token(","); | ||
this.space(); | ||
} | ||
} else { | ||
break; | ||
if (specifiers.length) { | ||
this.token(","); | ||
this.space(); | ||
} | ||
} else { | ||
break; | ||
} | ||
} | ||
if (specifiers.length) { | ||
this.token("{"); | ||
this.space(); | ||
this.printList(specifiers, node); | ||
this.space(); | ||
this.token("}"); | ||
} | ||
if (specifiers.length) { | ||
this.token("{"); | ||
this.space(); | ||
this.printList(specifiers, node); | ||
this.space(); | ||
this.token("}"); | ||
} else if (isTypeKind && !hasSpecifiers) { | ||
this.token("{"); | ||
this.token("}"); | ||
} | ||
if (hasSpecifiers || isTypeKind) { | ||
this.space(); | ||
@@ -209,0 +214,0 @@ this.word("from"); |
{ | ||
"name": "@babel/generator", | ||
"version": "7.17.3", | ||
"version": "7.17.7", | ||
"description": "Turns an AST into code.", | ||
@@ -28,3 +28,3 @@ "author": "The Babel Team (https://babel.dev/team)", | ||
"@babel/helper-fixtures": "^7.17.0", | ||
"@babel/parser": "^7.17.3", | ||
"@babel/parser": "^7.17.7", | ||
"@jridgewell/trace-mapping": "^0.3.4", | ||
@@ -31,0 +31,0 @@ "@types/jsesc": "^2.5.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119383
4255