'use strict'; import everyLimit from './everyLimit'; import doLimit from './internal/doLimit'; /** * Returns `true` if every element in `coll` satisfies an async test. If any * iteratee call returns `false`, the main `callback` is immediately called. * * @name every * @static * @memberOf async * @alias all * @category Collection * @param {Array|Object} coll - A collection to iterate over. * @param {Function} iteratee - A truth test to apply to each item in the * collection in parallel. The iteratee is passed a `callback(err, truthValue)` * which must be called with a boolean argument once it has completed. Invoked * with (item, callback). * @param {Function} [callback] - A callback which is called after all the * `iteratee` functions have finished. Result will be either `true` or `false` * depending on the values of the async tests. Invoked with (err, result). * @example * * async.every(['file1','file2','file3'], function(filePath, callback) { * fs.access(filePath, function(err) { * callback(null, !err) * }); * }, function(err, result) { * // if result is true then every file exists * }); */ export default doLimit(everyLimit, Infinity);