Brak opisu

log.js 576B

1234567891011121314151617181920
  1. 'use strict';
  2. function debug(logLevel, ...messages) {
  3. if (logLevel === 'debug')
  4. console.log(...messages);
  5. }
  6. function warn(logLevel, warning) {
  7. if (logLevel === 'debug' || logLevel === 'warn') {
  8. // https://github.com/typescript-eslint/typescript-eslint/issues/7478
  9. // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
  10. if (typeof process !== 'undefined' && process.emitWarning)
  11. process.emitWarning(warning);
  12. else
  13. console.warn(warning);
  14. }
  15. }
  16. exports.debug = debug;
  17. exports.warn = warn;