JSPM

  • Created
  • Published
  • Downloads 5470568
  • Score
    100M100P100Q211163F
  • License MIT

TypeScript implementation of invariant(condition, message)

Package Exports

  • ts-invariant
  • ts-invariant/lib/invariant.esm.js
  • ts-invariant/process
  • ts-invariant/process/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ts-invariant) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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