From 067aa26cb19856e4af6506bbc067c8fe82ba5f28 Mon Sep 17 00:00:00 2001 From: Brian Zengel Date: Mon, 14 Oct 2013 23:44:38 -0400 Subject: [PATCH] definitions for _.union --- lodash/lodash-tests.ts | 2 ++ lodash/lodash.d.ts | 16 +++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index f65eebdffe..55fd5604fe 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -154,6 +154,8 @@ result = _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function return this.wordToNumber[word]; }, sortedIndexDict); +result = _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); + //////////////////////////////////////////////////////////////////////////////////////// //WHAT'S LEFT //////////////////////////////////////////////////////////////////////////////////////// diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 215d224838..142cd89569 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -549,6 +549,14 @@ declare module _ { value: T, whereValue: Dictionary): 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(...arrays: List[]): T[]; + /* ************* * Collections * ************* */ @@ -1136,13 +1144,7 @@ declare module _ { array: List, ...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(...arrays: List[]): T[]; +