mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-30 23:17:48 +00:00
24 lines
718 B
JavaScript
24 lines
718 B
JavaScript
define(['./_apply', './_arrayMap', './_baseFlatten', './_baseIteratee', './rest'], function(apply, arrayMap, baseFlatten, baseIteratee, 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(baseFlatten(iteratees, 1), baseIteratee);
|
|
return rest(function(args) {
|
|
var thisArg = this;
|
|
return arrayFunc(iteratees, function(iteratee) {
|
|
return apply(iteratee, thisArg, args);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
|
|
return createOver;
|
|
});
|