diff --git a/constructor.js b/constructor.js index 88c52e5..07e91b2 100644 --- a/constructor.js +++ b/constructor.js @@ -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; diff --git a/create.js b/create.js index b77f331..cc8bca3 100644 --- a/create.js +++ b/create.js @@ -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; diff --git a/process.js b/process.js index 7af33b7..f469ba4 100644 --- a/process.js +++ b/process.js @@ -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; diff --git a/prototype.js b/prototype.js index 68c6888..705cd91 100644 --- a/prototype.js +++ b/prototype.js @@ -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) { diff --git a/regexp.js b/regexp.js index d74b112..9f8efee 100644 --- a/regexp.js +++ b/regexp.js @@ -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); diff --git a/transform.js b/transform.js index 11afd9b..2ab4dbc 100644 --- a/transform.js +++ b/transform.js @@ -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