1 | 'use strict';
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 |
|
---|
7 | var _identity = require('lodash/identity');
|
---|
8 |
|
---|
9 | var _identity2 = _interopRequireDefault(_identity);
|
---|
10 |
|
---|
11 | var _createTester = require('./internal/createTester');
|
---|
12 |
|
---|
13 | var _createTester2 = _interopRequireDefault(_createTester);
|
---|
14 |
|
---|
15 | var _doParallelLimit = require('./internal/doParallelLimit');
|
---|
16 |
|
---|
17 | var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
|
---|
18 |
|
---|
19 | var _findGetResult = require('./internal/findGetResult');
|
---|
20 |
|
---|
21 | var _findGetResult2 = _interopRequireDefault(_findGetResult);
|
---|
22 |
|
---|
23 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a
|
---|
27 | * time.
|
---|
28 | *
|
---|
29 | * @name detectLimit
|
---|
30 | * @static
|
---|
31 | * @memberOf module:Collections
|
---|
32 | * @method
|
---|
33 | * @see [async.detect]{@link module:Collections.detect}
|
---|
34 | * @alias findLimit
|
---|
35 | * @category Collections
|
---|
36 | * @param {Array|Iterable|Object} coll - A collection to iterate over.
|
---|
37 | * @param {number} limit - The maximum number of async operations at a time.
|
---|
38 | * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
|
---|
39 | * The iteratee must complete with a boolean value as its result.
|
---|
40 | * Invoked with (item, callback).
|
---|
41 | * @param {Function} [callback] - A callback which is called as soon as any
|
---|
42 | * iteratee returns `true`, or after all the `iteratee` functions have finished.
|
---|
43 | * Result will be the first item in the array that passes the truth test
|
---|
44 | * (iteratee) or the value `undefined` if none passed. Invoked with
|
---|
45 | * (err, result).
|
---|
46 | */
|
---|
47 | exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_identity2.default, _findGetResult2.default));
|
---|
48 | module.exports = exports['default']; |
---|