definitions for _.union

This commit is contained in:
Brian Zengel
2013-10-14 23:44:38 -04:00
parent 380b8a086d
commit 067aa26cb1
2 changed files with 11 additions and 7 deletions
+2
View File
@@ -154,6 +154,8 @@ result = <number>_.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function
return this.wordToNumber[word];
}, sortedIndexDict);
result = <number[]>_.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
////////////////////////////////////////////////////////////////////////////////////////
//WHAT'S LEFT
////////////////////////////////////////////////////////////////////////////////////////
+9 -7
View File
@@ -549,6 +549,14 @@ declare module _ {
value: T,
whereValue: Dictionary<any>): number;
/**
* Creates an array of unique values, in order, of the provided arrays using strict
* equality for comparisons, i.e. ===.
* @param arrays The arrays to inspect.
* @return Returns an array of composite values.
**/
export function union<T>(...arrays: List<T>[]): T[];
/* *************
* Collections *
************* */
@@ -1136,13 +1144,7 @@ declare module _ {
array: List<T>,
...values: T[]): T[];
/**
* Computes the union of the passed-in arrays: the list of unique items, in order, that are
* present in one or more of the arrays.
* @param arrays Array of arrays to compute the union of.
* @return The union of elements within `arrays`.
**/
export function union<T>(...arrays: List<T>[]): T[];