Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-modules-amd

Package Overview
Dependencies
54
Maintainers
4
Versions
79
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.19.6 to 7.20.7

28

lib/index.js

@@ -7,9 +7,5 @@ "use strict";

exports.default = void 0;
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _helperModuleTransforms = require("@babel/helper-module-transforms");
var _core = require("@babel/core");
const buildWrapper = _core.template.statement(`

@@ -19,3 +15,2 @@ define(MODULE_NAME, AMD_ARGUMENTS, function(IMPORT_NAMES) {

`);
const buildAnonymousWrapper = _core.template.statement(`

@@ -25,3 +20,2 @@ define(["require"], function(REQUIRE) {

`);
function injectWrapper(path, wrapper) {

@@ -40,6 +34,4 @@ const {

}
var _default = (0, _helperPluginUtils.declare)((api, options) => {
var _api$assumption, _api$assumption2;
api.assertVersion(7);

@@ -57,7 +49,5 @@ const {

name: "transform-modules-amd",
pre() {
this.file.set("@babel/plugin-transform-modules-*", "amd");
},
visitor: {

@@ -72,3 +62,2 @@ CallExpression(path, state) {

} = state;
if (!requireId) {

@@ -78,3 +67,2 @@ requireId = path.scope.generateUidIdentifier("require");

}
if (!resolveId || !rejectId) {

@@ -86,5 +74,3 @@ resolveId = path.scope.generateUidIdentifier("resolve");

}
let result = _core.types.identifier("imported");
if (!noInterop) result = (0, _helperModuleTransforms.wrapInterop)(path, result, "namespace");

@@ -100,3 +86,2 @@ path.replaceWith(_core.template.expression.ast`

},
Program: {

@@ -112,9 +97,6 @@ exit(path, {

}
return;
}
const amdArgs = [];
const importNames = [];
if (requireId) {

@@ -124,3 +106,2 @@ amdArgs.push(_core.types.stringLiteral("require"));

}
let moduleName = (0, _helperModuleTransforms.getModuleName)(this.file.opts, options);

@@ -141,3 +122,2 @@ if (moduleName) moduleName = _core.types.stringLiteral(moduleName);

});
if ((0, _helperModuleTransforms.hasExports)(meta)) {

@@ -147,13 +127,9 @@ amdArgs.push(_core.types.stringLiteral("exports"));

}
for (const [source, metadata] of meta.source) {
amdArgs.push(_core.types.stringLiteral(source));
importNames.push(_core.types.identifier(metadata.name));
if (!(0, _helperModuleTransforms.isSideEffectImport)(metadata)) {
const interop = (0, _helperModuleTransforms.wrapInterop)(path, _core.types.identifier(metadata.name), metadata.interop);
if (interop) {
const header = _core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.identifier(metadata.name), interop));
header.loc = metadata.loc;

@@ -163,6 +139,4 @@ headers.push(header);

}
headers.push(...(0, _helperModuleTransforms.buildNamespaceInitStatements)(meta, metadata, constantReexports));
}
(0, _helperModuleTransforms.ensureStatementsHoisted)(headers);

@@ -176,3 +150,2 @@ path.unshiftContainer("body", headers);

}
}

@@ -182,5 +155,4 @@ }

});
exports.default = _default;
//# sourceMappingURL=index.js.map

8

package.json
{
"name": "@babel/plugin-transform-modules-amd",
"version": "7.19.6",
"version": "7.20.7",
"description": "This plugin transforms ES2015 modules to AMD",

@@ -17,4 +17,4 @@ "repository": {

"dependencies": {
"@babel/helper-module-transforms": "^7.19.6",
"@babel/helper-plugin-utils": "^7.19.0"
"@babel/helper-module-transforms": "^7.20.7",
"@babel/helper-plugin-utils": "^7.20.2"
},

@@ -28,3 +28,3 @@ "keywords": [

"devDependencies": {
"@babel/core": "^7.19.6",
"@babel/core": "^7.20.7",
"@babel/helper-plugin-test-runner": "^7.18.6",

@@ -31,0 +31,0 @@ "@babel/plugin-external-helpers": "^7.18.6"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc