mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Merge pull request #5199 from chrootsu/lodash-ary
lodash: added _.ary() method
This commit is contained in:
@@ -759,6 +759,10 @@ _.forEach(saves, function (type) {
|
||||
asyncSave({ 'type': type, 'complete': done });
|
||||
});
|
||||
|
||||
// _.ary
|
||||
result = <number[]>['6', '8', '10'].map(_.ary<(s: string) => number>(parseInt, 1));
|
||||
result = <number[]>['6', '8', '10'].map(_(parseInt).ary<(s: string) => number>(1).value());
|
||||
|
||||
// _.backflow
|
||||
var testBackflowSquareFn = (n: number) => n * n;
|
||||
var testBackflowAddFn = (n: number, m: number) => n + m;
|
||||
|
||||
Vendored
+19
@@ -5149,6 +5149,25 @@ declare module _ {
|
||||
after(func: Function): LoDashObjectWrapper<Function>;
|
||||
}
|
||||
|
||||
//_.ary
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Creates a function that accepts up to n arguments ignoring any additional arguments.
|
||||
* @param func The function to cap arguments for.
|
||||
* @param n The arity cap.
|
||||
* @param guard Enables use as a callback for functions like `_.map`.
|
||||
* @returns Returns the new function.
|
||||
*/
|
||||
ary<TResult extends Function>(func: Function, n?: number, guard?: Object): TResult;
|
||||
}
|
||||
|
||||
interface LoDashObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.ary
|
||||
*/
|
||||
ary<TResult extends Function>(n?: number, guard?: Object): LoDashObjectWrapper<TResult>;
|
||||
}
|
||||
|
||||
//_.backflow
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user