From 1b89ccce22802705de8fc490a58d950ea054a448 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Thu, 5 Nov 2015 08:40:18 +0500 Subject: [PATCH] lodash: signatures of the method _.rest have been changed --- lodash/lodash-tests.ts | 52 ++++++++++++++++++++++++++++++++++-------- lodash/lodash.d.ts | 32 ++++++++++++++++++++++++-- 2 files changed, 72 insertions(+), 12 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index abe109c6e..707c965b0 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -920,12 +920,28 @@ module TestRemove { module TestRest { let array: TResult[]; let list: _.List; - let result: TResult[]; - result = _.rest(array); - result = _.rest(list); - result = _(array).rest().value(); - result = _(list).rest().value(); + { + let result: TResult[]; + + result = _.rest(array); + result = _.rest(list); + + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).rest(); + result = _(list).rest(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().rest(); + result = _(list).chain().rest(); + } } // _.slice @@ -991,12 +1007,28 @@ module TestSortedLastIndex { module TestTail { let array: TResult[]; let list: _.List; - let result: TResult[]; - result = _.tail(array); - result = _.tail(list); - result = _(array).tail().value(); - result = _(list).tail().value(); + { + let result: TResult[]; + + result = _.tail(array); + result = _.tail(list); + + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).tail(); + result = _(list).tail(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().tail(); + result = _(list).chain().tail(); + } } // _.take diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 7f20d7aa8..b4e17bb81 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1583,7 +1583,21 @@ declare module _ { /** * @see _.rest */ - rest(): LoDashImplicitArrayWrapper; + rest(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.rest + */ + rest(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.rest + */ + rest(): LoDashExplicitArrayWrapper; } //_.slice @@ -1782,7 +1796,21 @@ declare module _ { /** * @see _.rest */ - tail(): LoDashImplicitArrayWrapper; + tail(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.rest + */ + tail(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.rest + */ + tail(): LoDashExplicitArrayWrapper; } //_.take