source: node_modules/es-toolkit/dist/compat/array/intersectionBy.d.mts

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 3.2 KB
RevLine 
[a762898]1import { ValueIteratee } from '../_internal/ValueIteratee.mjs';
2
3/**
4 * Creates an array of unique values that are included in all given arrays, using an iteratee to compute equality.
5 *
6 * @template T, U
7 * @param {ArrayLike<T> | null} array - The array to inspect.
8 * @param {ArrayLike<U>} values - The values to compare.
9 * @param {ValueIteratee<T | U>} iteratee - The iteratee invoked per element.
10 * @returns {T[]} Returns the new array of intersecting values.
11 *
12 * @example
13 * intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
14 * // => [2.1]
15 */
16declare function intersectionBy<T, U>(array: ArrayLike<T> | null, values: ArrayLike<U>, iteratee: ValueIteratee<T | U>): T[];
17/**
18 * Creates an array of unique values that are included in all given arrays, using an iteratee to compute equality.
19 *
20 * @template T, U, V
21 * @param {ArrayLike<T> | null} array - The array to inspect.
22 * @param {ArrayLike<U>} values1 - The first values to compare.
23 * @param {ArrayLike<V>} values2 - The second values to compare.
24 * @param {ValueIteratee<T | U | V>} iteratee - The iteratee invoked per element.
25 * @returns {T[]} Returns the new array of intersecting values.
26 *
27 * @example
28 * intersectionBy([2.1, 1.2], [2.3, 3.4], [2.5], Math.floor);
29 * // => [2.1]
30 */
31declare function intersectionBy<T, U, V>(array: ArrayLike<T> | null, values1: ArrayLike<U>, values2: ArrayLike<V>, iteratee: ValueIteratee<T | U | V>): T[];
32/**
33 * Creates an array of unique values that are included in all given arrays, using an iteratee to compute equality.
34 *
35 * @template T, U, V, W
36 * @param {ArrayLike<T> | null | undefined} array - The array to inspect.
37 * @param {ArrayLike<U>} values1 - The first values to compare.
38 * @param {ArrayLike<V>} values2 - The second values to compare.
39 * @param {...Array<ArrayLike<W> | ValueIteratee<T | U | V | W>>} values - The other arrays to compare, and the iteratee to use.
40 * @returns {T[]} Returns the new array of intersecting values.
41 *
42 * @example
43 * intersectionBy([2.1, 1.2], [2.3, 3.4], [2.5], [2.6, 1.7], Math.floor);
44 * // => [2.1]
45 */
46declare function intersectionBy<T, U, V, W>(array: ArrayLike<T> | null | undefined, values1: ArrayLike<U>, values2: ArrayLike<V>, ...values: Array<ArrayLike<W> | ValueIteratee<T | U | V | W>>): T[];
47/**
48 * Creates an array of unique values that are included in all given arrays.
49 *
50 * @template T
51 * @param {ArrayLike<T> | null} [array] - The array to inspect.
52 * @param {...Array<ArrayLike<T>>} values - The values to compare.
53 * @returns {T[]} Returns the new array of intersecting values.
54 *
55 * @example
56 * intersectionBy([2, 1], [2, 3]);
57 * // => [2]
58 */
59declare function intersectionBy<T>(array?: ArrayLike<T> | null, ...values: Array<ArrayLike<T>>): T[];
60/**
61 * Creates an array of unique values that are included in all given arrays, using an iteratee to compute equality.
62 *
63 * @template T
64 * @param {...Array<ArrayLike<T> | ValueIteratee<T>>} values - The arrays to compare and the iteratee to use.
65 * @returns {T[]} Returns the new array of intersecting values.
66 *
67 * @example
68 * intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
69 * // => [2.1]
70 */
71declare function intersectionBy<T>(...values: Array<ArrayLike<T> | ValueIteratee<T>>): T[];
72
73export { intersectionBy };
Note: See TracBrowser for help on using the repository browser.