diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-24 15:10:37 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-24 15:11:17 +0200 |
commit | 7a3df06eb573d36142bd1a8e03c5ce8752d300b3 (patch) | |
tree | 70bfaea8884c374876f607774850a3a51c0cb381 /node_modules/async/apply.js | |
parent | aca1143cb9eed16cf37f04e475e4257418dd18ac (diff) |
fix build issues and add typedoc
Diffstat (limited to 'node_modules/async/apply.js')
-rw-r--r-- | node_modules/async/apply.js | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/node_modules/async/apply.js b/node_modules/async/apply.js index 8e6d6e6e4..f590fa574 100644 --- a/node_modules/async/apply.js +++ b/node_modules/async/apply.js @@ -4,12 +4,22 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _rest = require('./internal/rest'); +exports.default = function (fn /*, ...args*/) { + var args = (0, _slice2.default)(arguments, 1); + return function () /*callArgs*/{ + var callArgs = (0, _slice2.default)(arguments); + return fn.apply(null, args.concat(callArgs)); + }; +}; + +var _slice = require('./internal/slice'); -var _rest2 = _interopRequireDefault(_rest); +var _slice2 = _interopRequireDefault(_slice); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +; + /** * Creates a continuation function with some arguments already applied. * @@ -22,10 +32,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @memberOf module:Utils * @method * @category Util - * @param {Function} function - The function you want to eventually apply all + * @param {Function} fn - The function you want to eventually apply all * arguments to. Invokes with (arguments...). * @param {...*} arguments... - Any number of arguments to automatically apply * when the continuation is called. + * @returns {Function} the partially-applied function * @example * * // using apply @@ -54,9 +65,4 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * two * three */ -exports.default = (0, _rest2.default)(function (fn, args) { - return (0, _rest2.default)(function (callArgs) { - return fn.apply(null, args.concat(callArgs)); - }); -}); module.exports = exports['default'];
\ No newline at end of file |