everyLimit.js

  1. import createTester from './internal/createTester';
  2. import doParallelLimit from './internal/doParallelLimit';
  3. import notId from './internal/notId';
  4. /**
  5. * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.
  6. *
  7. * @name everyLimit
  8. * @static
  9. * @memberOf module:Collections
  10. * @method
  11. * @see [async.every]{@link module:Collections.every}
  12. * @alias allLimit
  13. * @category Collection
  14. * @param {Array|Iterable|Object} coll - A collection to iterate over.
  15. * @param {number} limit - The maximum number of async operations at a time.
  16. * @param {AsyncFunction} iteratee - An async truth test to apply to each item
  17. * in the collection in parallel.
  18. * The iteratee must complete with a boolean result value.
  19. * Invoked with (item, callback).
  20. * @param {Function} [callback] - A callback which is called after all the
  21. * `iteratee` functions have finished. Result will be either `true` or `false`
  22. * depending on the values of the async tests. Invoked with (err, result).
  23. */
  24. export default doParallelLimit(createTester(notId, notId));