UNPKG

619 BJavaScriptView Raw
1var baseEach = require('./_baseEach');
2
3/**
4 * The base implementation of `_.some` without support for iteratee shorthands.
5 *
6 * @private
7 * @param {Array|Object} collection The collection to iterate over.
8 * @param {Function} predicate The function invoked per iteration.
9 * @returns {boolean} Returns `true` if any element passes the predicate check,
10 * else `false`.
11 */
12function baseSome(collection, predicate) {
13 var result;
14
15 baseEach(collection, function(value, index, collection) {
16 result = predicate(value, index, collection);
17 return !result;
18 });
19 return !!result;
20}
21
22module.exports = baseSome;