mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
26 lines
661 B
JavaScript
26 lines
661 B
JavaScript
import apply from './_apply';
|
|
import arrayMap from './_arrayMap';
|
|
import baseIteratee from './_baseIteratee';
|
|
import rest from './rest';
|
|
|
|
/**
|
|
* Creates a function like `_.over`.
|
|
*
|
|
* @private
|
|
* @param {Function} arrayFunc The function to iterate over iteratees.
|
|
* @returns {Function} Returns the new invoker function.
|
|
*/
|
|
function createOver(arrayFunc) {
|
|
return rest(function(iteratees) {
|
|
iteratees = arrayMap(iteratees, baseIteratee);
|
|
return rest(function(args) {
|
|
var thisArg = this;
|
|
return arrayFunc(iteratees, function(iteratee) {
|
|
return apply(iteratee, thisArg, args);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
|
|
export default createOver;
|