tiny-invariant
1.3.3 · 23 Feb 2024MIT116.9M / weekRepositoryHomepagenpmAtom feed
Your version
1.3.3 is the newest release of 1.x.
In short
2 changed
Release note
Now
TypeScriptnative! (flowusage still supported ❤️)Leverages the new
TypeScript@3.7assertskeyword to correctly narrow types (caused a feature release)
const user: Person | null = getPerson();
invariant(user, 'expected user to be populated');
// the type of `user` is now narrowed to 'Person' rather than `Person | null`A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.