ts-invariant
TypeScript implementation of invariant(condition, message)
Last updated 3 years ago by benjamn .
MIT · Repository · Bugs · Original npm
$ cnpm install ts-invariant 
SYNC missed versions from official npm registry.

ts-invariant

TypeScript implementation of invariant(condition, message).

Supports invariant.log, invariant.warn, and invariant.error, which wrap console methods of the same name, and may be stripped in production by rollup-plugin-invariant.

The verbosity of these methods can be globally reconfigured using the setVerbosity function:

import { setVerbosity } from "ts-invariant";

setVerbosity("log"); // display all messages (default)
setVerbosity("warn"); // display only warnings and errors
setVerbosity("error"); // display only errors
setVerbosity("silent"); // display no messages

Current Tags

  • 0.4.4                                ...           latest (6 years ago)

4 Versions

  • 0.8.2                                ...           4 years ago
  • 0.10.3                                ...           3 years ago
  • 0.2.1                                ...           7 years ago
  • 0.4.4                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org