diff options
Diffstat (limited to 'node_modules/async/dist/async.js')
-rw-r--r-- | node_modules/async/dist/async.js | 967 |
1 files changed, 520 insertions, 447 deletions
diff --git a/node_modules/async/dist/async.js b/node_modules/async/dist/async.js index 4d2aa0882..a0f30b0d4 100644 --- a/node_modules/async/dist/async.js +++ b/node_modules/async/dist/async.js @@ -1,93 +1,25 @@ (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (factory((global.async = global.async || {}))); + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.async = global.async || {}))); }(this, (function (exports) { 'use strict'; -/** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ -function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); -} - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * A specialized version of `baseRest` which transforms the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. - * @returns {Function} Returns the new function. - */ -function overRest$1(func, start, transform) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; +function slice(arrayLike, start) { + start = start|0; + var newLen = Math.max(arrayLike.length - start, 0); + var newArr = Array(newLen); + for(var idx = 0; idx < newLen; idx++) { + newArr[idx] = arrayLike[start + idx]; } - otherArgs[start] = transform(array); - return apply(func, this, otherArgs); - }; -} - -/** - * This method returns the first argument it receives. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'a': 1 }; - * - * console.log(_.identity(object) === object); - * // => true - */ -function identity(value) { - return value; -} - -// Lodash rest function without function.toString() -// remappings -function rest(func, start) { - return overRest$1(func, start, identity); + return newArr; } var initialParams = function (fn) { - return rest(function (args /*..., callback*/) { + return function (/*...args, callback*/) { + var args = slice(arguments); var callback = args.pop(); fn.call(this, args, callback); - }); + }; }; /** @@ -120,6 +52,34 @@ function isObject(value) { return value != null && (type == 'object' || type == 'function'); } +var hasSetImmediate = typeof setImmediate === 'function' && setImmediate; +var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; + +function fallback(fn) { + setTimeout(fn, 0); +} + +function wrap(defer) { + return function (fn/*, ...args*/) { + var args = slice(arguments, 1); + defer(function () { + fn.apply(null, args); + }); + }; +} + +var _defer; + +if (hasSetImmediate) { + _defer = setImmediate; +} else if (hasNextTick) { + _defer = process.nextTick; +} else { + _defer = fallback; +} + +var setImmediate$1 = wrap(_defer); + /** * Take a sync function and make it async, passing its return value to a * callback. This is useful for plugging sync functions into a waterfall, @@ -139,7 +99,7 @@ function isObject(value) { * @method * @alias wrapSync * @category Util - * @param {Function} func - The synchronous funuction, or Promise-returning + * @param {Function} func - The synchronous function, or Promise-returning * function to convert to an {@link AsyncFunction}. * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be * invoked with `(args..., callback)`. @@ -186,10 +146,10 @@ function asyncify(func) { } // if result is Promise object if (isObject(result) && typeof result.then === 'function') { - result.then(function (value) { - callback(null, value); - }, function (err) { - callback(err.message ? err : new Error(err)); + result.then(function(value) { + invokeCallback(callback, null, value); + }, function(err) { + invokeCallback(callback, err.message ? err : new Error(err)); }); } else { callback(null, result); @@ -197,19 +157,20 @@ function asyncify(func) { }); } -var supportsSymbol = typeof Symbol === 'function'; - -function supportsAsync() { - var supported; +function invokeCallback(callback, error, value) { try { - /* eslint no-eval: 0 */ - supported = isAsync(eval('(async function () {})')); + callback(error, value); } catch (e) { - supported = false; + setImmediate$1(rethrow, e); } - return supported; } +function rethrow(error) { + throw error; +} + +var supportsSymbol = typeof Symbol === 'function'; + function isAsync(fn) { return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction'; } @@ -218,22 +179,22 @@ function wrapAsync(asyncFn) { return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; } -var wrapAsync$1 = supportsAsync() ? wrapAsync : identity; - function applyEach$1(eachfn) { - return rest(function (fns, args) { - var go = initialParams(function (args, callback) { + return function(fns/*, ...args*/) { + var args = slice(arguments, 1); + var go = initialParams(function(args, callback) { var that = this; return eachfn(fns, function (fn, cb) { - wrapAsync$1(fn).apply(that, args.concat(cb)); + wrapAsync(fn).apply(that, args.concat(cb)); }, callback); }); if (args.length) { return go.apply(this, args); - } else { + } + else { return go; } - }); + }; } /** Detect free variable `global` from Node.js. */ @@ -903,18 +864,19 @@ function createArrayIterator(coll) { var i = -1; var len = coll.length; return function next() { - return ++i < len ? { value: coll[i], key: i } : null; - }; + return ++i < len ? {value: coll[i], key: i} : null; + } } function createES2015Iterator(iterator) { var i = -1; return function next() { var item = iterator.next(); - if (item.done) return null; + if (item.done) + return null; i++; - return { value: item.value, key: i }; - }; + return {value: item.value, key: i}; + } } function createObjectIterator(obj) { @@ -923,7 +885,7 @@ function createObjectIterator(obj) { var len = okeys.length; return function next() { var key = okeys[++i]; - return i < len ? { value: obj[key], key: key } : null; + return i < len ? {value: obj[key], key: key} : null; }; } @@ -937,7 +899,7 @@ function iterator(coll) { } function onlyOnce(fn) { - return function () { + return function() { if (fn === null) throw new Error("Callback was already called."); var callFn = fn; fn = null; @@ -960,15 +922,17 @@ function _eachOfLimit(limit) { if (err) { done = true; callback(err); - } else if (value === breakLoop || done && running <= 0) { + } + else if (value === breakLoop || (done && running <= 0)) { done = true; return callback(null); - } else { + } + else { replenish(); } } - function replenish() { + function replenish () { while (running < limit && !done) { var elem = nextElem(); if (elem === null) { @@ -1008,7 +972,7 @@ function _eachOfLimit(limit) { * `iteratee` functions have finished, or an error occurs. Invoked with (err). */ function eachOfLimit(coll, limit, iteratee, callback) { - _eachOfLimit(limit)(coll, wrapAsync$1(iteratee), callback); + _eachOfLimit(limit)(coll, wrapAsync(iteratee), callback); } function doLimit(fn, limit) { @@ -1030,7 +994,7 @@ function eachOfArrayLike(coll, iteratee, callback) { function iteratorCallback(err, value) { if (err) { callback(err); - } else if (++completed === length || value === breakLoop) { + } else if ((++completed === length) || value === breakLoop) { callback(null); } } @@ -1082,14 +1046,14 @@ var eachOfGeneric = doLimit(eachOfLimit, Infinity); * doSomethingWith(configs); * }); */ -var eachOf = function (coll, iteratee, callback) { +var eachOf = function(coll, iteratee, callback) { var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric; - eachOfImplementation(coll, wrapAsync$1(iteratee), callback); + eachOfImplementation(coll, wrapAsync(iteratee), callback); }; function doParallel(fn) { return function (obj, iteratee, callback) { - return fn(eachOf, obj, wrapAsync$1(iteratee), callback); + return fn(eachOf, obj, wrapAsync(iteratee), callback); }; } @@ -1098,7 +1062,7 @@ function _asyncMap(eachfn, arr, iteratee, callback) { arr = arr || []; var results = []; var counter = 0; - var _iteratee = wrapAsync$1(iteratee); + var _iteratee = wrapAsync(iteratee); eachfn(arr, function (value, _, callback) { var index = counter++; @@ -1186,7 +1150,7 @@ var applyEach = applyEach$1(map); function doParallelLimit(fn) { return function (obj, limit, iteratee, callback) { - return fn(_eachOfLimit(limit), obj, wrapAsync$1(iteratee), callback); + return fn(_eachOfLimit(limit), obj, wrapAsync(iteratee), callback); }; } @@ -1264,10 +1228,11 @@ var applyEachSeries = applyEach$1(mapSeries); * @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 @@ -1296,11 +1261,13 @@ var applyEachSeries = applyEach$1(mapSeries); * two * three */ -var apply$2 = rest(function (fn, args) { - return rest(function (callArgs) { +var apply = function(fn/*, ...args*/) { + var args = slice(arguments, 1); + return function(/*callArgs*/) { + var callArgs = slice(arguments); return fn.apply(null, args.concat(callArgs)); - }); -}); + }; +}; /** * A specialized version of `_.forEach` for arrays without support for @@ -1570,7 +1537,10 @@ var auto = function (tasks, concurrency, callback) { arrayEach(dependencies, function (dependencyName) { if (!tasks[dependencyName]) { - throw new Error('async.auto task `' + key + '` has a non-existent dependency `' + dependencyName + '` in ' + dependencies.join(', ')); + throw new Error('async.auto task `' + key + + '` has a non-existent dependency `' + + dependencyName + '` in ' + + dependencies.join(', ')); } addListener(dependencyName, function () { remainingDependencies--; @@ -1594,10 +1564,11 @@ var auto = function (tasks, concurrency, callback) { if (readyTasks.length === 0 && runningTasks === 0) { return callback(null, results); } - while (readyTasks.length && runningTasks < concurrency) { + while(readyTasks.length && runningTasks < concurrency) { var run = readyTasks.shift(); run(); } + } function addListener(taskName, fn) { @@ -1617,32 +1588,33 @@ var auto = function (tasks, concurrency, callback) { processQueue(); } + function runTask(key, task) { if (hasError) return; - var taskCallback = onlyOnce(rest(function (err, args) { + var taskCallback = onlyOnce(function(err, result) { runningTasks--; - if (args.length <= 1) { - args = args[0]; + if (arguments.length > 2) { + result = slice(arguments, 1); } if (err) { var safeResults = {}; - baseForOwn(results, function (val, rkey) { + baseForOwn(results, function(val, rkey) { safeResults[rkey] = val; }); - safeResults[key] = args; + safeResults[key] = result; hasError = true; listeners = Object.create(null); callback(err, safeResults); } else { - results[key] = args; + results[key] = result; taskComplete(key); } - })); + }); runningTasks++; - var taskFn = wrapAsync$1(task[task.length - 1]); + var taskFn = wrapAsync(task[task.length - 1]); if (task.length > 1) { taskFn(results, taskCallback); } else { @@ -1667,7 +1639,9 @@ var auto = function (tasks, concurrency, callback) { } if (counter !== numTasks) { - throw new Error('async.auto cannot execute tasks due to a recursive dependency'); + throw new Error( + 'async.auto cannot execute tasks due to a recursive dependency' + ); } } @@ -1995,7 +1969,7 @@ function parseParams(func) { func = func.toString().replace(STRIP_COMMENTS, ''); func = func.match(FN_ARGS)[2].replace(' ', ''); func = func ? func.split(FN_ARG_SPLIT) : []; - func = func.map(function (arg) { + func = func.map(function (arg){ return trim(arg.replace(FN_ARG, '')); }); return func; @@ -2089,7 +2063,9 @@ function autoInject(tasks, callback) { baseForOwn(tasks, function (taskFn, key) { var params; var fnIsAsync = isAsync(taskFn); - var hasNoDeps = !fnIsAsync && taskFn.length === 1 || fnIsAsync && taskFn.length === 0; + var hasNoDeps = + (!fnIsAsync && taskFn.length === 1) || + (fnIsAsync && taskFn.length === 0); if (isArray(taskFn)) { params = taskFn.slice(0, -1); @@ -2116,40 +2092,13 @@ function autoInject(tasks, callback) { return results[name]; }); newArgs.push(taskCb); - wrapAsync$1(taskFn).apply(null, newArgs); + wrapAsync(taskFn).apply(null, newArgs); } }); auto(newTasks, callback); } -var hasSetImmediate = typeof setImmediate === 'function' && setImmediate; -var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; - -function fallback(fn) { - setTimeout(fn, 0); -} - -function wrap(defer) { - return rest(function (fn, args) { - defer(function () { - fn.apply(null, args); - }); - }); -} - -var _defer; - -if (hasSetImmediate) { - _defer = setImmediate; -} else if (hasNextTick) { - _defer = process.nextTick; -} else { - _defer = fallback; -} - -var setImmediate$1 = wrap(_defer); - // Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation // used for queues. This implementation assumes that the node provided by the user can be modified // to adjust the next and last properties. We implement only the minimal functionality @@ -2164,57 +2113,89 @@ function setInitial(dll, node) { dll.head = dll.tail = node; } -DLL.prototype.removeLink = function (node) { - if (node.prev) node.prev.next = node.next;else this.head = node.next; - if (node.next) node.next.prev = node.prev;else this.tail = node.prev; +DLL.prototype.removeLink = function(node) { + if (node.prev) node.prev.next = node.next; + else this.head = node.next; + if (node.next) node.next.prev = node.prev; + else this.tail = node.prev; node.prev = node.next = null; this.length -= 1; return node; }; -DLL.prototype.empty = DLL; +DLL.prototype.empty = function () { + while(this.head) this.shift(); + return this; +}; -DLL.prototype.insertAfter = function (node, newNode) { +DLL.prototype.insertAfter = function(node, newNode) { newNode.prev = node; newNode.next = node.next; - if (node.next) node.next.prev = newNode;else this.tail = newNode; + if (node.next) node.next.prev = newNode; + else this.tail = newNode; node.next = newNode; this.length += 1; }; -DLL.prototype.insertBefore = function (node, newNode) { +DLL.prototype.insertBefore = function(node, newNode) { newNode.prev = node.prev; newNode.next = node; - if (node.prev) node.prev.next = newNode;else this.head = newNode; + if (node.prev) node.prev.next = newNode; + else this.head = newNode; node.prev = newNode; this.length += 1; }; -DLL.prototype.unshift = function (node) { - if (this.head) this.insertBefore(this.head, node);else setInitial(this, node); +DLL.prototype.unshift = function(node) { + if (this.head) this.insertBefore(this.head, node); + else setInitial(this, node); }; -DLL.prototype.push = function (node) { - if (this.tail) this.insertAfter(this.tail, node);else setInitial(this, node); +DLL.prototype.push = function(node) { + if (this.tail) this.insertAfter(this.tail, node); + else setInitial(this, node); }; -DLL.prototype.shift = function () { +DLL.prototype.shift = function() { return this.head && this.removeLink(this.head); }; -DLL.prototype.pop = function () { +DLL.prototype.pop = function() { return this.tail && this.removeLink(this.tail); }; +DLL.prototype.toArray = function () { + var arr = Array(this.length); + var curr = this.head; + for(var idx = 0; idx < this.length; idx++) { + arr[idx] = curr.data; + curr = curr.next; + } + return arr; +}; + +DLL.prototype.remove = function (testFn) { + var curr = this.head; + while(!!curr) { + var next = curr.next; + if (testFn(curr)) { + this.removeLink(curr); + } + curr = next; + } + return this; +}; + function queue(worker, concurrency, payload) { if (concurrency == null) { concurrency = 1; - } else if (concurrency === 0) { + } + else if(concurrency === 0) { throw new Error('Concurrency must not be zero'); } - var _worker = wrapAsync$1(worker); + var _worker = wrapAsync(worker); var numRunning = 0; var workersList = []; @@ -2228,7 +2209,7 @@ function queue(worker, concurrency, payload) { } if (data.length === 0 && q.idle()) { // call drain immediately if there are no tasks - return setImmediate$1(function () { + return setImmediate$1(function() { q.drain(); }); } @@ -2249,7 +2230,7 @@ function queue(worker, concurrency, payload) { } function _next(tasks) { - return rest(function (args) { + return function(err){ numRunning -= 1; for (var i = 0, l = tasks.length; i < l; i++) { @@ -2259,14 +2240,14 @@ function queue(worker, concurrency, payload) { workersList.splice(index); } - task.callback.apply(task, args); + task.callback.apply(task, arguments); - if (args[0] != null) { - q.error(args[0], task.data); + if (err != null) { + q.error(err, task.data); } } - if (numRunning <= q.concurrency - q.buffer) { + if (numRunning <= (q.concurrency - q.buffer) ) { q.unsaturated(); } @@ -2274,7 +2255,7 @@ function queue(worker, concurrency, payload) { q.drain(); } q.process(); - }); + }; } var isProcessing = false; @@ -2283,7 +2264,7 @@ function queue(worker, concurrency, payload) { concurrency: concurrency, payload: payload, saturated: noop, - unsaturated: noop, + unsaturated:noop, buffer: concurrency / 4, empty: noop, drain: noop, @@ -2300,6 +2281,9 @@ function queue(worker, concurrency, payload) { unshift: function (data, callback) { _insert(data, true, callback); }, + remove: function (testFn) { + q._tasks.remove(testFn); + }, process: function () { // Avoid trying to start too many processing operations. This can occur // when callbacks resolve synchronously (#1267). @@ -2307,9 +2291,8 @@ function queue(worker, concurrency, payload) { return; } isProcessing = true; - while (!q.paused && numRunning < q.concurrency && q._tasks.length) { - var tasks = [], - data = []; + while(!q.paused && numRunning < q.concurrency && q._tasks.length){ + var tasks = [], data = []; var l = q._tasks.length; if (q.payload) l = Math.min(l, q.payload); for (var i = 0; i < l; i++) { @@ -2318,11 +2301,12 @@ function queue(worker, concurrency, payload) { data.push(node.data); } + numRunning += 1; + workersList.push(tasks[0]); + if (q._tasks.length === 0) { q.empty(); } - numRunning += 1; - workersList.push(tasks[0]); if (numRunning === q.concurrency) { q.saturated(); @@ -2342,16 +2326,14 @@ function queue(worker, concurrency, payload) { workersList: function () { return workersList; }, - idle: function () { + idle: function() { return q._tasks.length + numRunning === 0; }, pause: function () { q.paused = true; }, resume: function () { - if (q.paused === false) { - return; - } + if (q.paused === false) { return; } q.paused = false; setImmediate$1(q.process); } @@ -2437,7 +2419,7 @@ function queue(worker, concurrency, payload) { * }); */ function cargo(worker, payload) { - return queue(worker, 1, payload); + return queue(worker, 1, payload); } /** @@ -2501,13 +2483,13 @@ var eachOfSeries = doLimit(eachOfLimit, 1); */ function reduce(coll, memo, iteratee, callback) { callback = once(callback || noop); - var _iteratee = wrapAsync$1(iteratee); - eachOfSeries(coll, function (x, i, callback) { - _iteratee(memo, x, function (err, v) { + var _iteratee = wrapAsync(iteratee); + eachOfSeries(coll, function(x, i, callback) { + _iteratee(memo, x, function(err, v) { memo = v; callback(err); }); - }, function (err) { + }, function(err) { callback(err, memo); }); } @@ -2550,9 +2532,10 @@ function reduce(coll, memo, iteratee, callback) { * }); * }); */ -var seq$1 = rest(function seq(functions) { - var _functions = arrayMap(functions, wrapAsync$1); - return rest(function (args) { +function seq(/*...functions*/) { + var _functions = arrayMap(arguments, wrapAsync); + return function(/*...args*/) { + var args = slice(arguments); var that = this; var cb = args[args.length - 1]; @@ -2562,15 +2545,17 @@ var seq$1 = rest(function seq(functions) { cb = noop; } - reduce(_functions, args, function (newargs, fn, cb) { - fn.apply(that, newargs.concat(rest(function (err, nextargs) { + reduce(_functions, args, function(newargs, fn, cb) { + fn.apply(that, newargs.concat(function(err/*, ...nextargs*/) { + var nextargs = slice(arguments, 1); cb(err, nextargs); - }))); - }, function (err, results) { + })); + }, + function(err, results) { cb.apply(that, [err].concat(results)); }); - }); -}); + }; +} /** * Creates a function which is a composition of the passed asynchronous @@ -2607,9 +2592,9 @@ var seq$1 = rest(function seq(functions) { * // result now equals 15 * }); */ -var compose = rest(function (args) { - return seq$1.apply(null, args.reverse()); -}); +var compose = function(/*...args*/) { + return seq.apply(null, slice(arguments).reverse()); +}; function concat$1(eachfn, arr, fn, callback) { var result = []; @@ -2652,7 +2637,7 @@ var concat = doParallel(concat$1); function doSeries(fn) { return function (obj, iteratee, callback) { - return fn(eachOfSeries, obj, wrapAsync$1(iteratee), callback); + return fn(eachOfSeries, obj, wrapAsync(iteratee), callback); }; } @@ -2718,20 +2703,42 @@ var concatSeries = doSeries(concat$1); * //... * }, callback); */ -var constant = rest(function (values) { +var constant = function(/*...values*/) { + var values = slice(arguments); var args = [null].concat(values); - return initialParams(function (ignoredArgs, callback) { + return function (/*...ignoredArgs, callback*/) { + var callback = arguments[arguments.length - 1]; return callback.apply(this, args); - }); -}); + }; +}; + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} function _createTester(check, getResult) { - return function (eachfn, arr, iteratee, cb) { + return function(eachfn, arr, iteratee, cb) { cb = cb || noop; var testPassed = false; var testResult; - eachfn(arr, function (value, _, callback) { - iteratee(value, function (err, result) { + eachfn(arr, function(value, _, callback) { + iteratee(value, function(err, result) { if (err) { callback(err); } else if (check(result) && !testResult) { @@ -2742,7 +2749,7 @@ function _createTester(check, getResult) { callback(); } }); - }, function (err) { + }, function(err) { if (err) { cb(err); } else { @@ -2840,8 +2847,10 @@ var detectLimit = doParallelLimit(_createTester(identity, _findGetResult)); var detectSeries = doLimit(detectLimit, 1); function consoleFunc(name) { - return rest(function (fn, args) { - wrapAsync$1(fn).apply(null, args.concat(rest(function (err, args) { + return function (fn/*, ...args*/) { + var args = slice(arguments, 1); + args.push(function (err/*, ...args*/) { + var args = slice(arguments, 1); if (typeof console === 'object') { if (err) { if (console.error) { @@ -2853,8 +2862,9 @@ function consoleFunc(name) { }); } } - }))); - }); + }); + wrapAsync(fn).apply(null, args); + }; } /** @@ -2910,14 +2920,15 @@ var dir = consoleFunc('dir'); */ function doDuring(fn, test, callback) { callback = onlyOnce(callback || noop); - var _fn = wrapAsync$1(fn); - var _test = wrapAsync$1(test); + var _fn = wrapAsync(fn); + var _test = wrapAsync(test); - var next = rest(function (err, args) { + function next(err/*, ...args*/) { if (err) return callback(err); + var args = slice(arguments, 1); args.push(check); _test.apply(this, args); - }); + } function check(err, truth) { if (err) return callback(err); @@ -2926,6 +2937,7 @@ function doDuring(fn, test, callback) { } check(null, true); + } /** @@ -2952,12 +2964,13 @@ function doDuring(fn, test, callback) { */ function doWhilst(iteratee, test, callback) { callback = onlyOnce(callback || noop); - var _iteratee = wrapAsync$1(iteratee); - var next = rest(function (err, args) { + var _iteratee = wrapAsync(iteratee); + var next = function(err/*, ...args*/) { if (err) return callback(err); + var args = slice(arguments, 1); if (test.apply(this, args)) return _iteratee(next); callback.apply(null, [null].concat(args)); - }); + }; _iteratee(next); } @@ -2982,7 +2995,7 @@ function doWhilst(iteratee, test, callback) { * callback. Invoked with (err, [results]); */ function doUntil(iteratee, test, callback) { - doWhilst(iteratee, function () { + doWhilst(iteratee, function() { return !test.apply(this, arguments); }, callback); } @@ -3025,8 +3038,8 @@ function doUntil(iteratee, test, callback) { */ function during(test, fn, callback) { callback = onlyOnce(callback || noop); - var _fn = wrapAsync$1(fn); - var _test = wrapAsync$1(test); + var _fn = wrapAsync(fn); + var _test = wrapAsync(test); function next(err) { if (err) return callback(err); @@ -3106,7 +3119,7 @@ function _withoutIndex(iteratee) { * }); */ function eachLimit(coll, iteratee, callback) { - eachOf(coll, _withoutIndex(wrapAsync$1(iteratee)), callback); + eachOf(coll, _withoutIndex(wrapAsync(iteratee)), callback); } /** @@ -3130,7 +3143,7 @@ function eachLimit(coll, iteratee, callback) { * `iteratee` functions have finished, or an error occurs. Invoked with (err). */ function eachLimit$1(coll, limit, iteratee, callback) { - _eachOfLimit(limit)(coll, _withoutIndex(wrapAsync$1(iteratee)), callback); + _eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); } /** @@ -3323,7 +3336,7 @@ function filterGeneric(eachfn, coll, iteratee, callback) { callback(err); } else { if (v) { - results.push({ index: index, value: x }); + results.push({index: index, value: x}); } callback(); } @@ -3341,7 +3354,7 @@ function filterGeneric(eachfn, coll, iteratee, callback) { function _filter(eachfn, coll, iteratee, callback) { var filter = isArrayLike(coll) ? filterArray : filterGeneric; - filter(eachfn, coll, wrapAsync$1(iteratee), callback || noop); + filter(eachfn, coll, wrapAsync(iteratee), callback || noop); } /** @@ -3444,7 +3457,7 @@ var filterSeries = doLimit(filterLimit, 1); */ function forever(fn, errback) { var done = onlyOnce(errback || noop); - var task = wrapAsync$1(ensureAsync(fn)); + var task = wrapAsync(ensureAsync(fn)); function next(err) { if (err) return done(err); @@ -3472,15 +3485,15 @@ function forever(fn, errback) { * functions have finished, or an error occurs. Result is an `Object` whoses * properties are arrays of values which returned the corresponding key. */ -var groupByLimit = function (coll, limit, iteratee, callback) { +var groupByLimit = function(coll, limit, iteratee, callback) { callback = callback || noop; - var _iteratee = wrapAsync$1(iteratee); - mapLimit(coll, limit, function (val, callback) { - _iteratee(val, function (err, key) { + var _iteratee = wrapAsync(iteratee); + mapLimit(coll, limit, function(val, callback) { + _iteratee(val, function(err, key) { if (err) return callback(err); - return callback(null, { key: key, val: val }); + return callback(null, {key: key, val: val}); }); - }, function (err, mapResults) { + }, function(err, mapResults) { var result = {}; // from MDN, handle object having an `hasOwnProperty` prop var hasOwnProperty = Object.prototype.hasOwnProperty; @@ -3614,8 +3627,8 @@ var log = consoleFunc('log'); function mapValuesLimit(obj, limit, iteratee, callback) { callback = once(callback || noop); var newObj = {}; - var _iteratee = wrapAsync$1(iteratee); - eachOfLimit(obj, limit, function (val, key, next) { + var _iteratee = wrapAsync(iteratee); + eachOfLimit(obj, limit, function(val, key, next) { _iteratee(val, key, function (err, result) { if (err) return next(err); newObj[key] = result; @@ -3739,25 +3752,26 @@ function memoize(fn, hasher) { var memo = Object.create(null); var queues = Object.create(null); hasher = hasher || identity; - var _fn = wrapAsync$1(fn); + var _fn = wrapAsync(fn); var memoized = initialParams(function memoized(args, callback) { var key = hasher.apply(null, args); if (has(memo, key)) { - setImmediate$1(function () { + setImmediate$1(function() { callback.apply(null, memo[key]); }); } else if (has(queues, key)) { queues[key].push(callback); } else { queues[key] = [callback]; - _fn.apply(null, args.concat(rest(function (args) { + _fn.apply(null, args.concat(function(/*args*/) { + var args = slice(arguments); memo[key] = args; var q = queues[key]; delete queues[key]; for (var i = 0, l = q.length; i < l; i++) { q[i].apply(null, args); } - }))); + })); } }); memoized.memo = memo; @@ -3813,13 +3827,13 @@ function _parallel(eachfn, tasks, callback) { var results = isArrayLike(tasks) ? [] : {}; eachfn(tasks, function (task, key, callback) { - wrapAsync$1(task)(rest(function (err, args) { - if (args.length <= 1) { - args = args[0]; + wrapAsync(task)(function (err, result) { + if (arguments.length > 2) { + result = slice(arguments, 1); } - results[key] = args; + results[key] = result; callback(err); - })); + }); }, function (err) { callback(err, results); }); @@ -3895,7 +3909,7 @@ function _parallel(eachfn, tasks, callback) { * }); */ function parallelLimit(tasks, callback) { - _parallel(eachOf, tasks, callback); + _parallel(eachOf, tasks, callback); } /** @@ -3918,7 +3932,7 @@ function parallelLimit(tasks, callback) { * Invoked with (err, results). */ function parallelLimit$1(tasks, limit, callback) { - _parallel(_eachOfLimit(limit), tasks, callback); + _parallel(_eachOfLimit(limit), tasks, callback); } /** @@ -3944,6 +3958,12 @@ function parallelLimit$1(tasks, limit, callback) { * task in the list. Invoke with `queue.push(task, [callback])`, * @property {Function} unshift - add a new task to the front of the `queue`. * Invoke with `queue.unshift(task, [callback])`. + * @property {Function} remove - remove items from the queue that match a test + * function. The test function will be passed an object with a `data` property, + * and a `priority` property, if this is a + * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. + * Invoked with `queue.remove(testFn)`, where `testFn` is of the form + * `function ({data, priority}) {}` and returns a Boolean. * @property {Function} saturated - a callback that is called when the number of * running workers hits the `concurrency` limit, and further tasks will be * queued. @@ -4020,10 +4040,10 @@ function parallelLimit$1(tasks, limit, callback) { * }); */ var queue$1 = function (worker, concurrency) { - var _worker = wrapAsync$1(worker); - return queue(function (items, cb) { - _worker(items[0], cb); - }, concurrency, 1); + var _worker = wrapAsync(worker); + return queue(function (items, cb) { + _worker(items[0], cb); + }, concurrency, 1); }; /** @@ -4049,12 +4069,12 @@ var queue$1 = function (worker, concurrency) { * array of `tasks` is given, all tasks will be assigned the same priority. * * The `unshift` method was removed. */ -var priorityQueue = function (worker, concurrency) { +var priorityQueue = function(worker, concurrency) { // Start with a normal queue var q = queue$1(worker, concurrency); // Override push to accept second parameter representing priority - q.push = function (data, priority, callback) { + q.push = function(data, priority, callback) { if (callback == null) callback = noop; if (typeof callback !== 'function') { throw new Error('task callback must be a function'); @@ -4065,7 +4085,7 @@ var priorityQueue = function (worker, concurrency) { } if (data.length === 0) { // call drain immediately if there are no tasks - return setImmediate$1(function () { + return setImmediate$1(function() { q.drain(); }); } @@ -4139,12 +4159,10 @@ function race(tasks, callback) { if (!isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); if (!tasks.length) return callback(); for (var i = 0, l = tasks.length; i < l; i++) { - wrapAsync$1(tasks[i])(callback); + wrapAsync(tasks[i])(callback); } } -var slice = Array.prototype.slice; - /** * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. * @@ -4167,9 +4185,9 @@ var slice = Array.prototype.slice; * `iteratee` functions have finished. Result is the reduced value. Invoked with * (err, result). */ -function reduceRight(array, memo, iteratee, callback) { - var reversed = slice.call(array).reverse(); - reduce(reversed, memo, iteratee, callback); +function reduceRight (array, memo, iteratee, callback) { + var reversed = slice(array).reverse(); + reduce(reversed, memo, iteratee, callback); } /** @@ -4212,33 +4230,29 @@ function reduceRight(array, memo, iteratee, callback) { * }); */ function reflect(fn) { - var _fn = wrapAsync$1(fn); + var _fn = wrapAsync(fn); return initialParams(function reflectOn(args, reflectCallback) { - args.push(rest(function callback(err, cbArgs) { - if (err) { - reflectCallback(null, { - error: err - }); + args.push(function callback(error, cbArg) { + if (error) { + reflectCallback(null, { error: error }); } else { - var value = null; - if (cbArgs.length === 1) { - value = cbArgs[0]; - } else if (cbArgs.length > 1) { - value = cbArgs; + var value; + if (arguments.length <= 2) { + value = cbArg; + } else { + value = slice(arguments, 1); } - reflectCallback(null, { - value: value - }); + reflectCallback(null, { value: value }); } - })); + }); return _fn.apply(this, args); }); } function reject$1(eachfn, arr, iteratee, callback) { - _filter(eachfn, arr, function (value, cb) { - iteratee(value, function (err, v) { + _filter(eachfn, arr, function(value, cb) { + iteratee(value, function(err, v) { cb(err, !v); }); }, callback); @@ -4346,7 +4360,7 @@ function reflectAll(tasks) { results = arrayMap(tasks, reflect); } else { results = {}; - baseForOwn(tasks, function (task, key) { + baseForOwn(tasks, function(task, key) { results[key] = reflect.call(this, task); }); } @@ -4515,7 +4529,9 @@ function retry(opts, task, callback) { if (typeof t === 'object') { acc.times = +t.times || DEFAULT_TIMES; - acc.intervalFunc = typeof t.interval === 'function' ? t.interval : constant$1(+t.interval || DEFAULT_INTERVAL); + acc.intervalFunc = typeof t.interval === 'function' ? + t.interval : + constant$1(+t.interval || DEFAULT_INTERVAL); acc.errorFilter = t.errorFilter; } else if (typeof t === 'number' || typeof t === 'string') { @@ -4537,12 +4553,14 @@ function retry(opts, task, callback) { throw new Error("Invalid arguments for async.retry"); } - var _task = wrapAsync$1(task); + var _task = wrapAsync(task); var attempt = 1; function retryAttempt() { - _task(function (err) { - if (err && attempt++ < options.times && (typeof options.errorFilter != 'function' || options.errorFilter(err))) { + _task(function(err) { + if (err && attempt++ < options.times && + (typeof options.errorFilter != 'function' || + options.errorFilter(err))) { setTimeout(retryAttempt, options.intervalFunc(attempt)); } else { callback.apply(null, arguments); @@ -4586,13 +4604,15 @@ var retryable = function (opts, task) { task = opts; opts = null; } - var _task = wrapAsync$1(task); + var _task = wrapAsync(task); return initialParams(function (args, callback) { function taskFn(cb) { _task.apply(null, args.concat(cb)); } - if (opts) retry(opts, taskFn, callback);else retry(taskFn, callback); + if (opts) retry(opts, taskFn, callback); + else retry(taskFn, callback); + }); }; @@ -4661,7 +4681,7 @@ var retryable = function (opts, task) { * }); */ function series(tasks, callback) { - _parallel(eachOfSeries, tasks, callback); + _parallel(eachOfSeries, tasks, callback); } /** @@ -4788,12 +4808,12 @@ var someSeries = doLimit(someLimit, 1); * // result callback * }); */ -function sortBy(coll, iteratee, callback) { - var _iteratee = wrapAsync$1(iteratee); +function sortBy (coll, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); map(coll, function (x, callback) { _iteratee(x, function (err, criteria) { if (err) return callback(err); - callback(null, { value: x, criteria: criteria }); + callback(null, {value: x, criteria: criteria}); }); }, function (err, results) { if (err) return callback(err); @@ -4801,8 +4821,7 @@ function sortBy(coll, iteratee, callback) { }); function comparator(left, right) { - var a = left.criteria, - b = right.criteria; + var a = left.criteria, b = right.criteria; return a < b ? -1 : a > b ? 1 : 0; } } @@ -4849,40 +4868,39 @@ function sortBy(coll, iteratee, callback) { * }); */ function timeout(asyncFn, milliseconds, info) { - var originalCallback, timer; - var timedOut = false; - - function injectedCallback() { - if (!timedOut) { - originalCallback.apply(null, arguments); - clearTimeout(timer); - } - } + var fn = wrapAsync(asyncFn); - function timeoutCallback() { - var name = asyncFn.name || 'anonymous'; - var error = new Error('Callback function "' + name + '" timed out.'); - error.code = 'ETIMEDOUT'; - if (info) { - error.info = info; + return initialParams(function (args, callback) { + var timedOut = false; + var timer; + + function timeoutCallback() { + var name = asyncFn.name || 'anonymous'; + var error = new Error('Callback function "' + name + '" timed out.'); + error.code = 'ETIMEDOUT'; + if (info) { + error.info = info; + } + timedOut = true; + callback(error); } - timedOut = true; - originalCallback(error); - } - var fn = wrapAsync$1(asyncFn); + args.push(function () { + if (!timedOut) { + callback.apply(null, arguments); + clearTimeout(timer); + } + }); - return initialParams(function (args, origCallback) { - originalCallback = origCallback; // setup timer and call original function timer = setTimeout(timeoutCallback, milliseconds); - fn.apply(null, args.concat(injectedCallback)); + fn.apply(null, args); }); } /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil; -var nativeMax$1 = Math.max; +var nativeMax = Math.max; /** * The base implementation of `_.range` and `_.rangeRight` which doesn't @@ -4897,7 +4915,7 @@ var nativeMax$1 = Math.max; */ function baseRange(start, end, step, fromRight) { var index = -1, - length = nativeMax$1(nativeCeil((end - start) / (step || 1)), 0), + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result = Array(length); while (length--) { @@ -4924,8 +4942,8 @@ function baseRange(start, end, step, fromRight) { * @param {Function} callback - see [async.map]{@link module:Collections.map}. */ function timeLimit(count, limit, iteratee, callback) { - var _iteratee = wrapAsync$1(iteratee); - mapLimit(baseRange(0, count, 1), limit, _iteratee, callback); + var _iteratee = wrapAsync(iteratee); + mapLimit(baseRange(0, count, 1), limit, _iteratee, callback); } /** @@ -5020,23 +5038,79 @@ var timesSeries = doLimit(timeLimit, 1); * // result is equal to {a: 2, b: 4, c: 6} * }) */ -function transform(coll, accumulator, iteratee, callback) { +function transform (coll, accumulator, iteratee, callback) { if (arguments.length <= 3) { callback = iteratee; iteratee = accumulator; accumulator = isArray(coll) ? [] : {}; } callback = once(callback || noop); - var _iteratee = wrapAsync$1(iteratee); + var _iteratee = wrapAsync(iteratee); - eachOf(coll, function (v, k, cb) { + eachOf(coll, function(v, k, cb) { _iteratee(accumulator, v, k, cb); - }, function (err) { + }, function(err) { callback(err, accumulator); }); } /** + * It runs each task in series but stops whenever any of the functions were + * successful. If one of the tasks were successful, the `callback` will be + * passed the result of the successful task. If all tasks fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name tryEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|Object} tasks - A collection containing functions to + * run, each function is passed a `callback(err, result)` it must call on + * completion with an error `err` (which can be `null`) and an optional `result` + * value. + * @param {Function} [callback] - An optional callback which is called when one + * of the tasks has succeeded, or all have failed. It receives the `err` and + * `result` arguments of the last attempt at completing the `task`. Invoked with + * (err, results). + * @example + * async.try([ + * function getDataFromFirstWebsite(callback) { + * // Try getting the data from the first website + * callback(err, data); + * }, + * function getDataFromSecondWebsite(callback) { + * // First website failed, + * // Try getting the data from the backup website + * callback(err, data); + * } + * ], + * // optional callback + * function(err, results) { + * Now do something with the data. + * }); + * + */ +function tryEach(tasks, callback) { + var error = null; + var result; + callback = callback || noop; + eachSeries(tasks, function(task, callback) { + wrapAsync(task)(function (err, res/*, ...args*/) { + if (arguments.length > 2) { + result = slice(arguments, 1); + } else { + result = res; + } + error = err; + callback(!err); + }); + }, function () { + callback(error, result); + }); +} + +/** * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, * unmemoized form. Handy for testing. * @@ -5091,13 +5165,14 @@ function unmemoize(fn) { */ function whilst(test, iteratee, callback) { callback = onlyOnce(callback || noop); - var _iteratee = wrapAsync$1(iteratee); + var _iteratee = wrapAsync(iteratee); if (!test()) return callback(null); - var next = rest(function (err, args) { + var next = function(err/*, ...args*/) { if (err) return callback(err); if (test()) return _iteratee(next); + var args = slice(arguments, 1); callback.apply(null, [null].concat(args)); - }); + }; _iteratee(next); } @@ -5124,7 +5199,7 @@ function whilst(test, iteratee, callback) { * callback. Invoked with (err, [results]); */ function until(test, iteratee, callback) { - whilst(function () { + whilst(function() { return !test.apply(this, arguments); }, iteratee, callback); } @@ -5186,30 +5261,25 @@ function until(test, iteratee, callback) { * callback(null, 'done'); * } */ -var waterfall = function (tasks, callback) { +var waterfall = function(tasks, callback) { callback = once(callback || noop); if (!isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); if (!tasks.length) return callback(); var taskIndex = 0; function nextTask(args) { - if (taskIndex === tasks.length) { - return callback.apply(null, [null].concat(args)); - } - - var taskCallback = onlyOnce(rest(function (err, args) { - if (err) { - return callback.apply(null, [err].concat(args)); - } - nextTask(args); - })); - - args.push(taskCallback); - - var task = wrapAsync$1(tasks[taskIndex++]); + var task = wrapAsync(tasks[taskIndex++]); + args.push(onlyOnce(next)); task.apply(null, args); } + function next(err/*, ...args*/) { + if (err || taskIndex === tasks.length) { + return callback.apply(null, arguments); + } + nextTask(slice(arguments, 1)); + } + nextTask([]); }; @@ -5261,6 +5331,7 @@ var waterfall = function (tasks, callback) { * @see AsyncFunction */ + /** * A collection of `async` functions for manipulating collections, such as * arrays and objects. @@ -5278,104 +5349,105 @@ var waterfall = function (tasks, callback) { */ var index = { - applyEach: applyEach, - applyEachSeries: applyEachSeries, - apply: apply$2, - asyncify: asyncify, - auto: auto, - autoInject: autoInject, - cargo: cargo, - compose: compose, - concat: concat, - concatSeries: concatSeries, - constant: constant, - detect: detect, - detectLimit: detectLimit, - detectSeries: detectSeries, - dir: dir, - doDuring: doDuring, - doUntil: doUntil, - doWhilst: doWhilst, - during: during, - each: eachLimit, - eachLimit: eachLimit$1, - eachOf: eachOf, - eachOfLimit: eachOfLimit, - eachOfSeries: eachOfSeries, - eachSeries: eachSeries, - ensureAsync: ensureAsync, - every: every, - everyLimit: everyLimit, - everySeries: everySeries, - filter: filter, - filterLimit: filterLimit, - filterSeries: filterSeries, - forever: forever, - groupBy: groupBy, - groupByLimit: groupByLimit, - groupBySeries: groupBySeries, - log: log, - map: map, - mapLimit: mapLimit, - mapSeries: mapSeries, - mapValues: mapValues, - mapValuesLimit: mapValuesLimit, - mapValuesSeries: mapValuesSeries, - memoize: memoize, - nextTick: nextTick, - parallel: parallelLimit, - parallelLimit: parallelLimit$1, - priorityQueue: priorityQueue, - queue: queue$1, - race: race, - reduce: reduce, - reduceRight: reduceRight, - reflect: reflect, - reflectAll: reflectAll, - reject: reject, - rejectLimit: rejectLimit, - rejectSeries: rejectSeries, - retry: retry, - retryable: retryable, - seq: seq$1, - series: series, - setImmediate: setImmediate$1, - some: some, - someLimit: someLimit, - someSeries: someSeries, - sortBy: sortBy, - timeout: timeout, - times: times, - timesLimit: timeLimit, - timesSeries: timesSeries, - transform: transform, - unmemoize: unmemoize, - until: until, - waterfall: waterfall, - whilst: whilst, - - // aliases - all: every, - any: some, - forEach: eachLimit, - forEachSeries: eachSeries, - forEachLimit: eachLimit$1, - forEachOf: eachOf, - forEachOfSeries: eachOfSeries, - forEachOfLimit: eachOfLimit, - inject: reduce, - foldl: reduce, - foldr: reduceRight, - select: filter, - selectLimit: filterLimit, - selectSeries: filterSeries, - wrapSync: asyncify + applyEach: applyEach, + applyEachSeries: applyEachSeries, + apply: apply, + asyncify: asyncify, + auto: auto, + autoInject: autoInject, + cargo: cargo, + compose: compose, + concat: concat, + concatSeries: concatSeries, + constant: constant, + detect: detect, + detectLimit: detectLimit, + detectSeries: detectSeries, + dir: dir, + doDuring: doDuring, + doUntil: doUntil, + doWhilst: doWhilst, + during: during, + each: eachLimit, + eachLimit: eachLimit$1, + eachOf: eachOf, + eachOfLimit: eachOfLimit, + eachOfSeries: eachOfSeries, + eachSeries: eachSeries, + ensureAsync: ensureAsync, + every: every, + everyLimit: everyLimit, + everySeries: everySeries, + filter: filter, + filterLimit: filterLimit, + filterSeries: filterSeries, + forever: forever, + groupBy: groupBy, + groupByLimit: groupByLimit, + groupBySeries: groupBySeries, + log: log, + map: map, + mapLimit: mapLimit, + mapSeries: mapSeries, + mapValues: mapValues, + mapValuesLimit: mapValuesLimit, + mapValuesSeries: mapValuesSeries, + memoize: memoize, + nextTick: nextTick, + parallel: parallelLimit, + parallelLimit: parallelLimit$1, + priorityQueue: priorityQueue, + queue: queue$1, + race: race, + reduce: reduce, + reduceRight: reduceRight, + reflect: reflect, + reflectAll: reflectAll, + reject: reject, + rejectLimit: rejectLimit, + rejectSeries: rejectSeries, + retry: retry, + retryable: retryable, + seq: seq, + series: series, + setImmediate: setImmediate$1, + some: some, + someLimit: someLimit, + someSeries: someSeries, + sortBy: sortBy, + timeout: timeout, + times: times, + timesLimit: timeLimit, + timesSeries: timesSeries, + transform: transform, + tryEach: tryEach, + unmemoize: unmemoize, + until: until, + waterfall: waterfall, + whilst: whilst, + + // aliases + all: every, + any: some, + forEach: eachLimit, + forEachSeries: eachSeries, + forEachLimit: eachLimit$1, + forEachOf: eachOf, + forEachOfSeries: eachOfSeries, + forEachOfLimit: eachOfLimit, + inject: reduce, + foldl: reduce, + foldr: reduceRight, + select: filter, + selectLimit: filterLimit, + selectSeries: filterSeries, + wrapSync: asyncify }; exports['default'] = index; exports.applyEach = applyEach; exports.applyEachSeries = applyEachSeries; -exports.apply = apply$2; +exports.apply = apply; exports.asyncify = asyncify; exports.auto = auto; exports.autoInject = autoInject; @@ -5432,7 +5504,7 @@ exports.rejectLimit = rejectLimit; exports.rejectSeries = rejectSeries; exports.retry = retry; exports.retryable = retryable; -exports.seq = seq$1; +exports.seq = seq; exports.series = series; exports.setImmediate = setImmediate$1; exports.some = some; @@ -5444,6 +5516,7 @@ exports.times = times; exports.timesLimit = timeLimit; exports.timesSeries = timesSeries; exports.transform = transform; +exports.tryEach = tryEach; exports.unmemoize = unmemoize; exports.until = until; exports.waterfall = waterfall; |