root / HServer / 00.Server / 00.Program / node_modules / async / detectLimit.js
이력 | 보기 | 이력해설 | 다운로드 (1.74 KB)
1 | 39 | HKM | '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 _eachOfLimit = require('./eachOfLimit'); |
||
16 | |||
17 | var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
|
||
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 {Function} iteratee - A truth test to apply to each item in `coll`.
|
||
39 | * The iteratee is passed a `callback(err, truthValue)` which must be called
|
||
40 | * with a boolean argument once it has completed. 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, _createTester2.default)(_eachOfLimit2.default, _identity2.default, _findGetResult2.default); |
||
48 | module.exports = exports['default']; |