From 2ea95507714d10bae1896c9c6f35640ac9acfcbb Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Thu, 5 Nov 2015 08:29:02 +0500 Subject: [PATCH] lodash: signatures of the method _.initial have been changed --- lodash/lodash-tests.ts | 32 ++++++++++++++++++++++++-------- lodash/lodash.d.ts | 18 ++++++++++++++++-- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index abe109c6e..53cd954c6 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -614,14 +614,30 @@ module TestIndexOf { } //_.initial -{ - let testInitalArray: TResult[]; - let testInitalList: _.List; - let result: TResult[]; - result = _.initial(testInitalArray); - result = _.initial(testInitalList); - result = _(testInitalArray).initial().value(); - result = _(testInitalList).initial().value(); +module TestInitial { + let array: TResult[]; + let list: _.List; + + { + let result: TResult[]; + + result = _.initial(array); + result = _.initial(list); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).initial(); + result = _(list).initial(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().initial(); + result = _(list).chain().initial(); + } } // _.intersection diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 7f20d7aa8..b374b45ab 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1116,7 +1116,7 @@ declare module _ { * @param array The array to query. * @return Returns the slice of array. */ - initial(array: T[]|List): T[]; + initial(array: List): T[]; } interface LoDashImplicitArrayWrapper { @@ -1130,7 +1130,21 @@ declare module _ { /** * @see _.initial */ - initial(): LoDashImplicitArrayWrapper; + initial(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.initial + */ + initial(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.initial + */ + initial(): LoDashExplicitArrayWrapper; } //_.intersection