From d3860cb406c8dc685a68f4e1a62f28673a9a7618 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sat, 7 Nov 2015 13:00:37 +0500 Subject: [PATCH] lodash: signatures of the method _.last have been changed --- lodash/lodash-tests.ts | 26 +++++++++++++++++++++----- lodash/lodash.d.ts | 14 ++++++++++++++ 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 876547fd6..1b03228e5 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -744,12 +744,28 @@ module TestIntersection { module TestLast { let array: TResult[]; let list: _.List; - let result: TResult; - result = _.last(array); - result = _.last(list); - result = _(array).last(); - result = _(list).last(); + { + let result: TResult; + + result = _.last(array); + result = _.last(list); + + result = _(array).last(); + result = _(list).last(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().last(); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.List>; + + result = _(list).chain().last<_.List>(); + } } // _.lastIndexOf diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 359cc0fb9..eda63233e 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1326,6 +1326,20 @@ declare module _ { last(): T; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.last + */ + last(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.last + */ + last(): LoDashExplicitObjectWrapper; + } + //_.lastIndexOf interface LoDashStatic { /**