eachOfSeries.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _eachOfLimit = require('./eachOfLimit');
  6. var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
  7. var _doLimit = require('./internal/doLimit');
  8. var _doLimit2 = _interopRequireDefault(_doLimit);
  9. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10. /**
  11. * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time.
  12. *
  13. * @name eachOfSeries
  14. * @static
  15. * @memberOf module:Collections
  16. * @method
  17. * @see [async.eachOf]{@link module:Collections.eachOf}
  18. * @alias forEachOfSeries
  19. * @category Collection
  20. * @param {Array|Iterable|Object} coll - A collection to iterate over.
  21. * @param {Function} iteratee - A function to apply to each item in `coll`. The
  22. * `key` is the item's key, or index in the case of an array. The iteratee is
  23. * passed a `callback(err)` which must be called once it has completed. If no
  24. * error has occurred, the callback should be run without arguments or with an
  25. * explicit `null` argument. Invoked with (item, key, callback).
  26. * @param {Function} [callback] - A callback which is called when all `iteratee`
  27. * functions have finished, or an error occurs. Invoked with (err).
  28. */
  29. exports.default = (0, _doLimit2.default)(_eachOfLimit2.default, 1);
  30. module.exports = exports['default'];