1 | 'use strict';
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 |
|
---|
7 | var _createTester = require('./internal/createTester');
|
---|
8 |
|
---|
9 | var _createTester2 = _interopRequireDefault(_createTester);
|
---|
10 |
|
---|
11 | var _doParallel = require('./internal/doParallel');
|
---|
12 |
|
---|
13 | var _doParallel2 = _interopRequireDefault(_doParallel);
|
---|
14 |
|
---|
15 | var _notId = require('./internal/notId');
|
---|
16 |
|
---|
17 | var _notId2 = _interopRequireDefault(_notId);
|
---|
18 |
|
---|
19 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * Returns `true` if every element in `coll` satisfies an async test. If any
|
---|
23 | * iteratee call returns `false`, the main `callback` is immediately called.
|
---|
24 | *
|
---|
25 | * @name every
|
---|
26 | * @static
|
---|
27 | * @memberOf module:Collections
|
---|
28 | * @method
|
---|
29 | * @alias all
|
---|
30 | * @category Collection
|
---|
31 | * @param {Array|Iterable|Object} coll - A collection to iterate over.
|
---|
32 | * @param {AsyncFunction} iteratee - An async truth test to apply to each item
|
---|
33 | * in the collection in parallel.
|
---|
34 | * The iteratee must complete with a boolean result value.
|
---|
35 | * Invoked with (item, callback).
|
---|
36 | * @param {Function} [callback] - A callback which is called after all the
|
---|
37 | * `iteratee` functions have finished. Result will be either `true` or `false`
|
---|
38 | * depending on the values of the async tests. Invoked with (err, result).
|
---|
39 | * @example
|
---|
40 | *
|
---|
41 | * async.every(['file1','file2','file3'], function(filePath, callback) {
|
---|
42 | * fs.access(filePath, function(err) {
|
---|
43 | * callback(null, !err)
|
---|
44 | * });
|
---|
45 | * }, function(err, result) {
|
---|
46 | * // if result is true then every file exists
|
---|
47 | * });
|
---|
48 | */
|
---|
49 | exports.default = (0, _doParallel2.default)((0, _createTester2.default)(_notId2.default, _notId2.default));
|
---|
50 | module.exports = exports['default']; |
---|