source: trip-planner-front/node_modules/async/findLimit.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.7 KB
Line 
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6
7var _identity = require('lodash/identity');
8
9var _identity2 = _interopRequireDefault(_identity);
10
11var _createTester = require('./internal/createTester');
12
13var _createTester2 = _interopRequireDefault(_createTester);
14
15var _doParallelLimit = require('./internal/doParallelLimit');
16
17var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
18
19var _findGetResult = require('./internal/findGetResult');
20
21var _findGetResult2 = _interopRequireDefault(_findGetResult);
22
23function _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 */
47exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_identity2.default, _findGetResult2.default));
48module.exports = exports['default'];
Note: See TracBrowser for help on using the repository browser.