PluginProbe
Force Refresh / 2.1.0
Force Refresh v2.1.0
3.2.1 3.2.0 3.1.2 3.1.1 3.1.0 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.2.0 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.10.0 2.10.1 2.10.2 2.11.0 2.11.1 2.12.0 All 54 releases
force-refresh / node_modules / handlebars / node_modules / async / eachOfLimit.js

eachOfLimit.js in Force Refresh 2.1.0, at node_modules/handlebars/node_modules/async/eachOfLimit.js

41 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 'use strict';
2
3 Object.defineProperty(exports, "__esModule", {
4 value: true
5 });
6 exports.default = eachOfLimit;
7
8 var _eachOfLimit2 = require('./internal/eachOfLimit');
9
10 var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2);
11
12 var _wrapAsync = require('./internal/wrapAsync');
13
14 var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
15
16 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
18 /**
19 * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a
20 * time.
21 *
22 * @name eachOfLimit
23 * @static
24 * @memberOf module:Collections
25 * @method
26 * @see [async.eachOf]{@link module:Collections.eachOf}
27 * @alias forEachOfLimit
28 * @category Collection
29 * @param {Array|Iterable|Object} coll - A collection to iterate over.
30 * @param {number} limit - The maximum number of async operations at a time.
31 * @param {AsyncFunction} iteratee - An async function to apply to each
32 * item in `coll`. The `key` is the item's key, or index in the case of an
33 * array.
34 * Invoked with (item, key, callback).
35 * @param {Function} [callback] - A callback which is called when all
36 * `iteratee` functions have finished, or an error occurs. Invoked with (err).
37 */
38 function eachOfLimit(coll, limit, iteratee, callback) {
39 (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback);
40 }
41 module.exports = exports['default'];