mirror of
https://github.com/Rushilwiz/spaceout.git
synced 2025-04-22 20:39:50 -04:00
14 lines
321 B
JavaScript
14 lines
321 B
JavaScript
var isProduction = process.env.NODE_ENV === 'production';
|
|
var prefix = 'Invariant failed';
|
|
function invariant(condition, message) {
|
|
if (condition) {
|
|
return;
|
|
}
|
|
if (isProduction) {
|
|
throw new Error(prefix);
|
|
}
|
|
throw new Error(prefix + ": " + (message || ''));
|
|
}
|
|
|
|
export default invariant;
|