diff --git a/CHANGELOG.md b/CHANGELOG.md index 158a530..d49a9b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # @total-typescript/ts-reset +## 0.3.3 + +### Patch Changes + +- Fixed a bug where 0n was not being filtered out by filter-boolean + ## 0.3.2 ### Patch Changes diff --git a/package.json b/package.json index f290872..6773348 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@total-typescript/ts-reset", - "version": "0.3.2", + "version": "0.3.3", "description": "A CSS reset for TypeScript, improving types for common JavaScript API's", "private": false, "repository": "https://github.com/total-typescript/ts-reset", diff --git a/src/entrypoints/utils.d.ts b/src/entrypoints/utils.d.ts index 1f53cbf..00171cb 100644 --- a/src/entrypoints/utils.d.ts +++ b/src/entrypoints/utils.d.ts @@ -1,5 +1,7 @@ declare namespace TSReset { - type NonFalsy = T extends false | 0 | "" | null | undefined ? never : T; + type NonFalsy = T extends false | 0 | "" | null | undefined | 0n + ? never + : T; type WidenLiteral = T extends string ? string diff --git a/src/tests/filter-boolean.ts b/src/tests/filter-boolean.ts index 3584e00..4899b06 100644 --- a/src/tests/filter-boolean.ts +++ b/src/tests/filter-boolean.ts @@ -25,12 +25,13 @@ doNotExecute(() => { }); doNotExecute(() => { - const arr: (0 | null | undefined | false | "")[] = [ + const arr: (0 | null | undefined | false | "" | 0n)[] = [ 0, null, undefined, false, "", + 0n, ]; const result = arr.filter(Boolean); diff --git a/tsconfig.json b/tsconfig.json index ffe9aaa..2becd2c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + "target": "ES2020", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ "module": "commonjs", /* Specify what module code is generated. */ "noEmit": true, /* Disable emitting files from a compilation. */ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */