diff options
Diffstat (limited to 'node_modules/es5-ext/function/#')
-rw-r--r-- | node_modules/es5-ext/function/#/compose.js | 22 | ||||
-rw-r--r-- | node_modules/es5-ext/function/#/copy.js | 23 | ||||
-rw-r--r-- | node_modules/es5-ext/function/#/curry.js | 24 | ||||
-rw-r--r-- | node_modules/es5-ext/function/#/index.js | 13 | ||||
-rw-r--r-- | node_modules/es5-ext/function/#/lock.js | 14 | ||||
-rw-r--r-- | node_modules/es5-ext/function/#/not.js | 14 | ||||
-rw-r--r-- | node_modules/es5-ext/function/#/partial.js | 16 | ||||
-rw-r--r-- | node_modules/es5-ext/function/#/spread.js | 12 | ||||
-rw-r--r-- | node_modules/es5-ext/function/#/to-string-tokens.js | 17 |
9 files changed, 0 insertions, 155 deletions
diff --git a/node_modules/es5-ext/function/#/compose.js b/node_modules/es5-ext/function/#/compose.js deleted file mode 100644 index 089751783..000000000 --- a/node_modules/es5-ext/function/#/compose.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; - -var callable = require("../../object/valid-callable") - , aFrom = require("../../array/from") - , apply = Function.prototype.apply - , call = Function.prototype.call - , callFn = function (arg, fn) { - return call.call(fn, this, arg); -}; - -module.exports = function (fn /*, …fnn*/) { - var fns, first; - if (!fn) callable(fn); - fns = [this].concat(aFrom(arguments)); - fns.forEach(callable); - fns = fns.reverse(); - first = fns[0]; - fns = fns.slice(1); - return function (argIgnored) { - return fns.reduce(callFn, apply.call(first, this, arguments)); - }; -}; diff --git a/node_modules/es5-ext/function/#/copy.js b/node_modules/es5-ext/function/#/copy.js deleted file mode 100644 index f0403b304..000000000 --- a/node_modules/es5-ext/function/#/copy.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -var mixin = require("../../object/mixin") - , validFunction = require("../valid-function") - , re = /^\s*function\s*([\0-')-\uffff]+)*\s*\(([\0-(*-\uffff]*)\)\s*\{/; - -module.exports = function () { - var match = String(validFunction(this)).match(re), fn; - - // eslint-disable-next-line no-new-func - fn = new Function( - "fn", - "return function " + - match[1].trim() + - "(" + - match[2] + - ") { return fn.apply(this, arguments); };" - )(this); - try { - mixin(fn, this); - } catch (ignore) {} - return fn; -}; diff --git a/node_modules/es5-ext/function/#/curry.js b/node_modules/es5-ext/function/#/curry.js deleted file mode 100644 index cc1e14a5a..000000000 --- a/node_modules/es5-ext/function/#/curry.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; - -var toPosInt = require("../../number/to-pos-integer") - , callable = require("../../object/valid-callable") - , defineLength = require("../_define-length") - - , slice = Array.prototype.slice, apply = Function.prototype.apply - , curry; - -curry = function self(fn, length, preArgs) { - return defineLength(function () { - var args = preArgs - ? preArgs.concat(slice.call(arguments, 0, length - preArgs.length)) - : slice.call(arguments, 0, length); - return args.length === length ? apply.call(fn, this, args) - : self(fn, length, args); - }, preArgs ? length - preArgs.length : length); -}; - -module.exports = function (/* Length*/) { - var length = arguments[0]; - return curry(callable(this), - isNaN(length) ? toPosInt(this.length) : toPosInt(length)); -}; diff --git a/node_modules/es5-ext/function/#/index.js b/node_modules/es5-ext/function/#/index.js deleted file mode 100644 index 02ae9f491..000000000 --- a/node_modules/es5-ext/function/#/index.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -module.exports = { - compose: require("./compose"), - copy: require("./copy"), - curry: require("./curry"), - lock: require("./lock"), - microtaskDelay: require("./microtask-delay"), - not: require("./not"), - partial: require("./partial"), - spread: require("./spread"), - toStringTokens: require("./to-string-tokens") -}; diff --git a/node_modules/es5-ext/function/#/lock.js b/node_modules/es5-ext/function/#/lock.js deleted file mode 100644 index dcd93bb10..000000000 --- a/node_modules/es5-ext/function/#/lock.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -var callable = require("../../object/valid-callable") - - , apply = Function.prototype.apply; - -module.exports = function (/* …args*/) { - var fn = callable(this) - , args = arguments; - - return function () { - return apply.call(fn, this, args); -}; -}; diff --git a/node_modules/es5-ext/function/#/not.js b/node_modules/es5-ext/function/#/not.js deleted file mode 100644 index 82d64def7..000000000 --- a/node_modules/es5-ext/function/#/not.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -var callable = require("../../object/valid-callable") - , defineLength = require("../_define-length") - - , apply = Function.prototype.apply; - -module.exports = function () { - var fn = callable(this); - - return defineLength(function () { - return !apply.call(fn, this, arguments); - }, fn.length); -}; diff --git a/node_modules/es5-ext/function/#/partial.js b/node_modules/es5-ext/function/#/partial.js deleted file mode 100644 index 1734b1355..000000000 --- a/node_modules/es5-ext/function/#/partial.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; - -var callable = require("../../object/valid-callable") - , aFrom = require("../../array/from") - , defineLength = require("../_define-length") - - , apply = Function.prototype.apply; - -module.exports = function (/* …args*/) { - var fn = callable(this) - , args = aFrom(arguments); - - return defineLength(function () { - return apply.call(fn, this, args.concat(aFrom(arguments))); - }, fn.length - args.length); -}; diff --git a/node_modules/es5-ext/function/#/spread.js b/node_modules/es5-ext/function/#/spread.js deleted file mode 100644 index 755553b4e..000000000 --- a/node_modules/es5-ext/function/#/spread.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -var callable = require("../../object/valid-callable") - - , apply = Function.prototype.apply; - -module.exports = function () { - var fn = callable(this); - return function (args) { - return apply.call(fn, this, args); -}; -}; diff --git a/node_modules/es5-ext/function/#/to-string-tokens.js b/node_modules/es5-ext/function/#/to-string-tokens.js deleted file mode 100644 index 4ce026a56..000000000 --- a/node_modules/es5-ext/function/#/to-string-tokens.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -var validFunction = require("../valid-function"); - -var re1 = /^\s*function[\0-')-\uffff]*\(([\0-(*-\uffff]*)\)\s*\{([\0-\uffff]*)\}\s*$/ - , re2 = /^\s*\(?([\0-'*-\uffff]*)\)?\s*=>\s*(\{?[\0-\uffff]*\}?)\s*$/; - -module.exports = function () { - var str = String(validFunction(this)), data = str.match(re1); - if (!data) { - data = str.match(re2); - if (!data) throw new Error("Unrecognized string format"); - data[1] = data[1].trim(); - if (data[2][0] === "{") data[2] = data[2].trim().slice(1, -1); - } - return { args: data[1], body: data[2] }; -}; |