From 3f679d1bd95d9f03bc34dc8d7a3e2520ad8c0c9d Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sat, 7 Nov 2015 12:42:12 +0500 Subject: [PATCH] lodash: signatures of the method _.takeRight have been changed --- lodash/lodash-tests.ts | 45 +++++++++++++++++++++++++++++++----------- lodash/lodash.d.ts | 16 ++++++++++++++- 2 files changed, 48 insertions(+), 13 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 876547fd6..fa9951979 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1151,18 +1151,39 @@ module TestTake { } // _.takeRight -{ - let testTakeRightArray: TResult[]; - let testTakeRightList: _.List; - let result: TResult[]; - result = _.takeRight(testTakeRightArray); - result = _.takeRight(testTakeRightArray, 42); - result = _.takeRight(testTakeRightList); - result = _.takeRight(testTakeRightList, 42); - result = _(testTakeRightArray).takeRight().value(); - result = _(testTakeRightArray).takeRight(42).value(); - result = _(testTakeRightList).takeRight().value(); - result = _(testTakeRightList).takeRight(42).value(); +module TestTakeRight { + let array: TResult[]; + let list: _.List; + + { + let result: TResult[]; + + result = _.takeRight(array); + result = _.takeRight(array, 42); + + result = _.takeRight(list); + result = _.takeRight(list, 42); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).takeRight(); + result = _(array).takeRight(42); + + result = _(list).takeRight(); + result = _(list).takeRight(42); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().takeRight(); + result = _(array).chain().takeRight(42); + + result = _(list).chain().takeRight(); + result = _(list).chain().takeRight(42); + } } // _.takeRightWhile diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 359cc0fb9..4980ff4de 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1994,7 +1994,7 @@ declare module _ { * @return Returns the slice of array. */ takeRight( - array: T[]|List, + array: List, n?: number ): T[]; } @@ -2013,6 +2013,20 @@ declare module _ { takeRight(n?: number): LoDashImplicitArrayWrapper; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.takeRight + */ + takeRight(n?: number): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.takeRight + */ + takeRight(n?: number): LoDashExplicitArrayWrapper; + } + //_.takeRightWhile interface LoDashStatic { /**