mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
added _.curry definition
This commit is contained in:
@@ -443,6 +443,14 @@ var createCallbackObj = { name: 'Joe' };
|
||||
var pluckCallback: () => any = _.createCallback('name');
|
||||
var whereCallback: () => boolean = _.createCallback(createCallbackObj);
|
||||
|
||||
var curried: Function = _.curry(function(a, b, c) {
|
||||
console.log(a + b + c);
|
||||
});
|
||||
|
||||
curried(1)(2)(3);
|
||||
curried(1, 2)(3);
|
||||
curried(1, 2, 3);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
//WHAT'S LEFT
|
||||
|
||||
Vendored
+14
@@ -1780,6 +1780,20 @@ declare module _ {
|
||||
thisArg?: any,
|
||||
argCount?: number): () => boolean;
|
||||
|
||||
/**
|
||||
* Creates a function which accepts one or more arguments of func that when invoked either
|
||||
* executes func returning its result, if all func arguments have been provided, or returns
|
||||
* a function that accepts one or more of the remaining func arguments, and so on. The arity
|
||||
* of func can be specified if func.length is not sufficient.
|
||||
* @param func The function to curry.
|
||||
* @param arity The arity of func.
|
||||
* @return The new curried function.
|
||||
**/
|
||||
export function curry(
|
||||
func: Function,
|
||||
arity?: number): Function;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user