diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 44dd7f79a..e3e8e5090 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 319bcfbad..320fd6c18 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 { /**