diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 8567b62f4e..8be3a0ef09 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -726,21 +726,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 d8cf0d0563..e18e5f6b37 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1968,6 +1968,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. */ @@ -1978,14 +1979,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