source: node_modules/tiny-invariant/dist/tiny-invariant.cjs.js

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 462 bytes
Line 
1'use strict';
2
3var isProduction = process.env.NODE_ENV === 'production';
4var prefix = 'Invariant failed';
5function invariant(condition, message) {
6 if (condition) {
7 return;
8 }
9 if (isProduction) {
10 throw new Error(prefix);
11 }
12 var provided = typeof message === 'function' ? message() : message;
13 var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
14 throw new Error(value);
15}
16
17module.exports = invariant;
Note: See TracBrowser for help on using the repository browser.