tiny-invariant
Advanced tools
Comparing version 1.2.0-beta.1 to 1.2.0
{ | ||
"name": "tiny-invariant", | ||
"version": "1.2.0-beta.1", | ||
"version": "1.2.0", | ||
"description": "A tiny invariant function", | ||
"author": "Alex Reardon <alexreardon@gmail.com>", | ||
"license": "MIT", | ||
"keywords": [ | ||
@@ -11,4 +13,2 @@ "invariant", | ||
], | ||
"author": "Alex Reardon <alexreardon@gmail.com>", | ||
"license": "MIT", | ||
"repository": { | ||
@@ -15,0 +15,0 @@ "type": "git", |
@@ -24,2 +24,10 @@ # tiny-invariant 🔬💥 | ||
You can also provide a function to generate your message, for when your message is expensive to create | ||
```js | ||
import invariant from 'tiny-invariant'; | ||
invariant(value, () => getExpensiveMessage()); | ||
``` | ||
## Why `tiny-invariant`? | ||
@@ -44,8 +52,2 @@ | ||
Your `message` can be a function that returns a `string` (`() => string`) for the cases where you want to lazily create your error message, such as when they are expensive to make. | ||
```ts | ||
invariant(value, () => getExpensiveMessage()); | ||
``` | ||
## Installation | ||
@@ -97,3 +99,3 @@ | ||
- We have a `es` (EcmaScript module) build (because you _know_ you want to deduplicate this super heavy library) | ||
- We have a `es` (EcmaScript module) build | ||
- We have a `cjs` (CommonJS) build | ||
@@ -100,0 +102,0 @@ - We have a `umd` (Universal module definition) build in case you needed it |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
106
11213