3 Object.defineProperty(exports, "__esModule", {
6 exports.default = timeLimit;
8 var _mapLimit = require('./mapLimit');
10 var _mapLimit2 = _interopRequireDefault(_mapLimit);
12 var _baseRange = require('lodash/_baseRange');
14 var _baseRange2 = _interopRequireDefault(_baseRange);
16 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19 * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a
24 * @memberOf module:ControlFlow
26 * @see [async.times]{@link module:ControlFlow.times}
27 * @category Control Flow
28 * @param {number} count - The number of times to run the function.
29 * @param {number} limit - The maximum number of async operations at a time.
30 * @param {Function} iteratee - The function to call `n` times. Invoked with the
31 * iteration index and a callback (n, next).
32 * @param {Function} callback - see [async.map]{@link module:Collections.map}.
34 function timeLimit(count, limit, iteratee, callback) {
35 (0, _mapLimit2.default)((0, _baseRange2.default)(0, count, 1), limit, iteratee, callback);
37 module.exports = exports['default'];