'use strict';12Object.defineProperty(exports, "__esModule", {3value: true4});56var _createTester = require('./internal/createTester.js');78var _createTester2 = _interopRequireDefault(_createTester);910var _eachOfLimit = require('./internal/eachOfLimit.js');1112var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);1314var _awaitify = require('./internal/awaitify.js');1516var _awaitify2 = _interopRequireDefault(_awaitify);1718function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }1920/**21* The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a22* time.23*24* @name detectLimit25* @static26* @memberOf module:Collections27* @method28* @see [async.detect]{@link module:Collections.detect}29* @alias findLimit30* @category Collections31* @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.32* @param {number} limit - The maximum number of async operations at a time.33* @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.34* The iteratee must complete with a boolean value as its result.35* Invoked with (item, callback).36* @param {Function} [callback] - A callback which is called as soon as any37* iteratee returns `true`, or after all the `iteratee` functions have finished.38* Result will be the first item in the array that passes the truth test39* (iteratee) or the value `undefined` if none passed. Invoked with40* (err, result).41* @returns {Promise} a promise, if a callback is omitted42*/43function detectLimit(coll, limit, iteratee, callback) {44return (0, _createTester2.default)(bool => bool, (res, item) => item)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback);45}46exports.default = (0, _awaitify2.default)(detectLimit, 4);47module.exports = exports['default'];4849