From 11f2cbc14a711c6184c4851b1cee246cbeb56cf4 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sun, 1 Nov 2015 06:12:43 +0500 Subject: [PATCH] lodash: signatures of the method _.slice changed --- lodash/lodash-tests.ts | 35 ++++++++++++++++++++++++++--------- lodash/lodash.d.ts | 10 ++++++++++ 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 3afc49041b..b7bff79e1c 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -688,15 +688,32 @@ module TestRest { } // _.slice -{ - let testSliceArray: TResult[]; - let result: TResult[]; - result = _.slice(testSliceArray); - result = _.slice(testSliceArray, 42); - result = _.slice(testSliceArray, 42, 42); - result = _(testSliceArray).slice().value(); - result = _(testSliceArray).slice(42).value(); - result = _(testSliceArray).slice(42, 42).value(); +module TestSlice { + let array: TResult[]; + + { + let result: TResult[]; + + result = _.slice(array); + result = _.slice(array, 42); + result = _.slice(array, 42, 42); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).slice(); + result = _(array).slice(42); + result = _(array).slice(42, 42); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().slice(); + result = _(array).chain().slice(42); + result = _(array).chain().slice(42, 42); + } } result = _.sortedIndex([20, 30, 50], 40); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index d143f4e657..91de004e25 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1339,6 +1339,16 @@ declare module _ { ): LoDashImplicitArrayWrapper; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.slice + */ + slice( + start?: number, + end?: number + ): LoDashExplicitArrayWrapper; + } + //_.sortedIndex interface LoDashStatic { /**