From 8d8abe471b822ec9d84fd3c8c221f3288ae2e773 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sun, 6 Dec 2015 14:43:21 +0500 Subject: [PATCH] lodash: signatures of _.negate have been changed --- lodash/lodash-tests.ts | 41 +++++++++++++++++++++++++++++++---------- lodash/lodash.d.ts | 13 +++++++++++++ 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 9cae2a872..6cc720503 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -4925,17 +4925,38 @@ module TestModArgs { } // _.negate -interface TestNegatePredicate { - (a1: number, a2: number): boolean; +module TestNegate { + interface PredicateFn { + (a1: number, a2: number): boolean; + } + + interface ResultFn { + (a1: number, a2: number): boolean; + } + + var predicate = (a1: number, a2: number) => a1 > a2; + + { + let result: ResultFn; + + result = _.negate(predicate); + result = _.negate(predicate); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _(predicate).negate(); + result = _(predicate).negate(); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _(predicate).chain().negate(); + result = _(predicate).chain().negate(); + } } -interface TestNegateResult { - (a1: number, a2: number): boolean; -} -var testNegatePredicate = (a1: number, a2: number) => a1 > a2; -result = _.negate(testNegatePredicate); -result = _.negate(testNegatePredicate); -result = _(testNegatePredicate).negate().value(); -result = _(testNegatePredicate).negate().value(); // _.once module TestOnce { diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index ed8d72443..66e49e5f5 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -8462,6 +8462,7 @@ declare module _ { /** * Creates a function that negates the result of the predicate func. The func predicate is invoked with * the this binding and arguments of the created function. + * * @param predicate The predicate to negate. * @return Returns the new function. */ @@ -8485,6 +8486,18 @@ declare module _ { negate(): LoDashImplicitObjectWrapper; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.negate + */ + negate(): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; + + /** + * @see _.negate + */ + negate(): LoDashExplicitObjectWrapper; + } + //_.once interface LoDashStatic { /**