@bleedingdev/modern-js-utils 3.9.3-ultramodern.7 → 3.9.3-ultramodern.9
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/compiled/address/provenance.json +1 -1
- package/dist/compiled/browserslist/index.js +7 -7
- package/dist/compiled/browserslist/provenance.json +1 -1
- package/dist/compiled/chalk/provenance.json +1 -1
- package/dist/compiled/chokidar/index.d.mts +18 -9
- package/dist/compiled/chokidar/index.d.ts +18 -9
- package/dist/compiled/chokidar/index.js +194 -171
- package/dist/compiled/chokidar/index.mjs +94 -71
- package/dist/compiled/chokidar/provenance.json +2 -2
- package/dist/compiled/commander/provenance.json +1 -1
- package/dist/compiled/debug/provenance.json +1 -1
- package/dist/compiled/dotenv-expand/LICENSE +11 -7
- package/dist/compiled/dotenv-expand/declaration-licenses/dotenv-expand/LICENSE +11 -7
- package/dist/compiled/dotenv-expand/index.js +5545 -61
- package/dist/compiled/dotenv-expand/licenses-cjs.txt +12 -7
- package/dist/compiled/dotenv-expand/package.json +1 -1
- package/dist/compiled/dotenv-expand/provenance.json +7 -7
- package/dist/compiled/execa/index.d.mts +67 -33
- package/dist/compiled/execa/index.d.ts +67 -33
- package/dist/compiled/execa/index.js +1848 -1369
- package/dist/compiled/execa/index.mjs +1851 -1372
- package/dist/compiled/execa/package.json +1 -1
- package/dist/compiled/execa/provenance.json +3 -3
- package/dist/compiled/filesize/index.js +26 -25
- package/dist/compiled/filesize/index.js.LICENSE.txt +1 -1
- package/dist/compiled/filesize/index.mjs +25 -24
- package/dist/compiled/filesize/index.mjs.LICENSE.txt +1 -1
- package/dist/compiled/filesize/package.json +1 -1
- package/dist/compiled/filesize/provenance.json +4 -4
- package/dist/compiled/fs-extra/provenance.json +1 -1
- package/dist/compiled/glob/provenance.json +3 -3
- package/dist/compiled/globby/index.js +431 -139
- package/dist/compiled/globby/index.mjs +576 -284
- package/dist/compiled/globby/provenance.json +1 -1
- package/dist/compiled/gzip-size/provenance.json +1 -1
- package/dist/compiled/import-lazy/provenance.json +1 -1
- package/dist/compiled/inquirer/index.d.mts +10 -0
- package/dist/compiled/inquirer/index.d.ts +10 -0
- package/dist/compiled/inquirer/index.js +112 -96
- package/dist/compiled/inquirer/index.mjs +98 -82
- package/dist/compiled/inquirer/licenses-cjs.txt +26 -0
- package/dist/compiled/inquirer/licenses-esm.txt +26 -0
- package/dist/compiled/inquirer/package.json +1 -1
- package/dist/compiled/inquirer/provenance.json +18 -18
- package/dist/compiled/js-yaml/index.js +258 -208
- package/dist/compiled/js-yaml/index.js.LICENSE.txt +1 -1
- package/dist/compiled/js-yaml/index.mjs +328 -278
- package/dist/compiled/js-yaml/index.mjs.LICENSE.txt +1 -1
- package/dist/compiled/js-yaml/package.json +1 -1
- package/dist/compiled/js-yaml/provenance.json +4 -4
- package/dist/compiled/json5/provenance.json +1 -1
- package/dist/compiled/lodash/common/function.d.ts +2 -2
- package/dist/compiled/lodash/provenance.json +2 -2
- package/dist/compiled/mime-types/provenance.json +1 -1
- package/dist/compiled/minimist/provenance.json +1 -1
- package/dist/compiled/nanoid/index.d.mts +3 -3
- package/dist/compiled/nanoid/index.d.ts +3 -3
- package/dist/compiled/nanoid/index.js +10 -10
- package/dist/compiled/nanoid/index.mjs +10 -10
- package/dist/compiled/nanoid/package.json +1 -1
- package/dist/compiled/nanoid/provenance.json +4 -4
- package/dist/compiled/ora/index.js +310 -286
- package/dist/compiled/ora/index.mjs +651 -627
- package/dist/compiled/ora/provenance.json +1 -1
- package/dist/compiled/pkg-up/provenance.json +1 -1
- package/dist/compiled/semver/provenance.json +1 -1
- package/dist/compiled/signale/provenance.json +1 -1
- package/dist/compiled/slash/provenance.json +1 -1
- package/dist/compiled/strip-ansi/index.js +1 -1
- package/dist/compiled/strip-ansi/index.mjs +3 -3
- package/dist/compiled/strip-ansi/provenance.json +1 -1
- package/dist/compiled/tsconfig-paths/provenance.json +1 -1
- package/dist/compiled/upath/provenance.json +1 -1
- package/dist/compiled/url-join/index.js +56 -29
- package/dist/compiled/url-join/index.mjs +57 -30
- package/dist/compiled/url-join/package.json +1 -1
- package/dist/compiled/url-join/provenance.json +4 -4
- package/dist/types/cli/commands.d.ts +1 -1
- package/dist/types/compiled.d.ts +5 -5
- package/package.json +8 -8
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
});
|
|
32
32
|
const n = require("node:process");
|
|
33
33
|
const i = require("node:util");
|
|
34
|
-
const
|
|
34
|
+
const s = 10;
|
|
35
35
|
const wrapAnsi16 = (e = 0)=>(t)=>`[${t + e}m`;
|
|
36
36
|
const wrapAnsi256 = (e = 0)=>(t)=>`[${38 + e};5;${t}m`;
|
|
37
37
|
const wrapAnsi16m = (e = 0)=>(t, n, i)=>`[${38 + e};2;${t};${n};${i}m`;
|
|
38
|
-
const
|
|
38
|
+
const r = {
|
|
39
39
|
modifier: {
|
|
40
40
|
reset: [
|
|
41
41
|
0,
|
|
@@ -223,42 +223,42 @@
|
|
|
223
223
|
]
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
|
-
Object.keys(
|
|
227
|
-
const a = Object.keys(
|
|
228
|
-
const l = Object.keys(
|
|
226
|
+
Object.keys(r.modifier);
|
|
227
|
+
const a = Object.keys(r.color);
|
|
228
|
+
const l = Object.keys(r.bgColor);
|
|
229
229
|
[
|
|
230
230
|
...a,
|
|
231
231
|
...l
|
|
232
232
|
];
|
|
233
233
|
function assembleStyles() {
|
|
234
234
|
const e = new Map;
|
|
235
|
-
for (const [t, n] of Object.entries(
|
|
235
|
+
for (const [t, n] of Object.entries(r)){
|
|
236
236
|
for (const [t, i] of Object.entries(n)){
|
|
237
|
-
|
|
237
|
+
r[t] = {
|
|
238
238
|
open: `[${i[0]}m`,
|
|
239
239
|
close: `[${i[1]}m`
|
|
240
240
|
};
|
|
241
|
-
n[t] =
|
|
241
|
+
n[t] = r[t];
|
|
242
242
|
e.set(i[0], i[1]);
|
|
243
243
|
}
|
|
244
|
-
Object.defineProperty(
|
|
244
|
+
Object.defineProperty(r, t, {
|
|
245
245
|
value: n,
|
|
246
246
|
enumerable: false
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
|
-
Object.defineProperty(
|
|
249
|
+
Object.defineProperty(r, "codes", {
|
|
250
250
|
value: e,
|
|
251
251
|
enumerable: false
|
|
252
252
|
});
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
Object.defineProperties(
|
|
253
|
+
r.color.close = "[39m";
|
|
254
|
+
r.bgColor.close = "[49m";
|
|
255
|
+
r.color.ansi = wrapAnsi16();
|
|
256
|
+
r.color.ansi256 = wrapAnsi256();
|
|
257
|
+
r.color.ansi16m = wrapAnsi16m();
|
|
258
|
+
r.bgColor.ansi = wrapAnsi16(s);
|
|
259
|
+
r.bgColor.ansi256 = wrapAnsi256(s);
|
|
260
|
+
r.bgColor.ansi16m = wrapAnsi16m(s);
|
|
261
|
+
Object.defineProperties(r, {
|
|
262
262
|
rgbToAnsi256: {
|
|
263
263
|
value (e, t, n) {
|
|
264
264
|
if (e === t && t === n) {
|
|
@@ -292,7 +292,7 @@
|
|
|
292
292
|
enumerable: false
|
|
293
293
|
},
|
|
294
294
|
hexToAnsi256: {
|
|
295
|
-
value: (e)=>
|
|
295
|
+
value: (e)=>r.rgbToAnsi256(...r.hexToRgb(e)),
|
|
296
296
|
enumerable: false
|
|
297
297
|
},
|
|
298
298
|
ansi256ToAnsi: {
|
|
@@ -308,39 +308,39 @@
|
|
|
308
308
|
i = t;
|
|
309
309
|
} else {
|
|
310
310
|
e -= 16;
|
|
311
|
-
const
|
|
311
|
+
const s = e % 36;
|
|
312
312
|
t = Math.floor(e / 36) / 5;
|
|
313
|
-
n = Math.floor(
|
|
314
|
-
i =
|
|
313
|
+
n = Math.floor(s / 6) / 5;
|
|
314
|
+
i = s % 6 / 5;
|
|
315
315
|
}
|
|
316
|
-
const
|
|
317
|
-
if (0 ===
|
|
318
|
-
let
|
|
319
|
-
if (2 ===
|
|
320
|
-
return
|
|
316
|
+
const s = 2 * Math.max(t, n, i);
|
|
317
|
+
if (0 === s) return 30;
|
|
318
|
+
let r = 30 + (Math.round(i) << 2 | Math.round(n) << 1 | Math.round(t));
|
|
319
|
+
if (2 === s) r += 60;
|
|
320
|
+
return r;
|
|
321
321
|
},
|
|
322
322
|
enumerable: false
|
|
323
323
|
},
|
|
324
324
|
rgbToAnsi: {
|
|
325
|
-
value: (e, t, n)=>
|
|
325
|
+
value: (e, t, n)=>r.ansi256ToAnsi(r.rgbToAnsi256(e, t, n)),
|
|
326
326
|
enumerable: false
|
|
327
327
|
},
|
|
328
328
|
hexToAnsi: {
|
|
329
|
-
value: (e)=>
|
|
329
|
+
value: (e)=>r.ansi256ToAnsi(r.hexToAnsi256(e)),
|
|
330
330
|
enumerable: false
|
|
331
331
|
}
|
|
332
332
|
});
|
|
333
|
-
return
|
|
333
|
+
return r;
|
|
334
334
|
}
|
|
335
|
-
const
|
|
336
|
-
const u =
|
|
335
|
+
const f = assembleStyles();
|
|
336
|
+
const u = f;
|
|
337
337
|
const h = require("node:os");
|
|
338
338
|
const d = require("node:tty");
|
|
339
339
|
function hasFlag(e, t = globalThis.Deno ? globalThis.Deno.args : n.argv) {
|
|
340
340
|
const i = e.startsWith("-") ? "" : 1 === e.length ? "-" : "--";
|
|
341
|
-
const
|
|
342
|
-
const
|
|
343
|
-
return -1 !==
|
|
341
|
+
const s = t.indexOf(i + e);
|
|
342
|
+
const r = t.indexOf("--");
|
|
343
|
+
return -1 !== s && (-1 === r || s < r);
|
|
344
344
|
}
|
|
345
345
|
const { env: m } = n;
|
|
346
346
|
let p;
|
|
@@ -363,17 +363,17 @@
|
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
365
|
function _supportsColor(e, { streamIsTTY: t, sniffFlags: i = true } = {}) {
|
|
366
|
-
const
|
|
367
|
-
if (void 0 !==
|
|
368
|
-
const
|
|
369
|
-
if (0 ===
|
|
366
|
+
const s = envForceColor();
|
|
367
|
+
if (void 0 !== s) p = s;
|
|
368
|
+
const r = i ? p : s;
|
|
369
|
+
if (0 === r) return 0;
|
|
370
370
|
if (i) {
|
|
371
371
|
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3;
|
|
372
372
|
if (hasFlag("color=256")) return 2;
|
|
373
373
|
}
|
|
374
374
|
if ("TF_BUILD" in m && "AGENT_NAME" in m) return 1;
|
|
375
|
-
if (e && !t && void 0 ===
|
|
376
|
-
const o =
|
|
375
|
+
if (e && !t && void 0 === r) return 0;
|
|
376
|
+
const o = r || 0;
|
|
377
377
|
if ("dumb" === m.TERM) return o;
|
|
378
378
|
if ("win32" === n.platform) {
|
|
379
379
|
const e = h.release().split(".");
|
|
@@ -433,28 +433,28 @@
|
|
|
433
433
|
function stringReplaceAll(e, t, n) {
|
|
434
434
|
let i = e.indexOf(t);
|
|
435
435
|
if (-1 === i) return e;
|
|
436
|
-
const
|
|
437
|
-
let
|
|
436
|
+
const s = t.length;
|
|
437
|
+
let r = 0;
|
|
438
438
|
let o = "";
|
|
439
439
|
do {
|
|
440
|
-
o += e.slice(
|
|
441
|
-
|
|
442
|
-
i = e.indexOf(t,
|
|
440
|
+
o += e.slice(r, i) + t + n;
|
|
441
|
+
r = i + s;
|
|
442
|
+
i = e.indexOf(t, r);
|
|
443
443
|
}while (-1 !== i);
|
|
444
|
-
o += e.slice(
|
|
444
|
+
o += e.slice(r);
|
|
445
445
|
return o;
|
|
446
446
|
}
|
|
447
447
|
function stringEncaseCRLFWithFirstIndex(e, t, n, i) {
|
|
448
|
-
let
|
|
449
|
-
let
|
|
448
|
+
let s = 0;
|
|
449
|
+
let r = "";
|
|
450
450
|
do {
|
|
451
451
|
const o = "\r" === e[i - 1];
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
i = e.indexOf("\n",
|
|
452
|
+
r += e.slice(s, o ? i - 1 : i) + t + (o ? "\r\n" : "\n") + n;
|
|
453
|
+
s = i + 1;
|
|
454
|
+
i = e.indexOf("\n", s);
|
|
455
455
|
}while (-1 !== i);
|
|
456
|
-
|
|
457
|
-
return
|
|
456
|
+
r += e.slice(s);
|
|
457
|
+
return r;
|
|
458
458
|
}
|
|
459
459
|
const { stdout: b, stderr: v } = g;
|
|
460
460
|
const x = Symbol("GENERATOR");
|
|
@@ -549,19 +549,19 @@
|
|
|
549
549
|
});
|
|
550
550
|
const createStyler = (e, t, n)=>{
|
|
551
551
|
let i;
|
|
552
|
-
let
|
|
552
|
+
let s;
|
|
553
553
|
if (void 0 === n) {
|
|
554
554
|
i = e;
|
|
555
|
-
|
|
555
|
+
s = t;
|
|
556
556
|
} else {
|
|
557
557
|
i = n.openAll + e;
|
|
558
|
-
|
|
558
|
+
s = t + n.closeAll;
|
|
559
559
|
}
|
|
560
560
|
return {
|
|
561
561
|
open: e,
|
|
562
562
|
close: t,
|
|
563
563
|
openAll: i,
|
|
564
|
-
closeAll:
|
|
564
|
+
closeAll: s,
|
|
565
565
|
parent: n
|
|
566
566
|
};
|
|
567
567
|
};
|
|
@@ -577,28 +577,28 @@
|
|
|
577
577
|
if (e.level <= 0 || !t) return e[y] ? "" : t;
|
|
578
578
|
let n = e[T];
|
|
579
579
|
if (void 0 === n) return t;
|
|
580
|
-
const { openAll: i, closeAll:
|
|
580
|
+
const { openAll: i, closeAll: s } = n;
|
|
581
581
|
if (t.includes("")) while(void 0 !== n){
|
|
582
582
|
t = stringReplaceAll(t, n.close, n.open);
|
|
583
583
|
n = n.parent;
|
|
584
584
|
}
|
|
585
|
-
const
|
|
586
|
-
if (-1 !==
|
|
587
|
-
return i + t +
|
|
585
|
+
const r = t.indexOf("\n");
|
|
586
|
+
if (-1 !== r) t = stringEncaseCRLFWithFirstIndex(t, s, i, r);
|
|
587
|
+
return i + t + s;
|
|
588
588
|
};
|
|
589
589
|
Object.defineProperties(createChalk.prototype, S);
|
|
590
|
-
const
|
|
590
|
+
const O = createChalk();
|
|
591
591
|
createChalk({
|
|
592
592
|
level: v ? v.level : 0
|
|
593
593
|
});
|
|
594
|
-
const I =
|
|
594
|
+
const I = O;
|
|
595
595
|
const copyProperty = (e, t, n, i)=>{
|
|
596
596
|
if ("length" === n || "prototype" === n) return;
|
|
597
597
|
if ("arguments" === n || "caller" === n) return;
|
|
598
|
-
const
|
|
599
|
-
const
|
|
600
|
-
if (!canCopyProperty(
|
|
601
|
-
Object.defineProperty(e, n,
|
|
598
|
+
const s = Object.getOwnPropertyDescriptor(e, n);
|
|
599
|
+
const r = Object.getOwnPropertyDescriptor(t, n);
|
|
600
|
+
if (!canCopyProperty(s, r) && i) return;
|
|
601
|
+
Object.defineProperty(e, n, r);
|
|
602
602
|
};
|
|
603
603
|
const canCopyProperty = function(e, t) {
|
|
604
604
|
return void 0 === e || e.configurable || e.writable === t.writable && e.enumerable === t.enumerable && e.configurable === t.configurable && (e.writable || e.value === t.value);
|
|
@@ -613,12 +613,12 @@
|
|
|
613
613
|
const A = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
|
|
614
614
|
const changeToString = (e, t, n)=>{
|
|
615
615
|
const i = "" === n ? "" : `with ${n.trim()}() `;
|
|
616
|
-
const
|
|
617
|
-
Object.defineProperty(
|
|
618
|
-
const { writable:
|
|
616
|
+
const s = wrappedToString.bind(null, i, t.toString());
|
|
617
|
+
Object.defineProperty(s, "name", A);
|
|
618
|
+
const { writable: r, enumerable: o, configurable: a } = P;
|
|
619
619
|
Object.defineProperty(e, "toString", {
|
|
620
|
-
value:
|
|
621
|
-
writable:
|
|
620
|
+
value: s,
|
|
621
|
+
writable: r,
|
|
622
622
|
enumerable: o,
|
|
623
623
|
configurable: a
|
|
624
624
|
});
|
|
@@ -635,13 +635,13 @@
|
|
|
635
635
|
if ("function" != typeof e) throw new TypeError("Expected a function");
|
|
636
636
|
let n;
|
|
637
637
|
let i = 0;
|
|
638
|
-
const
|
|
639
|
-
const onetime = function(...
|
|
638
|
+
const s = e.displayName || e.name || "<anonymous>";
|
|
639
|
+
const onetime = function(...r) {
|
|
640
640
|
M.set(onetime, ++i);
|
|
641
641
|
if (1 === i) {
|
|
642
|
-
n = e.apply(this,
|
|
642
|
+
n = e.apply(this, r);
|
|
643
643
|
e = void 0;
|
|
644
|
-
} else if (true === t.throw) throw new Error(`Function \`${
|
|
644
|
+
} else if (true === t.throw) throw new Error(`Function \`${s}\` can only be called once`);
|
|
645
645
|
return n;
|
|
646
646
|
};
|
|
647
647
|
mimicFunction(onetime, e);
|
|
@@ -658,9 +658,9 @@
|
|
|
658
658
|
if ("win32" !== process.platform) B.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
|
|
659
659
|
if ("linux" === process.platform) B.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
660
660
|
const processOk = (e)=>!!e && "object" == typeof e && "function" == typeof e.removeListener && "function" == typeof e.emit && "function" == typeof e.reallyExit && "function" == typeof e.listeners && "function" == typeof e.kill && "number" == typeof e.pid && "function" == typeof e.on;
|
|
661
|
-
const
|
|
661
|
+
const k = Symbol.for("signal-exit emitter");
|
|
662
662
|
const L = globalThis;
|
|
663
|
-
const
|
|
663
|
+
const W = Object.defineProperty.bind(Object);
|
|
664
664
|
class Emitter {
|
|
665
665
|
emitted = {
|
|
666
666
|
afterExit: false,
|
|
@@ -673,8 +673,8 @@
|
|
|
673
673
|
count = 0;
|
|
674
674
|
id = Math.random();
|
|
675
675
|
constructor(){
|
|
676
|
-
if (L[
|
|
677
|
-
|
|
676
|
+
if (L[k]) return L[k];
|
|
677
|
+
W(L, k, {
|
|
678
678
|
value: this,
|
|
679
679
|
writable: false,
|
|
680
680
|
enumerable: false,
|
|
@@ -695,7 +695,7 @@
|
|
|
695
695
|
if (this.emitted[e]) return false;
|
|
696
696
|
this.emitted[e] = true;
|
|
697
697
|
let i = false;
|
|
698
|
-
for (const
|
|
698
|
+
for (const s of this.listeners[e])i = true === s(t, n) || i;
|
|
699
699
|
if ("exit" === e) i = this.emit("afterExit", t, n) || i;
|
|
700
700
|
return i;
|
|
701
701
|
}
|
|
@@ -725,18 +725,18 @@
|
|
|
725
725
|
#t = new Emitter;
|
|
726
726
|
#n;
|
|
727
727
|
#i;
|
|
728
|
-
#
|
|
729
|
-
#
|
|
728
|
+
#s;
|
|
729
|
+
#r = {};
|
|
730
730
|
#o = false;
|
|
731
731
|
constructor(e){
|
|
732
732
|
super();
|
|
733
733
|
this.#n = e;
|
|
734
|
-
this.#
|
|
735
|
-
for (const t of B)this.#
|
|
734
|
+
this.#r = {};
|
|
735
|
+
for (const t of B)this.#r[t] = ()=>{
|
|
736
736
|
const n = this.#n.listeners(t);
|
|
737
737
|
let { count: i } = this.#t;
|
|
738
|
-
const
|
|
739
|
-
if ("object" == typeof
|
|
738
|
+
const s = e;
|
|
739
|
+
if ("object" == typeof s.__signal_exit_emitter__ && "number" == typeof s.__signal_exit_emitter__.count) i += s.__signal_exit_emitter__.count;
|
|
740
740
|
if (n.length === i) {
|
|
741
741
|
this.unload();
|
|
742
742
|
const n = this.#t.emit("exit", null, t);
|
|
@@ -744,7 +744,7 @@
|
|
|
744
744
|
if (!n) e.kill(e.pid, i);
|
|
745
745
|
}
|
|
746
746
|
};
|
|
747
|
-
this.#
|
|
747
|
+
this.#s = e.reallyExit;
|
|
748
748
|
this.#i = e.emit;
|
|
749
749
|
}
|
|
750
750
|
onExit(e, t) {
|
|
@@ -762,7 +762,7 @@
|
|
|
762
762
|
this.#o = true;
|
|
763
763
|
this.#t.count += 1;
|
|
764
764
|
for (const e of B)try {
|
|
765
|
-
const t = this.#
|
|
765
|
+
const t = this.#r[e];
|
|
766
766
|
if (t) this.#n.on(e, t);
|
|
767
767
|
} catch (e) {}
|
|
768
768
|
this.#n.emit = (e, ...t)=>this.#a(e, ...t);
|
|
@@ -772,21 +772,21 @@
|
|
|
772
772
|
if (!this.#o) return;
|
|
773
773
|
this.#o = false;
|
|
774
774
|
B.forEach((e)=>{
|
|
775
|
-
const t = this.#
|
|
775
|
+
const t = this.#r[e];
|
|
776
776
|
if (!t) throw new Error("Listener not defined for signal: " + e);
|
|
777
777
|
try {
|
|
778
778
|
this.#n.removeListener(e, t);
|
|
779
779
|
} catch (e) {}
|
|
780
780
|
});
|
|
781
781
|
this.#n.emit = this.#i;
|
|
782
|
-
this.#n.reallyExit = this.#
|
|
782
|
+
this.#n.reallyExit = this.#s;
|
|
783
783
|
this.#t.count -= 1;
|
|
784
784
|
}
|
|
785
785
|
#l(e) {
|
|
786
786
|
if (!processOk(this.#n)) return 0;
|
|
787
787
|
this.#n.exitCode = e || 0;
|
|
788
788
|
this.#t.emit("exit", this.#n.exitCode, null);
|
|
789
|
-
return this.#
|
|
789
|
+
return this.#s.call(this.#n, this.#n.exitCode);
|
|
790
790
|
}
|
|
791
791
|
#a(e, ...t) {
|
|
792
792
|
const n = this.#i;
|
|
@@ -800,11 +800,11 @@
|
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
802
|
const j = globalThis.process;
|
|
803
|
-
const { onExit:
|
|
804
|
-
const
|
|
805
|
-
const $ =
|
|
806
|
-
|
|
807
|
-
|
|
803
|
+
const { onExit: N, load: G, unload: D } = signalExitWrap(processOk(j) ? new SignalExit(j) : new SignalExitFallback);
|
|
804
|
+
const H = n.stderr.isTTY ? n.stderr : n.stdout.isTTY ? n.stdout : void 0;
|
|
805
|
+
const $ = H ? F(()=>{
|
|
806
|
+
N(()=>{
|
|
807
|
+
H.write("[?25h");
|
|
808
808
|
}, {
|
|
809
809
|
alwaysLast: true
|
|
810
810
|
});
|
|
@@ -832,25 +832,25 @@
|
|
|
832
832
|
const q = JSON.parse('{"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"dots13":{"interval":80,"frames":["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},"dots14":{"interval":80,"frames":["⠉⠉","⠈⠙","⠀⠹","⠀⢸","⠀⣰","⢀⣠","⣀⣀","⣄⡀","⣆⠀","⡇⠀","⠏⠀","⠋⠁"]},"dots8Bit":{"interval":80,"frames":["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},"dotsCircle":{"interval":80,"frames":["⢎ ","⠎⠁","⠊⠑","⠈⠱"," ⡱","⢀⡰","⢄⡠","⢆⡀"]},"sand":{"interval":80,"frames":["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},"line":{"interval":130,"frames":["-","\\\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"rollingLine":{"interval":80,"frames":["/ "," - "," \\\\ "," |"," |"," \\\\ "," - ","/ "]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","\'","´","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","°","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"binary":{"interval":80,"frames":["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["😄 ","😝 "]},"monkey":{"interval":300,"frames":["🙈 ","🙈 ","🙉 ","🙊 "]},"hearts":{"interval":100,"frames":["💛 ","💙 ","💜 ","💚 ","💗 "]},"clock":{"interval":100,"frames":["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},"earth":{"interval":180,"frames":["🌍 ","🌎 ","🌏 "]},"material":{"interval":17,"frames":["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},"moon":{"interval":80,"frames":["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},"runner":{"interval":140,"frames":["🚶 ","🏃 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\\\____________▌","▐_|\\\\___________▌","▐__|\\\\__________▌","▐___|\\\\_________▌","▐____|\\\\________▌","▐_____|\\\\_______▌","▐______|\\\\______▌","▐_______|\\\\_____▌","▐________|\\\\____▌","▐_________|\\\\___▌","▐__________|\\\\__▌","▐___________|\\\\_▌","▐____________|\\\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["🌲","🎄"]},"grenade":{"interval":80,"frames":["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},"point":{"interval":125,"frames":["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},"layer":{"interval":150,"frames":["-","=","≡"]},"betaWave":{"interval":80,"frames":["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},"fingerDance":{"interval":160,"frames":["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},"fistBump":{"interval":80,"frames":["🤜 🤛 ","🤜 🤛 ","🤜 🤛 "," 🤜 🤛 "," 🤜🤛 "," 🤜✨🤛 ","🤜 ✨ 🤛 "]},"soccerHeader":{"interval":80,"frames":[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},"mindblown":{"interval":160,"frames":["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ "," "," "," "]},"speaker":{"interval":160,"frames":["🔈 ","🔉 ","🔊 ","🔉 "]},"orangePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},"bluePulse":{"interval":100,"frames":["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"orangeBluePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"timeTravel":{"interval":100,"frames":["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},"aesthetic":{"interval":80,"frames":["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},"dwarfFortress":{"interval":80,"frames":[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]},"fish":{"interval":80,"frames":["~~~~~~~~~~~~~~~~~~~~","> ~~~~~~~~~~~~~~~~~~","º> ~~~~~~~~~~~~~~~~~","(º> ~~~~~~~~~~~~~~~~","((º> ~~~~~~~~~~~~~~~","<((º> ~~~~~~~~~~~~~~","><((º> ~~~~~~~~~~~~~"," ><((º> ~~~~~~~~~~~~","~ ><((º> ~~~~~~~~~~~","~~ <>((º> ~~~~~~~~~~","~~~ ><((º> ~~~~~~~~~","~~~~ <>((º> ~~~~~~~~","~~~~~ ><((º> ~~~~~~~","~~~~~~ <>((º> ~~~~~~","~~~~~~~ ><((º> ~~~~~","~~~~~~~~ <>((º> ~~~~","~~~~~~~~~ ><((º> ~~~","~~~~~~~~~~ <>((º> ~~","~~~~~~~~~~~ ><((º> ~","~~~~~~~~~~~~ <>((º> ","~~~~~~~~~~~~~ ><((º>","~~~~~~~~~~~~~~ <>((º","~~~~~~~~~~~~~~~ ><((","~~~~~~~~~~~~~~~~ <>(","~~~~~~~~~~~~~~~~~ ><","~~~~~~~~~~~~~~~~~~ <","~~~~~~~~~~~~~~~~~~~~"]}}');
|
|
833
833
|
const z = q;
|
|
834
834
|
Object.keys(q);
|
|
835
|
-
const
|
|
835
|
+
const Q = d?.WriteStream?.prototype?.hasColors?.() ?? false;
|
|
836
836
|
const format = (e, t)=>{
|
|
837
|
-
if (!
|
|
837
|
+
if (!Q) return (e)=>e;
|
|
838
838
|
const n = `[${e}m`;
|
|
839
839
|
const i = `[${t}m`;
|
|
840
840
|
return (e)=>{
|
|
841
|
-
const
|
|
842
|
-
let
|
|
843
|
-
if (-1 ===
|
|
841
|
+
const s = e + "";
|
|
842
|
+
let r = s.indexOf(i);
|
|
843
|
+
if (-1 === r) return n + s + i;
|
|
844
844
|
let o = n;
|
|
845
845
|
let a = 0;
|
|
846
846
|
const l = 22 === t;
|
|
847
|
-
const
|
|
848
|
-
while(-1 !==
|
|
849
|
-
o +=
|
|
850
|
-
a =
|
|
851
|
-
|
|
847
|
+
const c = (l ? i : "") + n;
|
|
848
|
+
while(-1 !== r){
|
|
849
|
+
o += s.slice(a, r) + c;
|
|
850
|
+
a = r + i.length;
|
|
851
|
+
r = s.indexOf(i, a);
|
|
852
852
|
}
|
|
853
|
-
o +=
|
|
853
|
+
o += s.slice(a) + i;
|
|
854
854
|
return o;
|
|
855
855
|
};
|
|
856
856
|
};
|
|
@@ -859,15 +859,19 @@
|
|
|
859
859
|
format(2, 22);
|
|
860
860
|
format(3, 23);
|
|
861
861
|
format(4, 24);
|
|
862
|
+
format("4:2", 24);
|
|
863
|
+
format("4:3", 24);
|
|
864
|
+
format("4:4", 24);
|
|
865
|
+
format("4:5", 24);
|
|
862
866
|
format(53, 55);
|
|
863
867
|
format(7, 27);
|
|
864
868
|
format(8, 28);
|
|
865
869
|
format(9, 29);
|
|
866
870
|
format(30, 39);
|
|
867
|
-
const
|
|
868
|
-
const
|
|
869
|
-
const
|
|
870
|
-
const
|
|
871
|
+
const he = format(31, 39);
|
|
872
|
+
const de = format(32, 39);
|
|
873
|
+
const me = format(33, 39);
|
|
874
|
+
const pe = format(34, 39);
|
|
871
875
|
format(35, 39);
|
|
872
876
|
format(36, 39);
|
|
873
877
|
format(37, 39);
|
|
@@ -895,33 +899,49 @@
|
|
|
895
899
|
format(105, 49);
|
|
896
900
|
format(106, 49);
|
|
897
901
|
format(107, 49);
|
|
902
|
+
format("58;5;0", 59);
|
|
903
|
+
format("58;5;1", 59);
|
|
904
|
+
format("58;5;2", 59);
|
|
905
|
+
format("58;5;3", 59);
|
|
906
|
+
format("58;5;4", 59);
|
|
907
|
+
format("58;5;5", 59);
|
|
908
|
+
format("58;5;6", 59);
|
|
909
|
+
format("58;5;7", 59);
|
|
910
|
+
format("58;5;8", 59);
|
|
911
|
+
format("58;5;9", 59);
|
|
912
|
+
format("58;5;10", 59);
|
|
913
|
+
format("58;5;11", 59);
|
|
914
|
+
format("58;5;12", 59);
|
|
915
|
+
format("58;5;13", 59);
|
|
916
|
+
format("58;5;14", 59);
|
|
917
|
+
format("58;5;15", 59);
|
|
898
918
|
function isUnicodeSupported() {
|
|
899
919
|
const { env: e } = n;
|
|
900
920
|
const { TERM: t, TERM_PROGRAM: i } = e;
|
|
901
921
|
if ("win32" !== n.platform) return "linux" !== t;
|
|
902
922
|
return Boolean(e.WT_SESSION) || Boolean(e.TERMINUS_SUBLIME) || "{cmd::Cmder}" === e.ConEmuTask || "Terminus-Sublime" === i || "vscode" === i || "xterm-256color" === t || "alacritty" === t || "rxvt-unicode" === t || "rxvt-unicode-256color" === t || "JetBrains-JediTerm" === e.TERMINAL_EMULATOR;
|
|
903
923
|
}
|
|
904
|
-
const
|
|
905
|
-
const
|
|
906
|
-
const
|
|
907
|
-
const
|
|
908
|
-
const
|
|
924
|
+
const rt = isUnicodeSupported();
|
|
925
|
+
const ot = pe(rt ? "ℹ" : "i");
|
|
926
|
+
const at = de(rt ? "✔" : "√");
|
|
927
|
+
const lt = me(rt ? "⚠" : "‼");
|
|
928
|
+
const ct = he(rt ? "✖" : "×");
|
|
909
929
|
function ansiRegex({ onlyFirst: e = false } = {}) {
|
|
910
930
|
const t = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
911
|
-
const n = `(?:\\u001B\\][\\
|
|
931
|
+
const n = `(?:(?:\\u001B\\]|\\u009D)[^\\u0007\\u001B\\u009C\\u009D]*${t})`;
|
|
912
932
|
const i = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
|
|
913
|
-
const
|
|
914
|
-
return new RegExp(
|
|
933
|
+
const s = `${n}|${i}`;
|
|
934
|
+
return new RegExp(s, e ? void 0 : "g");
|
|
915
935
|
}
|
|
916
|
-
const
|
|
936
|
+
const ft = ansiRegex();
|
|
917
937
|
function stripAnsi(e) {
|
|
918
938
|
if ("string" != typeof e) throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);
|
|
919
939
|
if (!e.includes("") && !e.includes("")) return e;
|
|
920
|
-
return e.replace(
|
|
940
|
+
return e.replace(ft, "");
|
|
921
941
|
}
|
|
922
|
-
const
|
|
923
|
-
const
|
|
924
|
-
const
|
|
942
|
+
const ut = 161;
|
|
943
|
+
const ht = 1114109;
|
|
944
|
+
const dt = [
|
|
925
945
|
161,
|
|
926
946
|
161,
|
|
927
947
|
164,
|
|
@@ -1281,9 +1301,9 @@
|
|
|
1281
1301
|
1048576,
|
|
1282
1302
|
1114109
|
|
1283
1303
|
];
|
|
1284
|
-
const
|
|
1285
|
-
const
|
|
1286
|
-
const
|
|
1304
|
+
const mt = 12288;
|
|
1305
|
+
const pt = 65510;
|
|
1306
|
+
const _t = [
|
|
1287
1307
|
12288,
|
|
1288
1308
|
12288,
|
|
1289
1309
|
65281,
|
|
@@ -1291,9 +1311,9 @@
|
|
|
1291
1311
|
65504,
|
|
1292
1312
|
65510
|
|
1293
1313
|
];
|
|
1294
|
-
const
|
|
1295
|
-
const
|
|
1296
|
-
const
|
|
1314
|
+
const wt = 4352;
|
|
1315
|
+
const St = 262141;
|
|
1316
|
+
const Et = [
|
|
1297
1317
|
4352,
|
|
1298
1318
|
4447,
|
|
1299
1319
|
8986,
|
|
@@ -1415,11 +1435,15 @@
|
|
|
1415
1435
|
94192,
|
|
1416
1436
|
94198,
|
|
1417
1437
|
94208,
|
|
1418
|
-
|
|
1438
|
+
101594,
|
|
1419
1439
|
101631,
|
|
1420
|
-
|
|
1440
|
+
101664,
|
|
1421
1441
|
101760,
|
|
1422
1442
|
101874,
|
|
1443
|
+
101888,
|
|
1444
|
+
102801,
|
|
1445
|
+
102816,
|
|
1446
|
+
102866,
|
|
1423
1447
|
110576,
|
|
1424
1448
|
110579,
|
|
1425
1449
|
110581,
|
|
@@ -1427,7 +1451,7 @@
|
|
|
1427
1451
|
110589,
|
|
1428
1452
|
110590,
|
|
1429
1453
|
110592,
|
|
1430
|
-
|
|
1454
|
+
110888,
|
|
1431
1455
|
110898,
|
|
1432
1456
|
110898,
|
|
1433
1457
|
110928,
|
|
@@ -1435,7 +1459,7 @@
|
|
|
1435
1459
|
110933,
|
|
1436
1460
|
110933,
|
|
1437
1461
|
110948,
|
|
1438
|
-
|
|
1462
|
+
110952,
|
|
1439
1463
|
110960,
|
|
1440
1464
|
111355,
|
|
1441
1465
|
119552,
|
|
@@ -1450,6 +1474,8 @@
|
|
|
1450
1474
|
127374,
|
|
1451
1475
|
127377,
|
|
1452
1476
|
127386,
|
|
1477
|
+
127406,
|
|
1478
|
+
127406,
|
|
1453
1479
|
127488,
|
|
1454
1480
|
127490,
|
|
1455
1481
|
127504,
|
|
@@ -1503,13 +1529,15 @@
|
|
|
1503
1529
|
128720,
|
|
1504
1530
|
128722,
|
|
1505
1531
|
128725,
|
|
1506
|
-
|
|
1532
|
+
128729,
|
|
1507
1533
|
128732,
|
|
1508
1534
|
128735,
|
|
1509
1535
|
128747,
|
|
1510
1536
|
128748,
|
|
1511
1537
|
128756,
|
|
1512
1538
|
128764,
|
|
1539
|
+
128986,
|
|
1540
|
+
128986,
|
|
1513
1541
|
128992,
|
|
1514
1542
|
129003,
|
|
1515
1543
|
129008,
|
|
@@ -1523,17 +1551,15 @@
|
|
|
1523
1551
|
129648,
|
|
1524
1552
|
129660,
|
|
1525
1553
|
129664,
|
|
1526
|
-
129674,
|
|
1527
|
-
129678,
|
|
1528
1554
|
129734,
|
|
1529
1555
|
129736,
|
|
1530
1556
|
129736,
|
|
1531
|
-
|
|
1532
|
-
|
|
1557
|
+
129740,
|
|
1558
|
+
129757,
|
|
1533
1559
|
129759,
|
|
1534
|
-
|
|
1560
|
+
129771,
|
|
1535
1561
|
129775,
|
|
1536
|
-
|
|
1562
|
+
129786,
|
|
1537
1563
|
131072,
|
|
1538
1564
|
196605,
|
|
1539
1565
|
196608,
|
|
@@ -1543,31 +1569,31 @@
|
|
|
1543
1569
|
let n = 0;
|
|
1544
1570
|
let i = Math.floor(e.length / 2) - 1;
|
|
1545
1571
|
while(n <= i){
|
|
1546
|
-
const
|
|
1547
|
-
const
|
|
1548
|
-
if (t < e[
|
|
1572
|
+
const s = Math.floor((n + i) / 2);
|
|
1573
|
+
const r = 2 * s;
|
|
1574
|
+
if (t < e[r]) i = s - 1;
|
|
1549
1575
|
else {
|
|
1550
|
-
if (!(t > e[
|
|
1551
|
-
n =
|
|
1576
|
+
if (!(t > e[r + 1])) return true;
|
|
1577
|
+
n = s + 1;
|
|
1552
1578
|
}
|
|
1553
1579
|
}
|
|
1554
1580
|
return false;
|
|
1555
1581
|
};
|
|
1556
|
-
const
|
|
1557
|
-
const [
|
|
1582
|
+
const Rt = 19968;
|
|
1583
|
+
const [Ot, Ct] = findWideFastPathRange(Et);
|
|
1558
1584
|
function findWideFastPathRange(e) {
|
|
1559
1585
|
let t = e[0];
|
|
1560
1586
|
let n = e[1];
|
|
1561
1587
|
for(let i = 0; i < e.length; i += 2){
|
|
1562
|
-
const
|
|
1563
|
-
const
|
|
1564
|
-
if (
|
|
1565
|
-
|
|
1566
|
-
|
|
1588
|
+
const s = e[i];
|
|
1589
|
+
const r = e[i + 1];
|
|
1590
|
+
if (Rt >= s && Rt <= r) return [
|
|
1591
|
+
s,
|
|
1592
|
+
r
|
|
1567
1593
|
];
|
|
1568
|
-
if (
|
|
1569
|
-
t =
|
|
1570
|
-
n =
|
|
1594
|
+
if (r - s > n - t) {
|
|
1595
|
+
t = s;
|
|
1596
|
+
n = r;
|
|
1571
1597
|
}
|
|
1572
1598
|
}
|
|
1573
1599
|
return [
|
|
@@ -1576,46 +1602,44 @@
|
|
|
1576
1602
|
];
|
|
1577
1603
|
}
|
|
1578
1604
|
const isAmbiguous = (e)=>{
|
|
1579
|
-
if (e <
|
|
1580
|
-
return utilities_isInRange(
|
|
1605
|
+
if (e < ut || e > ht) return false;
|
|
1606
|
+
return utilities_isInRange(dt, e);
|
|
1581
1607
|
};
|
|
1582
|
-
const
|
|
1583
|
-
if (e <
|
|
1584
|
-
return utilities_isInRange(
|
|
1608
|
+
const isFullwidth = (e)=>{
|
|
1609
|
+
if (e < mt || e > pt) return false;
|
|
1610
|
+
return utilities_isInRange(_t, e);
|
|
1585
1611
|
};
|
|
1586
1612
|
const isWide = (e)=>{
|
|
1587
|
-
if (e >=
|
|
1588
|
-
if (e <
|
|
1589
|
-
return utilities_isInRange(
|
|
1613
|
+
if (e >= Ot && e <= Ct) return true;
|
|
1614
|
+
if (e < wt || e > St) return false;
|
|
1615
|
+
return utilities_isInRange(Et, e);
|
|
1590
1616
|
};
|
|
1591
1617
|
function validate(e) {
|
|
1592
1618
|
if (!Number.isSafeInteger(e)) throw new TypeError(`Expected a code point, got \`${typeof e}\`.`);
|
|
1593
1619
|
}
|
|
1594
1620
|
function eastAsianWidth(e, { ambiguousAsWide: t = false } = {}) {
|
|
1595
1621
|
validate(e);
|
|
1596
|
-
if (
|
|
1622
|
+
if (isFullwidth(e) || isWide(e) || t && isAmbiguous(e)) return 2;
|
|
1597
1623
|
return 1;
|
|
1598
1624
|
}
|
|
1599
|
-
const
|
|
1600
|
-
const
|
|
1601
|
-
const
|
|
1602
|
-
const
|
|
1603
|
-
const
|
|
1604
|
-
const
|
|
1625
|
+
const It = new Intl.Segmenter;
|
|
1626
|
+
const Pt = /[^\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Nonspacing_Mark}\p{Enclosing_Mark}\p{Surrogate}]/v;
|
|
1627
|
+
const At = /\p{Spacing_Mark}/v;
|
|
1628
|
+
const Mt = /^\p{RGI_Emoji}$/v;
|
|
1629
|
+
const Ft = /^[\d#*]\u20E3$/;
|
|
1630
|
+
const Bt = /\p{Extended_Pictographic}/gu;
|
|
1605
1631
|
function isDoubleWidthNonRgiEmojiSequence(e) {
|
|
1606
1632
|
if (e.length > 50) return false;
|
|
1607
|
-
if (
|
|
1633
|
+
if (Ft.test(e)) return true;
|
|
1608
1634
|
if (e.includes("")) {
|
|
1609
|
-
const t = e.match(
|
|
1635
|
+
const t = e.match(Bt);
|
|
1610
1636
|
return null !== t && t.length >= 2;
|
|
1611
1637
|
}
|
|
1612
1638
|
return false;
|
|
1613
1639
|
}
|
|
1614
1640
|
function baseVisible(e) {
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
function isZeroWidthCluster(e) {
|
|
1618
|
-
return ct.test(e);
|
|
1641
|
+
const t = e.search(Pt);
|
|
1642
|
+
return -1 === t ? void 0 : e.slice(t);
|
|
1619
1643
|
}
|
|
1620
1644
|
function isHangulLeadingJamo(e) {
|
|
1621
1645
|
return e >= 4352 && e <= 4447 || e >= 43360 && e <= 43388;
|
|
@@ -1631,95 +1655,95 @@
|
|
|
1631
1655
|
}
|
|
1632
1656
|
function hangulClusterWidth(e, t) {
|
|
1633
1657
|
const n = [];
|
|
1634
|
-
for (const t of e)if (
|
|
1658
|
+
for (const t of e)if (Pt.test(t)) n.push(t.codePointAt(0));
|
|
1635
1659
|
if (0 === n.length) return;
|
|
1636
1660
|
let i = 0;
|
|
1637
1661
|
for(let e = 0; e < n.length; e++){
|
|
1638
|
-
const
|
|
1639
|
-
if (!isHangulJamo(
|
|
1662
|
+
const s = n[e];
|
|
1663
|
+
if (!isHangulJamo(s)) {
|
|
1640
1664
|
if (0 === i) return;
|
|
1641
|
-
for(let
|
|
1665
|
+
for(let s = e; s < n.length; s++)i += eastAsianWidth(n[s], t);
|
|
1642
1666
|
break;
|
|
1643
1667
|
}
|
|
1644
|
-
if (isHangulLeadingJamo(
|
|
1668
|
+
if (isHangulLeadingJamo(s) && isHangulVowelJamo(n[e + 1])) {
|
|
1645
1669
|
i += 2;
|
|
1646
1670
|
e += isHangulTrailingJamo(n[e + 2]) ? 2 : 1;
|
|
1647
1671
|
continue;
|
|
1648
1672
|
}
|
|
1649
|
-
i += eastAsianWidth(
|
|
1673
|
+
i += eastAsianWidth(s, t);
|
|
1650
1674
|
}
|
|
1651
1675
|
return i;
|
|
1652
1676
|
}
|
|
1653
|
-
function
|
|
1677
|
+
function trailingWidth(e, t) {
|
|
1654
1678
|
let n = 0;
|
|
1655
1679
|
let i = true;
|
|
1656
|
-
for (const
|
|
1680
|
+
for (const s of e){
|
|
1657
1681
|
if (i) {
|
|
1658
1682
|
i = false;
|
|
1659
1683
|
continue;
|
|
1660
1684
|
}
|
|
1661
|
-
if (
|
|
1685
|
+
if (At.test(s) || s >= "" && s <= "") n += eastAsianWidth(s.codePointAt(0), t);
|
|
1662
1686
|
}
|
|
1663
1687
|
return n;
|
|
1664
1688
|
}
|
|
1665
1689
|
function stringWidth(e, t = {}) {
|
|
1666
1690
|
if ("string" != typeof e || 0 === e.length) return 0;
|
|
1667
1691
|
const { ambiguousIsNarrow: n = true, countAnsiEscapeCodes: i = false } = t;
|
|
1668
|
-
let
|
|
1669
|
-
if (!i && (
|
|
1670
|
-
if (0 ===
|
|
1671
|
-
if (/^[\u0020-\u007E]*$/.test(
|
|
1672
|
-
let
|
|
1692
|
+
let s = e;
|
|
1693
|
+
if (!i && (s.includes("") || s.includes(""))) s = stripAnsi(s);
|
|
1694
|
+
if (0 === s.length) return 0;
|
|
1695
|
+
if (/^[\u0020-\u007E]*$/.test(s)) return s.length;
|
|
1696
|
+
let r = 0;
|
|
1673
1697
|
const o = {
|
|
1674
1698
|
ambiguousAsWide: !n
|
|
1675
1699
|
};
|
|
1676
|
-
for (const { segment: e } of
|
|
1677
|
-
|
|
1678
|
-
if (
|
|
1679
|
-
|
|
1700
|
+
for (const { segment: e } of It.segment(s)){
|
|
1701
|
+
const t = baseVisible(e);
|
|
1702
|
+
if (void 0 === t) continue;
|
|
1703
|
+
if (Mt.test(e) || isDoubleWidthNonRgiEmojiSequence(e)) {
|
|
1704
|
+
r += 2;
|
|
1680
1705
|
continue;
|
|
1681
1706
|
}
|
|
1682
|
-
const t = baseVisible(e);
|
|
1683
1707
|
const n = hangulClusterWidth(t, o);
|
|
1684
1708
|
if (void 0 !== n) {
|
|
1685
|
-
|
|
1709
|
+
r += n;
|
|
1686
1710
|
continue;
|
|
1687
1711
|
}
|
|
1688
1712
|
const i = t.codePointAt(0);
|
|
1689
|
-
|
|
1690
|
-
|
|
1713
|
+
r += eastAsianWidth(i, o);
|
|
1714
|
+
r += trailingWidth(t, o);
|
|
1691
1715
|
}
|
|
1692
|
-
return
|
|
1716
|
+
return r;
|
|
1693
1717
|
}
|
|
1694
1718
|
function isInteractive({ stream: e = process.stdout } = {}) {
|
|
1695
1719
|
return Boolean(e && e.isTTY && "dumb" !== process.env.TERM && !("CI" in process.env));
|
|
1696
1720
|
}
|
|
1697
|
-
const
|
|
1721
|
+
const kt = 3;
|
|
1698
1722
|
class StdinDiscarder {
|
|
1699
|
-
#
|
|
1700
|
-
#
|
|
1723
|
+
#c = 0;
|
|
1724
|
+
#f;
|
|
1701
1725
|
#u = false;
|
|
1702
1726
|
#h = false;
|
|
1703
1727
|
#d = (e)=>{
|
|
1704
1728
|
if (!e?.length) return;
|
|
1705
1729
|
const t = "string" == typeof e ? e.codePointAt(0) : e[0];
|
|
1706
|
-
if (t ===
|
|
1730
|
+
if (t === kt) n.kill(n.pid, "SIGINT");
|
|
1707
1731
|
};
|
|
1708
1732
|
start() {
|
|
1709
|
-
this.#
|
|
1710
|
-
if (1 === this.#
|
|
1733
|
+
this.#c++;
|
|
1734
|
+
if (1 === this.#c) this.#m();
|
|
1711
1735
|
}
|
|
1712
1736
|
stop() {
|
|
1713
|
-
if (0 === this.#
|
|
1714
|
-
if (0 === --this.#
|
|
1737
|
+
if (0 === this.#c) return;
|
|
1738
|
+
if (0 === --this.#c) this.#p();
|
|
1715
1739
|
}
|
|
1716
1740
|
#m() {
|
|
1717
1741
|
const { stdin: e } = n;
|
|
1718
1742
|
if ("win32" === n.platform || !e?.isTTY || "function" != typeof e.setRawMode) {
|
|
1719
|
-
this.#
|
|
1743
|
+
this.#f = void 0;
|
|
1720
1744
|
return;
|
|
1721
1745
|
}
|
|
1722
|
-
this.#
|
|
1746
|
+
this.#f = e;
|
|
1723
1747
|
this.#u = e.isPaused();
|
|
1724
1748
|
this.#h = Boolean(e.isRaw);
|
|
1725
1749
|
e.setRawMode(true);
|
|
@@ -1727,23 +1751,23 @@
|
|
|
1727
1751
|
if (this.#u) e.resume();
|
|
1728
1752
|
}
|
|
1729
1753
|
#p() {
|
|
1730
|
-
if (!this.#
|
|
1731
|
-
const e = this.#
|
|
1754
|
+
if (!this.#f) return;
|
|
1755
|
+
const e = this.#f;
|
|
1732
1756
|
e.off("data", this.#d);
|
|
1733
1757
|
if (e.isTTY) e.setRawMode?.(this.#h);
|
|
1734
1758
|
if (this.#u) e.pause();
|
|
1735
|
-
this.#
|
|
1759
|
+
this.#f = void 0;
|
|
1736
1760
|
this.#u = false;
|
|
1737
1761
|
this.#h = false;
|
|
1738
1762
|
}
|
|
1739
1763
|
}
|
|
1740
|
-
const
|
|
1741
|
-
const
|
|
1742
|
-
const
|
|
1743
|
-
const
|
|
1744
|
-
const
|
|
1745
|
-
const
|
|
1746
|
-
const
|
|
1764
|
+
const Lt = new StdinDiscarder;
|
|
1765
|
+
const Wt = Object.freeze(Lt);
|
|
1766
|
+
const jt = 200;
|
|
1767
|
+
const Nt = "[?2026h";
|
|
1768
|
+
const Gt = "[?2026l";
|
|
1769
|
+
const Dt = new Map;
|
|
1770
|
+
const Ht = new Set([
|
|
1747
1771
|
"black",
|
|
1748
1772
|
"red",
|
|
1749
1773
|
"green",
|
|
@@ -1766,8 +1790,8 @@
|
|
|
1766
1790
|
#S = false;
|
|
1767
1791
|
#E;
|
|
1768
1792
|
#R;
|
|
1769
|
-
#
|
|
1770
|
-
#
|
|
1793
|
+
#O = false;
|
|
1794
|
+
#C;
|
|
1771
1795
|
#I(e) {
|
|
1772
1796
|
this.#S = true;
|
|
1773
1797
|
try {
|
|
@@ -1798,7 +1822,7 @@
|
|
|
1798
1822
|
this.#R = setTimeout(()=>{
|
|
1799
1823
|
this.#R = void 0;
|
|
1800
1824
|
if (this.isSpinning) this.#P();
|
|
1801
|
-
},
|
|
1825
|
+
}, jt);
|
|
1802
1826
|
if ("function" == typeof this.#R?.unref) this.#R.unref();
|
|
1803
1827
|
}
|
|
1804
1828
|
#B() {
|
|
@@ -1807,12 +1831,12 @@
|
|
|
1807
1831
|
this.#R = void 0;
|
|
1808
1832
|
}
|
|
1809
1833
|
}
|
|
1810
|
-
#
|
|
1811
|
-
const
|
|
1812
|
-
const
|
|
1813
|
-
const o = "string" == typeof t ?
|
|
1814
|
-
const a = this.#
|
|
1815
|
-
return
|
|
1834
|
+
#k(e, t, n, i) {
|
|
1835
|
+
const s = this.#L(n, " ");
|
|
1836
|
+
const r = e ? " " : "";
|
|
1837
|
+
const o = "string" == typeof t ? r + t : "";
|
|
1838
|
+
const a = this.#W(i, " ");
|
|
1839
|
+
return s + e + o + a;
|
|
1816
1840
|
}
|
|
1817
1841
|
constructor(e){
|
|
1818
1842
|
if ("string" == typeof e) e = {
|
|
@@ -1861,9 +1885,9 @@
|
|
|
1861
1885
|
const t = "function" == typeof this.#v.prefixText ? "" : this.#v.prefixText;
|
|
1862
1886
|
const n = "function" == typeof this.#v.suffixText ? "" : this.#v.suffixText;
|
|
1863
1887
|
const i = "string" == typeof t && "" !== t ? t + " " : "";
|
|
1864
|
-
const
|
|
1865
|
-
const
|
|
1866
|
-
const o = " ".repeat(this.#v.indent) + i +
|
|
1888
|
+
const s = "string" == typeof n && "" !== n ? " " + n : "";
|
|
1889
|
+
const r = "-";
|
|
1890
|
+
const o = " ".repeat(this.#v.indent) + i + r + ("string" == typeof this.#v.text ? " " + this.#v.text : "") + s;
|
|
1867
1891
|
return this.#j(o, e);
|
|
1868
1892
|
}
|
|
1869
1893
|
});
|
|
@@ -1915,28 +1939,28 @@
|
|
|
1915
1939
|
get isSpinning() {
|
|
1916
1940
|
return void 0 !== this.#y;
|
|
1917
1941
|
}
|
|
1918
|
-
#
|
|
1942
|
+
#N(e, t, n = false) {
|
|
1919
1943
|
const i = "function" == typeof e ? e() : e;
|
|
1920
1944
|
if ("string" == typeof i && "" !== i) return n ? t + i : i + t;
|
|
1921
1945
|
return "";
|
|
1922
1946
|
}
|
|
1923
1947
|
#L(e = this.#v.prefixText, t = " ") {
|
|
1924
|
-
return this.#
|
|
1948
|
+
return this.#N(e, t, false);
|
|
1925
1949
|
}
|
|
1926
|
-
#
|
|
1927
|
-
return this.#
|
|
1950
|
+
#W(e = this.#v.suffixText, t = " ") {
|
|
1951
|
+
return this.#N(e, t, true);
|
|
1928
1952
|
}
|
|
1929
1953
|
#j(e, t) {
|
|
1930
1954
|
let n = 0;
|
|
1931
|
-
for (const
|
|
1955
|
+
for (const s of (0, i.stripVTControlCharacters)(e).split("\n"))n += Math.max(1, Math.ceil(stringWidth(s) / t));
|
|
1932
1956
|
return n;
|
|
1933
1957
|
}
|
|
1934
1958
|
get color() {
|
|
1935
|
-
return this.#
|
|
1959
|
+
return this.#C;
|
|
1936
1960
|
}
|
|
1937
1961
|
set color(e) {
|
|
1938
|
-
if (void 0 !== e && false !== e && !
|
|
1939
|
-
this.#
|
|
1962
|
+
if (void 0 !== e && false !== e && !Ht.has(e)) throw new Error("The `color` option must be a valid color or `false` to disable");
|
|
1963
|
+
this.#C = e;
|
|
1940
1964
|
}
|
|
1941
1965
|
get isEnabled() {
|
|
1942
1966
|
return this.#v.isEnabled && !this.#v.isSilent;
|
|
@@ -1960,11 +1984,11 @@
|
|
|
1960
1984
|
}
|
|
1961
1985
|
const { frames: t } = this.#x;
|
|
1962
1986
|
let n = t[this.#g];
|
|
1963
|
-
if (this.#
|
|
1987
|
+
if (this.#C) n = I[this.#C](n);
|
|
1964
1988
|
const i = this.#L(this.#v.prefixText, " ");
|
|
1965
|
-
const
|
|
1966
|
-
const
|
|
1967
|
-
return i + n +
|
|
1989
|
+
const s = "string" == typeof this.text ? " " + this.text : "";
|
|
1990
|
+
const r = this.#W(this.#v.suffixText, " ");
|
|
1991
|
+
return i + n + s + r;
|
|
1968
1992
|
}
|
|
1969
1993
|
clear() {
|
|
1970
1994
|
if (!this.isEnabled || !this.#T.isTTY) return this;
|
|
@@ -1979,42 +2003,42 @@
|
|
|
1979
2003
|
this.#_ = 0;
|
|
1980
2004
|
return this;
|
|
1981
2005
|
}
|
|
1982
|
-
#
|
|
2006
|
+
#G(e) {
|
|
1983
2007
|
if (!e || this.#w.has(e) || !e.isTTY || "function" != typeof e.write) return;
|
|
1984
|
-
if (
|
|
2008
|
+
if (Dt.has(e)) console.warn("[ora] Multiple concurrent spinners detected. This may cause visual corruption. Use one spinner at a time.");
|
|
1985
2009
|
const t = e.write;
|
|
1986
2010
|
this.#w.set(e, t);
|
|
1987
|
-
|
|
1988
|
-
e.write = (n, i,
|
|
2011
|
+
Dt.set(e, this);
|
|
2012
|
+
e.write = (n, i, s)=>this.#D(e, t, n, i, s);
|
|
1989
2013
|
}
|
|
1990
|
-
#
|
|
2014
|
+
#H() {
|
|
1991
2015
|
if (!this.isEnabled || this.#w.size > 0) return;
|
|
1992
2016
|
const e = new Set([
|
|
1993
2017
|
this.#T,
|
|
1994
2018
|
n.stdout,
|
|
1995
2019
|
n.stderr
|
|
1996
2020
|
]);
|
|
1997
|
-
for (const t of e)this.#
|
|
2021
|
+
for (const t of e)this.#G(t);
|
|
1998
2022
|
}
|
|
1999
2023
|
#$() {
|
|
2000
2024
|
for (const [e, t] of this.#w){
|
|
2001
2025
|
e.write = t;
|
|
2002
|
-
if (
|
|
2026
|
+
if (Dt.get(e) === this) Dt.delete(e);
|
|
2003
2027
|
}
|
|
2004
2028
|
this.#w.clear();
|
|
2005
2029
|
}
|
|
2006
|
-
#
|
|
2030
|
+
#D(e, t, n, i, s) {
|
|
2007
2031
|
if ("function" == typeof i) {
|
|
2008
|
-
|
|
2032
|
+
s = i;
|
|
2009
2033
|
i = void 0;
|
|
2010
2034
|
}
|
|
2011
|
-
if (this.#S) return t.call(e, n, i,
|
|
2035
|
+
if (this.#S) return t.call(e, n, i, s);
|
|
2012
2036
|
this.clear();
|
|
2013
|
-
const
|
|
2014
|
-
const o = this.#M(
|
|
2015
|
-
const a = t.call(e, n, i,
|
|
2037
|
+
const r = this.#A(n, i);
|
|
2038
|
+
const o = this.#M(r);
|
|
2039
|
+
const a = t.call(e, n, i, s);
|
|
2016
2040
|
if (o) this.#B();
|
|
2017
|
-
else if (
|
|
2041
|
+
else if (r.length > 0) this.#F();
|
|
2018
2042
|
if (this.isSpinning && !this.#R) this.render();
|
|
2019
2043
|
return a;
|
|
2020
2044
|
}
|
|
@@ -2024,17 +2048,17 @@
|
|
|
2024
2048
|
let t = false;
|
|
2025
2049
|
try {
|
|
2026
2050
|
if (e) {
|
|
2027
|
-
this.#I(()=>this.#T.write(
|
|
2051
|
+
this.#I(()=>this.#T.write(Nt));
|
|
2028
2052
|
t = true;
|
|
2029
2053
|
}
|
|
2030
2054
|
this.clear();
|
|
2031
2055
|
let n = this.frame();
|
|
2032
2056
|
const i = this.#T.columns ?? 80;
|
|
2033
|
-
const
|
|
2034
|
-
const
|
|
2035
|
-
if (
|
|
2057
|
+
const s = this.#j(n, i);
|
|
2058
|
+
const r = this.#T.rows;
|
|
2059
|
+
if (r && r > 1 && s > r) {
|
|
2036
2060
|
const e = n.split("\n");
|
|
2037
|
-
const t =
|
|
2061
|
+
const t = r - 1;
|
|
2038
2062
|
n = [
|
|
2039
2063
|
...e.slice(0, t),
|
|
2040
2064
|
"... (content truncated to fit terminal)"
|
|
@@ -2050,7 +2074,7 @@
|
|
|
2050
2074
|
}
|
|
2051
2075
|
this.#_ = this.#j(n, i);
|
|
2052
2076
|
} finally{
|
|
2053
|
-
if (t) this.#I(()=>this.#T.write(
|
|
2077
|
+
if (t) this.#I(()=>this.#T.write(Gt));
|
|
2054
2078
|
}
|
|
2055
2079
|
return this;
|
|
2056
2080
|
}
|
|
@@ -2059,17 +2083,17 @@
|
|
|
2059
2083
|
if (this.isSilent) return this;
|
|
2060
2084
|
if (!this.isEnabled) {
|
|
2061
2085
|
const e = this.text ? "-" : "";
|
|
2062
|
-
const t = " ".repeat(this.#v.indent) + this.#
|
|
2086
|
+
const t = " ".repeat(this.#v.indent) + this.#k(e, this.text, this.#v.prefixText, this.#v.suffixText);
|
|
2063
2087
|
if ("" !== t.trim()) this.#I(()=>this.#T.write(t + "\n"));
|
|
2064
2088
|
return this;
|
|
2065
2089
|
}
|
|
2066
2090
|
if (this.isSpinning) return this;
|
|
2067
2091
|
if (this.#v.hideCursor) J.hide(this.#T);
|
|
2068
2092
|
if (this.#v.discardStdin && n.stdin.isTTY) {
|
|
2069
|
-
|
|
2070
|
-
this.#
|
|
2093
|
+
Wt.start();
|
|
2094
|
+
this.#O = true;
|
|
2071
2095
|
}
|
|
2072
|
-
this.#
|
|
2096
|
+
this.#H();
|
|
2073
2097
|
this.render();
|
|
2074
2098
|
this.#y = setInterval(this.render.bind(this), this.interval);
|
|
2075
2099
|
return this;
|
|
@@ -2089,33 +2113,33 @@
|
|
|
2089
2113
|
this.clear();
|
|
2090
2114
|
if (this.#v.hideCursor) J.show(this.#T);
|
|
2091
2115
|
}
|
|
2092
|
-
if (this.#
|
|
2093
|
-
this.#
|
|
2094
|
-
|
|
2116
|
+
if (this.#O) {
|
|
2117
|
+
this.#O = false;
|
|
2118
|
+
Wt.stop();
|
|
2095
2119
|
}
|
|
2096
2120
|
return this;
|
|
2097
2121
|
}
|
|
2098
2122
|
succeed(e) {
|
|
2099
2123
|
return this.stopAndPersist({
|
|
2100
|
-
symbol:
|
|
2124
|
+
symbol: at,
|
|
2101
2125
|
text: e
|
|
2102
2126
|
});
|
|
2103
2127
|
}
|
|
2104
2128
|
fail(e) {
|
|
2105
2129
|
return this.stopAndPersist({
|
|
2106
|
-
symbol:
|
|
2130
|
+
symbol: ct,
|
|
2107
2131
|
text: e
|
|
2108
2132
|
});
|
|
2109
2133
|
}
|
|
2110
2134
|
warn(e) {
|
|
2111
2135
|
return this.stopAndPersist({
|
|
2112
|
-
symbol:
|
|
2136
|
+
symbol: lt,
|
|
2113
2137
|
text: e
|
|
2114
2138
|
});
|
|
2115
2139
|
}
|
|
2116
2140
|
info(e) {
|
|
2117
2141
|
return this.stopAndPersist({
|
|
2118
|
-
symbol:
|
|
2142
|
+
symbol: ot,
|
|
2119
2143
|
text: e
|
|
2120
2144
|
});
|
|
2121
2145
|
}
|
|
@@ -2124,10 +2148,10 @@
|
|
|
2124
2148
|
const t = e.symbol ?? " ";
|
|
2125
2149
|
const n = e.text ?? this.text;
|
|
2126
2150
|
const i = e.prefixText ?? this.#v.prefixText;
|
|
2127
|
-
const
|
|
2128
|
-
const
|
|
2151
|
+
const s = e.suffixText ?? this.#v.suffixText;
|
|
2152
|
+
const r = this.#k(t, n, i, s) + "\n";
|
|
2129
2153
|
this.stop();
|
|
2130
|
-
this.#I(()=>this.#T.write(
|
|
2154
|
+
this.#I(()=>this.#T.write(r));
|
|
2131
2155
|
return this;
|
|
2132
2156
|
}
|
|
2133
2157
|
}
|
|
@@ -2138,20 +2162,20 @@
|
|
|
2138
2162
|
const n = "function" == typeof e;
|
|
2139
2163
|
const i = "function" == typeof e?.then;
|
|
2140
2164
|
if (!n && !i) throw new TypeError("Parameter `action` must be a Function or a Promise");
|
|
2141
|
-
const { successText:
|
|
2165
|
+
const { successText: s, failText: r, successSymbol: o, failSymbol: a } = "object" == typeof t && null !== t ? t : {};
|
|
2142
2166
|
const l = ora(t).start();
|
|
2143
2167
|
try {
|
|
2144
2168
|
const t = n ? e(l) : e;
|
|
2145
2169
|
const i = await t;
|
|
2146
|
-
const
|
|
2147
|
-
if (void 0 === o) l.succeed(
|
|
2170
|
+
const r = void 0 === s ? void 0 : "string" == typeof s ? s : s(i);
|
|
2171
|
+
if (void 0 === o) l.succeed(r);
|
|
2148
2172
|
else l.stopAndPersist({
|
|
2149
2173
|
symbol: o,
|
|
2150
|
-
text:
|
|
2174
|
+
text: r
|
|
2151
2175
|
});
|
|
2152
2176
|
return i;
|
|
2153
2177
|
} catch (e) {
|
|
2154
|
-
const t = void 0 ===
|
|
2178
|
+
const t = void 0 === r ? void 0 : "string" == typeof r ? r : r(e);
|
|
2155
2179
|
if (void 0 === a) l.fail(t);
|
|
2156
2180
|
else l.stopAndPersist({
|
|
2157
2181
|
symbol: a,
|