From d63c5e1b4dc62edd1f790f63cb6887c0cd83f6ea Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sun, 1 Nov 2015 06:51:11 +0500 Subject: [PATCH] lodash: signatures of the method _.takeRightWhile changed --- lodash/lodash-tests.ts | 75 ++++++++++++++++++++++++++++-------------- lodash/lodash.d.ts | 50 ++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 25 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 3afc49041..ef7df065e 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -758,35 +758,60 @@ module TestTakeRightWhile { let array: TResult[]; let list: _.List; let predicateFn: (value: TResult, index: number, collection: _.List) => boolean; - let result: TResult[]; - result = _.takeRightWhile(array); - result = _.takeRightWhile(array, predicateFn); - result = _.takeRightWhile(array, predicateFn, any); - result = _.takeRightWhile(array, ''); - result = _.takeRightWhile(array, '', any); - result = _.takeRightWhile<{a: number;}, TResult>(array, {a: 42}); + { + let result: TResult[]; - result = _.takeRightWhile(list); - result = _.takeRightWhile(list, predicateFn); - result = _.takeRightWhile(list, predicateFn, any); - result = _.takeRightWhile(list, ''); - result = _.takeRightWhile(list, '', any); - result = _.takeRightWhile<{a: number;}, TResult>(list, {a: 42}); + result = _.takeRightWhile(array); + result = _.takeRightWhile(array, predicateFn); + result = _.takeRightWhile(array, predicateFn, any); + result = _.takeRightWhile(array, ''); + result = _.takeRightWhile(array, '', any); + result = _.takeRightWhile<{a: number;}, TResult>(array, {a: 42}); - result = _(array).takeRightWhile().value(); - result = _(array).takeRightWhile(predicateFn).value(); - result = _(array).takeRightWhile(predicateFn, any).value(); - result = _(array).takeRightWhile('').value(); - result = _(array).takeRightWhile('', any).value(); - result = _(array).takeRightWhile<{a: number;}>({a: 42}).value(); + result = _.takeRightWhile(list); + result = _.takeRightWhile(list, predicateFn); + result = _.takeRightWhile(list, predicateFn, any); + result = _.takeRightWhile(list, ''); + result = _.takeRightWhile(list, '', any); + result = _.takeRightWhile<{a: number;}, TResult>(list, {a: 42}); + } - result = _(list).takeRightWhile().value(); - result = _(list).takeRightWhile(predicateFn).value(); - result = _(list).takeRightWhile(predicateFn, any).value(); - result = _(list).takeRightWhile('').value(); - result = _(list).takeRightWhile('', any).value(); - result = _(list).takeRightWhile<{a: number;}, TResult>({a: 42}).value(); + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).takeRightWhile(); + result = _(array).takeRightWhile(predicateFn); + result = _(array).takeRightWhile(predicateFn, any); + result = _(array).takeRightWhile(''); + result = _(array).takeRightWhile('', any); + result = _(array).takeRightWhile<{a: number;}>({a: 42}); + + result = _(list).takeRightWhile(); + result = _(list).takeRightWhile(predicateFn); + result = _(list).takeRightWhile(predicateFn, any); + result = _(list).takeRightWhile(''); + result = _(list).takeRightWhile('', any); + result = _(list).takeRightWhile<{a: number;}, TResult>({a: 42}); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().takeRightWhile(); + result = _(array).chain().takeRightWhile(predicateFn); + result = _(array).chain().takeRightWhile(predicateFn, any); + result = _(array).chain().takeRightWhile(''); + result = _(array).chain().takeRightWhile('', any); + result = _(array).chain().takeRightWhile<{a: number;}>({a: 42}); + + result = _(list).chain().takeRightWhile(); + result = _(list).chain().takeRightWhile(predicateFn); + result = _(list).chain().takeRightWhile(predicateFn, any); + result = _(list).chain().takeRightWhile(''); + result = _(list).chain().takeRightWhile('', any); + result = _(list).chain().takeRightWhile<{a: number;}, TResult>({a: 42}); + } } // _.takeWhile diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index d143f4e65..21b222ad0 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1583,6 +1583,56 @@ declare module _ { ): LoDashImplicitArrayWrapper; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: ListIterator, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: string, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: TWhere + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: ListIterator, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: string, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: TWhere + ): LoDashExplicitArrayWrapper; + } + //_.takeWhile interface LoDashStatic { /**