diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 14f68e1c41..aff134772b 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -759,6 +759,10 @@ _.forEach(saves, function (type) { asyncSave({ 'type': type, 'complete': done }); }); +// _.ary +result = ['6', '8', '10'].map(_.ary<(s: string) => number>(parseInt, 1)); +result = ['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; diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index ee21347665..a644381e03 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -5149,6 +5149,25 @@ declare module _ { after(func: Function): LoDashObjectWrapper; } + //_.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(func: Function, n?: number, guard?: Object): TResult; + } + + interface LoDashObjectWrapper { + /** + * @see _.ary + */ + ary(n?: number, guard?: Object): LoDashObjectWrapper; + } + //_.backflow interface LoDashStatic { /**