From ea6d2a70de0ce5d10b50702415c30c399a88f2da Mon Sep 17 00:00:00 2001 From: Brian Zengel Date: Mon, 21 Oct 2013 00:47:30 -0400 Subject: [PATCH] added _(...).curry def --- lodash/lodash-tests.ts | 8 ++++---- lodash/lodash.d.ts | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index ebd9e85dc..ebe254142 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -510,13 +510,13 @@ result = <_.LoDashWrapper<() => any>>_('name').createCallback(); result = <_.LoDashWrapper<() => boolean>>_(createCallbackObj).createCallback(); -var curried: Function = _.curry(function(a, b, c) { +result = _.curry(function(a, b, c) { console.log(a + b + c); }); -curried(1)(2)(3); -curried(1, 2)(3); -curried(1, 2, 3); +result = <_.LoDashWrapper>_(function(a, b, c) { + console.log(a + b + c); +}).curry(); var lazyLayout: Function = _.debounce(function() {}, 150); jQuery(window).on('resize', lazyLayout); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index a3dcff5ce..5d5b1b50d 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2080,6 +2080,13 @@ declare module _ { func: Function, arity?: number): Function; + interface LoDashWrapper { + /** + * @see _.curry + **/ + curry(arity?: number): LoDashWrapper; + } + /** * Creates a function that will delay the execution of func until after wait milliseconds have * elapsed since the last time it was invoked. Provide an options object to indicate that func