Socket
Socket
Sign inDemoInstall

tiny-invariant

Package Overview
Dependencies
0
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.0-beta.1 to 1.2.0

6

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc