@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
|
@@ -332,10 +332,20 @@ type ConfirmTheme = {
|
|
|
332
332
|
* Words accepted as "yes" and "no" answers. Matching is prefix-based and
|
|
333
333
|
* case-insensitive, and the first character of each word is shown in the
|
|
334
334
|
* hint. These words are also displayed once the prompt is answered.
|
|
335
|
+
* Regardless of these keywords, the built-in `y`/`n`/`yes`/`no` answers are
|
|
336
|
+
* always accepted.
|
|
335
337
|
*/
|
|
336
338
|
keywords: {
|
|
337
339
|
yes: string;
|
|
338
340
|
no: string;
|
|
341
|
+
/**
|
|
342
|
+
* Message shown when the submitted input matches no keyword. Receives the
|
|
343
|
+
* yes/no keywords; this is how `@inquirer/i18n` localizes the message.
|
|
344
|
+
*/
|
|
345
|
+
error: (keywords: {
|
|
346
|
+
yes: string;
|
|
347
|
+
no: string;
|
|
348
|
+
}) => string;
|
|
339
349
|
};
|
|
340
350
|
style: {
|
|
341
351
|
/**
|
|
@@ -332,10 +332,20 @@ type ConfirmTheme = {
|
|
|
332
332
|
* Words accepted as "yes" and "no" answers. Matching is prefix-based and
|
|
333
333
|
* case-insensitive, and the first character of each word is shown in the
|
|
334
334
|
* hint. These words are also displayed once the prompt is answered.
|
|
335
|
+
* Regardless of these keywords, the built-in `y`/`n`/`yes`/`no` answers are
|
|
336
|
+
* always accepted.
|
|
335
337
|
*/
|
|
336
338
|
keywords: {
|
|
337
339
|
yes: string;
|
|
338
340
|
no: string;
|
|
341
|
+
/**
|
|
342
|
+
* Message shown when the submitted input matches no keyword. Receives the
|
|
343
|
+
* yes/no keywords; this is how `@inquirer/i18n` localizes the message.
|
|
344
|
+
*/
|
|
345
|
+
error: (keywords: {
|
|
346
|
+
yes: string;
|
|
347
|
+
no: string;
|
|
348
|
+
}) => string;
|
|
339
349
|
};
|
|
340
350
|
style: {
|
|
341
351
|
/**
|
|
@@ -8516,6 +8516,19 @@
|
|
|
8516
8516
|
});
|
|
8517
8517
|
const e = require("node:readline");
|
|
8518
8518
|
const t = require("node:async_hooks");
|
|
8519
|
+
function withResolver() {
|
|
8520
|
+
let e;
|
|
8521
|
+
let t;
|
|
8522
|
+
const r = new Promise((r, n)=>{
|
|
8523
|
+
e = r;
|
|
8524
|
+
t = n;
|
|
8525
|
+
});
|
|
8526
|
+
return {
|
|
8527
|
+
promise: r,
|
|
8528
|
+
resolve: e,
|
|
8529
|
+
reject: t
|
|
8530
|
+
};
|
|
8531
|
+
}
|
|
8519
8532
|
var n = __nccwpck_require__(560);
|
|
8520
8533
|
const s = [];
|
|
8521
8534
|
s.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
@@ -8730,8 +8743,8 @@
|
|
|
8730
8743
|
let E = 0;
|
|
8731
8744
|
let B = e.length;
|
|
8732
8745
|
let C = 0;
|
|
8733
|
-
let
|
|
8734
|
-
let
|
|
8746
|
+
let k = false;
|
|
8747
|
+
let I = B;
|
|
8735
8748
|
let D = Math.max(0, n - i);
|
|
8736
8749
|
let T = 0;
|
|
8737
8750
|
let L = 0;
|
|
@@ -8744,9 +8757,9 @@
|
|
|
8744
8757
|
for (const e of t.replaceAll(S, "")){
|
|
8745
8758
|
const t = e.codePointAt(0) || 0;
|
|
8746
8759
|
O = isFullWidth(t) ? u : isWideNotCJKTNotEmoji(t) ? d : f;
|
|
8747
|
-
if (U + O > D)
|
|
8760
|
+
if (U + O > D) I = Math.min(I, Math.max(T, x) + C);
|
|
8748
8761
|
if (U + O > n) {
|
|
8749
|
-
|
|
8762
|
+
k = true;
|
|
8750
8763
|
break e;
|
|
8751
8764
|
}
|
|
8752
8765
|
C += e.length;
|
|
@@ -8761,9 +8774,9 @@
|
|
|
8761
8774
|
if (r.test(e)) {
|
|
8762
8775
|
C = r === g ? p(e.slice(E, r.lastIndex)) : r === w ? 1 : r.lastIndex - E;
|
|
8763
8776
|
O = C * s;
|
|
8764
|
-
if (U + O > D)
|
|
8777
|
+
if (U + O > D) I = Math.min(I, E + Math.floor((D - U) / s));
|
|
8765
8778
|
if (U + O > n) {
|
|
8766
|
-
|
|
8779
|
+
k = true;
|
|
8767
8780
|
break e;
|
|
8768
8781
|
}
|
|
8769
8782
|
U += O;
|
|
@@ -8776,10 +8789,10 @@
|
|
|
8776
8789
|
E += 1;
|
|
8777
8790
|
}
|
|
8778
8791
|
return {
|
|
8779
|
-
width:
|
|
8780
|
-
index:
|
|
8781
|
-
truncated:
|
|
8782
|
-
ellipsed:
|
|
8792
|
+
width: k ? D : U,
|
|
8793
|
+
index: k ? I : B,
|
|
8794
|
+
truncated: k,
|
|
8795
|
+
ellipsed: k && n >= i
|
|
8783
8796
|
};
|
|
8784
8797
|
};
|
|
8785
8798
|
const x = getStringTruncatedWidth;
|
|
@@ -8791,8 +8804,8 @@
|
|
|
8791
8804
|
const fastStringWidth = (e, t = {})=>x(e, E, t).width;
|
|
8792
8805
|
const B = fastStringWidth;
|
|
8793
8806
|
const C = "";
|
|
8794
|
-
const
|
|
8795
|
-
const
|
|
8807
|
+
const k = "";
|
|
8808
|
+
const I = 39;
|
|
8796
8809
|
const D = "";
|
|
8797
8810
|
const T = "[";
|
|
8798
8811
|
const L = "]";
|
|
@@ -8831,7 +8844,7 @@
|
|
|
8831
8844
|
e.push(o);
|
|
8832
8845
|
a = 0;
|
|
8833
8846
|
}
|
|
8834
|
-
if (o === C || o ===
|
|
8847
|
+
if (o === C || o === k) {
|
|
8835
8848
|
s = true;
|
|
8836
8849
|
i = t.startsWith(O, u + 1);
|
|
8837
8850
|
}
|
|
@@ -8934,13 +8947,13 @@
|
|
|
8934
8947
|
u = t >= "\ud800" && t <= "\udbff";
|
|
8935
8948
|
if (u) continue;
|
|
8936
8949
|
}
|
|
8937
|
-
if (t === C || t ===
|
|
8950
|
+
if (t === C || t === k) {
|
|
8938
8951
|
P.lastIndex = e + 1;
|
|
8939
8952
|
const t = P.exec(l);
|
|
8940
8953
|
const r = t?.groups;
|
|
8941
8954
|
if (r?.code !== void 0) {
|
|
8942
8955
|
const e = Number.parseFloat(r.code);
|
|
8943
|
-
s = e ===
|
|
8956
|
+
s = e === I ? void 0 : e;
|
|
8944
8957
|
} else if (r?.uri !== void 0) i = 0 === r.uri.length ? void 0 : r.uri;
|
|
8945
8958
|
}
|
|
8946
8959
|
if ("\n" === l[e + 1]) {
|
|
@@ -8993,16 +9006,14 @@
|
|
|
8993
9006
|
}
|
|
8994
9007
|
function withHooks(e, t) {
|
|
8995
9008
|
const r = createStore(e);
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
r.
|
|
8999
|
-
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
|
|
9003
|
-
|
|
9004
|
-
return t(cycle);
|
|
9005
|
-
});
|
|
9009
|
+
function cycle(e) {
|
|
9010
|
+
r.handleChange = ()=>{
|
|
9011
|
+
r.index = 0;
|
|
9012
|
+
e();
|
|
9013
|
+
};
|
|
9014
|
+
r.handleChange();
|
|
9015
|
+
}
|
|
9016
|
+
return M.run(r, ()=>t(cycle));
|
|
9006
9017
|
}
|
|
9007
9018
|
function getStore() {
|
|
9008
9019
|
const e = M.getStore();
|
|
@@ -9089,8 +9100,8 @@
|
|
|
9089
9100
|
}
|
|
9090
9101
|
const R = "[";
|
|
9091
9102
|
const F = R + "G";
|
|
9092
|
-
const
|
|
9093
|
-
const
|
|
9103
|
+
const $ = R + "?25l";
|
|
9104
|
+
const N = R + "?25h";
|
|
9094
9105
|
const cursorUp = (e = 1)=>e > 0 ? `${R}${e}A` : "";
|
|
9095
9106
|
const cursorDown = (e = 1)=>e > 0 ? `${R}${e}B` : "";
|
|
9096
9107
|
const cursorTo = (e, t)=>{
|
|
@@ -9147,26 +9158,11 @@
|
|
|
9147
9158
|
let t = cursorDown(this.extraLinesUnderPrompt);
|
|
9148
9159
|
t += e ? eraseLines(this.height) : "\n";
|
|
9149
9160
|
t += F;
|
|
9150
|
-
t +=
|
|
9161
|
+
t += N;
|
|
9151
9162
|
this.write(t);
|
|
9152
9163
|
this.rl.close();
|
|
9153
9164
|
}
|
|
9154
9165
|
}
|
|
9155
|
-
class PromisePolyfill extends Promise {
|
|
9156
|
-
static withResolver() {
|
|
9157
|
-
let e;
|
|
9158
|
-
let t;
|
|
9159
|
-
const r = new Promise((r, n)=>{
|
|
9160
|
-
e = r;
|
|
9161
|
-
t = n;
|
|
9162
|
-
});
|
|
9163
|
-
return {
|
|
9164
|
-
promise: r,
|
|
9165
|
-
resolve: e,
|
|
9166
|
-
reject: t
|
|
9167
|
-
};
|
|
9168
|
-
}
|
|
9169
|
-
}
|
|
9170
9166
|
const G = require("node:path");
|
|
9171
9167
|
const V = globalThis.setImmediate;
|
|
9172
9168
|
function listenTo(e, t, r) {
|
|
@@ -9207,7 +9203,7 @@
|
|
|
9207
9203
|
});
|
|
9208
9204
|
f.mute();
|
|
9209
9205
|
const h = new ScreenManager(d);
|
|
9210
|
-
const { promise: p, resolve: b, reject: m } =
|
|
9206
|
+
const { promise: p, resolve: b, reject: m } = withResolver();
|
|
9211
9207
|
return withHooks(d, (e)=>{
|
|
9212
9208
|
const n = t.AsyncResource.bind(()=>j.clearAll());
|
|
9213
9209
|
const settlePrompt = (e)=>{
|
|
@@ -10077,7 +10073,7 @@
|
|
|
10077
10073
|
g ? s.style.error(g) : "",
|
|
10078
10074
|
v
|
|
10079
10075
|
].filter(Boolean).join("\n").trimEnd();
|
|
10080
|
-
return `${E}${
|
|
10076
|
+
return `${E}${$}`;
|
|
10081
10077
|
});
|
|
10082
10078
|
function toDecimal(e) {
|
|
10083
10079
|
const [t = "", r = "0"] = e.toString().toLowerCase().split("e");
|
|
@@ -10174,7 +10170,8 @@
|
|
|
10174
10170
|
const le = {
|
|
10175
10171
|
keywords: {
|
|
10176
10172
|
yes: "Yes",
|
|
10177
|
-
no: "No"
|
|
10173
|
+
no: "No",
|
|
10174
|
+
error: ({ yes: e, no: t })=>`You must answer with "${e}" or "${t}"`
|
|
10178
10175
|
},
|
|
10179
10176
|
style: {
|
|
10180
10177
|
confirmDefault: (e)=>{
|
|
@@ -10187,46 +10184,64 @@
|
|
|
10187
10184
|
const ue = createPrompt((e, t)=>{
|
|
10188
10185
|
const [r, n] = useState("idle");
|
|
10189
10186
|
const [s, i] = useState("");
|
|
10190
|
-
const o =
|
|
10191
|
-
const
|
|
10187
|
+
const [o, a] = useState();
|
|
10188
|
+
const c = makeTheme(le, e.theme);
|
|
10189
|
+
const l = usePrefix({
|
|
10192
10190
|
status: r,
|
|
10193
|
-
theme:
|
|
10191
|
+
theme: c
|
|
10194
10192
|
});
|
|
10195
|
-
const { yes:
|
|
10196
|
-
const
|
|
10197
|
-
const
|
|
10198
|
-
const
|
|
10193
|
+
const { yes: u, no: f } = c.keywords;
|
|
10194
|
+
const d = (u[0] ?? "").toLowerCase();
|
|
10195
|
+
const h = (f[0] ?? "").toLowerCase();
|
|
10196
|
+
const p = false === e.default ? `${d}/${c.style.confirmDefault(h)}` : `${c.style.confirmDefault(d)}/${h}`;
|
|
10199
10197
|
function boolToString(e) {
|
|
10200
|
-
return e ?
|
|
10201
|
-
}
|
|
10202
|
-
const { transformer:
|
|
10203
|
-
function getBooleanValue(
|
|
10204
|
-
const r =
|
|
10205
|
-
if ("" === r) return false !==
|
|
10206
|
-
if (
|
|
10207
|
-
if (
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10198
|
+
return e ? u : f;
|
|
10199
|
+
}
|
|
10200
|
+
const { transformer: b = boolToString } = e;
|
|
10201
|
+
function getBooleanValue(t) {
|
|
10202
|
+
const r = t.trim().toLowerCase();
|
|
10203
|
+
if ("" === r) return false !== e.default;
|
|
10204
|
+
if (u.toLowerCase().startsWith(r)) return true;
|
|
10205
|
+
if (f.toLowerCase().startsWith(r)) return false;
|
|
10206
|
+
if ("yes".startsWith(r)) return true;
|
|
10207
|
+
if ("no".startsWith(r)) return false;
|
|
10208
|
+
}
|
|
10209
|
+
useKeypress((o, l)=>{
|
|
10211
10210
|
if ("idle" !== r) return;
|
|
10212
10211
|
if (isEnterKey(o)) {
|
|
10213
|
-
const
|
|
10214
|
-
|
|
10212
|
+
const e = getBooleanValue(s);
|
|
10213
|
+
if (void 0 === e) {
|
|
10214
|
+
l.write(s);
|
|
10215
|
+
a(c.keywords.error({
|
|
10216
|
+
yes: u,
|
|
10217
|
+
no: f
|
|
10218
|
+
}));
|
|
10219
|
+
return;
|
|
10220
|
+
}
|
|
10221
|
+
i(b(e));
|
|
10215
10222
|
n("done");
|
|
10216
|
-
t(
|
|
10223
|
+
t(e);
|
|
10217
10224
|
} else if (isTabKey(o)) {
|
|
10218
|
-
const t = boolToString(!getBooleanValue(s
|
|
10219
|
-
|
|
10220
|
-
|
|
10225
|
+
const t = boolToString(!(getBooleanValue(s) ?? false !== e.default));
|
|
10226
|
+
l.clearLine(0);
|
|
10227
|
+
l.write(t);
|
|
10221
10228
|
i(t);
|
|
10222
|
-
} else
|
|
10229
|
+
} else {
|
|
10230
|
+
i(l.line);
|
|
10231
|
+
a(void 0);
|
|
10232
|
+
}
|
|
10223
10233
|
});
|
|
10224
|
-
let
|
|
10225
|
-
let
|
|
10226
|
-
if ("done" === r)
|
|
10227
|
-
else
|
|
10228
|
-
const
|
|
10229
|
-
|
|
10234
|
+
let m = s;
|
|
10235
|
+
let g = "";
|
|
10236
|
+
if ("done" === r) m = c.style.answer(s);
|
|
10237
|
+
else g = ` ${c.style.defaultAnswer(p)}`;
|
|
10238
|
+
const y = c.style.message(e.message, r);
|
|
10239
|
+
let w = "";
|
|
10240
|
+
if (o) w = c.style.error(o);
|
|
10241
|
+
return [
|
|
10242
|
+
`${l} ${y}${g} ${m}`,
|
|
10243
|
+
w
|
|
10244
|
+
];
|
|
10230
10245
|
});
|
|
10231
10246
|
const fe = /\d+/;
|
|
10232
10247
|
const de = {
|
|
@@ -10264,7 +10279,8 @@
|
|
|
10264
10279
|
function getSelectedChoice(e, t) {
|
|
10265
10280
|
let r;
|
|
10266
10281
|
const n = t.filter(isSelectableChoice);
|
|
10267
|
-
|
|
10282
|
+
const s = e.trim();
|
|
10283
|
+
r = n.find((t)=>t.key === e || t.key === s);
|
|
10268
10284
|
if (!r && fe.test(e)) {
|
|
10269
10285
|
const t = Number.parseInt(e, 10) - 1;
|
|
10270
10286
|
r = n[t];
|
|
@@ -10338,22 +10354,22 @@
|
|
|
10338
10354
|
});
|
|
10339
10355
|
const b = u.style.message(e.message, s);
|
|
10340
10356
|
if ("done" === s) return `${h} ${b} ${u.style.answer(o)}`;
|
|
10341
|
-
const m = n
|
|
10357
|
+
const [m] = getSelectedChoice(o, n);
|
|
10358
|
+
const g = n.map((e)=>{
|
|
10342
10359
|
if (Separator.isSeparator(e)) return ` ${e.separator}`;
|
|
10343
10360
|
const t = ` ${e.key}) ${e.name}`;
|
|
10344
|
-
if (e.key ===
|
|
10361
|
+
if (m && e.key === m.key) return u.style.highlight(t);
|
|
10345
10362
|
return t;
|
|
10346
10363
|
}).join("\n");
|
|
10347
|
-
let
|
|
10348
|
-
if (c)
|
|
10349
|
-
const [y] = getSelectedChoice(o, n);
|
|
10364
|
+
let y = "";
|
|
10365
|
+
if (c) y = u.style.error(c);
|
|
10350
10366
|
let w = "";
|
|
10351
|
-
if (!c &&
|
|
10367
|
+
if (!c && m?.description) w = u.style.description(m.description);
|
|
10352
10368
|
return [
|
|
10353
10369
|
`${h} ${b} ${o}`,
|
|
10354
10370
|
[
|
|
10355
|
-
m,
|
|
10356
10371
|
g,
|
|
10372
|
+
y,
|
|
10357
10373
|
w
|
|
10358
10374
|
].filter(Boolean).join("\n")
|
|
10359
10375
|
];
|
|
@@ -10391,7 +10407,7 @@
|
|
|
10391
10407
|
});
|
|
10392
10408
|
useKeypress((e, s)=>{
|
|
10393
10409
|
if (isEnterKey(e)) {
|
|
10394
|
-
const e = (o || r).toLowerCase();
|
|
10410
|
+
const e = (o.trim() || r).toLowerCase();
|
|
10395
10411
|
if ("h" !== e || c) {
|
|
10396
10412
|
const r = n.find((t)=>!Separator.isSeparator(t) && t.key === e);
|
|
10397
10413
|
if (r) {
|
|
@@ -10426,12 +10442,12 @@
|
|
|
10426
10442
|
g = m.map((e)=>{
|
|
10427
10443
|
if (Separator.isSeparator(e)) return ` ${e.separator}`;
|
|
10428
10444
|
const t = ` ${e.key}) ${e.name}`;
|
|
10429
|
-
if (e.key === o.toLowerCase()) return h.style.highlight(t);
|
|
10445
|
+
if (e.key === o.trim().toLowerCase()) return h.style.highlight(t);
|
|
10430
10446
|
return t;
|
|
10431
10447
|
}).join("\n");
|
|
10432
10448
|
}
|
|
10433
10449
|
let w = "";
|
|
10434
|
-
const v = n.find((e)=>!Separator.isSeparator(e) && e.key === o.toLowerCase());
|
|
10450
|
+
const v = n.find((e)=>!Separator.isSeparator(e) && e.key === o.trim().toLowerCase());
|
|
10435
10451
|
if (v) w = `${(0, d.styleText)("cyan", ">>")} ${v.name}`;
|
|
10436
10452
|
let S = "";
|
|
10437
10453
|
if (u) S = h.style.error(u);
|
|
@@ -10652,7 +10668,7 @@
|
|
|
10652
10668
|
g ? a.style.error(g) : "",
|
|
10653
10669
|
x
|
|
10654
10670
|
].filter(Boolean).join("\n").trimEnd();
|
|
10655
|
-
return `${E}${
|
|
10671
|
+
return `${E}${$}`;
|
|
10656
10672
|
});
|
|
10657
10673
|
const we = {
|
|
10658
10674
|
style: {
|
|
@@ -10701,7 +10717,7 @@
|
|
|
10701
10717
|
m = t.repeat(l.length);
|
|
10702
10718
|
} else if ("done" !== i) m = s.style.help(s.style.maskedText);
|
|
10703
10719
|
if ("done" === i) m = s.style.answer(m);
|
|
10704
|
-
else if (!e.mask) m +=
|
|
10720
|
+
else if (!e.mask) m += $;
|
|
10705
10721
|
const g = [
|
|
10706
10722
|
h,
|
|
10707
10723
|
p,
|
|
@@ -10913,16 +10929,16 @@
|
|
|
10913
10929
|
}
|
|
10914
10930
|
}
|
|
10915
10931
|
}
|
|
10916
|
-
const
|
|
10932
|
+
const ke = {
|
|
10917
10933
|
validationFailureMode: "keep",
|
|
10918
10934
|
style: {
|
|
10919
10935
|
loadingMessage: ()=>"Validating...",
|
|
10920
10936
|
waitingMessage: (e)=>`Press ${e} to launch your preferred editor.`
|
|
10921
10937
|
}
|
|
10922
10938
|
};
|
|
10923
|
-
const
|
|
10939
|
+
const Ie = createPrompt((e, t)=>{
|
|
10924
10940
|
const { waitForUserInput: r = true, file: { postfix: n = e.postfix ?? ".txt", ...s } = {}, validate: i = ()=>true } = e;
|
|
10925
|
-
const o = makeTheme(
|
|
10941
|
+
const o = makeTheme(ke, e.theme);
|
|
10926
10942
|
const [a, c] = useState("idle");
|
|
10927
10943
|
const [l = "", u] = useState(e.default);
|
|
10928
10944
|
const [f, d] = useState();
|
|
@@ -11077,7 +11093,7 @@
|
|
|
11077
11093
|
]);
|
|
11078
11094
|
const y = l[m];
|
|
11079
11095
|
useKeypress(async (e, r)=>{
|
|
11080
|
-
if (isEnterKey(e)) if (y) {
|
|
11096
|
+
if (isEnterKey(e)) if (y && "idle" === i) {
|
|
11081
11097
|
o("loading");
|
|
11082
11098
|
const e = await n(y.value);
|
|
11083
11099
|
o("idle");
|
|
@@ -11557,7 +11573,7 @@
|
|
|
11557
11573
|
c.removeListener("SIGINT", onForceClose);
|
|
11558
11574
|
c.setPrompt("");
|
|
11559
11575
|
c.output.unmute();
|
|
11560
|
-
c.output.write(
|
|
11576
|
+
c.output.write(N);
|
|
11561
11577
|
e.cursorTo(c.output, 0);
|
|
11562
11578
|
c.output.end();
|
|
11563
11579
|
c.close();
|
|
@@ -11627,7 +11643,7 @@
|
|
|
11627
11643
|
expand: me,
|
|
11628
11644
|
checkbox: ye,
|
|
11629
11645
|
password: ve,
|
|
11630
|
-
editor:
|
|
11646
|
+
editor: Ie,
|
|
11631
11647
|
search: Te
|
|
11632
11648
|
};
|
|
11633
11649
|
function createPromptModule(e) {
|