mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 00:57:48 +00:00
Move internal modules to “internal” folder.
This commit is contained in:
19
.internal/createOver.js
Normal file
19
.internal/createOver.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import apply from './.internal/apply.js';
|
||||
|
||||
/**
|
||||
* Creates a function like `over`.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} arrayFunc The function to iterate over iteratees.
|
||||
* @returns {Function} Returns the new over function.
|
||||
*/
|
||||
function createOver(arrayFunc) {
|
||||
return (...iteratees) => {
|
||||
return function(...args) {
|
||||
const thisArg = this;
|
||||
return arrayFunc(iteratees, iteratee => apply(iteratee, thisArg, args));
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export default createOver;
|
||||
Reference in New Issue
Block a user