warning.js 698 B

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. exports.__esModule = true;
  3. exports["default"] = warning;
  4. /**
  5. * Prints a warning in the console if it exists.
  6. *
  7. * @param {String} message The warning message.
  8. * @returns {void}
  9. */
  10. function warning(message) {
  11. /* eslint-disable no-console */
  12. if (typeof console !== 'undefined' && typeof console.error === 'function') {
  13. console.error(message);
  14. }
  15. /* eslint-enable no-console */
  16. try {
  17. // This error was thrown as a convenience so that if you enable
  18. // "break on all exceptions" in your console,
  19. // it would pause the execution at this line.
  20. throw new Error(message);
  21. /* eslint-disable no-empty */
  22. } catch (e) {}
  23. /* eslint-enable no-empty */
  24. }