mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 03:47:50 +00:00
Remove isIterateeCall.
This commit is contained in:
7
some.js
7
some.js
@@ -1,6 +1,5 @@
|
||||
import arraySome from './.internal/arraySome.js'
|
||||
import baseSome from './.internal/baseSome.js'
|
||||
import isIterateeCall from './.internal/isIterateeCall.js'
|
||||
|
||||
/**
|
||||
* Checks if `predicate` returns truthy for **any** element of `collection`.
|
||||
@@ -11,7 +10,6 @@ import isIterateeCall from './.internal/isIterateeCall.js'
|
||||
* @category Collection
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} predicate The function invoked per iteration.
|
||||
* @param- {Object} [guard] Enables use as an iteratee for methods like `map`.
|
||||
* @returns {boolean} Returns `true` if any element passes the predicate check,
|
||||
* else `false`.
|
||||
* @example
|
||||
@@ -19,11 +17,8 @@ import isIterateeCall from './.internal/isIterateeCall.js'
|
||||
* some([null, 0, 'yes', false], Boolean)
|
||||
* // => true
|
||||
*/
|
||||
function some(collection, predicate, guard) {
|
||||
function some(collection, predicate) {
|
||||
const func = Array.isArray(collection) ? arraySome : baseSome
|
||||
if (guard && isIterateeCall(collection, predicate, guard)) {
|
||||
predicate = undefined
|
||||
}
|
||||
return func(collection, predicate)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user