[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]dist/2023-06-08 14:13 -  
[DIR]src/2023-06-08 14:13 -  
[DIR]test/2023-06-08 14:13 -  
[TXT]CHANGELOG.md1985-10-26 08:15 1.3K 
[   ]LICENSE1985-10-26 08:15 1.1K0fb859dc fixed mobile overflwo options [كارل مبارك]
[TXT]README.md1985-10-26 08:15 1.7K0fb859dc fixed mobile overflwo options [كارل مبارك]
[   ]package.json2023-06-08 14:14 2.0K 
[   ]tsconfig.json1985-10-26 08:15 740  
# invariant

[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Freact-dnd%2Finvariant%2Fbadge&style=flat)](https://actions-badge.atrox.dev/react-dnd/invariant/goto)

A mirror of Facebook's `invariant` (e.g. [React](https://github.com/facebook/react/blob/v0.13.3/src/vendor/core/invariant.js), [flux](https://github.com/facebook/flux/blob/2.0.2/src/invariant.js)).

A way to provide descriptive errors in development but generic errors in production.

## Note: This has been forked by react-dnd for ESM and TypeScript support

## Install

With [npm](http://npmjs.org) do:

```sh
npm install invariant
```

## `invariant(condition, message)`

```js
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](https://github.com/substack/node-browserify), it'll use `browser.js` (instead of `invariant.js`) and the [envify](https://github.com/hughsk/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 `process.env`. See [Server rendering is slower with npm react #812](https://github.com/facebook/react/issues/812)