2016-01-28 01:16:24 -08:00
|
|
|
define(['./_baseEach'], function(baseEach) {
|
2015-01-08 00:37:01 -08:00
|
|
|
|
|
|
|
|
/**
|
2015-12-16 17:53:20 -08:00
|
|
|
* The base implementation of `_.every` without support for iteratee shorthands.
|
2015-01-08 00:37:01 -08:00
|
|
|
*
|
|
|
|
|
* @private
|
2015-12-16 17:53:20 -08:00
|
|
|
* @param {Array|Object} collection The collection to iterate over.
|
2015-01-08 00:37:01 -08:00
|
|
|
* @param {Function} predicate The function invoked per iteration.
|
2016-03-26 00:00:01 -07:00
|
|
|
* @returns {boolean} Returns `true` if all elements pass the predicate check,
|
|
|
|
|
* else `false`
|
2015-01-08 00:37:01 -08:00
|
|
|
*/
|
|
|
|
|
function baseEvery(collection, predicate) {
|
|
|
|
|
var result = true;
|
|
|
|
|
baseEach(collection, function(value, index, collection) {
|
|
|
|
|
result = !!predicate(value, index, collection);
|
|
|
|
|
return result;
|
|
|
|
|
});
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return baseEvery;
|
|
|
|
|
});
|