NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #455 most downloaded on npm
A tiny invariant function
Last release 3 years ago
no release in 18 months
Release timing varies
gaps range from 8 days to 1.7 years
Most releases are documented
notes for 13 of 16 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
21 releases · first in 2018
Updating dev dependency resolution URLs in yarn.lock file to point to a common npm registry
yarn.lock file to point to a common npm registryadded jsdoc to function signature for improved IDE usage #177 (thanks @DarkPurple141 for originally raising and pushing for this)
One column per quarter.
Fix(types): Fixed an issue with TypeScript not being able to locate .d.ts with moduleResolution: node16 by @Andarist and @pkerschbaum #20. Thank you s
.d.ts with moduleResolution: node16 by @Andarist and @pkerschbaum #20. Thank you so much!Nothing published for this version
Thanks to a heroic effort by @pkerschbaum tiny-invariant now supports EcmaScript Modules (ESM) usage in Node.js #145. Thanks so much @pkerschbaum 👏
Node.js + ESMThanks to a heroic effort by @pkerschbaum tiny-invariant now supports EcmaScript Modules (ESM) usage in Node.js #145. Thanks so much @pkerschbaum 👏
This resulted in a
minorrelease as it a backwards compatible change that adds new functionality
Nothing published for this version
The message provided to invariant can now be a function that returns a string
message functionThe message provided to invariant can now be a function that returns a string
- export default function invariant(condition: any, message?: string): asserts condition;
+ export default function invariant(condition: any, message?: string | (() => string)): asserts condition;
Using a function that returns a string is helpful in cases where your message is expensive to create. By using a function you only need to create the message when you need it.
import invariant from 'tiny-invariant';
invariant(value, () => getExpensiveMessage());
Keep in mind, that ideally the second argument to invariant is stripped away entirely in production builds.
We have a guide on how to do remove messages for production builds
Nothing published for this version
Now TypeScript native! (flow usage still supported ❤️)
TypeScript native! (flow usage still supported ❤️)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`
Nothing published for this version
Nothing published for this version
Fixing typescript definition. #43 Thanks @ngryman and @TrySound!
Fixing typescript definition. #43 Thanks @ngryman and @TrySound!
Upgrading all dev dependencies #41
flow@0.102.0 #40Adding missing MIT license file #27. MIT was previously specified in the package.json but the LICENSE file was missing.
flow 0.95.1MIT license file #27. MIT was previously specified in the package.json but the LICENSE file was missing.- moving to flow 0.85 - bumping dev deps
flow 0.85Changing default export from an anonymous arrow function to a named function for improved debugging. Thanks @TrySound!!!!! #15
Changing default export from an anonymous arrow function to a named function for improved debugging. Thanks @TrySound!!!!! #15
## Improvements - Upgraded to babel 7 - Upgraded to flow 0.82
babel 7flow 0.82Adding tests to guard against size regressions #7. Thanks @TrySound!!!
README.md for setting up optimised production builds #8flow 0.78Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →