es-toolkit 1.27.0-dev.883 → 1.27.0-dev.885

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,12 +6,13 @@
6
6
  * by the custom equality function. It effectively filters out any elements from the first array that
7
7
  * do not have corresponding matches in the second array according to the equality function.
8
8
  *
9
- * @template T - The type of elements in the array.
10
- * @param {T[]} firstArr - The first array to compare.
11
- * @param {T[]} secondArr - The second array to compare.
12
- * @param {(x: T, y: T) => boolean} areItemsEqual - A custom function to determine if two elements are equal.
9
+ * @template F - The type of elements in the first array.
10
+ * @template S - The type of elements in the second array.
11
+ * @param {F[]} firstArr - The first array to compare.
12
+ * @param {S[]} secondArr - The second array to compare.
13
+ * @param {(x: F, y: S) => boolean} areItemsEqual - A custom function to determine if two elements are equal.
13
14
  * This function takes two arguments, one from each array, and returns `true` if the elements are considered equal, and `false` otherwise.
14
- * @returns {T[]} A new array containing the elements from the first array that have corresponding matches in the second array according to the custom equality function.
15
+ * @returns {F[]} A new array containing the elements from the first array that have corresponding matches in the second array according to the custom equality function.
15
16
  *
16
17
  * @example
17
18
  * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
@@ -20,6 +21,6 @@
20
21
  * const result = intersectionWith(array1, array2, areItemsEqual);
21
22
  * // result will be [{ id: 2 }] since this element has a matching id in both arrays.
22
23
  */
23
- declare function intersectionWith<T>(firstArr: readonly T[], secondArr: readonly T[], areItemsEqual: (x: T, y: T) => boolean): T[];
24
+ declare function intersectionWith<F, S>(firstArr: readonly F[], secondArr: readonly S[], areItemsEqual: (x: F, y: S) => boolean): F[];
24
25
 
25
26
  export { intersectionWith };
@@ -6,12 +6,13 @@
6
6
  * by the custom equality function. It effectively filters out any elements from the first array that
7
7
  * do not have corresponding matches in the second array according to the equality function.
8
8
  *
9
- * @template T - The type of elements in the array.
10
- * @param {T[]} firstArr - The first array to compare.
11
- * @param {T[]} secondArr - The second array to compare.
12
- * @param {(x: T, y: T) => boolean} areItemsEqual - A custom function to determine if two elements are equal.
9
+ * @template F - The type of elements in the first array.
10
+ * @template S - The type of elements in the second array.
11
+ * @param {F[]} firstArr - The first array to compare.
12
+ * @param {S[]} secondArr - The second array to compare.
13
+ * @param {(x: F, y: S) => boolean} areItemsEqual - A custom function to determine if two elements are equal.
13
14
  * This function takes two arguments, one from each array, and returns `true` if the elements are considered equal, and `false` otherwise.
14
- * @returns {T[]} A new array containing the elements from the first array that have corresponding matches in the second array according to the custom equality function.
15
+ * @returns {F[]} A new array containing the elements from the first array that have corresponding matches in the second array according to the custom equality function.
15
16
  *
16
17
  * @example
17
18
  * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
@@ -20,6 +21,6 @@
20
21
  * const result = intersectionWith(array1, array2, areItemsEqual);
21
22
  * // result will be [{ id: 2 }] since this element has a matching id in both arrays.
22
23
  */
23
- declare function intersectionWith<T>(firstArr: readonly T[], secondArr: readonly T[], areItemsEqual: (x: T, y: T) => boolean): T[];
24
+ declare function intersectionWith<F, S>(firstArr: readonly F[], secondArr: readonly S[], areItemsEqual: (x: F, y: S) => boolean): F[];
24
25
 
25
26
  export { intersectionWith };