diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index d8ba15961..156a21750 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1460,26 +1460,50 @@ module TestUnzip { } // _.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 dc1037d8d..64a382ad9 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2810,7 +2810,7 @@ declare module _ { * @return Returns the new array of filtered values. */ without( - array: T[]|List, + array: List, ...values: T[] ): T[]; } @@ -2826,7 +2826,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