filterLimit.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _filter = require('./internal/filter');
  6. var _filter2 = _interopRequireDefault(_filter);
  7. var _doParallelLimit = require('./internal/doParallelLimit');
  8. var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
  9. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10. /**
  11. * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a
  12. * time.
  13. *
  14. * @name filterLimit
  15. * @static
  16. * @memberOf module:Collections
  17. * @method
  18. * @see [async.filter]{@link module:Collections.filter}
  19. * @alias selectLimit
  20. * @category Collection
  21. * @param {Array|Iterable|Object} coll - A collection to iterate over.
  22. * @param {number} limit - The maximum number of async operations at a time.
  23. * @param {Function} iteratee - A truth test to apply to each item in `coll`.
  24. * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
  25. * with a boolean argument once it has completed. Invoked with (item, callback).
  26. * @param {Function} [callback] - A callback which is called after all the
  27. * `iteratee` functions have finished. Invoked with (err, results).
  28. */
  29. exports.default = (0, _doParallelLimit2.default)(_filter2.default);
  30. module.exports = exports['default'];