just-compact
Advanced tools
Comparing version 2.2.0 to 2.3.0
// NaN and document.all are also falsy but they cannot be represented as a type | ||
type Falsy = false | null | undefined | '' | 0 | 0n; | ||
// return type has | ||
export default function compact<T>(arr: (Falsy | T)[]): T[]; | ||
/** | ||
* Removes all falsy values from an array | ||
* @example | ||
* compact([1, null, 2, undefined, NaN, 3, 4, false, 5]); | ||
* // => [1, 2, 3, 4, 5] | ||
* compact([1, 2, [], 4, {}]); | ||
* // => [1, 2, [], 4, {}] | ||
*/ | ||
export default function compact<T>(arr: (Falsy | T)[]): T[]; |
@@ -22,2 +22,2 @@ import compact from './index'; | ||
// @ts-expect-error | ||
compact({ a: true, b: false }) | ||
compact({ a: true, b: false }) |
{ | ||
"name": "just-compact", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "returns a copy of an array with falsey values removed", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3538
51