tiny-invariant.cjs.js 401 B

123456789101112131415
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var isProduction = process.env.NODE_ENV === 'production';
  4. var prefix = 'Invariant failed';
  5. function invariant(condition, message) {
  6. if (condition) {
  7. return;
  8. }
  9. if (isProduction) {
  10. throw new Error(prefix);
  11. }
  12. throw new Error(prefix + ": " + (message || ''));
  13. }
  14. exports.default = invariant;