diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 8253af730c..e01960440f 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -970,15 +970,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 db27b7e438..8476314e43 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1730,6 +1730,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 { /**