Socket
Socket
Sign inDemoInstall

@babel/generator

Package Overview
Dependencies
Maintainers
4
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/generator - npm Package Compare versions

Comparing version 7.17.3 to 7.17.7

43

lib/generators/modules.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc