glitch-javascript-sdk 0.6.8 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +448 -448
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1270 -1461
- package/dist/esm/index.js.map +1 -1
- package/package.json +15 -13
package/dist/cjs/index.js
CHANGED
|
@@ -14347,162 +14347,7 @@ var followRedirects$1 = {exports: {}};
|
|
|
14347
14347
|
|
|
14348
14348
|
var src = {exports: {}};
|
|
14349
14349
|
|
|
14350
|
-
var
|
|
14351
|
-
|
|
14352
|
-
var hasFlag;
|
|
14353
|
-
var hasRequiredHasFlag;
|
|
14354
|
-
|
|
14355
|
-
function requireHasFlag () {
|
|
14356
|
-
if (hasRequiredHasFlag) return hasFlag;
|
|
14357
|
-
hasRequiredHasFlag = 1;
|
|
14358
|
-
hasFlag = (flag, argv) => {
|
|
14359
|
-
argv = argv || process.argv;
|
|
14360
|
-
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
14361
|
-
const pos = argv.indexOf(prefix + flag);
|
|
14362
|
-
const terminatorPos = argv.indexOf('--');
|
|
14363
|
-
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|
14364
|
-
};
|
|
14365
|
-
return hasFlag;
|
|
14366
|
-
}
|
|
14367
|
-
|
|
14368
|
-
var supportsColor_1;
|
|
14369
|
-
var hasRequiredSupportsColor;
|
|
14370
|
-
|
|
14371
|
-
function requireSupportsColor () {
|
|
14372
|
-
if (hasRequiredSupportsColor) return supportsColor_1;
|
|
14373
|
-
hasRequiredSupportsColor = 1;
|
|
14374
|
-
const os = require$$0$2;
|
|
14375
|
-
const hasFlag = requireHasFlag();
|
|
14376
|
-
|
|
14377
|
-
const env = process.env;
|
|
14378
|
-
|
|
14379
|
-
let forceColor;
|
|
14380
|
-
if (hasFlag('no-color') ||
|
|
14381
|
-
hasFlag('no-colors') ||
|
|
14382
|
-
hasFlag('color=false')) {
|
|
14383
|
-
forceColor = false;
|
|
14384
|
-
} else if (hasFlag('color') ||
|
|
14385
|
-
hasFlag('colors') ||
|
|
14386
|
-
hasFlag('color=true') ||
|
|
14387
|
-
hasFlag('color=always')) {
|
|
14388
|
-
forceColor = true;
|
|
14389
|
-
}
|
|
14390
|
-
if ('FORCE_COLOR' in env) {
|
|
14391
|
-
forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
|
|
14392
|
-
}
|
|
14393
|
-
|
|
14394
|
-
function translateLevel(level) {
|
|
14395
|
-
if (level === 0) {
|
|
14396
|
-
return false;
|
|
14397
|
-
}
|
|
14398
|
-
|
|
14399
|
-
return {
|
|
14400
|
-
level,
|
|
14401
|
-
hasBasic: true,
|
|
14402
|
-
has256: level >= 2,
|
|
14403
|
-
has16m: level >= 3
|
|
14404
|
-
};
|
|
14405
|
-
}
|
|
14406
|
-
|
|
14407
|
-
function supportsColor(stream) {
|
|
14408
|
-
if (forceColor === false) {
|
|
14409
|
-
return 0;
|
|
14410
|
-
}
|
|
14411
|
-
|
|
14412
|
-
if (hasFlag('color=16m') ||
|
|
14413
|
-
hasFlag('color=full') ||
|
|
14414
|
-
hasFlag('color=truecolor')) {
|
|
14415
|
-
return 3;
|
|
14416
|
-
}
|
|
14417
|
-
|
|
14418
|
-
if (hasFlag('color=256')) {
|
|
14419
|
-
return 2;
|
|
14420
|
-
}
|
|
14421
|
-
|
|
14422
|
-
if (stream && !stream.isTTY && forceColor !== true) {
|
|
14423
|
-
return 0;
|
|
14424
|
-
}
|
|
14425
|
-
|
|
14426
|
-
const min = forceColor ? 1 : 0;
|
|
14427
|
-
|
|
14428
|
-
if (process.platform === 'win32') {
|
|
14429
|
-
// Node.js 7.5.0 is the first version of Node.js to include a patch to
|
|
14430
|
-
// libuv that enables 256 color output on Windows. Anything earlier and it
|
|
14431
|
-
// won't work. However, here we target Node.js 8 at minimum as it is an LTS
|
|
14432
|
-
// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
|
|
14433
|
-
// release that supports 256 colors. Windows 10 build 14931 is the first release
|
|
14434
|
-
// that supports 16m/TrueColor.
|
|
14435
|
-
const osRelease = os.release().split('.');
|
|
14436
|
-
if (
|
|
14437
|
-
Number(process.versions.node.split('.')[0]) >= 8 &&
|
|
14438
|
-
Number(osRelease[0]) >= 10 &&
|
|
14439
|
-
Number(osRelease[2]) >= 10586
|
|
14440
|
-
) {
|
|
14441
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
14442
|
-
}
|
|
14443
|
-
|
|
14444
|
-
return 1;
|
|
14445
|
-
}
|
|
14446
|
-
|
|
14447
|
-
if ('CI' in env) {
|
|
14448
|
-
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
14449
|
-
return 1;
|
|
14450
|
-
}
|
|
14451
|
-
|
|
14452
|
-
return min;
|
|
14453
|
-
}
|
|
14454
|
-
|
|
14455
|
-
if ('TEAMCITY_VERSION' in env) {
|
|
14456
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
14457
|
-
}
|
|
14458
|
-
|
|
14459
|
-
if (env.COLORTERM === 'truecolor') {
|
|
14460
|
-
return 3;
|
|
14461
|
-
}
|
|
14462
|
-
|
|
14463
|
-
if ('TERM_PROGRAM' in env) {
|
|
14464
|
-
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
14465
|
-
|
|
14466
|
-
switch (env.TERM_PROGRAM) {
|
|
14467
|
-
case 'iTerm.app':
|
|
14468
|
-
return version >= 3 ? 3 : 2;
|
|
14469
|
-
case 'Apple_Terminal':
|
|
14470
|
-
return 2;
|
|
14471
|
-
// No default
|
|
14472
|
-
}
|
|
14473
|
-
}
|
|
14474
|
-
|
|
14475
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
14476
|
-
return 2;
|
|
14477
|
-
}
|
|
14478
|
-
|
|
14479
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
14480
|
-
return 1;
|
|
14481
|
-
}
|
|
14482
|
-
|
|
14483
|
-
if ('COLORTERM' in env) {
|
|
14484
|
-
return 1;
|
|
14485
|
-
}
|
|
14486
|
-
|
|
14487
|
-
if (env.TERM === 'dumb') {
|
|
14488
|
-
return min;
|
|
14489
|
-
}
|
|
14490
|
-
|
|
14491
|
-
return min;
|
|
14492
|
-
}
|
|
14493
|
-
|
|
14494
|
-
function getSupportLevel(stream) {
|
|
14495
|
-
const level = supportsColor(stream);
|
|
14496
|
-
return translateLevel(level);
|
|
14497
|
-
}
|
|
14498
|
-
|
|
14499
|
-
supportsColor_1 = {
|
|
14500
|
-
supportsColor: getSupportLevel,
|
|
14501
|
-
stdout: getSupportLevel(process.stdout),
|
|
14502
|
-
stderr: getSupportLevel(process.stderr)
|
|
14503
|
-
};
|
|
14504
|
-
return supportsColor_1;
|
|
14505
|
-
}
|
|
14350
|
+
var browser = {exports: {}};
|
|
14506
14351
|
|
|
14507
14352
|
/**
|
|
14508
14353
|
* Helpers.
|
|
@@ -14957,308 +14802,33 @@ function requireCommon () {
|
|
|
14957
14802
|
return common;
|
|
14958
14803
|
}
|
|
14959
14804
|
|
|
14960
|
-
|
|
14961
|
-
* Module dependencies.
|
|
14962
|
-
*/
|
|
14805
|
+
/* eslint-env browser */
|
|
14963
14806
|
|
|
14964
|
-
var
|
|
14807
|
+
var hasRequiredBrowser;
|
|
14965
14808
|
|
|
14966
|
-
function
|
|
14967
|
-
if (
|
|
14968
|
-
|
|
14809
|
+
function requireBrowser () {
|
|
14810
|
+
if (hasRequiredBrowser) return browser.exports;
|
|
14811
|
+
hasRequiredBrowser = 1;
|
|
14969
14812
|
(function (module, exports) {
|
|
14970
|
-
const tty = require$$0$3;
|
|
14971
|
-
const util = require$$1;
|
|
14972
|
-
|
|
14973
14813
|
/**
|
|
14974
|
-
* This is the
|
|
14814
|
+
* This is the web browser implementation of `debug()`.
|
|
14975
14815
|
*/
|
|
14976
14816
|
|
|
14977
|
-
exports.init = init;
|
|
14978
|
-
exports.log = log;
|
|
14979
14817
|
exports.formatArgs = formatArgs;
|
|
14980
14818
|
exports.save = save;
|
|
14981
14819
|
exports.load = load;
|
|
14982
14820
|
exports.useColors = useColors;
|
|
14983
|
-
exports.
|
|
14984
|
-
|
|
14985
|
-
|
|
14986
|
-
|
|
14987
|
-
|
|
14988
|
-
|
|
14989
|
-
|
|
14990
|
-
|
|
14991
|
-
|
|
14992
|
-
|
|
14993
|
-
|
|
14994
|
-
try {
|
|
14995
|
-
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
|
14996
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
14997
|
-
const supportsColor = requireSupportsColor();
|
|
14998
|
-
|
|
14999
|
-
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
15000
|
-
exports.colors = [
|
|
15001
|
-
20,
|
|
15002
|
-
21,
|
|
15003
|
-
26,
|
|
15004
|
-
27,
|
|
15005
|
-
32,
|
|
15006
|
-
33,
|
|
15007
|
-
38,
|
|
15008
|
-
39,
|
|
15009
|
-
40,
|
|
15010
|
-
41,
|
|
15011
|
-
42,
|
|
15012
|
-
43,
|
|
15013
|
-
44,
|
|
15014
|
-
45,
|
|
15015
|
-
56,
|
|
15016
|
-
57,
|
|
15017
|
-
62,
|
|
15018
|
-
63,
|
|
15019
|
-
68,
|
|
15020
|
-
69,
|
|
15021
|
-
74,
|
|
15022
|
-
75,
|
|
15023
|
-
76,
|
|
15024
|
-
77,
|
|
15025
|
-
78,
|
|
15026
|
-
79,
|
|
15027
|
-
80,
|
|
15028
|
-
81,
|
|
15029
|
-
92,
|
|
15030
|
-
93,
|
|
15031
|
-
98,
|
|
15032
|
-
99,
|
|
15033
|
-
112,
|
|
15034
|
-
113,
|
|
15035
|
-
128,
|
|
15036
|
-
129,
|
|
15037
|
-
134,
|
|
15038
|
-
135,
|
|
15039
|
-
148,
|
|
15040
|
-
149,
|
|
15041
|
-
160,
|
|
15042
|
-
161,
|
|
15043
|
-
162,
|
|
15044
|
-
163,
|
|
15045
|
-
164,
|
|
15046
|
-
165,
|
|
15047
|
-
166,
|
|
15048
|
-
167,
|
|
15049
|
-
168,
|
|
15050
|
-
169,
|
|
15051
|
-
170,
|
|
15052
|
-
171,
|
|
15053
|
-
172,
|
|
15054
|
-
173,
|
|
15055
|
-
178,
|
|
15056
|
-
179,
|
|
15057
|
-
184,
|
|
15058
|
-
185,
|
|
15059
|
-
196,
|
|
15060
|
-
197,
|
|
15061
|
-
198,
|
|
15062
|
-
199,
|
|
15063
|
-
200,
|
|
15064
|
-
201,
|
|
15065
|
-
202,
|
|
15066
|
-
203,
|
|
15067
|
-
204,
|
|
15068
|
-
205,
|
|
15069
|
-
206,
|
|
15070
|
-
207,
|
|
15071
|
-
208,
|
|
15072
|
-
209,
|
|
15073
|
-
214,
|
|
15074
|
-
215,
|
|
15075
|
-
220,
|
|
15076
|
-
221
|
|
15077
|
-
];
|
|
15078
|
-
}
|
|
15079
|
-
} catch (error) {
|
|
15080
|
-
// Swallow - we only care if `supports-color` is available; it doesn't have to be.
|
|
15081
|
-
}
|
|
15082
|
-
|
|
15083
|
-
/**
|
|
15084
|
-
* Build up the default `inspectOpts` object from the environment variables.
|
|
15085
|
-
*
|
|
15086
|
-
* $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
|
|
15087
|
-
*/
|
|
15088
|
-
|
|
15089
|
-
exports.inspectOpts = Object.keys(process.env).filter(key => {
|
|
15090
|
-
return /^debug_/i.test(key);
|
|
15091
|
-
}).reduce((obj, key) => {
|
|
15092
|
-
// Camel-case
|
|
15093
|
-
const prop = key
|
|
15094
|
-
.substring(6)
|
|
15095
|
-
.toLowerCase()
|
|
15096
|
-
.replace(/_([a-z])/g, (_, k) => {
|
|
15097
|
-
return k.toUpperCase();
|
|
15098
|
-
});
|
|
15099
|
-
|
|
15100
|
-
// Coerce string value into JS value
|
|
15101
|
-
let val = process.env[key];
|
|
15102
|
-
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
15103
|
-
val = true;
|
|
15104
|
-
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
15105
|
-
val = false;
|
|
15106
|
-
} else if (val === 'null') {
|
|
15107
|
-
val = null;
|
|
15108
|
-
} else {
|
|
15109
|
-
val = Number(val);
|
|
15110
|
-
}
|
|
15111
|
-
|
|
15112
|
-
obj[prop] = val;
|
|
15113
|
-
return obj;
|
|
15114
|
-
}, {});
|
|
15115
|
-
|
|
15116
|
-
/**
|
|
15117
|
-
* Is stdout a TTY? Colored output is enabled when `true`.
|
|
15118
|
-
*/
|
|
15119
|
-
|
|
15120
|
-
function useColors() {
|
|
15121
|
-
return 'colors' in exports.inspectOpts ?
|
|
15122
|
-
Boolean(exports.inspectOpts.colors) :
|
|
15123
|
-
tty.isatty(process.stderr.fd);
|
|
15124
|
-
}
|
|
15125
|
-
|
|
15126
|
-
/**
|
|
15127
|
-
* Adds ANSI color escape codes if enabled.
|
|
15128
|
-
*
|
|
15129
|
-
* @api public
|
|
15130
|
-
*/
|
|
15131
|
-
|
|
15132
|
-
function formatArgs(args) {
|
|
15133
|
-
const {namespace: name, useColors} = this;
|
|
15134
|
-
|
|
15135
|
-
if (useColors) {
|
|
15136
|
-
const c = this.color;
|
|
15137
|
-
const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
|
|
15138
|
-
const prefix = ` ${colorCode};1m${name} \u001B[0m`;
|
|
15139
|
-
|
|
15140
|
-
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
|
|
15141
|
-
args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
|
|
15142
|
-
} else {
|
|
15143
|
-
args[0] = getDate() + name + ' ' + args[0];
|
|
15144
|
-
}
|
|
15145
|
-
}
|
|
15146
|
-
|
|
15147
|
-
function getDate() {
|
|
15148
|
-
if (exports.inspectOpts.hideDate) {
|
|
15149
|
-
return '';
|
|
15150
|
-
}
|
|
15151
|
-
return new Date().toISOString() + ' ';
|
|
15152
|
-
}
|
|
15153
|
-
|
|
15154
|
-
/**
|
|
15155
|
-
* Invokes `util.format()` with the specified arguments and writes to stderr.
|
|
15156
|
-
*/
|
|
15157
|
-
|
|
15158
|
-
function log(...args) {
|
|
15159
|
-
return process.stderr.write(util.format(...args) + '\n');
|
|
15160
|
-
}
|
|
15161
|
-
|
|
15162
|
-
/**
|
|
15163
|
-
* Save `namespaces`.
|
|
15164
|
-
*
|
|
15165
|
-
* @param {String} namespaces
|
|
15166
|
-
* @api private
|
|
15167
|
-
*/
|
|
15168
|
-
function save(namespaces) {
|
|
15169
|
-
if (namespaces) {
|
|
15170
|
-
process.env.DEBUG = namespaces;
|
|
15171
|
-
} else {
|
|
15172
|
-
// If you set a process.env field to null or undefined, it gets cast to the
|
|
15173
|
-
// string 'null' or 'undefined'. Just delete instead.
|
|
15174
|
-
delete process.env.DEBUG;
|
|
15175
|
-
}
|
|
15176
|
-
}
|
|
15177
|
-
|
|
15178
|
-
/**
|
|
15179
|
-
* Load `namespaces`.
|
|
15180
|
-
*
|
|
15181
|
-
* @return {String} returns the previously persisted debug modes
|
|
15182
|
-
* @api private
|
|
15183
|
-
*/
|
|
15184
|
-
|
|
15185
|
-
function load() {
|
|
15186
|
-
return process.env.DEBUG;
|
|
15187
|
-
}
|
|
15188
|
-
|
|
15189
|
-
/**
|
|
15190
|
-
* Init logic for `debug` instances.
|
|
15191
|
-
*
|
|
15192
|
-
* Create a new `inspectOpts` object in case `useColors` is set
|
|
15193
|
-
* differently for a particular `debug` instance.
|
|
15194
|
-
*/
|
|
15195
|
-
|
|
15196
|
-
function init(debug) {
|
|
15197
|
-
debug.inspectOpts = {};
|
|
15198
|
-
|
|
15199
|
-
const keys = Object.keys(exports.inspectOpts);
|
|
15200
|
-
for (let i = 0; i < keys.length; i++) {
|
|
15201
|
-
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
15202
|
-
}
|
|
15203
|
-
}
|
|
15204
|
-
|
|
15205
|
-
module.exports = requireCommon()(exports);
|
|
15206
|
-
|
|
15207
|
-
const {formatters} = module.exports;
|
|
15208
|
-
|
|
15209
|
-
/**
|
|
15210
|
-
* Map %o to `util.inspect()`, all on a single line.
|
|
15211
|
-
*/
|
|
15212
|
-
|
|
15213
|
-
formatters.o = function (v) {
|
|
15214
|
-
this.inspectOpts.colors = this.useColors;
|
|
15215
|
-
return util.inspect(v, this.inspectOpts)
|
|
15216
|
-
.split('\n')
|
|
15217
|
-
.map(str => str.trim())
|
|
15218
|
-
.join(' ');
|
|
15219
|
-
};
|
|
15220
|
-
|
|
15221
|
-
/**
|
|
15222
|
-
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
|
15223
|
-
*/
|
|
15224
|
-
|
|
15225
|
-
formatters.O = function (v) {
|
|
15226
|
-
this.inspectOpts.colors = this.useColors;
|
|
15227
|
-
return util.inspect(v, this.inspectOpts);
|
|
15228
|
-
};
|
|
15229
|
-
} (node, node.exports));
|
|
15230
|
-
return node.exports;
|
|
15231
|
-
}
|
|
15232
|
-
|
|
15233
|
-
var browser = {exports: {}};
|
|
15234
|
-
|
|
15235
|
-
/* eslint-env browser */
|
|
15236
|
-
|
|
15237
|
-
var hasRequiredBrowser;
|
|
15238
|
-
|
|
15239
|
-
function requireBrowser () {
|
|
15240
|
-
if (hasRequiredBrowser) return browser.exports;
|
|
15241
|
-
hasRequiredBrowser = 1;
|
|
15242
|
-
(function (module, exports) {
|
|
15243
|
-
/**
|
|
15244
|
-
* This is the web browser implementation of `debug()`.
|
|
15245
|
-
*/
|
|
15246
|
-
|
|
15247
|
-
exports.formatArgs = formatArgs;
|
|
15248
|
-
exports.save = save;
|
|
15249
|
-
exports.load = load;
|
|
15250
|
-
exports.useColors = useColors;
|
|
15251
|
-
exports.storage = localstorage();
|
|
15252
|
-
exports.destroy = (() => {
|
|
15253
|
-
let warned = false;
|
|
15254
|
-
|
|
15255
|
-
return () => {
|
|
15256
|
-
if (!warned) {
|
|
15257
|
-
warned = true;
|
|
15258
|
-
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
15259
|
-
}
|
|
15260
|
-
};
|
|
15261
|
-
})();
|
|
14821
|
+
exports.storage = localstorage();
|
|
14822
|
+
exports.destroy = (() => {
|
|
14823
|
+
let warned = false;
|
|
14824
|
+
|
|
14825
|
+
return () => {
|
|
14826
|
+
if (!warned) {
|
|
14827
|
+
warned = true;
|
|
14828
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
14829
|
+
}
|
|
14830
|
+
};
|
|
14831
|
+
})();
|
|
15262
14832
|
|
|
15263
14833
|
/**
|
|
15264
14834
|
* Colors.
|
|
@@ -15511,6 +15081,436 @@ function requireBrowser () {
|
|
|
15511
15081
|
return browser.exports;
|
|
15512
15082
|
}
|
|
15513
15083
|
|
|
15084
|
+
var node = {exports: {}};
|
|
15085
|
+
|
|
15086
|
+
var hasFlag;
|
|
15087
|
+
var hasRequiredHasFlag;
|
|
15088
|
+
|
|
15089
|
+
function requireHasFlag () {
|
|
15090
|
+
if (hasRequiredHasFlag) return hasFlag;
|
|
15091
|
+
hasRequiredHasFlag = 1;
|
|
15092
|
+
hasFlag = (flag, argv) => {
|
|
15093
|
+
argv = argv || process.argv;
|
|
15094
|
+
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
15095
|
+
const pos = argv.indexOf(prefix + flag);
|
|
15096
|
+
const terminatorPos = argv.indexOf('--');
|
|
15097
|
+
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|
15098
|
+
};
|
|
15099
|
+
return hasFlag;
|
|
15100
|
+
}
|
|
15101
|
+
|
|
15102
|
+
var supportsColor_1;
|
|
15103
|
+
var hasRequiredSupportsColor;
|
|
15104
|
+
|
|
15105
|
+
function requireSupportsColor () {
|
|
15106
|
+
if (hasRequiredSupportsColor) return supportsColor_1;
|
|
15107
|
+
hasRequiredSupportsColor = 1;
|
|
15108
|
+
const os = require$$0$2;
|
|
15109
|
+
const hasFlag = requireHasFlag();
|
|
15110
|
+
|
|
15111
|
+
const env = process.env;
|
|
15112
|
+
|
|
15113
|
+
let forceColor;
|
|
15114
|
+
if (hasFlag('no-color') ||
|
|
15115
|
+
hasFlag('no-colors') ||
|
|
15116
|
+
hasFlag('color=false')) {
|
|
15117
|
+
forceColor = false;
|
|
15118
|
+
} else if (hasFlag('color') ||
|
|
15119
|
+
hasFlag('colors') ||
|
|
15120
|
+
hasFlag('color=true') ||
|
|
15121
|
+
hasFlag('color=always')) {
|
|
15122
|
+
forceColor = true;
|
|
15123
|
+
}
|
|
15124
|
+
if ('FORCE_COLOR' in env) {
|
|
15125
|
+
forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
|
|
15126
|
+
}
|
|
15127
|
+
|
|
15128
|
+
function translateLevel(level) {
|
|
15129
|
+
if (level === 0) {
|
|
15130
|
+
return false;
|
|
15131
|
+
}
|
|
15132
|
+
|
|
15133
|
+
return {
|
|
15134
|
+
level,
|
|
15135
|
+
hasBasic: true,
|
|
15136
|
+
has256: level >= 2,
|
|
15137
|
+
has16m: level >= 3
|
|
15138
|
+
};
|
|
15139
|
+
}
|
|
15140
|
+
|
|
15141
|
+
function supportsColor(stream) {
|
|
15142
|
+
if (forceColor === false) {
|
|
15143
|
+
return 0;
|
|
15144
|
+
}
|
|
15145
|
+
|
|
15146
|
+
if (hasFlag('color=16m') ||
|
|
15147
|
+
hasFlag('color=full') ||
|
|
15148
|
+
hasFlag('color=truecolor')) {
|
|
15149
|
+
return 3;
|
|
15150
|
+
}
|
|
15151
|
+
|
|
15152
|
+
if (hasFlag('color=256')) {
|
|
15153
|
+
return 2;
|
|
15154
|
+
}
|
|
15155
|
+
|
|
15156
|
+
if (stream && !stream.isTTY && forceColor !== true) {
|
|
15157
|
+
return 0;
|
|
15158
|
+
}
|
|
15159
|
+
|
|
15160
|
+
const min = forceColor ? 1 : 0;
|
|
15161
|
+
|
|
15162
|
+
if (process.platform === 'win32') {
|
|
15163
|
+
// Node.js 7.5.0 is the first version of Node.js to include a patch to
|
|
15164
|
+
// libuv that enables 256 color output on Windows. Anything earlier and it
|
|
15165
|
+
// won't work. However, here we target Node.js 8 at minimum as it is an LTS
|
|
15166
|
+
// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
|
|
15167
|
+
// release that supports 256 colors. Windows 10 build 14931 is the first release
|
|
15168
|
+
// that supports 16m/TrueColor.
|
|
15169
|
+
const osRelease = os.release().split('.');
|
|
15170
|
+
if (
|
|
15171
|
+
Number(process.versions.node.split('.')[0]) >= 8 &&
|
|
15172
|
+
Number(osRelease[0]) >= 10 &&
|
|
15173
|
+
Number(osRelease[2]) >= 10586
|
|
15174
|
+
) {
|
|
15175
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
15176
|
+
}
|
|
15177
|
+
|
|
15178
|
+
return 1;
|
|
15179
|
+
}
|
|
15180
|
+
|
|
15181
|
+
if ('CI' in env) {
|
|
15182
|
+
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
15183
|
+
return 1;
|
|
15184
|
+
}
|
|
15185
|
+
|
|
15186
|
+
return min;
|
|
15187
|
+
}
|
|
15188
|
+
|
|
15189
|
+
if ('TEAMCITY_VERSION' in env) {
|
|
15190
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
15191
|
+
}
|
|
15192
|
+
|
|
15193
|
+
if (env.COLORTERM === 'truecolor') {
|
|
15194
|
+
return 3;
|
|
15195
|
+
}
|
|
15196
|
+
|
|
15197
|
+
if ('TERM_PROGRAM' in env) {
|
|
15198
|
+
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
15199
|
+
|
|
15200
|
+
switch (env.TERM_PROGRAM) {
|
|
15201
|
+
case 'iTerm.app':
|
|
15202
|
+
return version >= 3 ? 3 : 2;
|
|
15203
|
+
case 'Apple_Terminal':
|
|
15204
|
+
return 2;
|
|
15205
|
+
// No default
|
|
15206
|
+
}
|
|
15207
|
+
}
|
|
15208
|
+
|
|
15209
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
15210
|
+
return 2;
|
|
15211
|
+
}
|
|
15212
|
+
|
|
15213
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
15214
|
+
return 1;
|
|
15215
|
+
}
|
|
15216
|
+
|
|
15217
|
+
if ('COLORTERM' in env) {
|
|
15218
|
+
return 1;
|
|
15219
|
+
}
|
|
15220
|
+
|
|
15221
|
+
if (env.TERM === 'dumb') {
|
|
15222
|
+
return min;
|
|
15223
|
+
}
|
|
15224
|
+
|
|
15225
|
+
return min;
|
|
15226
|
+
}
|
|
15227
|
+
|
|
15228
|
+
function getSupportLevel(stream) {
|
|
15229
|
+
const level = supportsColor(stream);
|
|
15230
|
+
return translateLevel(level);
|
|
15231
|
+
}
|
|
15232
|
+
|
|
15233
|
+
supportsColor_1 = {
|
|
15234
|
+
supportsColor: getSupportLevel,
|
|
15235
|
+
stdout: getSupportLevel(process.stdout),
|
|
15236
|
+
stderr: getSupportLevel(process.stderr)
|
|
15237
|
+
};
|
|
15238
|
+
return supportsColor_1;
|
|
15239
|
+
}
|
|
15240
|
+
|
|
15241
|
+
/**
|
|
15242
|
+
* Module dependencies.
|
|
15243
|
+
*/
|
|
15244
|
+
|
|
15245
|
+
var hasRequiredNode;
|
|
15246
|
+
|
|
15247
|
+
function requireNode () {
|
|
15248
|
+
if (hasRequiredNode) return node.exports;
|
|
15249
|
+
hasRequiredNode = 1;
|
|
15250
|
+
(function (module, exports) {
|
|
15251
|
+
const tty = require$$0$3;
|
|
15252
|
+
const util = require$$1;
|
|
15253
|
+
|
|
15254
|
+
/**
|
|
15255
|
+
* This is the Node.js implementation of `debug()`.
|
|
15256
|
+
*/
|
|
15257
|
+
|
|
15258
|
+
exports.init = init;
|
|
15259
|
+
exports.log = log;
|
|
15260
|
+
exports.formatArgs = formatArgs;
|
|
15261
|
+
exports.save = save;
|
|
15262
|
+
exports.load = load;
|
|
15263
|
+
exports.useColors = useColors;
|
|
15264
|
+
exports.destroy = util.deprecate(
|
|
15265
|
+
() => {},
|
|
15266
|
+
'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
|
|
15267
|
+
);
|
|
15268
|
+
|
|
15269
|
+
/**
|
|
15270
|
+
* Colors.
|
|
15271
|
+
*/
|
|
15272
|
+
|
|
15273
|
+
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
15274
|
+
|
|
15275
|
+
try {
|
|
15276
|
+
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
|
15277
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
15278
|
+
const supportsColor = requireSupportsColor();
|
|
15279
|
+
|
|
15280
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
15281
|
+
exports.colors = [
|
|
15282
|
+
20,
|
|
15283
|
+
21,
|
|
15284
|
+
26,
|
|
15285
|
+
27,
|
|
15286
|
+
32,
|
|
15287
|
+
33,
|
|
15288
|
+
38,
|
|
15289
|
+
39,
|
|
15290
|
+
40,
|
|
15291
|
+
41,
|
|
15292
|
+
42,
|
|
15293
|
+
43,
|
|
15294
|
+
44,
|
|
15295
|
+
45,
|
|
15296
|
+
56,
|
|
15297
|
+
57,
|
|
15298
|
+
62,
|
|
15299
|
+
63,
|
|
15300
|
+
68,
|
|
15301
|
+
69,
|
|
15302
|
+
74,
|
|
15303
|
+
75,
|
|
15304
|
+
76,
|
|
15305
|
+
77,
|
|
15306
|
+
78,
|
|
15307
|
+
79,
|
|
15308
|
+
80,
|
|
15309
|
+
81,
|
|
15310
|
+
92,
|
|
15311
|
+
93,
|
|
15312
|
+
98,
|
|
15313
|
+
99,
|
|
15314
|
+
112,
|
|
15315
|
+
113,
|
|
15316
|
+
128,
|
|
15317
|
+
129,
|
|
15318
|
+
134,
|
|
15319
|
+
135,
|
|
15320
|
+
148,
|
|
15321
|
+
149,
|
|
15322
|
+
160,
|
|
15323
|
+
161,
|
|
15324
|
+
162,
|
|
15325
|
+
163,
|
|
15326
|
+
164,
|
|
15327
|
+
165,
|
|
15328
|
+
166,
|
|
15329
|
+
167,
|
|
15330
|
+
168,
|
|
15331
|
+
169,
|
|
15332
|
+
170,
|
|
15333
|
+
171,
|
|
15334
|
+
172,
|
|
15335
|
+
173,
|
|
15336
|
+
178,
|
|
15337
|
+
179,
|
|
15338
|
+
184,
|
|
15339
|
+
185,
|
|
15340
|
+
196,
|
|
15341
|
+
197,
|
|
15342
|
+
198,
|
|
15343
|
+
199,
|
|
15344
|
+
200,
|
|
15345
|
+
201,
|
|
15346
|
+
202,
|
|
15347
|
+
203,
|
|
15348
|
+
204,
|
|
15349
|
+
205,
|
|
15350
|
+
206,
|
|
15351
|
+
207,
|
|
15352
|
+
208,
|
|
15353
|
+
209,
|
|
15354
|
+
214,
|
|
15355
|
+
215,
|
|
15356
|
+
220,
|
|
15357
|
+
221
|
|
15358
|
+
];
|
|
15359
|
+
}
|
|
15360
|
+
} catch (error) {
|
|
15361
|
+
// Swallow - we only care if `supports-color` is available; it doesn't have to be.
|
|
15362
|
+
}
|
|
15363
|
+
|
|
15364
|
+
/**
|
|
15365
|
+
* Build up the default `inspectOpts` object from the environment variables.
|
|
15366
|
+
*
|
|
15367
|
+
* $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
|
|
15368
|
+
*/
|
|
15369
|
+
|
|
15370
|
+
exports.inspectOpts = Object.keys(process.env).filter(key => {
|
|
15371
|
+
return /^debug_/i.test(key);
|
|
15372
|
+
}).reduce((obj, key) => {
|
|
15373
|
+
// Camel-case
|
|
15374
|
+
const prop = key
|
|
15375
|
+
.substring(6)
|
|
15376
|
+
.toLowerCase()
|
|
15377
|
+
.replace(/_([a-z])/g, (_, k) => {
|
|
15378
|
+
return k.toUpperCase();
|
|
15379
|
+
});
|
|
15380
|
+
|
|
15381
|
+
// Coerce string value into JS value
|
|
15382
|
+
let val = process.env[key];
|
|
15383
|
+
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
15384
|
+
val = true;
|
|
15385
|
+
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
15386
|
+
val = false;
|
|
15387
|
+
} else if (val === 'null') {
|
|
15388
|
+
val = null;
|
|
15389
|
+
} else {
|
|
15390
|
+
val = Number(val);
|
|
15391
|
+
}
|
|
15392
|
+
|
|
15393
|
+
obj[prop] = val;
|
|
15394
|
+
return obj;
|
|
15395
|
+
}, {});
|
|
15396
|
+
|
|
15397
|
+
/**
|
|
15398
|
+
* Is stdout a TTY? Colored output is enabled when `true`.
|
|
15399
|
+
*/
|
|
15400
|
+
|
|
15401
|
+
function useColors() {
|
|
15402
|
+
return 'colors' in exports.inspectOpts ?
|
|
15403
|
+
Boolean(exports.inspectOpts.colors) :
|
|
15404
|
+
tty.isatty(process.stderr.fd);
|
|
15405
|
+
}
|
|
15406
|
+
|
|
15407
|
+
/**
|
|
15408
|
+
* Adds ANSI color escape codes if enabled.
|
|
15409
|
+
*
|
|
15410
|
+
* @api public
|
|
15411
|
+
*/
|
|
15412
|
+
|
|
15413
|
+
function formatArgs(args) {
|
|
15414
|
+
const {namespace: name, useColors} = this;
|
|
15415
|
+
|
|
15416
|
+
if (useColors) {
|
|
15417
|
+
const c = this.color;
|
|
15418
|
+
const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
|
|
15419
|
+
const prefix = ` ${colorCode};1m${name} \u001B[0m`;
|
|
15420
|
+
|
|
15421
|
+
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
|
|
15422
|
+
args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
|
|
15423
|
+
} else {
|
|
15424
|
+
args[0] = getDate() + name + ' ' + args[0];
|
|
15425
|
+
}
|
|
15426
|
+
}
|
|
15427
|
+
|
|
15428
|
+
function getDate() {
|
|
15429
|
+
if (exports.inspectOpts.hideDate) {
|
|
15430
|
+
return '';
|
|
15431
|
+
}
|
|
15432
|
+
return new Date().toISOString() + ' ';
|
|
15433
|
+
}
|
|
15434
|
+
|
|
15435
|
+
/**
|
|
15436
|
+
* Invokes `util.format()` with the specified arguments and writes to stderr.
|
|
15437
|
+
*/
|
|
15438
|
+
|
|
15439
|
+
function log(...args) {
|
|
15440
|
+
return process.stderr.write(util.format(...args) + '\n');
|
|
15441
|
+
}
|
|
15442
|
+
|
|
15443
|
+
/**
|
|
15444
|
+
* Save `namespaces`.
|
|
15445
|
+
*
|
|
15446
|
+
* @param {String} namespaces
|
|
15447
|
+
* @api private
|
|
15448
|
+
*/
|
|
15449
|
+
function save(namespaces) {
|
|
15450
|
+
if (namespaces) {
|
|
15451
|
+
process.env.DEBUG = namespaces;
|
|
15452
|
+
} else {
|
|
15453
|
+
// If you set a process.env field to null or undefined, it gets cast to the
|
|
15454
|
+
// string 'null' or 'undefined'. Just delete instead.
|
|
15455
|
+
delete process.env.DEBUG;
|
|
15456
|
+
}
|
|
15457
|
+
}
|
|
15458
|
+
|
|
15459
|
+
/**
|
|
15460
|
+
* Load `namespaces`.
|
|
15461
|
+
*
|
|
15462
|
+
* @return {String} returns the previously persisted debug modes
|
|
15463
|
+
* @api private
|
|
15464
|
+
*/
|
|
15465
|
+
|
|
15466
|
+
function load() {
|
|
15467
|
+
return process.env.DEBUG;
|
|
15468
|
+
}
|
|
15469
|
+
|
|
15470
|
+
/**
|
|
15471
|
+
* Init logic for `debug` instances.
|
|
15472
|
+
*
|
|
15473
|
+
* Create a new `inspectOpts` object in case `useColors` is set
|
|
15474
|
+
* differently for a particular `debug` instance.
|
|
15475
|
+
*/
|
|
15476
|
+
|
|
15477
|
+
function init(debug) {
|
|
15478
|
+
debug.inspectOpts = {};
|
|
15479
|
+
|
|
15480
|
+
const keys = Object.keys(exports.inspectOpts);
|
|
15481
|
+
for (let i = 0; i < keys.length; i++) {
|
|
15482
|
+
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
15483
|
+
}
|
|
15484
|
+
}
|
|
15485
|
+
|
|
15486
|
+
module.exports = requireCommon()(exports);
|
|
15487
|
+
|
|
15488
|
+
const {formatters} = module.exports;
|
|
15489
|
+
|
|
15490
|
+
/**
|
|
15491
|
+
* Map %o to `util.inspect()`, all on a single line.
|
|
15492
|
+
*/
|
|
15493
|
+
|
|
15494
|
+
formatters.o = function (v) {
|
|
15495
|
+
this.inspectOpts.colors = this.useColors;
|
|
15496
|
+
return util.inspect(v, this.inspectOpts)
|
|
15497
|
+
.split('\n')
|
|
15498
|
+
.map(str => str.trim())
|
|
15499
|
+
.join(' ');
|
|
15500
|
+
};
|
|
15501
|
+
|
|
15502
|
+
/**
|
|
15503
|
+
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
|
15504
|
+
*/
|
|
15505
|
+
|
|
15506
|
+
formatters.O = function (v) {
|
|
15507
|
+
this.inspectOpts.colors = this.useColors;
|
|
15508
|
+
return util.inspect(v, this.inspectOpts);
|
|
15509
|
+
};
|
|
15510
|
+
} (node, node.exports));
|
|
15511
|
+
return node.exports;
|
|
15512
|
+
}
|
|
15513
|
+
|
|
15514
15514
|
/**
|
|
15515
15515
|
* Detect Electron renderer / nwjs process, which is node, but we should
|
|
15516
15516
|
* treat as a browser.
|