From 10a7deb032dad5b6c3758faadb957d7c519019e2 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sun, 1 Nov 2015 06:22:20 +0500 Subject: [PATCH] lodash: signatures of the method _.take changed --- lodash/lodash-tests.ts | 39 ++++++++++++++++++++++++++++++--------- lodash/lodash.d.ts | 14 ++++++++++++++ 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 3afc49041b..d318ec4f44 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -727,15 +727,36 @@ module TestTail { module TestTake { let array: TResult[]; let list: _.List; - let result: TResult[]; - result = _.take(array); - result = _.take(array, 42); - result = _.take(list); - result = _.take(list, 42); - result = _(array).take().value(); - result = _(array).take(42).value(); - result = _(list).take().value(); - result = _(list).take(42).value(); + + { + let result: TResult[]; + + result = _.take(array); + result = _.take(array, 42); + + result = _.take(list); + result = _.take(list, 42); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).take(); + result = _(array).take(42); + + result = _(list).take(); + result = _(list).take(42); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().take(); + result = _(array).chain().take(42); + + result = _(list).chain().take(); + result = _(list).chain().take(42); + } } // _.takeRight diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index d143f4e657..1a200ffa51 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1460,6 +1460,20 @@ declare module _ { take(n?: number): LoDashImplicitArrayWrapper; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.take + */ + take(n?: number): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.take + */ + take(n?: number): LoDashExplicitArrayWrapper; + } + //_.takeRight interface LoDashStatic { /**