🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

babel-plugin-namespace-amd-define

Package Overview
Dependencies
Maintainers
1
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-namespace-amd-define - npm Package Compare versions

Comparing version

to
1.4.1

11

lib/__tests__/index.test.js

@@ -81,3 +81,14 @@ 'use strict';

});
it('when it is an object field', function () {
var source = '\n\t\t\tvar a = {\n\t\t\t\tdefine: function(name, value) {\n\t\t\t\t\treturn name;\n\t\t\t\t}\n\t\t\t}\n\t\t\t';
var _babel$transform7 = babel.transform(source, {
plugins: [_index2.default]
}),
code = _babel$transform7.code;
expect(code).toMatchSnapshot();
});
});
//# sourceMappingURL=index.test.js.map

4

lib/index.js

@@ -15,2 +15,6 @@ 'use strict';

if (path.parent.type === 'ObjectProperty' && path.parent.key === path.node) {
return;
}
var scope = void 0;

@@ -17,0 +21,0 @@

2

package.json
{
"name": "babel-plugin-namespace-amd-define",
"version": "1.4.0",
"version": "1.4.1",
"description": "A Babel plugin to namespace (prefix) AMD define() calls.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -88,2 +88,18 @@ import * as babel from 'babel-core';

});
it('when it is an object field', () => {
const source = `
var a = {
define: function(name, value) {
return name;
}
}
`;
const {code} = babel.transform(source, {
plugins: [plugin],
});
expect(code).toMatchSnapshot();
});
});

@@ -17,2 +17,9 @@ /**

if (
path.parent.type === 'ObjectProperty' &&
path.parent.key === path.node
) {
return;
}
let scope;

@@ -19,0 +26,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet