1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 |
|
4 | let debug;
|
5 | try {
|
6 | debug = require('debug');
|
7 | }
|
8 | catch (_a) { }
|
9 | function displayWarnings() {
|
10 | if (process.listenerCount('warning') > 1)
|
11 | return;
|
12 | process.on('warning', (warning) => {
|
13 | console.error(warning.stack);
|
14 | if (warning.detail)
|
15 | console.error(warning.detail);
|
16 | });
|
17 | }
|
18 | exports.default = (...scope) => {
|
19 | if (!debug)
|
20 | return (..._) => { };
|
21 | const d = debug(['@oclif/config', ...scope].join(':'));
|
22 | if (d.enabled)
|
23 | displayWarnings();
|
24 | return (...args) => d(...args);
|
25 | };
|