mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add _.xor to Lodash #2377
This commit is contained in:
@@ -319,6 +319,11 @@ result = <{ x: number; }[]>_([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }]).unique('x').v
|
||||
|
||||
result = <number[]>_.without([1, 2, 1, 0, 3, 1, 4], 0, 1);
|
||||
|
||||
result = <number[]>_.xor([1, 2, 3, 4, 5], [5, 2, 10]);
|
||||
result = <number[]>_.xor([1, 2, 3, 4, 5], [5, 2, 10], [4, 5, 6]);
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3, 4, 5]).xor([5, 2, 10]);
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3, 4, 5]).xor([5, 2, 10], [4, 5, 6]);
|
||||
|
||||
result = <any[][]>_.zip(['moe', 'larry'], [30, 40], [true, false]);
|
||||
result = <any[][]>_.unzip(['moe', 'larry'], [30, 40], [true, false]);
|
||||
|
||||
|
||||
Vendored
+32
@@ -1968,6 +1968,38 @@ declare module _ {
|
||||
...values: T[]): T[];
|
||||
}
|
||||
|
||||
//_.xor
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Creates an array that is the symmetric difference of the provided arrays.
|
||||
* @param array The array to process
|
||||
* @param others The arrays of values to calculate the symmetric difference.
|
||||
* @return Returns a new array of filtered values.
|
||||
**/
|
||||
xor<T>(
|
||||
array: Array<T>,
|
||||
...others: Array<T>[]): T[];
|
||||
/**
|
||||
* @see _.xor
|
||||
**/
|
||||
xor<T>(
|
||||
array: List<T>,
|
||||
...others: List<T>[]): T[];
|
||||
}
|
||||
|
||||
interface LoDashArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.xor
|
||||
**/
|
||||
xor(
|
||||
...others: Array<T>[]): LoDashArrayWrapper<T>;
|
||||
/**
|
||||
* @see _.xor
|
||||
**/
|
||||
xor(
|
||||
...others: List<T>[]): LoDashArrayWrapper<T>;
|
||||
}
|
||||
|
||||
//_.zip
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user