main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
778 bytes
|
Rev | Line | |
---|
[d565449] | 1 | import apply from './_apply.js';
|
---|
| 2 | import arrayMap from './_arrayMap.js';
|
---|
| 3 | import baseIteratee from './_baseIteratee.js';
|
---|
| 4 | import baseRest from './_baseRest.js';
|
---|
| 5 | import baseUnary from './_baseUnary.js';
|
---|
| 6 | import flatRest from './_flatRest.js';
|
---|
| 7 |
|
---|
| 8 | /**
|
---|
| 9 | * Creates a function like `_.over`.
|
---|
| 10 | *
|
---|
| 11 | * @private
|
---|
| 12 | * @param {Function} arrayFunc The function to iterate over iteratees.
|
---|
| 13 | * @returns {Function} Returns the new over function.
|
---|
| 14 | */
|
---|
| 15 | function createOver(arrayFunc) {
|
---|
| 16 | return flatRest(function(iteratees) {
|
---|
| 17 | iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
|
---|
| 18 | return baseRest(function(args) {
|
---|
| 19 | var thisArg = this;
|
---|
| 20 | return arrayFunc(iteratees, function(iteratee) {
|
---|
| 21 | return apply(iteratee, thisArg, args);
|
---|
| 22 | });
|
---|
| 23 | });
|
---|
| 24 | });
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | export default createOver;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.