mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 09:47:48 +00:00
Consolidate over modules.
This commit is contained in:
11
overSome.js
11
overSome.js
@@ -1,5 +1,5 @@
|
||||
import apply from './.internal/apply.js';
|
||||
import arraySome from './.internal/arraySome.js';
|
||||
import createOver from './.internal/createOver.js';
|
||||
|
||||
/**
|
||||
* Creates a function that checks if **any** of the `predicates` return
|
||||
@@ -7,7 +7,7 @@ import createOver from './.internal/createOver.js';
|
||||
*
|
||||
* @since 4.0.0
|
||||
* @category Util
|
||||
* @param {...(Function|Function[])} [predicates=[identity]]
|
||||
* @param {Function[]} [predicates=[identity]]
|
||||
* The predicates to check.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
@@ -23,6 +23,11 @@ import createOver from './.internal/createOver.js';
|
||||
* func(NaN);
|
||||
* // => false
|
||||
*/
|
||||
const overSome = createOver(arraySome);
|
||||
function overSome(iteratees) {
|
||||
return function(...args) {
|
||||
const thisArg = this;
|
||||
return arraySome(iteratees, iteratee => apply(iteratee, thisArg, args));
|
||||
};
|
||||
}
|
||||
|
||||
export default overSome;
|
||||
|
||||
Reference in New Issue
Block a user