From b62d42832fd8c4f34f5789337f3fec62436d817a Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Fri, 30 Oct 2015 01:24:05 +0500 Subject: [PATCH] lodash: signatures of the method _.chunk 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 3afc49041..6f30d2169 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -150,15 +150,36 @@ result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3, 4]).unshift(5, 6); module TestChunk { let array: TResult[]; let list: _.List; - let result: TResult[][]; - result = _.chunk(array); - result = _.chunk(array, 42); - result = _.chunk(list); - result = _.chunk(list, 42); - result = _(array).chunk().value(); - result = _(array).chunk(42).value(); - result = _(list).chunk().value(); - result = _(list).chunk(42).value(); + + { + let result: TResult[][]; + + result = _.chunk(array); + result = _.chunk(array, 42); + + result = _.chunk(list); + result = _.chunk(list, 42); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).chunk(); + result = _(array).chunk(42); + + result = _(list).chunk(); + result = _(list).chunk(42); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().chunk(); + result = _(array).chain().chunk(42); + + result = _(list).chain().chunk(); + result = _(list).chain().chunk(42); + } } // _.compact diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index d143f4e65..68a0a60f0 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -280,6 +280,20 @@ declare module _ { chunk(size?: number): LoDashImplicitArrayWrapper; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.chunk + */ + chunk(size?: number): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.chunk + */ + chunk(size?: number): LoDashExplicitArrayWrapper; + } + //_.compact interface LoDashStatic { /**