es-toolkit 1.20.0-dev.646 → 1.20.0-dev.647
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.
package/dist/array/compact.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
type NotFalsey<T> = Exclude<T, false | null | 0 | '' | undefined>;
|
|
1
|
+
type NotFalsey<T> = Exclude<T, false | null | 0 | 0n | '' | undefined>;
|
|
2
2
|
/**
|
|
3
|
-
* Removes falsey values (false, null, 0, '', undefined, NaN) from an array.
|
|
3
|
+
* Removes falsey values (false, null, 0, 0n, '', undefined, NaN) from an array.
|
|
4
4
|
*
|
|
5
5
|
* @template T - The type of elements in the array.
|
|
6
6
|
* @param {T[]} arr - The input array to remove falsey values.
|
|
7
|
-
* @returns {Array<Exclude<T, false | null | 0 | '' | undefined>>} - A new array with all falsey values removed.
|
|
7
|
+
* @returns {Array<Exclude<T, false | null | 0 | 0n | '' | undefined>>} - A new array with all falsey values removed.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
|
-
* compact([0, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]);
|
|
10
|
+
* compact([0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]);
|
|
11
11
|
* Returns: [1, 2, 3, 4, 5]
|
|
12
12
|
*/
|
|
13
13
|
declare function compact<T>(arr: readonly T[]): Array<NotFalsey<T>>;
|
package/dist/array/compact.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
type NotFalsey<T> = Exclude<T, false | null | 0 | '' | undefined>;
|
|
1
|
+
type NotFalsey<T> = Exclude<T, false | null | 0 | 0n | '' | undefined>;
|
|
2
2
|
/**
|
|
3
|
-
* Removes falsey values (false, null, 0, '', undefined, NaN) from an array.
|
|
3
|
+
* Removes falsey values (false, null, 0, 0n, '', undefined, NaN) from an array.
|
|
4
4
|
*
|
|
5
5
|
* @template T - The type of elements in the array.
|
|
6
6
|
* @param {T[]} arr - The input array to remove falsey values.
|
|
7
|
-
* @returns {Array<Exclude<T, false | null | 0 | '' | undefined>>} - A new array with all falsey values removed.
|
|
7
|
+
* @returns {Array<Exclude<T, false | null | 0 | 0n | '' | undefined>>} - A new array with all falsey values removed.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
|
-
* compact([0, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]);
|
|
10
|
+
* compact([0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]);
|
|
11
11
|
* Returns: [1, 2, 3, 4, 5]
|
|
12
12
|
*/
|
|
13
13
|
declare function compact<T>(arr: readonly T[]): Array<NotFalsey<T>>;
|