es-toolkit 1.49.0-dev.1970 → 1.49.0-dev.1971

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.
@@ -33,11 +33,12 @@ declare function partition<T, U extends T>(arr: readonly T[], isInTruthy: (value
33
33
  * @template T - The type of elements in the array.
34
34
  * @param arr - The array to partition.
35
35
  * @param isInTruthy - A predicate function that determines
36
- * whether an element should be placed in the truthy array. The function is called with each
36
+ * whether an element should be placed in the truthy array. An element is placed in the truthy
37
+ * array when the function returns a truthy value. The function is called with each
37
38
  * element of the array and its index.
38
39
  * @returns A tuple containing two arrays: the first array contains elements for
39
- * which the predicate returned true, and the second array contains elements for which the
40
- * predicate returned false.
40
+ * which the predicate returned a truthy value, and the second array contains elements for which the
41
+ * predicate returned a falsy value.
41
42
  *
42
43
  * @example
43
44
  * const array = [1, 2, 3, 4, 5];
@@ -45,6 +46,6 @@ declare function partition<T, U extends T>(arr: readonly T[], isInTruthy: (value
45
46
  * const [even, odd] = partition(array, isEven);
46
47
  * // even will be [2, 4], and odd will be [1, 3, 5]
47
48
  */
48
- declare function partition<T>(arr: readonly T[], isInTruthy: (value: T, index: number, array: readonly T[]) => boolean): [truthy: T[], falsy: T[]];
49
+ declare function partition<T>(arr: readonly T[], isInTruthy: (value: T, index: number, array: readonly T[]) => unknown): [truthy: T[], falsy: T[]];
49
50
  //#endregion
50
51
  export { partition };
@@ -33,11 +33,12 @@ declare function partition<T, U extends T>(arr: readonly T[], isInTruthy: (value
33
33
  * @template T - The type of elements in the array.
34
34
  * @param arr - The array to partition.
35
35
  * @param isInTruthy - A predicate function that determines
36
- * whether an element should be placed in the truthy array. The function is called with each
36
+ * whether an element should be placed in the truthy array. An element is placed in the truthy
37
+ * array when the function returns a truthy value. The function is called with each
37
38
  * element of the array and its index.
38
39
  * @returns A tuple containing two arrays: the first array contains elements for
39
- * which the predicate returned true, and the second array contains elements for which the
40
- * predicate returned false.
40
+ * which the predicate returned a truthy value, and the second array contains elements for which the
41
+ * predicate returned a falsy value.
41
42
  *
42
43
  * @example
43
44
  * const array = [1, 2, 3, 4, 5];
@@ -45,6 +46,6 @@ declare function partition<T, U extends T>(arr: readonly T[], isInTruthy: (value
45
46
  * const [even, odd] = partition(array, isEven);
46
47
  * // even will be [2, 4], and odd will be [1, 3, 5]
47
48
  */
48
- declare function partition<T>(arr: readonly T[], isInTruthy: (value: T, index: number, array: readonly T[]) => boolean): [truthy: T[], falsy: T[]];
49
+ declare function partition<T>(arr: readonly T[], isInTruthy: (value: T, index: number, array: readonly T[]) => unknown): [truthy: T[], falsy: T[]];
49
50
  //#endregion
50
51
  export { partition };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-toolkit",
3
- "version": "1.49.0-dev.1970+953920b2",
3
+ "version": "1.49.0-dev.1971+b854e154",
4
4
  "description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
5
5
  "homepage": "https://es-toolkit.dev",
6
6
  "bugs": "https://github.com/toss/es-toolkit/issues",