Socket
Socket
Sign inDemoInstall

@babel/helper-module-transforms

Package Overview
Dependencies
Maintainers
4
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/helper-module-transforms - npm Package Compare versions

Comparing version 7.17.6 to 7.17.7

4

lib/index.js

@@ -372,3 +372,5 @@ "use strict";

for (let i = 0, uninitializedExportNames = []; i < initStatements.length; i += chunkSize) {
for (let i = 0; i < initStatements.length; i += chunkSize) {
let uninitializedExportNames = [];
for (let j = 0; j < chunkSize && i + j < initStatements.length; j++) {

@@ -375,0 +377,0 @@ const [exportName, initStatement] = initStatements[i + j];

@@ -93,3 +93,3 @@ "use strict";

programPath.traverse(rewriteBindingInitVisitor, rewriteBindingInitVisitorState);
(0, _helperSimpleAccess.default)(programPath, new Set([...Array.from(imported.keys()), ...Array.from(exported.keys())]));
(0, _helperSimpleAccess.default)(programPath, new Set([...Array.from(imported.keys()), ...Array.from(exported.keys())]), false);
const rewriteReferencesVisitorState = {

@@ -234,2 +234,43 @@ seen: new WeakSet(),

UpdateExpression(path) {
const {
scope,
seen,
imported,
exported,
requeueInParent,
buildImportReference
} = this;
if (seen.has(path.node)) return;
seen.add(path.node);
const arg = path.get("argument");
if (arg.isMemberExpression()) return;
const update = path.node;
if (arg.isIdentifier()) {
const localName = arg.node.name;
if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {
return;
}
const exportedNames = exported.get(localName);
const importData = imported.get(localName);
if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) {
if (importData) {
path.replaceWith(assignmentExpression(update.operator[0] + "=", buildImportReference(importData, arg.node), buildImportThrow(localName)));
} else if (update.prefix) {
path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, cloneNode(update)));
} else {
const ref = scope.generateDeclaredUidIdentifier(localName);
path.replaceWith(sequenceExpression([assignmentExpression("=", cloneNode(ref), cloneNode(update)), buildBindingExportAssignmentExpression(this.metadata, exportedNames, identifier(localName)), cloneNode(ref)]));
}
}
}
requeueInParent(path);
path.skip();
},
AssignmentExpression: {

@@ -236,0 +277,0 @@ exit(path) {

{
"name": "@babel/helper-module-transforms",
"version": "7.17.6",
"version": "7.17.7",
"description": "Babel helper functions for implementing ES6 module transformations",

@@ -20,3 +20,3 @@ "author": "The Babel Team (https://babel.dev/team)",

"@babel/helper-module-imports": "^7.16.7",
"@babel/helper-simple-access": "^7.16.7",
"@babel/helper-simple-access": "^7.17.7",
"@babel/helper-split-export-declaration": "^7.16.7",

@@ -23,0 +23,0 @@ "@babel/helper-validator-identifier": "^7.16.7",

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