tiny-warning.cjs.js 378 B

12345678910111213141516171819202122
  1. 'use strict';
  2. var isProduction = process.env.NODE_ENV === 'production';
  3. function warning(condition, message) {
  4. if (!isProduction) {
  5. if (condition) {
  6. return;
  7. }
  8. var text = "Warning: " + message;
  9. if (typeof console !== 'undefined') {
  10. console.warn(text);
  11. }
  12. try {
  13. throw Error(text);
  14. } catch (x) {}
  15. }
  16. }
  17. module.exports = warning;