|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
841 bytes
|
| Rev | Line | |
|---|
| [a762898] | 1 | (function (global, factory) {
|
|---|
| 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|---|
| 3 | typeof define === 'function' && define.amd ? define(factory) :
|
|---|
| 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.invariant = factory());
|
|---|
| 5 | })(this, (function () { 'use strict';
|
|---|
| 6 |
|
|---|
| 7 | var isProduction = process.env.NODE_ENV === 'production';
|
|---|
| 8 | var prefix = 'Invariant failed';
|
|---|
| 9 | function invariant(condition, message) {
|
|---|
| 10 | if (condition) {
|
|---|
| 11 | return;
|
|---|
| 12 | }
|
|---|
| 13 | if (isProduction) {
|
|---|
| 14 | throw new Error(prefix);
|
|---|
| 15 | }
|
|---|
| 16 | var provided = typeof message === 'function' ? message() : message;
|
|---|
| 17 | var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
|
|---|
| 18 | throw new Error(value);
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | return invariant;
|
|---|
| 22 |
|
|---|
| 23 | }));
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.