From f94388c1c9295d27cbdd5f32fc1563f8221d68ad Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Thu, 12 Nov 2015 15:11:28 +0500 Subject: [PATCH] lodash: signatures of the method _.without have been changed --- lodash/lodash-tests.ts | 64 +++++++++++++++++++++++++++++------------- lodash/lodash.d.ts | 18 ++++++++++-- 2 files changed, 60 insertions(+), 22 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 4c587b57b..a75ec7afb 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1427,26 +1427,50 @@ result = <{ x: number; }[]>_([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }]).unique('x').v } // _.without -{ - let testWithoutArray: number[]; - let testWithoutList: _.List; - let result: number[]; - result = _.without(testWithoutArray); - result = _.without(testWithoutArray, 1); - result = _.without(testWithoutArray, 1, 2); - result = _.without(testWithoutArray, 1, 2, 3); - result = _.without(testWithoutList); - result = _.without(testWithoutList, 1); - result = _.without(testWithoutList, 1, 2); - result = _.without(testWithoutList, 1, 2, 3); - result = _(testWithoutArray).without().value(); - result = _(testWithoutArray).without(1).value(); - result = _(testWithoutArray).without(1, 2).value(); - result = _(testWithoutArray).without(1, 2, 3).value(); - result = _(testWithoutList).without().value(); - result = _(testWithoutList).without(1).value(); - result = _(testWithoutList).without(1, 2).value(); - result = _(testWithoutList).without(1, 2, 3).value(); +module TestWithout { + let array: number[]; + let list: _.List; + + { + let result: number[]; + + result = _.without(array); + result = _.without(array, 1); + result = _.without(array, 1, 2); + result = _.without(array, 1, 2, 3); + + result = _.without(list); + result = _.without(list, 1); + result = _.without(list, 1, 2); + result = _.without(list, 1, 2, 3); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).without(); + result = _(array).without(1); + result = _(array).without(1, 2); + result = _(array).without(1, 2, 3); + result = _(list).without(); + result = _(list).without(1); + result = _(list).without(1, 2); + result = _(list).without(1, 2, 3); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().without(); + result = _(array).chain().without(1); + result = _(array).chain().without(1, 2); + result = _(array).chain().without(1, 2, 3); + + result = _(list).chain().without(); + result = _(list).chain().without(1); + result = _(list).chain().without(1, 2); + result = _(list).chain().without(1, 2, 3); + } } // _.xor diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 98d8bf55d..12c8c2028 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2770,7 +2770,7 @@ declare module _ { * @return Returns the new array of filtered values. */ without( - array: T[]|List, + array: List, ...values: T[] ): T[]; } @@ -2786,7 +2786,21 @@ declare module _ { /** * @see _.without */ - without(...values: TValue[]): LoDashImplicitArrayWrapper; + without(...values: T[]): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.without + */ + without(...values: T[]): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.without + */ + without(...values: T[]): LoDashExplicitArrayWrapper; } //_.xor