| [a762898] | 1 | /**
|
|---|
| 2 | * This method is like `union` except that it accepts `comparator` which
|
|---|
| 3 | * is invoked to compare elements of `arrays`. The comparator is invoked
|
|---|
| 4 | * with two arguments: (arrVal, othVal).
|
|---|
| 5 | *
|
|---|
| 6 | * @template T
|
|---|
| 7 | * @param {ArrayLike<T> | null | undefined} arrays - The arrays to inspect.
|
|---|
| 8 | * @param {(a: T, b: T) => boolean} [comparator] - The comparator invoked per element.
|
|---|
| 9 | * @returns {T[]} Returns the new array of combined values.
|
|---|
| 10 | *
|
|---|
| 11 | * @example
|
|---|
| 12 | * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
|
|---|
| 13 | * const others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
|
|---|
| 14 | * unionWith(objects, others, isEqual);
|
|---|
| 15 | * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
|
|---|
| 16 | */
|
|---|
| 17 | declare function unionWith<T>(arrays: ArrayLike<T> | null | undefined, comparator?: (a: T, b: T) => boolean): T[];
|
|---|
| 18 | /**
|
|---|
| 19 | * This method is like `union` except that it accepts `comparator` which
|
|---|
| 20 | * is invoked to compare elements of `arrays`. The comparator is invoked
|
|---|
| 21 | * with two arguments: (arrVal, othVal).
|
|---|
| 22 | *
|
|---|
| 23 | * @template T
|
|---|
| 24 | * @param {ArrayLike<T> | null | undefined} arrays - The first array to inspect.
|
|---|
| 25 | * @param {ArrayLike<T> | null | undefined} arrays2 - The second array to inspect.
|
|---|
| 26 | * @param {(a: T, b: T) => boolean} [comparator] - The comparator invoked per element.
|
|---|
| 27 | * @returns {T[]} Returns the new array of combined values.
|
|---|
| 28 | *
|
|---|
| 29 | * @example
|
|---|
| 30 | * unionWith([1, 2], [2, 3], (a, b) => a === b);
|
|---|
| 31 | * // => [1, 2, 3]
|
|---|
| 32 | */
|
|---|
| 33 | declare function unionWith<T>(arrays: ArrayLike<T> | null | undefined, arrays2: ArrayLike<T> | null | undefined, comparator?: (a: T, b: T) => boolean): T[];
|
|---|
| 34 | /**
|
|---|
| 35 | * This method is like `union` except that it accepts `comparator` which
|
|---|
| 36 | * is invoked to compare elements of `arrays`. The comparator is invoked
|
|---|
| 37 | * with two arguments: (arrVal, othVal).
|
|---|
| 38 | *
|
|---|
| 39 | * @template T
|
|---|
| 40 | * @param {ArrayLike<T> | null | undefined} arrays - The first array to inspect.
|
|---|
| 41 | * @param {ArrayLike<T> | null | undefined} arrays2 - The second array to inspect.
|
|---|
| 42 | * @param {ArrayLike<T> | null | undefined} arrays3 - The third array to inspect.
|
|---|
| 43 | * @param {...Array<(a: T, b: T) => boolean | ArrayLike<T> | null | undefined>} comparator - The comparator invoked per element.
|
|---|
| 44 | * @returns {T[]} Returns the new array of combined values.
|
|---|
| 45 | *
|
|---|
| 46 | * @example
|
|---|
| 47 | * unionWith([1], [2], [3], (a, b) => a === b);
|
|---|
| 48 | * // => [1, 2, 3]
|
|---|
| 49 | */
|
|---|
| 50 | declare function unionWith<T>(arrays: ArrayLike<T> | null | undefined, arrays2: ArrayLike<T> | null | undefined, arrays3: ArrayLike<T> | null | undefined, ...comparator: Array<((a: T, b: T) => boolean) | ArrayLike<T> | null | undefined>): T[];
|
|---|
| 51 |
|
|---|
| 52 | export { unionWith };
|
|---|