Remove remaining rest helper use.

This commit is contained in:
John-David Dalton
2017-01-09 15:36:35 -08:00
parent 648722f1a6
commit aacfefc752
25 changed files with 53 additions and 165 deletions

View File

@@ -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;