Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / internal / baseSome.js
1 var baseEach = require('./baseEach');
2
3 /**
4  * The base implementation of `_.some` without support for callback shorthands
5  * and `this` binding.
6  *
7  * @private
8  * @param {Array|Object|string} collection The collection to iterate over.
9  * @param {Function} predicate The function invoked per iteration.
10  * @returns {boolean} Returns `true` if any element passes the predicate check,
11  *  else `false`.
12  */
13 function baseSome(collection, predicate) {
14   var result;
15
16   baseEach(collection, function(value, index, collection) {
17     result = predicate(value, index, collection);
18     return !result;
19   });
20   return !!result;
21 }
22
23 module.exports = baseSome;