chensenlai 10988628a0 语音房项目初始化 5 lat temu
..
CHANGELOG.md 10988628a0 语音房项目初始化 5 lat temu
README.md 10988628a0 语音房项目初始化 5 lat temu
browser.js 10988628a0 语音房项目初始化 5 lat temu
invariant.js 10988628a0 语音房项目初始化 5 lat temu
package.json 10988628a0 语音房项目初始化 5 lat temu

README.md

invariant

Build Status

A mirror of Facebook's invariant (e.g. React, flux).

Install

With npm do:

npm install invariant

invariant(condition, message)

var invariant = require('invariant');

invariant(someTruthyVal, 'This will not throw');
// No errors

invariant(someFalseyVal, 'This will throw an error with this message');
// Error: Invariant Violation: This will throw an error with this message

Note: When process.env.NODE_ENV is not production, the message is required. If omitted, invariant will throw regardless of the truthiness of the condition. When process.env.NODE_ENV is production, the message is optional – so they can be minified away.

Browser

When used with browserify, it'll use browser.js (instead of invariant.js) and the envify transform will inline the value of process.env.NODE_ENV.

Node

The node version is optimized around the performance implications of accessing process.env. The value of process.env.NODE_ENV is cached, and repeatedly used instead of reading proces.env. See Server rendering is slower with npm react #812