aboutsummaryrefslogtreecommitdiff
path: root/node_modules/async/timesLimit.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-10-10 03:43:44 +0200
committerFlorian Dold <florian.dold@gmail.com>2016-10-10 03:43:44 +0200
commitabd94a7f5a50f43c797a11b53549ae48fff667c3 (patch)
treeab8ed457f65cdd72e13e0571d2975729428f1551 /node_modules/async/timesLimit.js
parenta0247c6a3fd6a09a41a7e35a3441324c4dcb58be (diff)
add node_modules to address #4364
Diffstat (limited to 'node_modules/async/timesLimit.js')
-rw-r--r--node_modules/async/timesLimit.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/node_modules/async/timesLimit.js b/node_modules/async/timesLimit.js
new file mode 100644
index 000000000..d38e53172
--- /dev/null
+++ b/node_modules/async/timesLimit.js
@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = timeLimit;
+
+var _mapLimit = require('./mapLimit');
+
+var _mapLimit2 = _interopRequireDefault(_mapLimit);
+
+var _baseRange = require('lodash/_baseRange');
+
+var _baseRange2 = _interopRequireDefault(_baseRange);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name timesLimit
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.times]{@link module:ControlFlow.times}
+ * @category Control Flow
+ * @param {number} count - The number of times to run the function.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {Function} iteratee - The function to call `n` times. Invoked with the
+ * iteration index and a callback (n, next).
+ * @param {Function} callback - see [async.map]{@link module:Collections.map}.
+ */
+function timeLimit(count, limit, iteratee, callback) {
+ (0, _mapLimit2.default)((0, _baseRange2.default)(0, count, 1), limit, iteratee, callback);
+}
+module.exports = exports['default']; \ No newline at end of file