Skip to content

Commit

Permalink
fix: UMD fixes
Browse files Browse the repository at this point in the history
Fix UMD wrapper to for static analysis
  • Loading branch information
mikaelkaron committed Jun 15, 2017
1 parent 218a1f0 commit 9e2c054
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 22 deletions.
6 changes: 3 additions & 3 deletions constructor.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(function (modules, root, factory) {
(function (root, factory) {
if (typeof define === "function" && define.amd) {
define(modules, factory);
define([], factory);
} else if (typeof module === "object" && module.exports) {
module.exports = factory.call(root);
} else {
root["mu-create/constructor"] = factory.call(root);
}
})([], this, function () {
})(this, function () {
return function (result, data) {
var key = data.key;

Expand Down
12 changes: 5 additions & 7 deletions create.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
(function (modules, root, factory) {
(function (root, factory) {
if (typeof define === "function" && define.amd) {
define(modules, factory);
define(["./transform", "./process"], factory);
} else if (typeof module === "object" && module.exports) {
module.exports = factory.apply(root, modules.map(require));
module.exports = factory.call(root, require("./transform"), require("./process"));
} else {
root["mu-create/create"] = factory.apply(root, modules.map(function (m) {
return root[m.replace(/^\./, "mu-create")];
}));
root["mu-create/create"] = factory.call(root, root["mu-create/transform"], root["mu-create/process"]);
}
})(["./transform", "./process"], this, function (transform, process) {
})(this, function (transform, process) {
var root = this;
var array = Array.prototype;
var slice = array.slice;
Expand Down
6 changes: 3 additions & 3 deletions process.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(function (modules, root, factory) {
(function (root, factory) {
if (typeof define === "function" && define.amd) {
define(modules, factory);
define([], factory);
} else if (typeof module === "object" && module.exports) {
module.exports = factory.call(root);
} else {
root["mu-create/process"] = factory.call(root);
}
})([], this, function () {
})(this, function () {
var array = Array.prototype;
var slice = array.slice;
var concat = array.concat;
Expand Down
6 changes: 3 additions & 3 deletions prototype.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(function (modules, root, factory) {
(function (root, factory) {
if (typeof define === "function" && define.amd) {
define(modules, factory);
define([], factory);
} else if (typeof module === "object" && module.exports) {
module.exports = factory.call(root);
} else {
root["mu-create/prototype"] = factory.call(root);
}
})([], this, function () {
})(this, function () {
var toString = Object.prototype.toString;

return function (result, data) {
Expand Down
6 changes: 3 additions & 3 deletions regexp.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(function (modules, root, factory) {
(function (root, factory) {
if (typeof define === "function" && define.amd) {
define(modules, factory);
define([], factory);
} else if (typeof module === "object" && module.exports) {
module.exports = factory.call(root);
} else {
root["mu-create/regexp"] = factory.call(root);
}
})([], this, function () {
})(this, function () {
return function (regexp, callback) {
return function (result, data) {
var matches = data.key.match(regexp);
Expand Down
6 changes: 3 additions & 3 deletions transform.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(function (modules, root, factory) {
(function (root, factory) {
if (typeof define === "function" && define.amd) {
define(modules, factory);
define([], factory);
} else if (typeof module === "object" && module.exports) {
module.exports = factory.call(root);
} else {
root["mu-create/transform"] = factory.call(root);
}
})([], this, function () {
})(this, function () {
var slice = Array.prototype.slice;
var toString = Object.prototype.toString

Expand Down

0 comments on commit 9e2c054

Please sign in to comment.