mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
661 B
24 lines
661 B
10 years ago
|
var createWrapper = require('./createWrapper'),
|
||
|
isIterateeCall = require('./isIterateeCall');
|
||
|
|
||
|
/**
|
||
|
* Creates a `_.curry` or `_.curryRight` function.
|
||
|
*
|
||
|
* @private
|
||
|
* @param {boolean} flag The curry bit flag.
|
||
|
* @returns {Function} Returns the new curry function.
|
||
|
*/
|
||
|
function createCurry(flag) {
|
||
|
function curryFunc(func, arity, guard) {
|
||
|
if (guard && isIterateeCall(func, arity, guard)) {
|
||
9 years ago
|
arity = undefined;
|
||
10 years ago
|
}
|
||
9 years ago
|
var result = createWrapper(func, flag, undefined, undefined, undefined, undefined, undefined, arity);
|
||
10 years ago
|
result.placeholder = curryFunc.placeholder;
|
||
|
return result;
|
||
|
}
|
||
|
return curryFunc;
|
||
|
}
|
||
|
|
||
|
module.exports = createCurry;
|