Packages

tiny-invariant

1.3.3 · 23 Feb 2024MIT116.9M / weekRepositoryHomepagenpmAtom feed

Your version

1.1.0

30 Jan 2020Where it was published

1.3.3 is the newest release of 1.x.

In short

2 changed

Release note

  • Now TypeScript native! (flow usage still supported ❤️)

  • Leverages the new TypeScript@3.7 asserts keyword 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.