mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
621 B
21 lines
621 B
9 years ago
|
var baseEach = require('./_baseEach');
|
||
10 years ago
|
|
||
|
/**
|
||
9 years ago
|
* The base implementation of `_.every` without support for iteratee shorthands.
|
||
10 years ago
|
*
|
||
|
* @private
|
||
9 years ago
|
* @param {Array|Object} collection The collection to iterate over.
|
||
10 years ago
|
* @param {Function} predicate The function invoked per iteration.
|
||
9 years ago
|
* @returns {boolean} Returns `true` if all elements pass the predicate check, else `false`
|
||
10 years ago
|
*/
|
||
|
function baseEvery(collection, predicate) {
|
||
|
var result = true;
|
||
|
baseEach(collection, function(value, index, collection) {
|
||
|
result = !!predicate(value, index, collection);
|
||
|
return result;
|
||
|
});
|
||
|
return result;
|
||
|
}
|
||
|
|
||
|
module.exports = baseEvery;
|