You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Anand Shukla
5269ec3c66
|
6 months ago | |
---|---|---|
.. | ||
lib | 6 months ago | |
process | 6 months ago | |
LICENSE | 6 months ago | |
README.md | 6 months ago | |
package.json | 6 months ago | |
rollup.config.js | 6 months ago | |
tsconfig.json | 6 months ago | |
tsconfig.rollup.json | 6 months ago |
README.md
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