Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Commit

Permalink
Partial fix for gfranko#104, part 1 only
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylvain Prat authored and ozouai-6sense committed Apr 12, 2022
1 parent 1b02c05 commit 6633296
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions build/amdclean.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! amdclean - v2.7.0 - 2015-04-10
/*! amdclean - v2.7.0 - 2015-12-05
* http://gregfranko.com/amdclean
* Copyright (c) 2015 Greg Franko */

Expand Down Expand Up @@ -464,7 +464,7 @@ convertToIIFEDeclaration = function convertToIIFEDeclaration(obj) {
'computed': true,
'object': {
'type': 'Identifier',
'name': 'module'
'name': 'modules'
},
'property': {
'type': 'Literal',
Expand Down Expand Up @@ -1451,7 +1451,7 @@ clean = function clean() {
});
}
});
// Adds a local module variable if a user wants local module information available to them
// Adds a local modules variable if a user wants local module information available to them
if (_.isObject(options.config) && !_.isEmpty(options.config)) {
configAst = function () {
var props = [];
Expand Down Expand Up @@ -1493,7 +1493,7 @@ clean = function clean() {
'type': 'VariableDeclarator',
'id': {
'type': 'Identifier',
'name': 'module'
'name': 'modules'
},
'init': {
'type': 'ObjectExpression',
Expand Down Expand Up @@ -1528,7 +1528,7 @@ clean = function clean() {
};
(function () {
(function (root, factory, undefined) {

'use strict';
// Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, and plain browser loading
if (typeof define === 'function' && define.amd) {
factory.amd = true;
Expand All @@ -1554,7 +1554,7 @@ clean = function clean() {
root.amdclean = factory(null, root);
}
}(this, function cleanamd(amdDependencies, context) {

'use strict';
// Third-Party Dependencies
// Note: These dependencies are hoisted to the top (as local variables) at build time (Look in the gulpfile.js file and the AMDclean wrap option for more details)
sourcemapToAst = function () {
Expand Down
4 changes: 2 additions & 2 deletions build/amdclean.min.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/amdclean.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! amdclean - v2.7.0 - 2015-04-10
/*! amdclean - v2.7.0 - 2015-12-05
* http://gregfranko.com/amdclean
* Copyright (c) 2015 Greg Franko */

Expand Down Expand Up @@ -464,7 +464,7 @@ convertToIIFEDeclaration = function convertToIIFEDeclaration(obj) {
'computed': true,
'object': {
'type': 'Identifier',
'name': 'module'
'name': 'modules'
},
'property': {
'type': 'Literal',
Expand Down Expand Up @@ -1451,7 +1451,7 @@ clean = function clean() {
});
}
});
// Adds a local module variable if a user wants local module information available to them
// Adds a local modules variable if a user wants local module information available to them
if (_.isObject(options.config) && !_.isEmpty(options.config)) {
configAst = function () {
var props = [];
Expand Down Expand Up @@ -1493,7 +1493,7 @@ clean = function clean() {
'type': 'VariableDeclarator',
'id': {
'type': 'Identifier',
'name': 'module'
'name': 'modules'
},
'init': {
'type': 'ObjectExpression',
Expand Down Expand Up @@ -1528,7 +1528,7 @@ clean = function clean() {
};
(function () {
(function (root, factory, undefined) {

'use strict';
// Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, and plain browser loading
if (typeof define === 'function' && define.amd) {
factory.amd = true;
Expand All @@ -1554,7 +1554,7 @@ clean = function clean() {
root.amdclean = factory(null, root);
}
}(this, function cleanamd(amdDependencies, context) {

'use strict';
// Third-Party Dependencies
// Note: These dependencies are hoisted to the top (as local variables) at build time (Look in the gulpfile.js file and the AMDclean wrap option for more details)
sourcemapToAst = function () {
Expand Down
4 changes: 2 additions & 2 deletions src/modules/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ define([
}
});

// Adds a local module variable if a user wants local module information available to them
// Adds a local modules variable if a user wants local module information available to them
if (_.isObject(options.config) && !_.isEmpty(options.config)) {
configAst = (function() {
var props = [];
Expand Down Expand Up @@ -306,7 +306,7 @@ define([
'type': 'VariableDeclarator',
'id': {
'type': 'Identifier',
'name': 'module'
'name': 'modules'
},
'init': {
'type': 'ObjectExpression',
Expand Down
2 changes: 1 addition & 1 deletion src/modules/convertToIIFEDeclaration.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ define([
'computed': true,
'object': {
'type': 'Identifier',
'name': 'module'
'name': 'modules'
},
'property': {
'type': 'Literal',
Expand Down
6 changes: 3 additions & 3 deletions test/specs/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ describe('amdclean specs', function() {
}
}),
cleanedCode = amdclean.clean(AMDcode, options),
standardJavaScript = "var moment,module={'moment':{'config':function(){return{'noGlobal':true};}}};if(true){moment=function (require,exports,module){return moment;}({},{},module['moment']);}";
standardJavaScript = "var moment,modules={'moment':{'config':function(){return{'noGlobal':true};}}};if(true){moment=function (require,exports,module){return moment;}({},{},modules['moment']);}";

expect(cleanedCode).toBe(standardJavaScript);
});
Expand All @@ -920,7 +920,7 @@ describe('amdclean specs', function() {
}
}),
cleanedCode = amdclean.clean(AMDcode, options),
standardJavaScript = "var moment,module={'moment':{'config':function(){return{'noGlobal':true};}}};if(true){moment=function (module){return moment;}(module['moment']);}";
standardJavaScript = "var moment,modules={'moment':{'config':function(){return{'noGlobal':true};}}};if(true){moment=function (module){return moment;}(modules['moment']);}";

expect(cleanedCode).toBe(standardJavaScript);
});
Expand All @@ -939,7 +939,7 @@ describe('amdclean specs', function() {
}
}),
cleanedCode = amdclean.clean(AMDcode, options),
standardJavaScript = "var moment,module={'moment':{'config':function(){return{'noGlobal':true};}}};if(true){moment=function (test,module){return moment;}(test,module['moment']);}";
standardJavaScript = "var moment,modules={'moment':{'config':function(){return{'noGlobal':true};}}};if(true){moment=function (test,module){return moment;}(test,modules['moment']);}";

expect(cleanedCode).toBe(standardJavaScript);
});
Expand Down

0 comments on commit 6633296

Please sign in to comment.