mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 16:47:49 +00:00
Remove remaining rest helper use.
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
import apply from './_apply.js';
|
||||
import arrayMap from './_arrayMap.js';
|
||||
import baseIteratee from './_baseIteratee.js';
|
||||
import baseRest from './_baseRest.js';
|
||||
import baseUnary from './_baseUnary.js';
|
||||
import flatRest from './_flatRest.js';
|
||||
|
||||
/**
|
||||
* Creates a function like `_.over`.
|
||||
@@ -13,13 +11,13 @@ import flatRest from './_flatRest.js';
|
||||
* @returns {Function} Returns the new over function.
|
||||
*/
|
||||
function createOver(arrayFunc) {
|
||||
return flatRest(iteratees => {
|
||||
return (...iteratees) => {
|
||||
iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
|
||||
return baseRest(function(args) {
|
||||
return (...args) => {
|
||||
const thisArg = this;
|
||||
return arrayFunc(iteratees, iteratee => apply(iteratee, thisArg, args));
|
||||
});
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export default createOver;
|
||||
|
||||
Reference in New Issue
Block a user