source: trip-planner-front/node_modules/async/eachLimit.js@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[6a3a178]1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = eachLimit;
7
8var _eachOfLimit = require('./internal/eachOfLimit');
9
10var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
11
12var _withoutIndex = require('./internal/withoutIndex');
13
14var _withoutIndex2 = _interopRequireDefault(_withoutIndex);
15
16var _wrapAsync = require('./internal/wrapAsync');
17
18var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
19
20function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
22/**
23 * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.
24 *
25 * @name eachLimit
26 * @static
27 * @memberOf module:Collections
28 * @method
29 * @see [async.each]{@link module:Collections.each}
30 * @alias forEachLimit
31 * @category Collection
32 * @param {Array|Iterable|Object} coll - A collection to iterate over.
33 * @param {number} limit - The maximum number of async operations at a time.
34 * @param {AsyncFunction} iteratee - An async function to apply to each item in
35 * `coll`.
36 * The array index is not passed to the iteratee.
37 * If you need the index, use `eachOfLimit`.
38 * Invoked with (item, callback).
39 * @param {Function} [callback] - A callback which is called when all
40 * `iteratee` functions have finished, or an error occurs. Invoked with (err).
41 */
42function eachLimit(coll, limit, iteratee, callback) {
43 (0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);
44}
45module.exports = exports['default'];
Note: See TracBrowser for help on using the repository browser.