iyegoroff / ts-tiny-invariant

Stricter version of tiny-invariant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ts-tiny-invariant

npm build publish Libraries.io dependency status for latest release Bundlephobia npm

Stricter version of tiny-invariant that accepts only boolean condition

Installation

$ npm i ts-tiny-invariant

Usage

import invariant from 'ts-tiny-invariant'

expect(() => {
  invariant(false, 'fail')
}).toThrow('Invariant failed: fail')

expect(() => {
  invariant(true, 'pass')
}).not.toThrow()

About

Stricter version of tiny-invariant

License:MIT License


Languages

Language:TypeScript 100.0%