es-toolkit 1.37.2-dev.1253 → 1.37.2-dev.1255

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.
@@ -82,5 +82,25 @@ declare function zip<T, U, V>(arr1: readonly T[], arr2: readonly U[], arr3: read
82
82
  * // result will be [[1, 'a', true, null], [2, 'b', false, null], [3, 'c', undefined, null]]
83
83
  */
84
84
  declare function zip<T, U, V, W>(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[], arr4: readonly W[]): Array<[T, U, V, W]>;
85
+ /**
86
+ * Combines multiple arrays into a single array of tuples.
87
+ *
88
+ * This function takes multiple arrays and returns a new array where each element is a tuple
89
+ * containing the corresponding elements from the input arrays. If the input arrays are of
90
+ * different lengths, the resulting array will have the length of the longest input array,
91
+ * with undefined values for missing elements.
92
+ *
93
+ * @template T
94
+ * @param {...Array<readonly T[]>} arrs - The arrays to zip together.
95
+ * @returns {T[][]} A new array of tuples containing the corresponding elements from the input arrays.
96
+ *
97
+ * @example
98
+ * const arr1 = [1, 2, 3];
99
+ * const arr2 = ['a', 'b', 'c'];
100
+ * const arr3 = [true, false];
101
+ * const result = zip(arr1, arr2, arr3);
102
+ * // result will be [[1, 'a', true], [2, 'b', false], [3, 'c', undefined]]
103
+ */
104
+ declare function zip<T>(...arrs: Array<readonly T[]>): T[][];
85
105
 
86
106
  export { zip };
@@ -82,5 +82,25 @@ declare function zip<T, U, V>(arr1: readonly T[], arr2: readonly U[], arr3: read
82
82
  * // result will be [[1, 'a', true, null], [2, 'b', false, null], [3, 'c', undefined, null]]
83
83
  */
84
84
  declare function zip<T, U, V, W>(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[], arr4: readonly W[]): Array<[T, U, V, W]>;
85
+ /**
86
+ * Combines multiple arrays into a single array of tuples.
87
+ *
88
+ * This function takes multiple arrays and returns a new array where each element is a tuple
89
+ * containing the corresponding elements from the input arrays. If the input arrays are of
90
+ * different lengths, the resulting array will have the length of the longest input array,
91
+ * with undefined values for missing elements.
92
+ *
93
+ * @template T
94
+ * @param {...Array<readonly T[]>} arrs - The arrays to zip together.
95
+ * @returns {T[][]} A new array of tuples containing the corresponding elements from the input arrays.
96
+ *
97
+ * @example
98
+ * const arr1 = [1, 2, 3];
99
+ * const arr2 = ['a', 'b', 'c'];
100
+ * const arr3 = [true, false];
101
+ * const result = zip(arr1, arr2, arr3);
102
+ * // result will be [[1, 'a', true], [2, 'b', false], [3, 'c', undefined]]
103
+ */
104
+ declare function zip<T>(...arrs: Array<readonly T[]>): T[][];
85
105
 
86
106
  export { zip };