Last change
on this file since eed0bf8 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
619 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var 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 | */
|
---|
| 12 | function 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 |
|
---|
| 22 | module.exports = baseSome;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.