Releases: uhyo/better-typescript-lib
v2.11.0
ℹ️ TypeScript Upgrade Guide
better-typescript-lib 2.11.0 supports TypeScript 5.8.
When you upgrade TypeScript to 5.8 or later, we recommend adding the following setting to your tsconfig.json:
"libReplacement": true
This will be required for better-typescript-lib to work in a future TypeScript version (presumably 6.0).
What's Changed
- fix: correct return type of
document.getElementById
fromHTMLElement | null
toElement | null
to account for more general situations likeSVGElement
by @uhyo in #65 - Mark Omit as deprecated by @uhyo in #66
- docs: guide user to enable libReplacement option by @uhyo in #67
- refactor: refactor aliasing system by @uhyo in #68
- feat: support TypeScript 5.8 by @uhyo in #69
Full Changelog: v2.10.1...v2.11.0
v2.10.1
What's Changed
- refactor: remove debugger statement by @uhyo in #55
- fix: #57 more generic types for
Promise.then
andPromise.catch
by @danielrentz in #60 - fix: #58 allow to pass function or nullish to
JSON.stringify
by @danielrentz in #61 - build:package: fix windows paths in generated package.json by @danielrentz in #62
⚠️ Possible Breaking Change
Calling Promise methods (then
and catch
) without any parameter is now a type error.
// @ts-expect-error
promise.then();
// @ts-expect-error
promise.catch();
New Contributors
- @danielrentz made their first contribution in #60
Full Changelog: v2.10.0...v2.10.1
v2.10.0
v2.9.0
v2.8.0
What's Changed
- fix: tighten up Object.values and Object.entries types by @uhyo in #42
- fix: improve
NodeListOf<T>
#item return type to include null by @uhyo in #44 - feat: upgrade to TS 5.5 by @uhyo in #45
Full Changelog: v2.7.0...v2.8.0
Breaking Change to Object.entries
and Object.values
#42 changed the types of Object.entries
and Object.values
in a backwards-incompatible way. This had to be done because previous typing was too permissive and unsafe.
The change can be observed in cases like below:
// Previously number[], now unknown[]
const values = Object.values({ foo: 123 });
To recover the previous behavior, you need to give a Record<string, T>
type to your object.
const obj: Record<string, number> = { foo: 123 };
// still number[]
const values = Object.values(obj);
Also, we recommend migrating out from Object.values
and Object.entries
if possible. Map
should be a good alternative for many use cases.
See also: #46
v2.7.0
v2.6.0
Full Changelog: v2.5.0...v2.6.0
v2.5.0
Full Changelog: v2.4.0...v2.5.0
- Upgraded TypeScript to 5.2.
This release suppresses any
from new SuppressedError
in lib.esnext.disposable.d.ts
🥳
v2.4.0
Full Changelog: v2.3.1...v2.4.0
- Upgrade TypeScript to
5.1.3