main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
576 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | function debug(logLevel, ...messages) {
|
---|
4 | if (logLevel === 'debug')
|
---|
5 | console.log(...messages);
|
---|
6 | }
|
---|
7 | function warn(logLevel, warning) {
|
---|
8 | if (logLevel === 'debug' || logLevel === 'warn') {
|
---|
9 | // https://github.com/typescript-eslint/typescript-eslint/issues/7478
|
---|
10 | // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
---|
11 | if (typeof process !== 'undefined' && process.emitWarning)
|
---|
12 | process.emitWarning(warning);
|
---|
13 | else
|
---|
14 | console.warn(warning);
|
---|
15 | }
|
---|
16 | }
|
---|
17 |
|
---|
18 | exports.debug = debug;
|
---|
19 | exports.warn = warn;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.