variante-alta
v0.1.0
Published
Invariant, F1 flavored
Downloads
2
Readme
variante-alta 🏎️
Yet another invariant
alternative, albeit much smaller.
What is an invariant
?
An invariant
function takes a value, and if the value is falsy then the invariant
function will throw. If the value is truthy, then the function will not throw.
Why variante-alta
?
variante-alta is an utility package that looks to replicate invariant, albeit it is much simpler and has no custom logic beyond its core. It's extremely similar to Solidity's require function and seeks to replicate its (very basic) behavior.
Installation and usage
Install with Yarn/NPM
# yarn
yarn add variante-alta
# npm
npm add variante-alta --save
Import the function into your code
import invariant from 'variante-alta'
invariant(1 === 1, 'One is not equal to one!')