[6a3a178] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
---|
| 4 | value: true
|
---|
| 5 | });
|
---|
| 6 |
|
---|
| 7 | var _filter = require('./internal/filter');
|
---|
| 8 |
|
---|
| 9 | var _filter2 = _interopRequireDefault(_filter);
|
---|
| 10 |
|
---|
| 11 | var _doParallel = require('./internal/doParallel');
|
---|
| 12 |
|
---|
| 13 | var _doParallel2 = _interopRequireDefault(_doParallel);
|
---|
| 14 |
|
---|
| 15 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
---|
| 16 |
|
---|
| 17 | /**
|
---|
| 18 | * Returns a new array of all the values in `coll` which pass an async truth
|
---|
| 19 | * test. This operation is performed in parallel, but the results array will be
|
---|
| 20 | * in the same order as the original.
|
---|
| 21 | *
|
---|
| 22 | * @name filter
|
---|
| 23 | * @static
|
---|
| 24 | * @memberOf module:Collections
|
---|
| 25 | * @method
|
---|
| 26 | * @alias select
|
---|
| 27 | * @category Collection
|
---|
| 28 | * @param {Array|Iterable|Object} coll - A collection to iterate over.
|
---|
| 29 | * @param {Function} iteratee - A truth test to apply to each item in `coll`.
|
---|
| 30 | * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
|
---|
| 31 | * with a boolean argument once it has completed. Invoked with (item, callback).
|
---|
| 32 | * @param {Function} [callback] - A callback which is called after all the
|
---|
| 33 | * `iteratee` functions have finished. Invoked with (err, results).
|
---|
| 34 | * @example
|
---|
| 35 | *
|
---|
| 36 | * async.filter(['file1','file2','file3'], function(filePath, callback) {
|
---|
| 37 | * fs.access(filePath, function(err) {
|
---|
| 38 | * callback(null, !err)
|
---|
| 39 | * });
|
---|
| 40 | * }, function(err, results) {
|
---|
| 41 | * // results now equals an array of the existing files
|
---|
| 42 | * });
|
---|
| 43 | */
|
---|
| 44 | exports.default = (0, _doParallel2.default)(_filter2.default);
|
---|
| 45 | module.exports = exports['default']; |
---|