From 4f41cdc2f06c4ab64377d5ad9acd62fed177e7a1 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Tue, 6 Oct 2015 06:08:49 +0500 Subject: [PATCH] lodash: changed signatures of the method _.xor --- lodash/lodash-tests.ts | 38 +++++++++++++++++++++++--------------- lodash/lodash.d.ts | 5 +++-- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 6733f77d4f..cd81cf20a0 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -690,21 +690,29 @@ result = <{ x: number; }[]>_([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }]).unique('x').v } // _.xor -var testXorArray: number[]; -var testXorList: _.List; -result = _.xor(); -result = _.xor(testXorArray); -result = _.xor(testXorArray, testXorArray); -result = _.xor(testXorArray, testXorArray, testXorArray); -result = _.xor(testXorList); -result = _.xor(testXorList, testXorList); -result = _.xor(testXorList, testXorList, testXorList); -result = (_(testXorArray).xor().value()); -result = (_(testXorArray).xor(testXorArray).value()); -result = (_(testXorArray).xor(testXorArray, testXorArray).value()); -result = (_(testXorList).xor().value()); -result = (_(testXorList).xor(testXorList).value()); -result = (_(testXorList).xor(testXorList, testXorList).value()); +module TestXor { + let array: TResult[]; + let list: _.List; + let result: TResult[]; + + result = _.xor(); + + result = _.xor(array); + result = _.xor(array, list); + result = _.xor(array, list, array); + + result = _.xor(list); + result = _.xor(list, array); + result = _.xor(list, array, list); + + result = _(array).xor().value(); + result = _(array).xor(list).value(); + result = _(array).xor(list, array).value(); + + result = _(list).xor().value(); + result = _(list).xor(array).value(); + result = _(list).xor(array, list).value(); +} result = _.zip(['moe', 'larry'], [30, 40], [true, false]); result = _.unzip(['moe', 'larry'], [30, 40], [true, false]); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index e7411f3a9f..6038db6649 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1874,6 +1874,7 @@ declare module _ { interface LoDashStatic { /** * Creates an array of unique values that is the symmetric difference of the provided arrays. + * * @param arrays The arrays to inspect. * @return Returns the new array of values. */ @@ -1884,14 +1885,14 @@ declare module _ { /** * @see _.xor */ - xor(...arrays: T[][]): LoDashArrayWrapper; + xor(...arrays: List[]): LoDashArrayWrapper; } interface LoDashObjectWrapper { /** * @see _.xor */ - xor(...arrays: T[]): LoDashObjectWrapper; + xor(...arrays: List[]): LoDashArrayWrapper; } //_.zip