diff --git a/dist/vue-mess-detector.es.js b/dist/vue-mess-detector.es.js
index ec3d47b8..0d52baab 100644
--- a/dist/vue-mess-detector.es.js
+++ b/dist/vue-mess-detector.es.js
@@ -1,45 +1,45 @@
import ie from "node:fs/promises";
-import V from "node:path";
-import Hs, { format as Un, inspect as Vs } from "util";
-import Gs from "os";
+import zs, { format as Hn, inspect as Vs } from "util";
+import Hs from "os";
import Us from "yargs";
-import { normalize as qs, resolve as pe, dirname as ut, basename as Zs, extname as Ks, relative as Ys } from "path";
-import { readFileSync as Yt, statSync as qn, readdirSync as Js, writeFile as Qs } from "fs";
-import { notStrictEqual as Xs, strictEqual as er } from "assert";
-import { fileURLToPath as tr } from "url";
-import { parse as nr } from "@vue/compiler-sfc";
-import Jt from "node:fs";
-import { fileURLToPath as sr } from "node:url";
-function rr(t) {
+import { normalize as qs, resolve as de, dirname as it, basename as Gs, extname as Zs, relative as Ks } from "path";
+import { readFileSync as Jt, statSync as Un, readdirSync as Ys, writeFile as Js } from "fs";
+import { notStrictEqual as Qs, strictEqual as Xs } from "assert";
+import { fileURLToPath as er } from "url";
+import H from "node:path";
+import { parse as tr } from "@vue/compiler-sfc";
+import Qt from "node:fs";
+import { fileURLToPath as nr } from "node:url";
+function sr(t) {
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
-let Qt = [], Zn = 0;
+let Xt = [], qn = 0;
const P = (t, e) => {
- Zn >= e && Qt.push(t);
+ qn >= e && Xt.push(t);
};
P.WARN = 1;
P.INFO = 2;
P.DEBUG = 3;
P.reset = () => {
- Qt = [];
+ Xt = [];
};
P.setDebugLevel = (t) => {
- Zn = t;
+ qn = t;
};
P.warn = (t) => P(t, P.WARN);
P.info = (t) => P(t, P.INFO);
P.debug = (t) => P(t, P.DEBUG);
-P.debugMessages = () => Qt;
-var Xt = P, en = { exports: {} }, or = ({ onlyFirst: t = !1 } = {}) => {
+P.debugMessages = () => Xt;
+var en = P, tn = { exports: {} }, rr = ({ onlyFirst: t = !1 } = {}) => {
const e = [
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
].join("|");
return new RegExp(e, t ? void 0 : "g");
};
-const ur = or;
-var ir = (t) => typeof t == "string" ? t.replace(ur(), "") : t, tn = { exports: {} };
-const Kn = (t) => Number.isNaN(t) ? !1 : t >= 4352 && (t <= 4447 || // Hangul Jamo
+const or = rr;
+var ur = (t) => typeof t == "string" ? t.replace(or(), "") : t, nn = { exports: {} };
+const Gn = (t) => Number.isNaN(t) ? !1 : t >= 4352 && (t <= 4447 || // Hangul Jamo
t === 9001 || // LEFT-POINTING ANGLE BRACKET
t === 9002 || // RIGHT-POINTING ANGLE BRACKET
// CJK Radicals Supplement .. Enclosed CJK Letters and Months
@@ -55,71 +55,71 @@ t === 9002 || // RIGHT-POINTING ANGLE BRACKET
110592 <= t && t <= 110593 || // Enclosed Ideographic Supplement
127488 <= t && t <= 127569 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
131072 <= t && t <= 262141);
-tn.exports = Kn;
-tn.exports.default = Kn;
-var ar = tn.exports, cr = function() {
+nn.exports = Gn;
+nn.exports.default = Gn;
+var ir = nn.exports, ar = function() {
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
};
-const lr = ir, Dr = ar, fr = cr, Yn = (t) => {
- if (typeof t != "string" || t.length === 0 || (t = lr(t), t.length === 0))
+const cr = ur, lr = ir, Dr = ar, Zn = (t) => {
+ if (typeof t != "string" || t.length === 0 || (t = cr(t), t.length === 0))
return 0;
- t = t.replace(fr(), " ");
+ t = t.replace(Dr(), " ");
let e = 0;
for (let n = 0; n < t.length; n++) {
const s = t.codePointAt(n);
- s <= 31 || s >= 127 && s <= 159 || s >= 768 && s <= 879 || (s > 65535 && n++, e += Dr(s) ? 2 : 1);
+ s <= 31 || s >= 127 && s <= 159 || s >= 768 && s <= 879 || (s > 65535 && n++, e += lr(s) ? 2 : 1);
}
return e;
};
-en.exports = Yn;
-en.exports.default = Yn;
-var hr = en.exports;
-const fn = hr;
-function Ne(t) {
+tn.exports = Zn;
+tn.exports.default = Zn;
+var fr = tn.exports;
+const Dn = fr;
+function Le(t) {
return t ? /\u001b\[((?:\d*;){0,5}\d*)m/g : /\u001b\[(?:\d*;){0,5}\d*m/g;
}
function ee(t) {
- let e = Ne();
+ let e = Le();
return ("" + t).replace(e, "").split(`
`).reduce(function(r, o) {
- return fn(o) > r ? fn(o) : r;
+ return Dn(o) > r ? Dn(o) : r;
}, 0);
}
-function me(t, e) {
+function be(t, e) {
return Array(e + 1).join(t);
}
-function pr(t, e, n, s) {
+function hr(t, e, n, s) {
let r = ee(t);
if (e + 1 >= r) {
let o = e - r;
switch (s) {
case "right": {
- t = me(n, o) + t;
+ t = be(n, o) + t;
break;
}
case "center": {
let u = Math.ceil(o / 2), i = o - u;
- t = me(n, i) + t + me(n, u);
+ t = be(n, i) + t + be(n, u);
break;
}
default: {
- t = t + me(n, o);
+ t = t + be(n, o);
break;
}
}
}
return t;
}
-let he = {};
-function _e(t, e, n) {
- e = "\x1B[" + e + "m", n = "\x1B[" + n + "m", he[e] = { set: t, to: !0 }, he[n] = { set: t, to: !1 }, he[t] = { on: e, off: n };
+let pe = {};
+function ye(t, e, n) {
+ e = "\x1B[" + e + "m", n = "\x1B[" + n + "m", pe[e] = { set: t, to: !0 }, pe[n] = { set: t, to: !1 }, pe[t] = { on: e, off: n };
}
-_e("bold", 1, 22);
-_e("italics", 3, 23);
-_e("underline", 4, 24);
-_e("inverse", 7, 27);
-_e("strikethrough", 9, 29);
-function Jn(t, e) {
+ye("bold", 1, 22);
+ye("italics", 3, 23);
+ye("underline", 4, 24);
+ye("inverse", 7, 27);
+ye("strikethrough", 9, 29);
+function Kn(t, e) {
let n = e[1] ? parseInt(e[1].split(";")[0]) : 0;
if (n >= 30 && n <= 39 || n >= 90 && n <= 97) {
t.lastForegroundAdded = e[0];
@@ -134,52 +134,52 @@ function Jn(t, e) {
Object.prototype.hasOwnProperty.call(t, r) && delete t[r];
return;
}
- let s = he[e[0]];
+ let s = pe[e[0]];
s && (t[s.set] = s.to);
}
-function dr(t) {
- let e = Ne(!0), n = e.exec(t), s = {};
+function pr(t) {
+ let e = Le(!0), n = e.exec(t), s = {};
for (; n !== null; )
- Jn(s, n), n = e.exec(t);
+ Kn(s, n), n = e.exec(t);
return s;
}
-function Qn(t, e) {
+function Yn(t, e) {
let n = t.lastBackgroundAdded, s = t.lastForegroundAdded;
return delete t.lastBackgroundAdded, delete t.lastForegroundAdded, Object.keys(t).forEach(function(r) {
- t[r] && (e += he[r].off);
+ t[r] && (e += pe[r].off);
}), n && n != "\x1B[49m" && (e += "\x1B[49m"), s && s != "\x1B[39m" && (e += "\x1B[39m"), e;
}
-function gr(t, e) {
+function dr(t, e) {
let n = t.lastBackgroundAdded, s = t.lastForegroundAdded;
return delete t.lastBackgroundAdded, delete t.lastForegroundAdded, Object.keys(t).forEach(function(r) {
- t[r] && (e = he[r].on + e);
+ t[r] && (e = pe[r].on + e);
}), n && n != "\x1B[49m" && (e = n + e), s && s != "\x1B[39m" && (e = s + e), e;
}
-function mr(t, e) {
+function gr(t, e) {
if (t.length === ee(t))
return t.substr(0, e);
for (; ee(t) > e; )
t = t.slice(0, -1);
return t;
}
-function br(t, e) {
- let n = Ne(!0), s = t.split(Ne()), r = 0, o = 0, u = "", i, c = {};
+function mr(t, e) {
+ let n = Le(!0), s = t.split(Le()), r = 0, o = 0, u = "", i, l = {};
for (; o < e; ) {
i = n.exec(t);
- let h = s[r];
- if (r++, o + ee(h) > e && (h = mr(h, e - o)), u += h, o += ee(h), o < e) {
+ let p = s[r];
+ if (r++, o + ee(p) > e && (p = gr(p, e - o)), u += p, o += ee(p), o < e) {
if (!i)
break;
- u += i[0], Jn(c, i);
+ u += i[0], Kn(l, i);
}
}
- return Qn(c, u);
+ return Yn(l, u);
}
-function Fr(t, e, n) {
+function br(t, e, n) {
if (n = n || "…", ee(t) <= e)
return t;
e -= ee(n);
- let r = br(t, e);
+ let r = mr(t, e);
r += n;
const o = "\x1B]8;;\x07";
return t.includes(o) && !r.includes(o) && (r += o), r;
@@ -218,20 +218,20 @@ function Cr() {
head: []
};
}
-function Er(t, e) {
+function Fr(t, e) {
t = t || {}, e = e || Cr();
let n = Object.assign({}, e, t);
return n.chars = Object.assign({}, e.chars, t.chars), n.style = Object.assign({}, e.style, t.style), n;
}
-function xr(t, e) {
+function Er(t, e) {
let n = [], s = e.split(/(\s+)/g), r = [], o = 0, u;
for (let i = 0; i < s.length; i += 2) {
- let c = s[i], h = o + ee(c);
- o > 0 && u && (h += u.length), h > t ? (o !== 0 && n.push(r.join("")), r = [c], o = ee(c)) : (r.push(u || "", c), o = h), u = s[i + 1];
+ let l = s[i], p = o + ee(l);
+ o > 0 && u && (p += u.length), p > t ? (o !== 0 && n.push(r.join("")), r = [l], o = ee(l)) : (r.push(u || "", l), o = p), u = s[i + 1];
}
return o && n.push(r.join("")), n;
}
-function wr(t, e) {
+function xr(t, e) {
let n = [], s = "";
function r(u, i) {
for (s.length && i && (s += i), s += u; s.length > t; )
@@ -242,41 +242,41 @@ function wr(t, e) {
r(o[u], u && o[u - 1]);
return s.length && n.push(s), n;
}
-function _r(t, e, n = !0) {
+function wr(t, e, n = !0) {
let s = [];
e = e.split(`
`);
- const r = n ? xr : wr;
+ const r = n ? Er : xr;
for (let o = 0; o < e.length; o++)
s.push.apply(s, r(t, e[o]));
return s;
}
-function yr(t) {
+function _r(t) {
let e = {}, n = [];
for (let s = 0; s < t.length; s++) {
- let r = gr(e, t[s]);
- e = dr(r);
+ let r = dr(e, t[s]);
+ e = pr(r);
let o = Object.assign({}, e);
- n.push(Qn(o, r));
+ n.push(Yn(o, r));
}
return n;
}
-function Ar(t, e) {
+function yr(t, e) {
const n = "\x1B]", s = "\x07", r = ";";
return [n, "8", r, r, t || e, s, e, n, "8", r, r, s].join("");
}
-var Xn = {
+var Jn = {
strlen: ee,
- repeat: me,
- pad: pr,
- truncate: Fr,
- mergeOptions: Er,
- wordWrap: _r,
- colorizeLines: yr,
- hyperlink: Ar
-}, es = { exports: {} }, Me = { exports: {} }, ze = { exports: {} }, He = { exports: {} }, Ve = { exports: {} }, hn;
-function vr() {
- return hn || (hn = 1, function(t) {
+ repeat: be,
+ pad: hr,
+ truncate: br,
+ mergeOptions: Fr,
+ wordWrap: wr,
+ colorizeLines: _r,
+ hyperlink: yr
+}, Qn = { exports: {} }, ke = { exports: {} }, Ve = { exports: {} }, He = { exports: {} }, Ue = { exports: {} }, fn;
+function Ar() {
+ return fn || (fn = 1, function(t) {
var e = {};
t.exports = e;
var n = {
@@ -336,21 +336,21 @@ function vr() {
var r = n[s], o = e[s] = [];
o.open = "\x1B[" + r[0] + "m", o.close = "\x1B[" + r[1] + "m";
});
- }(Ve)), Ve.exports;
+ }(Ue)), Ue.exports;
}
-var Ge, pn;
-function $r() {
- return pn || (pn = 1, Ge = function(t, e) {
+var qe, hn;
+function vr() {
+ return hn || (hn = 1, qe = function(t, e) {
e = e || process.argv;
var n = e.indexOf("--"), s = /^-{1,2}/.test(t) ? "" : "--", r = e.indexOf(s + t);
return r !== -1 && (n === -1 ? !0 : r < n);
- }), Ge;
+ }), qe;
}
-var Ue, dn;
-function Br() {
- if (dn) return Ue;
- dn = 1;
- var t = Gs, e = $r(), n = process.env, s = void 0;
+var Ge, pn;
+function $r() {
+ if (pn) return Ge;
+ pn = 1;
+ var t = Hs, e = vr(), n = process.env, s = void 0;
e("no-color") || e("no-colors") || e("color=false") ? s = !1 : (e("color") || e("colors") || e("color=true") || e("color=always")) && (s = !0), "FORCE_COLOR" in n && (s = n.FORCE_COLOR.length === 0 || parseInt(n.FORCE_COLOR, 10) !== 0);
function r(i) {
return i === 0 ? !1 : {
@@ -369,15 +369,15 @@ function Br() {
return 2;
if (i && !i.isTTY && s !== !0)
return 0;
- var c = s ? 1 : 0;
+ var l = s ? 1 : 0;
if (process.platform === "win32") {
- var h = t.release().split(".");
- return Number(process.versions.node.split(".")[0]) >= 8 && Number(h[0]) >= 10 && Number(h[2]) >= 10586 ? Number(h[2]) >= 14931 ? 3 : 2 : 1;
+ var p = t.release().split(".");
+ return Number(process.versions.node.split(".")[0]) >= 8 && Number(p[0]) >= 10 && Number(p[2]) >= 10586 ? Number(p[2]) >= 14931 ? 3 : 2 : 1;
}
if ("CI" in n)
return ["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some(function(E) {
return E in n;
- }) || n.CI_NAME === "codeship" ? 1 : c;
+ }) || n.CI_NAME === "codeship" ? 1 : l;
if ("TEAMCITY_VERSION" in n)
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION) ? 1 : 0;
if ("TERM_PROGRAM" in n) {
@@ -391,21 +391,21 @@ function Br() {
return 2;
}
}
- return /-256(color)?$/i.test(n.TERM) ? 2 : /^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM) || "COLORTERM" in n ? 1 : (n.TERM === "dumb", c);
+ return /-256(color)?$/i.test(n.TERM) ? 2 : /^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM) || "COLORTERM" in n ? 1 : (n.TERM === "dumb", l);
}
function u(i) {
- var c = o(i);
- return r(c);
+ var l = o(i);
+ return r(l);
}
- return Ue = {
+ return Ge = {
supportsColor: u,
stdout: u(process.stdout),
stderr: u(process.stderr)
- }, Ue;
+ }, Ge;
}
-var qe = { exports: {} }, gn;
-function Sr() {
- return gn || (gn = 1, function(t) {
+var Ze = { exports: {} }, dn;
+function Br() {
+ return dn || (dn = 1, function(t) {
t.exports = function(n, s) {
var r = "";
n = n || "Run the trap, drop the bass", n = n.split("");
@@ -458,15 +458,15 @@ function Sr() {
};
return n.forEach(function(u) {
u = u.toLowerCase();
- var i = o[u] || [" "], c = Math.floor(Math.random() * i.length);
- typeof o[u] < "u" ? r += o[u][c] : r += u;
+ var i = o[u] || [" "], l = Math.floor(Math.random() * i.length);
+ typeof o[u] < "u" ? r += o[u][l] : r += u;
}), r;
};
- }(qe)), qe.exports;
+ }(Ze)), Ze.exports;
}
-var Ze = { exports: {} }, mn;
-function Or() {
- return mn || (mn = 1, function(t) {
+var Ke = { exports: {} }, gn;
+function Sr() {
+ return gn || (gn = 1, function(t) {
t.exports = function(n, s) {
n = n || " he is here ";
var r = {
@@ -589,46 +589,46 @@ function Or() {
" ҉"
]
}, o = [].concat(r.up, r.down, r.mid);
- function u(h) {
- var d = Math.floor(Math.random() * h);
+ function u(p) {
+ var d = Math.floor(Math.random() * p);
return d;
}
- function i(h) {
+ function i(p) {
var d = !1;
return o.filter(function(E) {
- d = E === h;
+ d = E === p;
}), d;
}
- function c(h, d) {
- var E = "", C, m;
- d = d || {}, d.up = typeof d.up < "u" ? d.up : !0, d.mid = typeof d.mid < "u" ? d.mid : !0, d.down = typeof d.down < "u" ? d.down : !0, d.size = typeof d.size < "u" ? d.size : "maxi", h = h.split("");
- for (m in h)
- if (!i(m)) {
- switch (E = E + h[m], C = { up: 0, down: 0, mid: 0 }, d.size) {
+ function l(p, d) {
+ var E = "", x, b;
+ d = d || {}, d.up = typeof d.up < "u" ? d.up : !0, d.mid = typeof d.mid < "u" ? d.mid : !0, d.down = typeof d.down < "u" ? d.down : !0, d.size = typeof d.size < "u" ? d.size : "maxi", p = p.split("");
+ for (b in p)
+ if (!i(b)) {
+ switch (E = E + p[b], x = { up: 0, down: 0, mid: 0 }, d.size) {
case "mini":
- C.up = u(8), C.mid = u(2), C.down = u(8);
+ x.up = u(8), x.mid = u(2), x.down = u(8);
break;
case "maxi":
- C.up = u(16) + 3, C.mid = u(4) + 1, C.down = u(64) + 3;
+ x.up = u(16) + 3, x.mid = u(4) + 1, x.down = u(64) + 3;
break;
default:
- C.up = u(8) + 1, C.mid = u(6) / 2, C.down = u(8) + 1;
+ x.up = u(8) + 1, x.mid = u(6) / 2, x.down = u(8) + 1;
break;
}
- var b = ["up", "mid", "down"];
- for (var g in b)
- for (var l = b[g], w = 0; w <= C[l]; w++)
- d[l] && (E = E + r[l][u(r[l].length)]);
+ var m = ["up", "mid", "down"];
+ for (var g in m)
+ for (var c = m[g], w = 0; w <= x[c]; w++)
+ d[c] && (E = E + r[c][u(r[c].length)]);
}
return E;
}
- return c(n, s);
+ return l(n, s);
};
- }(Ze)), Ze.exports;
+ }(Ke)), Ke.exports;
}
-var Ke = { exports: {} }, bn;
-function Rr() {
- return bn || (bn = 1, function(t) {
+var Ye = { exports: {} }, mn;
+function Or() {
+ return mn || (mn = 1, function(t) {
t.exports = function(e) {
return function(n, s, r) {
if (n === " ") return n;
@@ -642,20 +642,20 @@ function Rr() {
}
};
};
- }(Ke)), Ke.exports;
+ }(Ye)), Ye.exports;
}
-var Ye = { exports: {} }, Fn;
-function Nr() {
- return Fn || (Fn = 1, function(t) {
+var Je = { exports: {} }, bn;
+function Rr() {
+ return bn || (bn = 1, function(t) {
t.exports = function(e) {
return function(n, s, r) {
return s % 2 === 0 ? n : e.inverse(n);
};
};
- }(Ye)), Ye.exports;
+ }(Je)), Je.exports;
}
-var Je = { exports: {} }, Cn;
-function Lr() {
+var Qe = { exports: {} }, Cn;
+function Nr() {
return Cn || (Cn = 1, function(t) {
t.exports = function(e) {
var n = ["red", "yellow", "green", "blue", "magenta"];
@@ -663,11 +663,11 @@ function Lr() {
return s === " " ? s : e[n[r++ % n.length]](s);
};
};
- }(Je)), Je.exports;
+ }(Qe)), Qe.exports;
}
-var Qe = { exports: {} }, En;
-function jr() {
- return En || (En = 1, function(t) {
+var Xe = { exports: {} }, Fn;
+function Lr() {
+ return Fn || (Fn = 1, function(t) {
t.exports = function(e) {
var n = [
"underline",
@@ -692,114 +692,114 @@ function jr() {
return s === " " ? s : e[n[Math.round(Math.random() * (n.length - 2))]](s);
};
};
- }(Qe)), Qe.exports;
+ }(Xe)), Xe.exports;
}
-var xn;
-function Tr() {
- return xn || (xn = 1, function(t) {
+var En;
+function jr() {
+ return En || (En = 1, function(t) {
var e = {};
t.exports = e, e.themes = {};
- var n = Hs, s = e.styles = vr(), r = Object.defineProperties, o = new RegExp(/[\r\n]+/g);
- e.supportsColor = Br().supportsColor, typeof e.enabled > "u" && (e.enabled = e.supportsColor() !== !1), e.enable = function() {
+ var n = zs, s = e.styles = Ar(), r = Object.defineProperties, o = new RegExp(/[\r\n]+/g);
+ e.supportsColor = $r().supportsColor, typeof e.enabled > "u" && (e.enabled = e.supportsColor() !== !1), e.enable = function() {
e.enabled = !0;
}, e.disable = function() {
e.enabled = !1;
}, e.stripColors = e.strip = function(g) {
return ("" + g).replace(/\x1B\[\d+m/g, "");
- }, e.stylize = function(l, w) {
+ }, e.stylize = function(c, w) {
if (!e.enabled)
- return l + "";
+ return c + "";
var y = s[w];
- return !y && w in e ? e[w](l) : y.open + l + y.close;
+ return !y && w in e ? e[w](c) : y.open + c + y.close;
};
var u = /[|\\{}()[\]^$+*?.]/g, i = function(g) {
if (typeof g != "string")
throw new TypeError("Expected a string");
return g.replace(u, "\\$&");
};
- function c(g) {
- var l = function w() {
+ function l(g) {
+ var c = function w() {
return E.apply(w, arguments);
};
- return l._styles = g, l.__proto__ = d, l;
+ return c._styles = g, c.__proto__ = d, c;
}
- var h = function() {
+ var p = function() {
var g = {};
- return s.grey = s.gray, Object.keys(s).forEach(function(l) {
- s[l].closeRe = new RegExp(i(s[l].close), "g"), g[l] = {
+ return s.grey = s.gray, Object.keys(s).forEach(function(c) {
+ s[c].closeRe = new RegExp(i(s[c].close), "g"), g[c] = {
get: function() {
- return c(this._styles.concat(l));
+ return l(this._styles.concat(c));
}
};
}), g;
}(), d = r(function() {
- }, h);
+ }, p);
function E() {
- var g = Array.prototype.slice.call(arguments), l = g.map(function(O) {
+ var g = Array.prototype.slice.call(arguments), c = g.map(function(O) {
return O != null && O.constructor === String ? O : n.inspect(O);
}).join(" ");
- if (!e.enabled || !l)
- return l;
- for (var w = l.indexOf(`
-`) != -1, y = this._styles, S = y.length; S--; ) {
- var N = s[y[S]];
- l = N.open + l.replace(N.closeRe, N.open) + N.close, w && (l = l.replace(o, function(O) {
+ if (!e.enabled || !c)
+ return c;
+ for (var w = c.indexOf(`
+`) != -1, y = this._styles, B = y.length; B--; ) {
+ var N = s[y[B]];
+ c = N.open + c.replace(N.closeRe, N.open) + N.close, w && (c = c.replace(o, function(O) {
return N.close + O + N.open;
}));
}
- return l;
+ return c;
}
e.setTheme = function(g) {
if (typeof g == "string") {
console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");
return;
}
- for (var l in g)
+ for (var c in g)
(function(w) {
e[w] = function(y) {
if (typeof g[w] == "object") {
- var S = y;
+ var B = y;
for (var N in g[w])
- S = e[g[w][N]](S);
- return S;
+ B = e[g[w][N]](B);
+ return B;
}
return e[g[w]](y);
};
- })(l);
+ })(c);
};
- function C() {
+ function x() {
var g = {};
- return Object.keys(h).forEach(function(l) {
- g[l] = {
+ return Object.keys(p).forEach(function(c) {
+ g[c] = {
get: function() {
- return c([l]);
+ return l([c]);
}
};
}), g;
}
- var m = function(l, w) {
+ var b = function(c, w) {
var y = w.split("");
- return y = y.map(l), y.join("");
+ return y = y.map(c), y.join("");
};
- e.trap = Sr(), e.zalgo = Or(), e.maps = {}, e.maps.america = Rr()(e), e.maps.zebra = Nr()(e), e.maps.rainbow = Lr()(e), e.maps.random = jr()(e);
- for (var b in e.maps)
+ e.trap = Br(), e.zalgo = Sr(), e.maps = {}, e.maps.america = Or()(e), e.maps.zebra = Rr()(e), e.maps.rainbow = Nr()(e), e.maps.random = Lr()(e);
+ for (var m in e.maps)
(function(g) {
- e[g] = function(l) {
- return m(e.maps[g], l);
+ e[g] = function(c) {
+ return b(e.maps[g], c);
};
- })(b);
- r(e, C());
+ })(m);
+ r(e, x());
}(He)), He.exports;
}
-var wn;
-function Wr() {
- return wn || (wn = 1, function(t) {
- var e = Tr();
+var xn;
+function Tr() {
+ return xn || (xn = 1, function(t) {
+ var e = jr();
t.exports = e;
- }(ze)), ze.exports;
+ }(Ve)), Ve.exports;
}
-const { info: Ir, debug: ts } = Xt, G = Xn;
-let Mr = class Be {
+const { info: Wr, debug: Xn } = en, U = Jn;
+let Mr = class Se {
/**
* A representation of a cell within the table.
* Implementations must have `init` and `draw` methods,
@@ -828,11 +828,11 @@ let Mr = class Be {
mergeTableOptions(e, n) {
this.cells = n;
let s = this.options.chars || {}, r = e.chars, o = this.chars = {};
- Pr.forEach(function(c) {
- Xe(s, r, c, o);
+ kr.forEach(function(l) {
+ et(s, r, l, o);
}), this.truncate = this.options.truncate || e.truncate;
let u = this.options.style = this.options.style || {}, i = e.style;
- Xe(u, i, "padding-left", this), Xe(u, i, "padding-right", this), this.head = u.head || i.head, this.border = u.border || i.border, this.fixedWidth = e.colWidths[this.x], this.lines = this.computeLines(e), this.desiredWidth = G.strlen(this.content) + this.paddingLeft + this.paddingRight, this.desiredHeight = this.lines.length;
+ et(u, i, "padding-left", this), et(u, i, "padding-right", this), this.head = u.head || i.head, this.border = u.border || i.border, this.fixedWidth = e.colWidths[this.x], this.lines = this.computeLines(e), this.desiredWidth = U.strlen(this.content) + this.paddingLeft + this.paddingRight, this.desiredHeight = this.lines.length;
}
computeLines(e) {
const n = e.wordWrap || e.textWrap, { wordWrap: s = n } = this.options;
@@ -843,14 +843,14 @@ let Mr = class Be {
this.fixedWidth += e.colWidths[this.x + u], u++;
}
const { wrapOnWordBoundary: r = !0 } = e, { wrapOnWordBoundary: o = r } = this.options;
- return this.wrapLines(G.wordWrap(this.fixedWidth, this.content, o));
+ return this.wrapLines(U.wordWrap(this.fixedWidth, this.content, o));
}
return this.wrapLines(this.content.split(`
`));
}
wrapLines(e) {
- const n = G.colorizeLines(e);
- return this.href ? n.map((s) => G.hyperlink(this.href, s)) : n;
+ const n = U.colorizeLines(e);
+ return this.href ? n.map((s) => U.hyperlink(this.href, s)) : n;
}
/**
* Initializes the Cells data structure.
@@ -863,7 +863,7 @@ let Mr = class Be {
*/
init(e) {
let n = this.x, s = this.y;
- this.widths = e.colWidths.slice(n, n + this.colSpan), this.heights = e.rowHeights.slice(s, s + this.rowSpan), this.width = this.widths.reduce(yn, -1), this.height = this.heights.reduce(yn, -1), this.hAlign = this.options.hAlign || e.colAligns[n], this.vAlign = this.options.vAlign || e.rowAligns[s], this.drawRight = n + this.colSpan == e.colWidths.length;
+ this.widths = e.colWidths.slice(n, n + this.colSpan), this.heights = e.rowHeights.slice(s, s + this.rowSpan), this.width = this.widths.reduce(_n, -1), this.height = this.heights.reduce(_n, -1), this.hAlign = this.options.hAlign || e.colAligns[n], this.vAlign = this.options.vAlign || e.rowAligns[s], this.drawRight = n + this.colSpan == e.colWidths.length;
}
/**
* Draws the given line of the cell.
@@ -876,8 +876,8 @@ let Mr = class Be {
draw(e, n) {
if (e == "top") return this.drawTop(this.drawRight);
if (e == "bottom") return this.drawBottom(this.drawRight);
- let s = G.truncate(this.content, 10, this.truncate);
- e || Ir(`${this.y}-${this.x}: ${this.rowSpan - e}x${this.colSpan} Cell ${s}`);
+ let s = U.truncate(this.content, 10, this.truncate);
+ e || Wr(`${this.y}-${this.x}: ${this.rowSpan - e}x${this.colSpan} Cell ${s}`);
let r = Math.max(this.height - this.lines.length, 0), o;
switch (this.vAlign) {
case "center":
@@ -902,8 +902,8 @@ let Mr = class Be {
drawTop(e) {
let n = [];
return this.cells ? this.widths.forEach(function(s, r) {
- n.push(this._topLeftChar(r)), n.push(G.repeat(this.chars[this.y == 0 ? "top" : "mid"], s));
- }, this) : (n.push(this._topLeftChar(0)), n.push(G.repeat(this.chars[this.y == 0 ? "top" : "mid"], this.width))), e && n.push(this.chars[this.y == 0 ? "topRight" : "rightMid"]), this.wrapWithStyleColors("border", n.join(""));
+ n.push(this._topLeftChar(r)), n.push(U.repeat(this.chars[this.y == 0 ? "top" : "mid"], s));
+ }, this) : (n.push(this._topLeftChar(0)), n.push(U.repeat(this.chars[this.y == 0 ? "top" : "mid"], this.width))), e && n.push(this.chars[this.y == 0 ? "topRight" : "rightMid"]), this.wrapWithStyleColors("border", n.join(""));
}
_topLeftChar(e) {
let n = this.x + e, s;
@@ -911,18 +911,18 @@ let Mr = class Be {
s = n == 0 ? "topLeft" : e == 0 ? "topMid" : "top";
else if (n == 0)
s = "leftMid";
- else if (s = e == 0 ? "midMid" : "bottomMid", this.cells && (this.cells[this.y - 1][n] instanceof Be.ColSpanCell && (s = e == 0 ? "topMid" : "mid"), e == 0)) {
+ else if (s = e == 0 ? "midMid" : "bottomMid", this.cells && (this.cells[this.y - 1][n] instanceof Se.ColSpanCell && (s = e == 0 ? "topMid" : "mid"), e == 0)) {
let o = 1;
- for (; this.cells[this.y][n - o] instanceof Be.ColSpanCell; )
+ for (; this.cells[this.y][n - o] instanceof Se.ColSpanCell; )
o++;
- this.cells[this.y][n - o] instanceof Be.RowSpanCell && (s = "leftMid");
+ this.cells[this.y][n - o] instanceof Se.RowSpanCell && (s = "leftMid");
}
return this.chars[s];
}
wrapWithStyleColors(e, n) {
if (this[e] && this[e].length)
try {
- let s = Wr();
+ let s = Tr();
for (let r = this[e].length - 1; r >= 0; r--)
s = s[this[e][r]];
return s(n);
@@ -946,15 +946,15 @@ let Mr = class Be {
drawLine(e, n, s, r) {
let o = this.chars[this.x == 0 ? "left" : "middle"];
if (this.x && r && this.cells) {
- let C = this.cells[this.y + r][this.x - 1];
- for (; C instanceof it; )
- C = this.cells[C.y][C.x - 1];
- C instanceof at || (o = this.chars.rightMid);
+ let x = this.cells[this.y + r][this.x - 1];
+ for (; x instanceof at; )
+ x = this.cells[x.y][x.x - 1];
+ x instanceof ct || (o = this.chars.rightMid);
}
- let u = G.repeat(" ", this.paddingLeft), i = n ? this.chars.right : "", c = G.repeat(" ", this.paddingRight), h = this.lines[e], d = this.width - (this.paddingLeft + this.paddingRight);
- s && (h += this.truncate || "…");
- let E = G.truncate(h, d, this.truncate);
- return E = G.pad(E, d, " ", this.hAlign), E = u + E + c, this.stylizeLine(o, E, i);
+ let u = U.repeat(" ", this.paddingLeft), i = n ? this.chars.right : "", l = U.repeat(" ", this.paddingRight), p = this.lines[e], d = this.width - (this.paddingLeft + this.paddingRight);
+ s && (p += this.truncate || "…");
+ let E = U.truncate(p, d, this.truncate);
+ return E = U.pad(E, d, " ", this.hAlign), E = u + E + l, this.stylizeLine(o, E, i);
}
stylizeLine(e, n, s) {
return e = this.wrapWithStyleColors("border", e), s = this.wrapWithStyleColors("border", s), this.y === 0 && (n = this.wrapWithStyleColors("head", n)), e + n + s;
@@ -965,7 +965,7 @@ let Mr = class Be {
* @returns {String}
*/
drawBottom(e) {
- let n = this.chars[this.x == 0 ? "bottomLeft" : "bottomMid"], s = G.repeat(this.chars.bottom, this.width), r = e ? this.chars.bottomRight : "";
+ let n = this.chars[this.x == 0 ? "bottomLeft" : "bottomMid"], s = U.repeat(this.chars.bottom, this.width), r = e ? this.chars.bottomRight : "";
return this.wrapWithStyleColors("border", n + s + r);
}
/**
@@ -978,14 +978,14 @@ let Mr = class Be {
let s = this.chars[this.x == 0 ? "left" : "middle"];
if (this.x && n && this.cells) {
let u = this.cells[this.y + n][this.x - 1];
- for (; u instanceof it; )
+ for (; u instanceof at; )
u = this.cells[u.y][u.x - 1];
- u instanceof at || (s = this.chars.rightMid);
+ u instanceof ct || (s = this.chars.rightMid);
}
- let r = e ? this.chars.right : "", o = G.repeat(" ", this.width);
+ let r = e ? this.chars.right : "", o = U.repeat(" ", this.width);
return this.stylizeLine(s, o, r);
}
-}, it = class {
+}, at = class {
/**
* A Cell that doesn't do anything. It just draws empty lines.
* Used as a placeholder in column spanning.
@@ -994,13 +994,13 @@ let Mr = class Be {
constructor() {
}
draw(e) {
- return typeof e == "number" && ts(`${this.y}-${this.x}: 1x1 ColSpanCell`), "";
+ return typeof e == "number" && Xn(`${this.y}-${this.x}: 1x1 ColSpanCell`), "";
}
init() {
}
mergeTableOptions() {
}
-}, at = class {
+}, ct = class {
/**
* A placeholder Cell for a Cell that spans multiple rows.
* It delegates rendering to the original cell, but adds the appropriate offset.
@@ -1012,31 +1012,31 @@ let Mr = class Be {
}
init(e) {
let n = this.y, s = this.originalCell.y;
- this.cellOffset = n - s, this.offset = kr(e.rowHeights, s, this.cellOffset);
+ this.cellOffset = n - s, this.offset = Ir(e.rowHeights, s, this.cellOffset);
}
draw(e) {
- return e == "top" ? this.originalCell.draw(this.offset, this.cellOffset) : e == "bottom" ? this.originalCell.draw("bottom") : (ts(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`), this.originalCell.draw(this.offset + 1 + e));
+ return e == "top" ? this.originalCell.draw(this.offset, this.cellOffset) : e == "bottom" ? this.originalCell.draw("bottom") : (Xn(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`), this.originalCell.draw(this.offset + 1 + e));
}
mergeTableOptions() {
}
};
-function _n(...t) {
+function wn(...t) {
return t.filter((e) => e != null).shift();
}
-function Xe(t, e, n, s) {
+function et(t, e, n, s) {
let r = n.split("-");
- r.length > 1 ? (r[1] = r[1].charAt(0).toUpperCase() + r[1].substr(1), r = r.join(""), s[r] = _n(t[r], t[n], e[r], e[n])) : s[n] = _n(t[n], e[n]);
+ r.length > 1 ? (r[1] = r[1].charAt(0).toUpperCase() + r[1].substr(1), r = r.join(""), s[r] = wn(t[r], t[n], e[r], e[n])) : s[n] = wn(t[n], e[n]);
}
-function kr(t, e, n) {
+function Ir(t, e, n) {
let s = t[e];
for (let r = 1; r < n; r++)
s += 1 + t[e + r];
return s;
}
-function yn(t, e) {
+function _n(t, e) {
return t + e + 1;
}
-let Pr = [
+let kr = [
"top",
"top-mid",
"top-left",
@@ -1053,170 +1053,170 @@ let Pr = [
"right-mid",
"middle"
];
-Me.exports = Mr;
-Me.exports.ColSpanCell = it;
-Me.exports.RowSpanCell = at;
-var zr = Me.exports;
-const { warn: Hr, debug: Vr } = Xt, ct = zr, { ColSpanCell: Gr, RowSpanCell: Ur } = ct;
+ke.exports = Mr;
+ke.exports.ColSpanCell = at;
+ke.exports.RowSpanCell = ct;
+var Pr = ke.exports;
+const { warn: zr, debug: Vr } = en, lt = Pr, { ColSpanCell: Hr, RowSpanCell: Ur } = lt;
(function() {
- function t(m, b) {
- return m[b] > 0 ? t(m, b + 1) : b;
+ function t(b, m) {
+ return b[m] > 0 ? t(b, m + 1) : m;
}
- function e(m) {
- let b = {};
- m.forEach(function(g, l) {
+ function e(b) {
+ let m = {};
+ b.forEach(function(g, c) {
let w = 0;
g.forEach(function(y) {
- y.y = l, y.x = l ? t(b, w) : w;
- const S = y.rowSpan || 1, N = y.colSpan || 1;
- if (S > 1)
+ y.y = c, y.x = c ? t(m, w) : w;
+ const B = y.rowSpan || 1, N = y.colSpan || 1;
+ if (B > 1)
for (let O = 0; O < N; O++)
- b[y.x + O] = S;
+ m[y.x + O] = B;
w = y.x + N;
- }), Object.keys(b).forEach((y) => {
- b[y]--, b[y] < 1 && delete b[y];
+ }), Object.keys(m).forEach((y) => {
+ m[y]--, m[y] < 1 && delete m[y];
});
});
}
- function n(m) {
- let b = 0;
- return m.forEach(function(g) {
- g.forEach(function(l) {
- b = Math.max(b, l.x + (l.colSpan || 1));
+ function n(b) {
+ let m = 0;
+ return b.forEach(function(g) {
+ g.forEach(function(c) {
+ m = Math.max(m, c.x + (c.colSpan || 1));
});
- }), b;
+ }), m;
}
- function s(m) {
- return m.length;
+ function s(b) {
+ return b.length;
}
- function r(m, b) {
- let g = m.y, l = m.y - 1 + (m.rowSpan || 1), w = b.y, y = b.y - 1 + (b.rowSpan || 1), S = !(g > y || w > l), N = m.x, O = m.x - 1 + (m.colSpan || 1), De = b.x, ce = b.x - 1 + (b.colSpan || 1), oe = !(N > ce || De > O);
- return S && oe;
+ function r(b, m) {
+ let g = b.y, c = b.y - 1 + (b.rowSpan || 1), w = m.y, y = m.y - 1 + (m.rowSpan || 1), B = !(g > y || w > c), N = b.x, O = b.x - 1 + (b.colSpan || 1), De = m.x, ce = m.x - 1 + (m.colSpan || 1), oe = !(N > ce || De > O);
+ return B && oe;
}
- function o(m, b, g) {
- let l = Math.min(m.length - 1, g), w = { x: b, y: g };
- for (let y = 0; y <= l; y++) {
- let S = m[y];
- for (let N = 0; N < S.length; N++)
- if (r(w, S[N]))
+ function o(b, m, g) {
+ let c = Math.min(b.length - 1, g), w = { x: m, y: g };
+ for (let y = 0; y <= c; y++) {
+ let B = b[y];
+ for (let N = 0; N < B.length; N++)
+ if (r(w, B[N]))
return !0;
}
return !1;
}
- function u(m, b, g, l) {
- for (let w = g; w < l; w++)
- if (o(m, w, b))
+ function u(b, m, g, c) {
+ for (let w = g; w < c; w++)
+ if (o(b, w, m))
return !1;
return !0;
}
- function i(m) {
- m.forEach(function(b, g) {
- b.forEach(function(l) {
- for (let w = 1; w < l.rowSpan; w++) {
- let y = new Ur(l);
- y.x = l.x, y.y = l.y + w, y.colSpan = l.colSpan, h(y, m[g + w]);
+ function i(b) {
+ b.forEach(function(m, g) {
+ m.forEach(function(c) {
+ for (let w = 1; w < c.rowSpan; w++) {
+ let y = new Ur(c);
+ y.x = c.x, y.y = c.y + w, y.colSpan = c.colSpan, p(y, b[g + w]);
}
});
});
}
- function c(m) {
- for (let b = m.length - 1; b >= 0; b--) {
- let g = m[b];
- for (let l = 0; l < g.length; l++) {
- let w = g[l];
+ function l(b) {
+ for (let m = b.length - 1; m >= 0; m--) {
+ let g = b[m];
+ for (let c = 0; c < g.length; c++) {
+ let w = g[c];
for (let y = 1; y < w.colSpan; y++) {
- let S = new Gr();
- S.x = w.x + y, S.y = w.y, g.splice(l + 1, 0, S);
+ let B = new Hr();
+ B.x = w.x + y, B.y = w.y, g.splice(c + 1, 0, B);
}
}
}
}
- function h(m, b) {
+ function p(b, m) {
let g = 0;
- for (; g < b.length && b[g].x < m.x; )
+ for (; g < m.length && m[g].x < b.x; )
g++;
- b.splice(g, 0, m);
+ m.splice(g, 0, b);
}
- function d(m) {
- let b = s(m), g = n(m);
- Vr(`Max rows: ${b}; Max cols: ${g}`);
- for (let l = 0; l < b; l++)
+ function d(b) {
+ let m = s(b), g = n(b);
+ Vr(`Max rows: ${m}; Max cols: ${g}`);
+ for (let c = 0; c < m; c++)
for (let w = 0; w < g; w++)
- if (!o(m, w, l)) {
- let y = { x: w, y: l, colSpan: 1, rowSpan: 1 };
- for (w++; w < g && !o(m, w, l); )
+ if (!o(b, w, c)) {
+ let y = { x: w, y: c, colSpan: 1, rowSpan: 1 };
+ for (w++; w < g && !o(b, w, c); )
y.colSpan++, w++;
- let S = l + 1;
- for (; S < b && u(m, S, y.x, y.x + y.colSpan); )
- y.rowSpan++, S++;
- let N = new ct(y);
- N.x = y.x, N.y = y.y, Hr(`Missing cell at ${N.y}-${N.x}.`), h(N, m[l]);
+ let B = c + 1;
+ for (; B < m && u(b, B, y.x, y.x + y.colSpan); )
+ y.rowSpan++, B++;
+ let N = new lt(y);
+ N.x = y.x, N.y = y.y, zr(`Missing cell at ${N.y}-${N.x}.`), p(N, b[c]);
}
}
- function E(m) {
- return m.map(function(b) {
- if (!Array.isArray(b)) {
- let g = Object.keys(b)[0];
- b = b[g], Array.isArray(b) ? (b = b.slice(), b.unshift(g)) : b = [g, b];
+ function E(b) {
+ return b.map(function(m) {
+ if (!Array.isArray(m)) {
+ let g = Object.keys(m)[0];
+ m = m[g], Array.isArray(m) ? (m = m.slice(), m.unshift(g)) : m = [g, m];
}
- return b.map(function(g) {
- return new ct(g);
+ return m.map(function(g) {
+ return new lt(g);
});
});
}
- function C(m) {
- let b = E(m);
- return e(b), d(b), i(b), c(b), b;
+ function x(b) {
+ let m = E(b);
+ return e(m), d(m), i(m), l(m), m;
}
- es.exports = {
- makeTableLayout: C,
+ Qn.exports = {
+ makeTableLayout: x,
layoutTable: e,
addRowSpanCells: i,
maxWidth: n,
fillInTable: d,
- computeWidths: An("colSpan", "desiredWidth", "x", 1),
- computeHeights: An("rowSpan", "desiredHeight", "y", 1)
+ computeWidths: yn("colSpan", "desiredWidth", "x", 1),
+ computeHeights: yn("rowSpan", "desiredHeight", "y", 1)
};
})();
-function An(t, e, n, s) {
+function yn(t, e, n, s) {
return function(r, o) {
- let u = [], i = [], c = {};
- o.forEach(function(h) {
- h.forEach(function(d) {
+ let u = [], i = [], l = {};
+ o.forEach(function(p) {
+ p.forEach(function(d) {
(d[t] || 1) > 1 ? i.push(d) : u[d[n]] = Math.max(u[d[n]] || 0, d[e] || 0, s);
});
- }), r.forEach(function(h, d) {
- typeof h == "number" && (u[d] = h);
+ }), r.forEach(function(p, d) {
+ typeof p == "number" && (u[d] = p);
});
- for (let h = i.length - 1; h >= 0; h--) {
- let d = i[h], E = d[t], C = d[n], m = u[C], b = typeof r[C] == "number" ? 0 : 1;
- if (typeof m == "number")
+ for (let p = i.length - 1; p >= 0; p--) {
+ let d = i[p], E = d[t], x = d[n], b = u[x], m = typeof r[x] == "number" ? 0 : 1;
+ if (typeof b == "number")
for (let g = 1; g < E; g++)
- m += 1 + u[C + g], typeof r[C + g] != "number" && b++;
+ b += 1 + u[x + g], typeof r[x + g] != "number" && m++;
else
- m = e === "desiredWidth" ? d.desiredWidth - 1 : 1, (!c[C] || c[C] < m) && (c[C] = m);
- if (d[e] > m) {
+ b = e === "desiredWidth" ? d.desiredWidth - 1 : 1, (!l[x] || l[x] < b) && (l[x] = b);
+ if (d[e] > b) {
let g = 0;
- for (; b > 0 && d[e] > m; ) {
- if (typeof r[C + g] != "number") {
- let l = Math.round((d[e] - m) / b);
- m += l, u[C + g] += l, b--;
+ for (; m > 0 && d[e] > b; ) {
+ if (typeof r[x + g] != "number") {
+ let c = Math.round((d[e] - b) / m);
+ b += c, u[x + g] += c, m--;
}
g++;
}
}
}
- Object.assign(r, u, c);
- for (let h = 0; h < r.length; h++)
- r[h] = Math.max(s, r[h] || 0);
+ Object.assign(r, u, l);
+ for (let p = 0; p < r.length; p++)
+ r[p] = Math.max(s, r[p] || 0);
};
}
-var qr = es.exports;
-const se = Xt, Zr = Xn, et = qr;
-let ns = class extends Array {
+var qr = Qn.exports;
+const se = en, Gr = Jn, tt = qr;
+let es = class extends Array {
constructor(e) {
super();
- const n = Zr.mergeOptions(e);
+ const n = Gr.mergeOptions(e);
if (Object.defineProperty(this, "options", {
value: n,
enumerable: n.debug
@@ -1244,12 +1244,12 @@ let ns = class extends Array {
toString() {
let e = this, n = this.options.head && this.options.head.length;
n ? (e = [this.options.head], this.length && e.push.apply(e, this)) : this.options.style.head = [];
- let s = et.makeTableLayout(e);
+ let s = tt.makeTableLayout(e);
s.forEach(function(o) {
o.forEach(function(u) {
u.mergeTableOptions(this.options, s);
}, this);
- }, this), et.computeWidths(this.options.colWidths, s), et.computeHeights(this.options.rowHeights, s), s.forEach(function(o) {
+ }, this), tt.computeWidths(this.options.colWidths, s), tt.computeHeights(this.options.rowHeights, s), s.forEach(function(o) {
o.forEach(function(u) {
u.init(this.options);
}, this);
@@ -1257,10 +1257,10 @@ let ns = class extends Array {
let r = [];
for (let o = 0; o < s.length; o++) {
let u = s[o], i = this.options.rowHeights[o];
- (o === 0 || !this.options.style.compact || o == 1 && n) && tt(u, "top", r);
- for (let c = 0; c < i; c++)
- tt(u, c, r);
- o + 1 == s.length && tt(u, "bottom", r);
+ (o === 0 || !this.options.style.compact || o == 1 && n) && nt(u, "top", r);
+ for (let l = 0; l < i; l++)
+ nt(u, l, r);
+ o + 1 == s.length && nt(u, "bottom", r);
}
return r.join(`
`);
@@ -1270,8 +1270,8 @@ let ns = class extends Array {
`)[0].length;
}
};
-ns.reset = () => se.reset();
-function tt(t, e, n) {
+es.reset = () => se.reset();
+function nt(t, e, n) {
let s = [];
t.forEach(function(o) {
s.push(o.draw(e));
@@ -1279,34 +1279,34 @@ function tt(t, e, n) {
let r = s.join("");
r.length && n.push(r);
}
-var Kr = ns, Yr = Kr;
-const Jr = /* @__PURE__ */ rr(Yr);
+var Zr = es, Kr = Zr;
+const Yr = /* @__PURE__ */ sr(Kr);
class Fe extends Error {
constructor(e) {
super(e || "yargs error"), this.name = "YError", Error.captureStackTrace && Error.captureStackTrace(this, Fe);
}
}
-function ss() {
- return Qr() ? 0 : 1;
+function ts() {
+ return Jr() ? 0 : 1;
}
-function Qr() {
- return Xr() && !process.defaultApp;
+function Jr() {
+ return Qr() && !process.defaultApp;
}
-function Xr() {
+function Qr() {
return !!process.versions.electron;
}
-function eo(t) {
- return t.slice(ss() + 1);
+function Xr(t) {
+ return t.slice(ts() + 1);
}
-function to() {
- return process.argv[ss()];
+function eo() {
+ return process.argv[ts()];
}
/**
* @license
* Copyright (c) 2016, Contributors
* SPDX-License-Identifier: ISC
*/
-function be(t) {
+function Ce(t) {
if (t !== t.toLowerCase() && t !== t.toUpperCase() || (t = t.toLowerCase()), t.indexOf("-") === -1 && t.indexOf("_") === -1)
return t;
{
@@ -1319,7 +1319,7 @@ function be(t) {
return n;
}
}
-function rs(t, e) {
+function ns(t, e) {
const n = t.toLowerCase();
e = e || "-";
let s = "";
@@ -1329,7 +1329,7 @@ function rs(t, e) {
}
return s;
}
-function os(t) {
+function ss(t) {
return t == null ? !1 : typeof t == "number" || /^0x[0-9a-f]+$/i.test(t) ? !0 : /^0[^.]/.test(t) ? !1 : /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t);
}
/**
@@ -1337,7 +1337,7 @@ function os(t) {
* Copyright (c) 2016, Contributors
* SPDX-License-Identifier: ISC
*/
-function no(t) {
+function to(t) {
if (Array.isArray(t))
return t.map((u) => typeof u != "string" ? u + "" : u);
t = t.trim();
@@ -1357,17 +1357,17 @@ function no(t) {
* Copyright (c) 2016, Contributors
* SPDX-License-Identifier: ISC
*/
-var Y;
+var K;
(function(t) {
t.BOOLEAN = "boolean", t.STRING = "string", t.NUMBER = "number", t.ARRAY = "array";
-})(Y || (Y = {}));
+})(K || (K = {}));
/**
* @license
* Copyright (c) 2016, Contributors
* SPDX-License-Identifier: ISC
*/
let ne;
-class so {
+class no {
constructor(e) {
ne = e;
}
@@ -1389,7 +1389,7 @@ class so {
number: void 0,
__: void 0,
key: void 0
- }, n), r = no(e), o = typeof e == "string", u = ro(Object.assign(/* @__PURE__ */ Object.create(null), s.alias)), i = Object.assign({
+ }, n), r = to(e), o = typeof e == "string", u = so(Object.assign(/* @__PURE__ */ Object.create(null), s.alias)), i = Object.assign({
"boolean-negation": !0,
"camel-case-expansion": !0,
"combine-arrays": !1,
@@ -1408,7 +1408,7 @@ class so {
"strip-aliased": !1,
"strip-dashed": !1,
"unknown-options-as-args": !1
- }, s.configuration), c = Object.assign(/* @__PURE__ */ Object.create(null), s.default), h = s.configObjects || [], d = s.envPrefix, E = i["populate--"], C = E ? "--" : "_", m = /* @__PURE__ */ Object.create(null), b = /* @__PURE__ */ Object.create(null), g = s.__ || ne.format, l = {
+ }, s.configuration), l = Object.assign(/* @__PURE__ */ Object.create(null), s.default), p = s.configObjects || [], d = s.envPrefix, E = i["populate--"], x = E ? "--" : "_", b = /* @__PURE__ */ Object.create(null), m = /* @__PURE__ */ Object.create(null), g = s.__ || ne.format, c = {
aliases: /* @__PURE__ */ Object.create(null),
arrays: /* @__PURE__ */ Object.create(null),
bools: /* @__PURE__ */ Object.create(null),
@@ -1422,83 +1422,83 @@ class so {
keys: []
}, w = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/, y = new RegExp("^--" + i["negation-prefix"] + "(.+)");
[].concat(s.array || []).filter(Boolean).forEach(function(a) {
- const f = typeof a == "object" ? a.key : a, F = Object.keys(a).map(function(p) {
+ const f = typeof a == "object" ? a.key : a, C = Object.keys(a).map(function(h) {
return {
boolean: "bools",
string: "strings",
number: "numbers"
- }[p];
+ }[h];
}).filter(Boolean).pop();
- F && (l[F][f] = !0), l.arrays[f] = !0, l.keys.push(f);
+ C && (c[C][f] = !0), c.arrays[f] = !0, c.keys.push(f);
}), [].concat(s.boolean || []).filter(Boolean).forEach(function(a) {
- l.bools[a] = !0, l.keys.push(a);
+ c.bools[a] = !0, c.keys.push(a);
}), [].concat(s.string || []).filter(Boolean).forEach(function(a) {
- l.strings[a] = !0, l.keys.push(a);
+ c.strings[a] = !0, c.keys.push(a);
}), [].concat(s.number || []).filter(Boolean).forEach(function(a) {
- l.numbers[a] = !0, l.keys.push(a);
+ c.numbers[a] = !0, c.keys.push(a);
}), [].concat(s.count || []).filter(Boolean).forEach(function(a) {
- l.counts[a] = !0, l.keys.push(a);
+ c.counts[a] = !0, c.keys.push(a);
}), [].concat(s.normalize || []).filter(Boolean).forEach(function(a) {
- l.normalize[a] = !0, l.keys.push(a);
+ c.normalize[a] = !0, c.keys.push(a);
}), typeof s.narg == "object" && Object.entries(s.narg).forEach(([a, f]) => {
- typeof f == "number" && (l.nargs[a] = f, l.keys.push(a));
+ typeof f == "number" && (c.nargs[a] = f, c.keys.push(a));
}), typeof s.coerce == "object" && Object.entries(s.coerce).forEach(([a, f]) => {
- typeof f == "function" && (l.coercions[a] = f, l.keys.push(a));
+ typeof f == "function" && (c.coercions[a] = f, c.keys.push(a));
}), typeof s.config < "u" && (Array.isArray(s.config) || typeof s.config == "string" ? [].concat(s.config).filter(Boolean).forEach(function(a) {
- l.configs[a] = !0;
+ c.configs[a] = !0;
}) : typeof s.config == "object" && Object.entries(s.config).forEach(([a, f]) => {
- (typeof f == "boolean" || typeof f == "function") && (l.configs[a] = f);
- })), Ts(s.key, u, s.default, l.arrays), Object.keys(c).forEach(function(a) {
- (l.aliases[a] || []).forEach(function(f) {
- c[f] = c[a];
+ (typeof f == "boolean" || typeof f == "function") && (c.configs[a] = f);
+ })), js(s.key, u, s.default, c.arrays), Object.keys(l).forEach(function(a) {
+ (c.aliases[a] || []).forEach(function(f) {
+ l[f] = l[a];
});
});
- let S = null;
- zs();
+ let B = null;
+ Ps();
let N = [];
const O = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }), De = {};
for (let a = 0; a < r.length; a++) {
- const f = r[a], F = f.replace(/^-{3,}/, "---");
- let p, D, _, x, A, I;
- if (f !== "--" && /^-/.test(f) && ve(f))
+ const f = r[a], C = f.replace(/^-{3,}/, "---");
+ let h, D, _, F, A, M;
+ if (f !== "--" && /^-/.test(f) && $e(f))
ce(f);
- else if (F.match(/^---+(=|$)/)) {
+ else if (C.match(/^---+(=|$)/)) {
ce(f);
continue;
} else if (f.match(/^--.+=/) || !i["short-option-groups"] && f.match(/^-.+=/))
- x = f.match(/^--?([^=]+)=([\s\S]*)$/), x !== null && Array.isArray(x) && x.length >= 3 && ($(x[1], l.arrays) ? a = q(a, x[1], r, x[2]) : $(x[1], l.nargs) !== !1 ? a = oe(a, x[1], r, x[2]) : L(x[1], x[2], !0));
+ F = f.match(/^--?([^=]+)=([\s\S]*)$/), F !== null && Array.isArray(F) && F.length >= 3 && ($(F[1], c.arrays) ? a = fe(a, F[1], r, F[2]) : $(F[1], c.nargs) !== !1 ? a = oe(a, F[1], r, F[2]) : L(F[1], F[2], !0));
else if (f.match(y) && i["boolean-negation"])
- x = f.match(y), x !== null && Array.isArray(x) && x.length >= 2 && (D = x[1], L(D, $(D, l.arrays) ? [!1] : !1));
+ F = f.match(y), F !== null && Array.isArray(F) && F.length >= 2 && (D = F[1], L(D, $(D, c.arrays) ? [!1] : !1));
else if (f.match(/^--.+/) || !i["short-option-groups"] && f.match(/^-[^-]+/))
- x = f.match(/^--?(.+)/), x !== null && Array.isArray(x) && x.length >= 2 && (D = x[1], $(D, l.arrays) ? a = q(a, D, r) : $(D, l.nargs) !== !1 ? a = oe(a, D, r) : (A = r[a + 1], A !== void 0 && (!A.match(/^-/) || A.match(w)) && !$(D, l.bools) && !$(D, l.counts) || /^(true|false)$/.test(A) ? (L(D, A), a++) : L(D, fe(D))));
+ F = f.match(/^--?(.+)/), F !== null && Array.isArray(F) && F.length >= 2 && (D = F[1], $(D, c.arrays) ? a = fe(a, D, r) : $(D, c.nargs) !== !1 ? a = oe(a, D, r) : (A = r[a + 1], A !== void 0 && (!A.match(/^-/) || A.match(w)) && !$(D, c.bools) && !$(D, c.counts) || /^(true|false)$/.test(A) ? (L(D, A), a++) : L(D, he(D))));
else if (f.match(/^-.\..+=/))
- x = f.match(/^-([^=]+)=([\s\S]*)$/), x !== null && Array.isArray(x) && x.length >= 3 && L(x[1], x[2]);
+ F = f.match(/^-([^=]+)=([\s\S]*)$/), F !== null && Array.isArray(F) && F.length >= 3 && L(F[1], F[2]);
else if (f.match(/^-.\..+/) && !f.match(w))
- A = r[a + 1], x = f.match(/^-(.\..+)/), x !== null && Array.isArray(x) && x.length >= 2 && (D = x[1], A !== void 0 && !A.match(/^-/) && !$(D, l.bools) && !$(D, l.counts) ? (L(D, A), a++) : L(D, fe(D)));
+ A = r[a + 1], F = f.match(/^-(.\..+)/), F !== null && Array.isArray(F) && F.length >= 2 && (D = F[1], A !== void 0 && !A.match(/^-/) && !$(D, c.bools) && !$(D, c.counts) ? (L(D, A), a++) : L(D, he(D)));
else if (f.match(/^-[^-]+/) && !f.match(w)) {
- _ = f.slice(1, -1).split(""), p = !1;
+ _ = f.slice(1, -1).split(""), h = !1;
for (let z = 0; z < _.length; z++) {
if (A = f.slice(z + 2), _[z + 1] && _[z + 1] === "=") {
- I = f.slice(z + 3), D = _[z], $(D, l.arrays) ? a = q(a, D, r, I) : $(D, l.nargs) !== !1 ? a = oe(a, D, r, I) : L(D, I), p = !0;
+ M = f.slice(z + 3), D = _[z], $(D, c.arrays) ? a = fe(a, D, r, M) : $(D, c.nargs) !== !1 ? a = oe(a, D, r, M) : L(D, M), h = !0;
break;
}
if (A === "-") {
L(_[z], A);
continue;
}
- if (/[A-Za-z]/.test(_[z]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(A) && $(A, l.bools) === !1) {
- L(_[z], A), p = !0;
+ if (/[A-Za-z]/.test(_[z]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(A) && $(A, c.bools) === !1) {
+ L(_[z], A), h = !0;
break;
}
if (_[z + 1] && _[z + 1].match(/\W/)) {
- L(_[z], A), p = !0;
+ L(_[z], A), h = !0;
break;
} else
- L(_[z], fe(_[z]));
+ L(_[z], he(_[z]));
}
- D = f.slice(-1)[0], !p && D !== "-" && ($(D, l.arrays) ? a = q(a, D, r) : $(D, l.nargs) !== !1 ? a = oe(a, D, r) : (A = r[a + 1], A !== void 0 && (!/^(-|--)[^-]/.test(A) || A.match(w)) && !$(D, l.bools) && !$(D, l.counts) || /^(true|false)$/.test(A) ? (L(D, A), a++) : L(D, fe(D))));
- } else if (f.match(/^-[0-9]$/) && f.match(w) && $(f.slice(1), l.bools))
- D = f.slice(1), L(D, fe(D));
+ D = f.slice(-1)[0], !h && D !== "-" && ($(D, c.arrays) ? a = fe(a, D, r) : $(D, c.nargs) !== !1 ? a = oe(a, D, r) : (A = r[a + 1], A !== void 0 && (!/^(-|--)[^-]/.test(A) || A.match(w)) && !$(D, c.bools) && !$(D, c.counts) || /^(true|false)$/.test(A) ? (L(D, A), a++) : L(D, he(D))));
+ } else if (f.match(/^-[0-9]$/) && f.match(w) && $(f.slice(1), c.bools))
+ D = f.slice(1), L(D, he(D));
else if (f === "--") {
N = r.slice(a + 1);
break;
@@ -1508,70 +1508,70 @@ class so {
} else
ce(f);
}
- cn(O, !0), cn(O, !1), Rs(O), Ns(), ln(O, l.aliases, c, !0), Ls(O), i["set-placeholder-key"] && js(O), Object.keys(l.counts).forEach(function(a) {
- de(O, a.split(".")) || L(a, 0);
- }), E && N.length && (O[C] = []), N.forEach(function(a) {
- O[C].push(a);
+ an(O, !0), an(O, !1), Os(O), Rs(), cn(O, c.aliases, l, !0), Ns(O), i["set-placeholder-key"] && Ls(O), Object.keys(c.counts).forEach(function(a) {
+ ge(O, a.split(".")) || L(a, 0);
+ }), E && N.length && (O[x] = []), N.forEach(function(a) {
+ O[x].push(a);
}), i["camel-case-expansion"] && i["strip-dashed"] && Object.keys(O).filter((a) => a !== "--" && a.includes("-")).forEach((a) => {
delete O[a];
}), i["strip-aliased"] && [].concat(...Object.keys(u).map((a) => u[a])).forEach((a) => {
- i["camel-case-expansion"] && a.includes("-") && delete O[a.split(".").map((f) => be(f)).join(".")], delete O[a];
+ i["camel-case-expansion"] && a.includes("-") && delete O[a.split(".").map((f) => Ce(f)).join(".")], delete O[a];
});
function ce(a) {
- const f = Ae("_", a);
+ const f = ve("_", a);
(typeof f == "string" || typeof f == "number") && O._.push(f);
}
- function oe(a, f, F, p) {
- let D, _ = $(f, l.nargs);
+ function oe(a, f, C, h) {
+ let D, _ = $(f, c.nargs);
if (_ = typeof _ != "number" || isNaN(_) ? 1 : _, _ === 0)
- return te(p) || (S = Error(g("Argument unexpected for: %s", f))), L(f, fe(f)), a;
- let x = te(p) ? 0 : 1;
+ return te(h) || (B = Error(g("Argument unexpected for: %s", f))), L(f, he(f)), a;
+ let F = te(h) ? 0 : 1;
if (i["nargs-eats-options"])
- F.length - (a + 1) + x < _ && (S = Error(g("Not enough arguments following: %s", f))), x = _;
+ C.length - (a + 1) + F < _ && (B = Error(g("Not enough arguments following: %s", f))), F = _;
else {
- for (D = a + 1; D < F.length && (!F[D].match(/^-[^0-9]/) || F[D].match(w) || ve(F[D])); D++)
- x++;
- x < _ && (S = Error(g("Not enough arguments following: %s", f)));
+ for (D = a + 1; D < C.length && (!C[D].match(/^-[^0-9]/) || C[D].match(w) || $e(C[D])); D++)
+ F++;
+ F < _ && (B = Error(g("Not enough arguments following: %s", f)));
}
- let A = Math.min(x, _);
- for (!te(p) && A > 0 && (L(f, p), A--), D = a + 1; D < A + a + 1; D++)
- L(f, F[D]);
+ let A = Math.min(F, _);
+ for (!te(h) && A > 0 && (L(f, h), A--), D = a + 1; D < A + a + 1; D++)
+ L(f, C[D]);
return a + A;
}
- function q(a, f, F, p) {
- let D = [], _ = p || F[a + 1];
- const x = $(f, l.nargs);
- if ($(f, l.bools) && !/^(true|false)$/.test(_))
+ function fe(a, f, C, h) {
+ let D = [], _ = h || C[a + 1];
+ const F = $(f, c.nargs);
+ if ($(f, c.bools) && !/^(true|false)$/.test(_))
D.push(!0);
- else if (te(_) || te(p) && /^-/.test(_) && !w.test(_) && !ve(_)) {
- if (c[f] !== void 0) {
- const A = c[f];
+ else if (te(_) || te(h) && /^-/.test(_) && !w.test(_) && !$e(_)) {
+ if (l[f] !== void 0) {
+ const A = l[f];
D = Array.isArray(A) ? A : [A];
}
} else {
- te(p) || D.push(ke(f, p, !0));
- for (let A = a + 1; A < F.length && !(!i["greedy-arrays"] && D.length > 0 || x && typeof x == "number" && D.length >= x || (_ = F[A], /^-/.test(_) && !w.test(_) && !ve(_))); A++)
- a = A, D.push(ke(f, _, o));
+ te(h) || D.push(Pe(f, h, !0));
+ for (let A = a + 1; A < C.length && !(!i["greedy-arrays"] && D.length > 0 || F && typeof F == "number" && D.length >= F || (_ = C[A], /^-/.test(_) && !w.test(_) && !$e(_))); A++)
+ a = A, D.push(Pe(f, _, o));
}
- return typeof x == "number" && (x && D.length < x || isNaN(x) && D.length === 0) && (S = Error(g("Not enough arguments following: %s", f))), L(f, D), a;
+ return typeof F == "number" && (F && D.length < F || isNaN(F) && D.length === 0) && (B = Error(g("Not enough arguments following: %s", f))), L(f, D), a;
}
- function L(a, f, F = o) {
+ function L(a, f, C = o) {
if (/-/.test(a) && i["camel-case-expansion"]) {
- const _ = a.split(".").map(function(x) {
- return be(x);
+ const _ = a.split(".").map(function(F) {
+ return Ce(F);
}).join(".");
- an(a, _);
+ X(a, _);
}
- const p = ke(a, f, F), D = a.split(".");
- ge(O, D, p), l.aliases[a] && l.aliases[a].forEach(function(_) {
- const x = _.split(".");
- ge(O, x, p);
- }), D.length > 1 && i["dot-notation"] && (l.aliases[D[0]] || []).forEach(function(_) {
- let x = _.split(".");
+ const h = Pe(a, f, C), D = a.split(".");
+ me(O, D, h), c.aliases[a] && c.aliases[a].forEach(function(_) {
+ const F = _.split(".");
+ me(O, F, h);
+ }), D.length > 1 && i["dot-notation"] && (c.aliases[D[0]] || []).forEach(function(_) {
+ let F = _.split(".");
const A = [].concat(D);
- A.shift(), x = x.concat(A), (l.aliases[a] || []).includes(x.join(".")) || ge(O, x, p);
- }), $(a, l.normalize) && !$(a, l.arrays) && [a].concat(l.aliases[a] || []).forEach(function(x) {
- Object.defineProperty(De, x, {
+ A.shift(), F = F.concat(A), (c.aliases[a] || []).includes(F.join(".")) || me(O, F, h);
+ }), $(a, c.normalize) && !$(a, c.arrays) && [a].concat(c.aliases[a] || []).forEach(function(F) {
+ Object.defineProperty(De, F, {
enumerable: !0,
get() {
return f;
@@ -1582,203 +1582,203 @@ class so {
});
});
}
- function an(a, f) {
- l.aliases[a] && l.aliases[a].length || (l.aliases[a] = [f], m[f] = !0), l.aliases[f] && l.aliases[f].length || an(f, a);
+ function X(a, f) {
+ c.aliases[a] && c.aliases[a].length || (c.aliases[a] = [f], b[f] = !0), c.aliases[f] && c.aliases[f].length || X(f, a);
}
- function ke(a, f, F) {
- F && (f = oo(f)), ($(a, l.bools) || $(a, l.counts)) && typeof f == "string" && (f = f === "true");
- let p = Array.isArray(f) ? f.map(function(D) {
- return Ae(a, D);
- }) : Ae(a, f);
- return $(a, l.counts) && (te(p) || typeof p == "boolean") && (p = nt()), $(a, l.normalize) && $(a, l.arrays) && (Array.isArray(f) ? p = f.map((D) => ne.normalize(D)) : p = ne.normalize(f)), p;
+ function Pe(a, f, C) {
+ C && (f = ro(f)), ($(a, c.bools) || $(a, c.counts)) && typeof f == "string" && (f = f === "true");
+ let h = Array.isArray(f) ? f.map(function(D) {
+ return ve(a, D);
+ }) : ve(a, f);
+ return $(a, c.counts) && (te(h) || typeof h == "boolean") && (h = st()), $(a, c.normalize) && $(a, c.arrays) && (Array.isArray(f) ? h = f.map((D) => ne.normalize(D)) : h = ne.normalize(f)), h;
}
- function Ae(a, f) {
- return !i["parse-positional-numbers"] && a === "_" || !$(a, l.strings) && !$(a, l.bools) && !Array.isArray(f) && (os(f) && i["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${f}`))) || !te(f) && $(a, l.numbers)) && (f = Number(f)), f;
+ function ve(a, f) {
+ return !i["parse-positional-numbers"] && a === "_" || !$(a, c.strings) && !$(a, c.bools) && !Array.isArray(f) && (ss(f) && i["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${f}`))) || !te(f) && $(a, c.numbers)) && (f = Number(f)), f;
}
- function Rs(a) {
+ function Os(a) {
const f = /* @__PURE__ */ Object.create(null);
- ln(f, l.aliases, c), Object.keys(l.configs).forEach(function(F) {
- const p = a[F] || f[F];
- if (p)
+ cn(f, c.aliases, l), Object.keys(c.configs).forEach(function(C) {
+ const h = a[C] || f[C];
+ if (h)
try {
let D = null;
- const _ = ne.resolve(ne.cwd(), p), x = l.configs[F];
- if (typeof x == "function") {
+ const _ = ne.resolve(ne.cwd(), h), F = c.configs[C];
+ if (typeof F == "function") {
try {
- D = x(_);
+ D = F(_);
} catch (A) {
D = A;
}
if (D instanceof Error) {
- S = D;
+ B = D;
return;
}
} else
D = ne.require(_);
- Pe(D);
+ ze(D);
} catch (D) {
- D.name === "PermissionDenied" ? S = D : a[F] && (S = Error(g("Invalid JSON config file: %s", p)));
+ D.name === "PermissionDenied" ? B = D : a[C] && (B = Error(g("Invalid JSON config file: %s", h)));
}
});
}
- function Pe(a, f) {
- Object.keys(a).forEach(function(F) {
- const p = a[F], D = f ? f + "." + F : F;
- typeof p == "object" && p !== null && !Array.isArray(p) && i["dot-notation"] ? Pe(p, D) : (!de(O, D.split(".")) || $(D, l.arrays) && i["combine-arrays"]) && L(D, p);
+ function ze(a, f) {
+ Object.keys(a).forEach(function(C) {
+ const h = a[C], D = f ? f + "." + C : C;
+ typeof h == "object" && h !== null && !Array.isArray(h) && i["dot-notation"] ? ze(h, D) : (!ge(O, D.split(".")) || $(D, c.arrays) && i["combine-arrays"]) && L(D, h);
});
}
- function Ns() {
- typeof h < "u" && h.forEach(function(a) {
- Pe(a);
+ function Rs() {
+ typeof p < "u" && p.forEach(function(a) {
+ ze(a);
});
}
- function cn(a, f) {
+ function an(a, f) {
if (typeof d > "u")
return;
- const F = typeof d == "string" ? d : "", p = ne.env();
- Object.keys(p).forEach(function(D) {
- if (F === "" || D.lastIndexOf(F, 0) === 0) {
- const _ = D.split("__").map(function(x, A) {
- return A === 0 && (x = x.substring(F.length)), be(x);
+ const C = typeof d == "string" ? d : "", h = ne.env();
+ Object.keys(h).forEach(function(D) {
+ if (C === "" || D.lastIndexOf(C, 0) === 0) {
+ const _ = D.split("__").map(function(F, A) {
+ return A === 0 && (F = F.substring(C.length)), Ce(F);
});
- (f && l.configs[_.join(".")] || !f) && !de(a, _) && L(_.join("."), p[D]);
+ (f && c.configs[_.join(".")] || !f) && !ge(a, _) && L(_.join("."), h[D]);
}
});
}
- function Ls(a) {
+ function Ns(a) {
let f;
- const F = /* @__PURE__ */ new Set();
- Object.keys(a).forEach(function(p) {
- if (!F.has(p) && (f = $(p, l.coercions), typeof f == "function"))
+ const C = /* @__PURE__ */ new Set();
+ Object.keys(a).forEach(function(h) {
+ if (!C.has(h) && (f = $(h, c.coercions), typeof f == "function"))
try {
- const D = Ae(p, f(a[p]));
- [].concat(l.aliases[p] || [], p).forEach((_) => {
- F.add(_), a[_] = D;
+ const D = ve(h, f(a[h]));
+ [].concat(c.aliases[h] || [], h).forEach((_) => {
+ C.add(_), a[_] = D;
});
} catch (D) {
- S = D;
+ B = D;
}
});
}
- function js(a) {
- return l.keys.forEach((f) => {
+ function Ls(a) {
+ return c.keys.forEach((f) => {
~f.indexOf(".") || typeof a[f] > "u" && (a[f] = void 0);
}), a;
}
- function ln(a, f, F, p = !1) {
- Object.keys(F).forEach(function(D) {
- de(a, D.split(".")) || (ge(a, D.split("."), F[D]), p && (b[D] = !0), (f[D] || []).forEach(function(_) {
- de(a, _.split(".")) || ge(a, _.split("."), F[D]);
+ function cn(a, f, C, h = !1) {
+ Object.keys(C).forEach(function(D) {
+ ge(a, D.split(".")) || (me(a, D.split("."), C[D]), h && (m[D] = !0), (f[D] || []).forEach(function(_) {
+ ge(a, _.split(".")) || me(a, _.split("."), C[D]);
}));
});
}
- function de(a, f) {
- let F = a;
+ function ge(a, f) {
+ let C = a;
i["dot-notation"] || (f = [f.join(".")]), f.slice(0, -1).forEach(function(D) {
- F = F[D] || {};
+ C = C[D] || {};
});
- const p = f[f.length - 1];
- return typeof F != "object" ? !1 : p in F;
+ const h = f[f.length - 1];
+ return typeof C != "object" ? !1 : h in C;
}
- function ge(a, f, F) {
- let p = a;
- i["dot-notation"] || (f = [f.join(".")]), f.slice(0, -1).forEach(function(I) {
- I = vn(I), typeof p == "object" && p[I] === void 0 && (p[I] = {}), typeof p[I] != "object" || Array.isArray(p[I]) ? (Array.isArray(p[I]) ? p[I].push({}) : p[I] = [p[I], {}], p = p[I][p[I].length - 1]) : p = p[I];
+ function me(a, f, C) {
+ let h = a;
+ i["dot-notation"] || (f = [f.join(".")]), f.slice(0, -1).forEach(function(M) {
+ M = An(M), typeof h == "object" && h[M] === void 0 && (h[M] = {}), typeof h[M] != "object" || Array.isArray(h[M]) ? (Array.isArray(h[M]) ? h[M].push({}) : h[M] = [h[M], {}], h = h[M][h[M].length - 1]) : h = h[M];
});
- const D = vn(f[f.length - 1]), _ = $(f.join("."), l.arrays), x = Array.isArray(F);
+ const D = An(f[f.length - 1]), _ = $(f.join("."), c.arrays), F = Array.isArray(C);
let A = i["duplicate-arguments-array"];
- !A && $(D, l.nargs) && (A = !0, (!te(p[D]) && l.nargs[D] === 1 || Array.isArray(p[D]) && p[D].length === l.nargs[D]) && (p[D] = void 0)), F === nt() ? p[D] = nt(p[D]) : Array.isArray(p[D]) ? A && _ && x ? p[D] = i["flatten-duplicate-arrays"] ? p[D].concat(F) : (Array.isArray(p[D][0]) ? p[D] : [p[D]]).concat([F]) : !A && !!_ == !!x ? p[D] = F : p[D] = p[D].concat([F]) : p[D] === void 0 && _ ? p[D] = x ? F : [F] : A && !(p[D] === void 0 || $(D, l.counts) || $(D, l.bools)) ? p[D] = [p[D], F] : p[D] = F;
+ !A && $(D, c.nargs) && (A = !0, (!te(h[D]) && c.nargs[D] === 1 || Array.isArray(h[D]) && h[D].length === c.nargs[D]) && (h[D] = void 0)), C === st() ? h[D] = st(h[D]) : Array.isArray(h[D]) ? A && _ && F ? h[D] = i["flatten-duplicate-arrays"] ? h[D].concat(C) : (Array.isArray(h[D][0]) ? h[D] : [h[D]]).concat([C]) : !A && !!_ == !!F ? h[D] = C : h[D] = h[D].concat([C]) : h[D] === void 0 && _ ? h[D] = F ? C : [C] : A && !(h[D] === void 0 || $(D, c.counts) || $(D, c.bools)) ? h[D] = [h[D], C] : h[D] = C;
}
- function Ts(...a) {
+ function js(...a) {
a.forEach(function(f) {
- Object.keys(f || {}).forEach(function(F) {
- l.aliases[F] || (l.aliases[F] = [].concat(u[F] || []), l.aliases[F].concat(F).forEach(function(p) {
- if (/-/.test(p) && i["camel-case-expansion"]) {
- const D = be(p);
- D !== F && l.aliases[F].indexOf(D) === -1 && (l.aliases[F].push(D), m[D] = !0);
+ Object.keys(f || {}).forEach(function(C) {
+ c.aliases[C] || (c.aliases[C] = [].concat(u[C] || []), c.aliases[C].concat(C).forEach(function(h) {
+ if (/-/.test(h) && i["camel-case-expansion"]) {
+ const D = Ce(h);
+ D !== C && c.aliases[C].indexOf(D) === -1 && (c.aliases[C].push(D), b[D] = !0);
}
- }), l.aliases[F].concat(F).forEach(function(p) {
- if (p.length > 1 && /[A-Z]/.test(p) && i["camel-case-expansion"]) {
- const D = rs(p, "-");
- D !== F && l.aliases[F].indexOf(D) === -1 && (l.aliases[F].push(D), m[D] = !0);
+ }), c.aliases[C].concat(C).forEach(function(h) {
+ if (h.length > 1 && /[A-Z]/.test(h) && i["camel-case-expansion"]) {
+ const D = ns(h, "-");
+ D !== C && c.aliases[C].indexOf(D) === -1 && (c.aliases[C].push(D), b[D] = !0);
}
- }), l.aliases[F].forEach(function(p) {
- l.aliases[p] = [F].concat(l.aliases[F].filter(function(D) {
- return p !== D;
+ }), c.aliases[C].forEach(function(h) {
+ c.aliases[h] = [C].concat(c.aliases[C].filter(function(D) {
+ return h !== D;
}));
}));
});
});
}
function $(a, f) {
- const F = [].concat(l.aliases[a] || [], a), p = Object.keys(f), D = F.find((_) => p.includes(_));
+ const C = [].concat(c.aliases[a] || [], a), h = Object.keys(f), D = C.find((_) => h.includes(_));
return D ? f[D] : !1;
}
- function Dn(a) {
- const f = Object.keys(l);
- return [].concat(f.map((p) => l[p])).some(function(p) {
- return Array.isArray(p) ? p.includes(a) : p[a];
+ function ln(a) {
+ const f = Object.keys(c);
+ return [].concat(f.map((h) => c[h])).some(function(h) {
+ return Array.isArray(h) ? h.includes(a) : h[a];
});
}
- function Ws(a, ...f) {
- return [].concat(...f).some(function(p) {
- const D = a.match(p);
- return D && Dn(D[1]);
+ function Ts(a, ...f) {
+ return [].concat(...f).some(function(h) {
+ const D = a.match(h);
+ return D && ln(D[1]);
});
}
- function Is(a) {
+ function Ws(a) {
if (a.match(w) || !a.match(/^-[^-]+/))
return !1;
- let f = !0, F;
- const p = a.slice(1).split("");
- for (let D = 0; D < p.length; D++) {
- if (F = a.slice(D + 2), !Dn(p[D])) {
+ let f = !0, C;
+ const h = a.slice(1).split("");
+ for (let D = 0; D < h.length; D++) {
+ if (C = a.slice(D + 2), !ln(h[D])) {
f = !1;
break;
}
- if (p[D + 1] && p[D + 1] === "=" || F === "-" || /[A-Za-z]/.test(p[D]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(F) || p[D + 1] && p[D + 1].match(/\W/))
+ if (h[D + 1] && h[D + 1] === "=" || C === "-" || /[A-Za-z]/.test(h[D]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(C) || h[D + 1] && h[D + 1].match(/\W/))
break;
}
return f;
}
- function ve(a) {
+ function $e(a) {
return i["unknown-options-as-args"] && Ms(a);
}
function Ms(a) {
- return a = a.replace(/^-{3,}/, "--"), a.match(w) || Is(a) ? !1 : !Ws(a, /^-+([^=]+?)=[\s\S]*$/, y, /^-+([^=]+?)$/, /^-+([^=]+?)-$/, /^-+([^=]+?\d+)$/, /^-+([^=]+?)\W+.*$/);
+ return a = a.replace(/^-{3,}/, "--"), a.match(w) || Ws(a) ? !1 : !Ts(a, /^-+([^=]+?)=[\s\S]*$/, y, /^-+([^=]+?)$/, /^-+([^=]+?)-$/, /^-+([^=]+?\d+)$/, /^-+([^=]+?)\W+.*$/);
}
- function fe(a) {
- return !$(a, l.bools) && !$(a, l.counts) && `${a}` in c ? c[a] : ks(Ps(a));
+ function he(a) {
+ return !$(a, c.bools) && !$(a, c.counts) && `${a}` in l ? l[a] : Is(ks(a));
}
- function ks(a) {
+ function Is(a) {
return {
- [Y.BOOLEAN]: !0,
- [Y.STRING]: "",
- [Y.NUMBER]: void 0,
- [Y.ARRAY]: []
+ [K.BOOLEAN]: !0,
+ [K.STRING]: "",
+ [K.NUMBER]: void 0,
+ [K.ARRAY]: []
}[a];
}
- function Ps(a) {
- let f = Y.BOOLEAN;
- return $(a, l.strings) ? f = Y.STRING : $(a, l.numbers) ? f = Y.NUMBER : $(a, l.bools) ? f = Y.BOOLEAN : $(a, l.arrays) && (f = Y.ARRAY), f;
+ function ks(a) {
+ let f = K.BOOLEAN;
+ return $(a, c.strings) ? f = K.STRING : $(a, c.numbers) ? f = K.NUMBER : $(a, c.bools) ? f = K.BOOLEAN : $(a, c.arrays) && (f = K.ARRAY), f;
}
function te(a) {
return a === void 0;
}
- function zs() {
- Object.keys(l.counts).find((a) => $(a, l.arrays) ? (S = Error(g("Invalid configuration: %s, opts.count excludes opts.array.", a)), !0) : $(a, l.nargs) ? (S = Error(g("Invalid configuration: %s, opts.count excludes opts.narg.", a)), !0) : !1);
+ function Ps() {
+ Object.keys(c.counts).find((a) => $(a, c.arrays) ? (B = Error(g("Invalid configuration: %s, opts.count excludes opts.array.", a)), !0) : $(a, c.nargs) ? (B = Error(g("Invalid configuration: %s, opts.count excludes opts.narg.", a)), !0) : !1);
}
return {
- aliases: Object.assign({}, l.aliases),
+ aliases: Object.assign({}, c.aliases),
argv: Object.assign(De, O),
configuration: i,
- defaulted: Object.assign({}, b),
- error: S,
- newAliases: Object.assign({}, m)
+ defaulted: Object.assign({}, m),
+ error: B,
+ newAliases: Object.assign({}, b)
};
}
}
-function ro(t) {
+function so(t) {
const e = [], n = /* @__PURE__ */ Object.create(null);
let s = !0;
for (Object.keys(t).forEach(function(r) {
@@ -1795,20 +1795,20 @@ function ro(t) {
}
}
return e.forEach(function(r) {
- r = r.filter(function(u, i, c) {
- return c.indexOf(u) === i;
+ r = r.filter(function(u, i, l) {
+ return l.indexOf(u) === i;
});
const o = r.pop();
o !== void 0 && typeof o == "string" && (n[o] = r);
}), n;
}
-function nt(t) {
+function st(t) {
return t !== void 0 ? t + 1 : 1;
}
-function vn(t) {
+function An(t) {
return t === "__proto__" ? "___proto___" : t;
}
-function oo(t) {
+function ro(t) {
return typeof t == "string" && (t[0] === "'" || t[0] === '"') && t[t.length - 1] === t[0] ? t.substring(1, t.length - 1) : t;
}
/**
@@ -1819,39 +1819,39 @@ function oo(t) {
* Copyright (c) 2016, Contributors
* SPDX-License-Identifier: ISC
*/
-var st, rt, ot;
-const $n = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12, Bn = (rt = (st = process == null ? void 0 : process.versions) === null || st === void 0 ? void 0 : st.node) !== null && rt !== void 0 ? rt : (ot = process == null ? void 0 : process.version) === null || ot === void 0 ? void 0 : ot.slice(1);
-if (Bn && Number(Bn.match(/^([^.]+)/)[1]) < $n)
- throw Error(`yargs parser supports a minimum Node.js version of ${$n}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
-const uo = process ? process.env : {}, us = new so({
+var rt, ot, ut;
+const vn = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12, $n = (ot = (rt = process == null ? void 0 : process.versions) === null || rt === void 0 ? void 0 : rt.node) !== null && ot !== void 0 ? ot : (ut = process == null ? void 0 : process.version) === null || ut === void 0 ? void 0 : ut.slice(1);
+if ($n && Number($n.match(/^([^.]+)/)[1]) < vn)
+ throw Error(`yargs parser supports a minimum Node.js version of ${vn}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
+const oo = process ? process.env : {}, rs = new no({
cwd: process.cwd,
- env: () => uo,
- format: Un,
+ env: () => oo,
+ format: Hn,
normalize: qs,
- resolve: pe,
+ resolve: de,
// TODO: figure out a way to combine ESM and CJS coverage, such that
// we can exercise all the lines below:
require: (t) => {
if (typeof require < "u")
return require(t);
if (t.match(/\.json$/))
- return JSON.parse(Yt(t, "utf8"));
+ return JSON.parse(Jt(t, "utf8"));
throw Error("only .json config files are supported in ESM");
}
-}), ye = function(e, n) {
- return us.parse(e.slice(), n).argv;
+}), Ae = function(e, n) {
+ return rs.parse(e.slice(), n).argv;
};
-ye.detailed = function(t, e) {
- return us.parse(t.slice(), e);
+Ae.detailed = function(t, e) {
+ return rs.parse(t.slice(), e);
};
-ye.camelCase = be;
-ye.decamelize = rs;
-ye.looksLikeNumber = os;
-const io = {
- right: ho,
- center: po
-}, ao = 0, Se = 1, co = 2, Oe = 3;
-class lo {
+Ae.camelCase = Ce;
+Ae.decamelize = ns;
+Ae.looksLikeNumber = ss;
+const uo = {
+ right: fo,
+ center: ho
+}, io = 0, Oe = 1, ao = 2, Re = 3;
+class co {
constructor(e) {
var n;
this.width = e.width, this.wrap = (n = e.wrap) !== null && n !== void 0 ? n : !0, this.rows = [];
@@ -1877,7 +1877,7 @@ class lo {
`).map((r) => r.split(" "));
let s = 0;
return n.forEach((r) => {
- r.length > 1 && U.stringWidth(r[0]) > s && (s = Math.min(Math.floor(this.width * 0.5), U.stringWidth(r[0])));
+ r.length > 1 && q.stringWidth(r[0]) > s && (s = Math.min(Math.floor(this.width * 0.5), q.stringWidth(r[0])));
}), n.forEach((r) => {
this.div(...r.map((o, u) => ({
text: o.trim(),
@@ -1893,7 +1893,7 @@ class lo {
};
}
measurePadding(e) {
- const n = U.stripAnsi(e);
+ const n = q.stripAnsi(e);
return [0, n.match(/\s*$/)[0].length, 0, n.match(/^\s*/)[0].length];
}
toString() {
@@ -1907,14 +1907,14 @@ class lo {
return this.rasterize(e).forEach((s, r) => {
let o = "";
s.forEach((u, i) => {
- const { width: c } = e[i], h = this.negatePadding(e[i]);
+ const { width: l } = e[i], p = this.negatePadding(e[i]);
let d = u;
- if (h > U.stringWidth(u) && (d += " ".repeat(h - U.stringWidth(u))), e[i].align && e[i].align !== "left" && this.wrap) {
- const C = io[e[i].align];
- d = C(d, h), U.stringWidth(d) < h && (d += " ".repeat((c || 0) - U.stringWidth(d) - 1));
+ if (p > q.stringWidth(u) && (d += " ".repeat(p - q.stringWidth(u))), e[i].align && e[i].align !== "left" && this.wrap) {
+ const x = uo[e[i].align];
+ d = x(d, p), q.stringWidth(d) < p && (d += " ".repeat((l || 0) - q.stringWidth(d) - 1));
}
const E = e[i].padding || [0, 0, 0, 0];
- E[Oe] && (o += " ".repeat(E[Oe])), o += Sn(e[i], d, "| "), o += d, o += Sn(e[i], d, " |"), E[Se] && (o += " ".repeat(E[Se])), r === 0 && n.length > 0 && (o = this.renderInline(o, n[n.length - 1]));
+ E[Re] && (o += " ".repeat(E[Re])), o += Bn(e[i], d, "| "), o += d, o += Bn(e[i], d, " |"), E[Oe] && (o += " ".repeat(E[Oe])), r === 0 && n.length > 0 && (o = this.renderInline(o, n[n.length - 1]));
}), n.push({
text: o.replace(/ +$/, ""),
span: e.span
@@ -1924,110 +1924,110 @@ class lo {
// if the full 'source' can render in
// the target line, do so.
renderInline(e, n) {
- const s = e.match(/^ */), r = s ? s[0].length : 0, o = n.text, u = U.stringWidth(o.trimRight());
+ const s = e.match(/^ */), r = s ? s[0].length : 0, o = n.text, u = q.stringWidth(o.trimRight());
return n.span ? this.wrap ? r < u ? e : (n.hidden = !0, o.trimRight() + " ".repeat(r - u) + e.trimLeft()) : (n.hidden = !0, o + e) : e;
}
rasterize(e) {
const n = [], s = this.columnWidths(e);
let r;
return e.forEach((o, u) => {
- o.width = s[u], this.wrap ? r = U.wrap(o.text, this.negatePadding(o), { hard: !0 }).split(`
+ o.width = s[u], this.wrap ? r = q.wrap(o.text, this.negatePadding(o), { hard: !0 }).split(`
`) : r = o.text.split(`
-`), o.border && (r.unshift("." + "-".repeat(this.negatePadding(o) + 2) + "."), r.push("'" + "-".repeat(this.negatePadding(o) + 2) + "'")), o.padding && (r.unshift(...new Array(o.padding[ao] || 0).fill("")), r.push(...new Array(o.padding[co] || 0).fill(""))), r.forEach((i, c) => {
- n[c] || n.push([]);
- const h = n[c];
+`), o.border && (r.unshift("." + "-".repeat(this.negatePadding(o) + 2) + "."), r.push("'" + "-".repeat(this.negatePadding(o) + 2) + "'")), o.padding && (r.unshift(...new Array(o.padding[io] || 0).fill("")), r.push(...new Array(o.padding[ao] || 0).fill(""))), r.forEach((i, l) => {
+ n[l] || n.push([]);
+ const p = n[l];
for (let d = 0; d < u; d++)
- h[d] === void 0 && h.push("");
- h.push(i);
+ p[d] === void 0 && p.push("");
+ p.push(i);
});
}), n;
}
negatePadding(e) {
let n = e.width || 0;
- return e.padding && (n -= (e.padding[Oe] || 0) + (e.padding[Se] || 0)), e.border && (n -= 4), n;
+ return e.padding && (n -= (e.padding[Re] || 0) + (e.padding[Oe] || 0)), e.border && (n -= 4), n;
}
columnWidths(e) {
if (!this.wrap)
- return e.map((u) => u.width || U.stringWidth(u.text));
+ return e.map((u) => u.width || q.stringWidth(u.text));
let n = e.length, s = this.width;
const r = e.map((u) => {
if (u.width)
return n--, s -= u.width, u.width;
}), o = n ? Math.floor(s / n) : 0;
- return r.map((u, i) => u === void 0 ? Math.max(o, Do(e[i])) : u);
+ return r.map((u, i) => u === void 0 ? Math.max(o, lo(e[i])) : u);
}
}
-function Sn(t, e, n) {
+function Bn(t, e, n) {
return t.border ? /[.']-+[.']/.test(e) ? "" : e.trim().length !== 0 ? n : " " : "";
}
-function Do(t) {
- const e = t.padding || [], n = 1 + (e[Oe] || 0) + (e[Se] || 0);
+function lo(t) {
+ const e = t.padding || [], n = 1 + (e[Re] || 0) + (e[Oe] || 0);
return t.border ? n + 4 : n;
}
-function fo() {
+function Do() {
return typeof process == "object" && process.stdout && process.stdout.columns ? process.stdout.columns : 80;
}
-function ho(t, e) {
+function fo(t, e) {
t = t.trim();
- const n = U.stringWidth(t);
+ const n = q.stringWidth(t);
return n < e ? " ".repeat(e - n) + t : t;
}
-function po(t, e) {
+function ho(t, e) {
t = t.trim();
- const n = U.stringWidth(t);
+ const n = q.stringWidth(t);
return n >= e ? t : " ".repeat(e - n >> 1) + t;
}
-let U;
-function go(t, e) {
- return U = e, new lo({
- width: t?.width || fo(),
+let q;
+function po(t, e) {
+ return q = e, new co({
+ width: t?.width || Do(),
wrap: t?.wrap
});
}
-const is = new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g");
-function as(t) {
- return t.replace(is, "");
+const os = new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g");
+function us(t) {
+ return t.replace(os, "");
}
-function mo(t, e) {
- const [n, s] = t.match(is) || ["", ""];
- t = as(t);
+function go(t, e) {
+ const [n, s] = t.match(os) || ["", ""];
+ t = us(t);
let r = "";
for (let o = 0; o < t.length; o++)
o !== 0 && o % e === 0 && (r += `
`), r += t.charAt(o);
return n && s && (r = `${n}${r}${s}`), r;
}
-function bo(t) {
- return go(t, {
+function mo(t) {
+ return po(t, {
stringWidth: (e) => [...e].length,
- stripAnsi: as,
- wrap: mo
+ stripAnsi: us,
+ wrap: go
});
}
-function Fo(t, e) {
- let n = pe(".", t), s;
- for (qn(n).isDirectory() || (n = ut(n)); ; ) {
- if (s = e(n, Js(n)), s) return pe(n, s);
- if (n = ut(s = n), s === n) break;
+function bo(t, e) {
+ let n = de(".", t), s;
+ for (Un(n).isDirectory() || (n = it(n)); ; ) {
+ if (s = e(n, Ys(n)), s) return de(n, s);
+ if (n = it(s = n), s === n) break;
}
}
const Co = {
fs: {
- readFileSync: Yt,
- writeFile: Qs
+ readFileSync: Jt,
+ writeFile: Js
},
- format: Un,
- resolve: pe,
+ format: Hn,
+ resolve: de,
exists: (t) => {
try {
- return qn(t).isFile();
+ return Un(t).isFile();
} catch {
return !1;
}
}
};
-let K;
-class Eo {
+let Z;
+class Fo {
constructor(e) {
e = e || {}, this.directory = e.directory || "./locales", this.updateFiles = typeof e.updateFiles == "boolean" ? e.updateFiles : !0, this.locale = e.locale || "en", this.fallbackToLanguage = typeof e.fallbackToLanguage == "boolean" ? e.fallbackToLanguage : !0, this.cache = /* @__PURE__ */ Object.create(null), this.writeQueue = [];
}
@@ -2042,7 +2042,7 @@ class Eo {
directory: this.directory,
locale: this.locale,
cb: s
- })) : s(), K.format.apply(K.format, [this.cache[this.locale][n] || n].concat(e));
+ })) : s(), Z.format.apply(Z.format, [this.cache[this.locale][n] || n].concat(e));
}
__n() {
const e = Array.prototype.slice.call(arguments), n = e.shift(), s = e.shift(), r = e.shift();
@@ -2059,7 +2059,7 @@ class Eo {
cb: o
})) : o();
const i = [u];
- return ~u.indexOf("%d") && i.push(r), K.format.apply(K.format, i.concat(e));
+ return ~u.indexOf("%d") && i.push(r), Z.format.apply(Z.format, i.concat(e));
}
setLocale(e) {
this.locale = e;
@@ -2084,15 +2084,15 @@ class Eo {
}
_processWriteQueue() {
const e = this, n = this.writeQueue[0], s = n.directory, r = n.locale, o = n.cb, u = this._resolveLocaleFile(s, r), i = JSON.stringify(this.cache[r], null, 2);
- K.fs.writeFile(u, i, "utf-8", function(c) {
- e.writeQueue.shift(), e.writeQueue.length > 0 && e._processWriteQueue(), o(c);
+ Z.fs.writeFile(u, i, "utf-8", function(l) {
+ e.writeQueue.shift(), e.writeQueue.length > 0 && e._processWriteQueue(), o(l);
});
}
_readLocaleFile() {
let e = {};
const n = this._resolveLocaleFile(this.directory, this.locale);
try {
- K.fs.readFileSync && (e = JSON.parse(K.fs.readFileSync(n, "utf-8")));
+ Z.fs.readFileSync && (e = JSON.parse(Z.fs.readFileSync(n, "utf-8")));
} catch (s) {
if (s instanceof SyntaxError && (s.message = "syntax error in " + n), s.code === "ENOENT")
e = {};
@@ -2102,20 +2102,20 @@ class Eo {
this.cache[this.locale] = e;
}
_resolveLocaleFile(e, n) {
- let s = K.resolve(e, "./", n + ".json");
+ let s = Z.resolve(e, "./", n + ".json");
if (this.fallbackToLanguage && !this._fileExistsSync(s) && ~n.lastIndexOf("_")) {
- const r = K.resolve(e, "./", n.split("_")[0] + ".json");
+ const r = Z.resolve(e, "./", n.split("_")[0] + ".json");
this._fileExistsSync(r) && (s = r);
}
return s;
}
_fileExistsSync(e) {
- return K.exists(e);
+ return Z.exists(e);
}
}
-function xo(t, e) {
- K = e;
- const n = new Eo(t);
+function Eo(t, e) {
+ Z = e;
+ const n = new Fo(t);
return {
__: n.__.bind(n),
__n: n.__n.bind(n),
@@ -2125,22 +2125,22 @@ function xo(t, e) {
locale: n.locale
};
}
-const wo = (t) => xo(t, Co), _o = "require is not supported by ESM", On = "loading a directory of commands is not supported yet for ESM";
-let Ee;
+const xo = (t) => Eo(t, Co), wo = "require is not supported by ESM", Sn = "loading a directory of commands is not supported yet for ESM";
+let xe;
try {
- Ee = tr(import.meta.url);
+ xe = er(import.meta.url);
} catch {
- Ee = process.cwd();
+ xe = process.cwd();
}
-const yo = Ee.substring(0, Ee.lastIndexOf("node_modules"));
-Xs, er, Vs, yo || process.cwd(), Zs, ut, Ks, Ys, pe, process.cwd, process.exit, process.nextTick, typeof process.stdout.columns < "u" && process.stdout.columns, Yt, wo({
- directory: pe(Ee, "../../../locales"),
+const _o = xe.substring(0, xe.lastIndexOf("node_modules"));
+Qs, Xs, Vs, _o || process.cwd(), Gs, it, Zs, Ks, de, process.cwd, process.exit, process.nextTick, typeof process.stdout.columns < "u" && process.stdout.columns, Jt, xo({
+ directory: de(xe, "../../../locales"),
updateFiles: !1
});
-let cs = !1;
-const Ao = (t) => {
- cs = t;
-}, Rn = () => cs, ae = {
+let is = !1;
+const yo = (t) => {
+ is = t;
+}, On = () => is, ae = {
"vue-caution": [
"elementSelectorsWithScoped",
"implicitParentChildCommunication"
@@ -2195,32 +2195,71 @@ const Ao = (t) => {
"vForWithIndexKey",
"zeroLengthComparison"
]
-}, nn = Object.keys(ae), vo = 1.5, Nn = 75, Ln = 85, jn = 95, ls = [...nn, ...Object.values(ae).flat()], $o = {
+}, sn = Object.keys(ae), Ao = 1.5, Rn = 75, Nn = 85, Ln = 95, as = [...sn, ...Object.values(ae).flat()], vo = {
+ maxExpressionLength: 40,
+ maxComputedLength: 5,
+ minimalConsonantCount: 3,
+ maxPropsCount: 5,
+ minVariableName: 4,
+ maxParameterCount: 3,
+ maxTabs: 5,
+ maxVshowLines: 10,
+ maxVifLines: 10,
+ complexityModerate: 5,
+ warningThreshold: 4,
maxFunctionSize: 20,
maxScriptLength: 100
-}, Bo = (t, e, n) => {
- const { errors: s, warnings: r } = t.reduce((C, { errors: m, warnings: b }) => ({ errors: C.errors + m, warnings: C.warnings + b }), { errors: 0, warnings: 0 }), o = [];
+}, $o = (t, e, n) => {
+ const { errors: s, warnings: r } = t.reduce((x, { errors: b, warnings: m }) => ({ errors: x.errors + b, warnings: x.warnings + m }), { errors: 0, warnings: 0 }), o = [];
o.push({ info: `Found ${Intl.NumberFormat("en-US").format(s)} errors, and ${Intl.NumberFormat("en-US").format(r)} warnings, ${Intl.NumberFormat("en-US").format(e)} lines of code in ${Intl.NumberFormat("en-US").format(n)} files` });
- const u = Math.ceil((1 - (s * vo + r) / e) * 100), i = 60, c = r ? Math.max(1, Math.ceil(r / e * i)) : 0, h = s ? Math.max(1, i - Math.ceil(u * i / 100) - c) : 0, d = i - h - c, E = `${"_".repeat(d)}${"_".repeat(c)}${"_".repeat(h)}`;
+ const u = Math.ceil((1 - (s * Ao + r) / e) * 100), i = 60, l = r ? Math.max(1, Math.ceil(r / e * i)) : 0, p = s ? Math.max(1, i - Math.ceil(u * i / 100) - l) : 0, d = i - p - l, E = `${"_".repeat(d)}${"_".repeat(l)}${"_".repeat(p)}`;
return o.push({ info: `Code Health: [${E}] ${u}%
-` }), u < Nn && o.push({ info: `Code health is LOW: ${u}%
-` }), u >= Nn && u < Ln && o.push({ info: `Code health is MEDIUM ${u}%$
-` }), u >= Ln && u < jn && o.push({ info: `Code health is OK: ${u}%
-` }), u >= jn && o.push({ info: `Code health is GOOD: ${u}%
+` }), u < Rn && o.push({ info: `Code health is LOW: ${u}%
+` }), u >= Rn && u < Nn && o.push({ info: `Code health is MEDIUM ${u}%$
+` }), u >= Nn && u < Ln && o.push({ info: `Code health is OK: ${u}%
+` }), u >= Ln && o.push({ info: `Code health is GOOD: ${u}%
` }), { errors: s, warnings: r, output: o };
-}, sn = async (t) => {
+}, cs = async (t) => {
+ const e = {
+ path: "./src",
+ apply: Object.values(sn).join(","),
+ ignore: "",
+ exclude: "",
+ group: "rule",
+ level: "all",
+ sort: "desc",
+ output: "text",
+ override: vo
+ }, n = H.join(t, "vue-mess-detector.json");
+ try {
+ const s = await ie.readFile(n, "utf-8"), r = JSON.parse(s);
+ return {
+ ...e,
+ ...r,
+ override: {
+ ...e.override,
+ ...r.override
+ }
+ };
+ } catch {
+ return {
+ ...e,
+ isDefault: !0
+ };
+ }
+}, rn = async (t) => {
let e = t;
- for (; e !== V.parse(e).root; ) {
- const n = V.join(e, "package.json");
+ for (; e !== H.parse(e).root; ) {
+ const n = H.join(e, "package.json");
try {
return await ie.access(n), e;
} catch {
- e = V.dirname(e);
+ e = H.dirname(e);
}
}
throw new Error("Project root not found");
};
-function So(t) {
+function Bo(t) {
const e = [], n = [];
return Object.entries(ae).forEach(([s, r]) => {
if (r.every((o) => t.includes(o)))
@@ -2231,40 +2270,40 @@ function So(t) {
}
}), { rulesets: e, individualRules: n };
}
-const Ds = async (t) => {
+const ls = async (t) => {
let e = "";
if (!t) {
- const s = sr(import.meta.url), r = V.dirname(s), o = V.resolve(r, "..");
- e = V.join(o, "package.json");
- }
- return t && (e = V.join(t, "package.json")), JSON.parse(await ie.readFile(e, "utf-8"));
-}, rn = async () => await sn(process?.cwd() || "./") || "", fs = async (t, e) => {
- const n = await rn(), s = V.join(n, "package.json");
- return Jt.existsSync(s) ? !!(await Ds(e)).dependencies[t] : !1;
-}, hs = async (t) => {
- const e = await rn(), n = ["nuxt.config.js", "nuxt.config.ts"];
- return await fs("nuxt", t) || n.some((s) => Jt.existsSync(V.join(e, s)));
-}, Oo = async (t) => {
- const e = await rn(), n = ["vue.config.js", "vue.config.ts"];
- return !await hs(t) && (await fs("vue", t) || n.some((r) => Jt.existsSync(V.join(e, r))));
-}, Ro = /^(\(.*\)|\\?.)$/;
+ const s = nr(import.meta.url), r = H.dirname(s), o = H.resolve(r, "..");
+ e = H.join(o, "package.json");
+ }
+ return t && (e = H.join(t, "package.json")), JSON.parse(await ie.readFile(e, "utf-8"));
+}, on = async () => await rn(process?.cwd() || "./") || "", Ds = async (t, e) => {
+ const n = await on(), s = H.join(n, "package.json");
+ return Qt.existsSync(s) ? !!(await ls(e)).dependencies[t] : !1;
+}, fs = async (t) => {
+ const e = await on(), n = ["nuxt.config.js", "nuxt.config.ts"];
+ return await Ds("nuxt", t) || n.some((s) => Qt.existsSync(H.join(e, s)));
+}, So = async (t) => {
+ const e = await on(), n = ["vue.config.js", "vue.config.ts"];
+ return !await fs(t) && (await Ds("vue", t) || n.some((r) => Qt.existsSync(H.join(e, r))));
+}, Oo = /^(\(.*\)|\\?.)$/;
function ue(t) {
const e = t.toString();
- return Ro.test(e) ? e : `(?:${e})`;
+ return Oo.test(e) ? e : `(?:${e})`;
}
-const No = /^(?:\(\?:(.+)\)|(\(?.+\)?))$/, Lo = /^(?:\(\?:(.+)\)([?+*]|{[\d,]+})?|(.+))$/;
+const Ro = /^(?:\(\?:(.+)\)|(\(?.+\)?))$/, No = /^(?:\(\?:(.+)\)([?+*]|{[\d,]+})?|(.+))$/;
function v(t) {
- const e = (n) => v(`(?<${n}>${`${t}`.replace(No, "$1$2")})`);
+ const e = (n) => v(`(?<${n}>${`${t}`.replace(Ro, "$1$2")})`);
return {
toString: () => t.toString(),
- and: Object.assign((...n) => v(`${t}${M(...n)}`), {
+ and: Object.assign((...n) => v(`${t}${I(...n)}`), {
referenceTo: (n) => v(`${t}\\k<${n}>`)
}),
- or: (...n) => v(`(?:${t}|${M(...n)})`),
- after: (...n) => v(`(?<=${M(...n)})${t}`),
- before: (...n) => v(`${t}(?=${M(...n)})`),
- notAfter: (...n) => v(`(? v(`${t}(?!${M(...n)})`),
+ or: (...n) => v(`(?:${t}|${I(...n)})`),
+ after: (...n) => v(`(?<=${I(...n)})${t}`),
+ before: (...n) => v(`${t}(?=${I(...n)})`),
+ notAfter: (...n) => v(`(? v(`${t}(?!${I(...n)})`),
times: Object.assign((n) => v(`${ue(t)}{${n}}`), {
any: () => v(`${ue(t)}*`),
atLeast: (n) => v(`${ue(t)}{${n},}`),
@@ -2274,69 +2313,69 @@ function v(t) {
optionally: () => v(`${ue(t)}?`),
as: e,
groupedAs: e,
- grouped: () => v(`${t}`.replace(Lo, "($1$3)$2")),
+ grouped: () => v(`${t}`.replace(No, "($1$3)$2")),
at: {
lineStart: () => v(`^${t}`),
lineEnd: () => v(`${t}$`)
}
};
}
-const jo = /[.*+?^${}()|[\]\\/]/g;
-function xe(t) {
+const Lo = /[.*+?^${}()|[\]\\/]/g;
+function we(t) {
return v(`[${t.replace(/[-\\^\]]/g, "\\$&")}]`);
}
function k(t) {
return v(`[^${t.replace(/[-\\^\]]/g, "\\$&")}]`);
}
-function Ce(...t) {
- return v(`(?:${t.map((e) => M(e)).join("|")})`);
+function Ee(...t) {
+ return v(`(?:${t.map((e) => I(e)).join("|")})`);
}
const le = v(".");
v("\\b\\w+\\b");
-const Z = v("\\w"), H = v("\\b"), To = v("\\d"), W = v("\\s"), ps = Object.assign(v("[a-zA-Z]"), {
+const G = v("\\w"), V = v("\\b"), jo = v("\\d"), W = v("\\s"), hs = Object.assign(v("[a-zA-Z]"), {
lowercase: v("[a-z]"),
uppercase: v("[A-Z]")
-}), ds = v("\\t"), gs = v("\\n");
+}), ps = v("\\t"), ds = v("\\n");
v("\\r");
v("\\W+"), v("\\W"), v("\\B"), v("\\D"), v("\\S"), Object.assign(v("[^a-zA-Z]"), {
lowercase: v("[^a-z]"),
uppercase: v("[^A-Z]")
}), v("[^\\t]"), v("[^\\n]"), v("[^\\r]");
-function J(...t) {
- return v(`${ue(M(...t))}?`);
+function Y(...t) {
+ return v(`${ue(I(...t))}?`);
}
-function M(...t) {
+function I(...t) {
return v(
- t.map((e) => typeof e == "string" ? e.replace(jo, "\\$&") : e).join("")
+ t.map((e) => typeof e == "string" ? e.replace(Lo, "\\$&") : e).join("")
);
}
-function B(...t) {
- return v(`${ue(M(...t))}+`);
+function S(...t) {
+ return v(`${ue(I(...t))}+`);
}
-const Q = "i", j = "g", R = (...t) => {
+const J = "i", j = "g", R = (...t) => {
const e = t.length > 1 && (Array.isArray(t[t.length - 1]) || t[t.length - 1] instanceof Set) ? t.pop() : void 0;
- return new RegExp(M(...t).toString(), [...e || ""].join(""));
-}, lt = [], Wo = ["get", "post", "put", "delete", "patch", "options", "head"], Io = (t, e) => {
+ return new RegExp(I(...t).toString(), [...e || ""].join(""));
+}, Dt = [], To = ["get", "post", "put", "delete", "patch", "options", "head"], Wo = (t, e) => {
if (!e.includes("/server/api/"))
return;
const n = e.replace(/\.[^/.]+$/, "");
- if (Wo.some((u) => n.toLowerCase().endsWith(`.${u}`)))
+ if (To.some((u) => n.toLowerCase().endsWith(`.${u}`)))
return;
const r = t.source;
R(
- M("if"),
- B(" "),
+ I("if"),
+ S(" "),
"(",
- M("event.node.req.method"),
- B(" "),
+ I("event.node.req.method"),
+ S(" "),
"!="
- ).test(r) || lt.push({
+ ).test(r) || Dt.push({
filePath: e,
message: "API route without HTTP method specified in filename or content"
});
}, Mo = () => {
const t = [];
- return lt.length > 0 && lt.forEach((e) => {
+ return Dt.length > 0 && Dt.forEach((e) => {
const n = e.filePath.split("/").pop()?.replace(/\.[^/.]+$/, "");
t.push({
file: e.filePath,
@@ -2349,12 +2388,12 @@ const Q = "i", j = "g", R = (...t) => {
if (!e.includes(`
`))
return t.split(`
-`).findIndex((i, c) => c >= n && i.includes(e)) + 1;
+`).findIndex((i, l) => l >= n && i.includes(e)) + 1;
const s = t.split(`
`).slice(0, n).reduce((u, i) => u + i.length, 0), r = t.indexOf(e, s);
return t.slice(0, r).split(`
`).length;
-}, Le = [], ko = (t, e) => {
+}, je = [], Io = (t, e) => {
if (!t)
return;
const n = 10, s = /<([a-z0-9-]+)[^>]*v-if[^>]*>[\s\S]*?<\/\1>|<[^>]*v-if[^>]*\/>/gi;
@@ -2362,20 +2401,20 @@ const Q = "i", j = "g", R = (...t) => {
const u = o.split(`
`).length, i = T(t.content, o);
if (u > n * 2) {
- Le.push({
+ je.push({
filePath: e,
message: `line #${i} has a v-if with ${u} lines`
});
return;
}
- u > n && Le.push({
+ u > n && je.push({
filePath: e,
message: `line #${i} has a v-if with ${u} lines`
});
});
-}, Po = () => {
+}, ko = () => {
const t = [];
- return Le.length > 0 && Le.forEach((e) => {
+ return je.length > 0 && je.forEach((e) => {
t.push({
file: e.filePath,
rule: "rrd ~ big v-if",
@@ -2383,7 +2422,7 @@ const Q = "i", j = "g", R = (...t) => {
message: `${e.message} 🚨`
});
}), t;
-}, je = [], zo = (t, e) => {
+}, Te = [], Po = (t, e) => {
if (!t)
return;
const n = 10, s = /<([a-z0-9-]+)[^>]*v-show[^>]*>[\s\S]*?<\/\1>|<[^>]*v-show[^>]*\/>/gi;
@@ -2391,20 +2430,20 @@ const Q = "i", j = "g", R = (...t) => {
const u = o.split(`
`).length, i = T(t.content, o);
if (u > n * 2) {
- je.push({
+ Te.push({
filePath: e,
message: `line #${i} has a v-show with ${u} lines`
});
return;
}
- u > n && je.push({
+ u > n && Te.push({
filePath: e,
message: `line #${i} has a v-show with ${u} lines`
});
});
-}, Ho = () => {
+}, zo = () => {
const t = [];
- return je.length > 0 && je.forEach((e) => {
+ return Te.length > 0 && Te.forEach((e) => {
t.push({
file: e.filePath,
rule: "rrd ~ big v-show",
@@ -2412,11 +2451,11 @@ const Q = "i", j = "g", R = (...t) => {
message: `${e.message} 🚨`
});
}), t;
-}, X = (t) => {
+}, Q = (t) => {
const e = R(
- M("/*").and(k("*").times.any(), J(`
-`).as("newline"), M("*").notBefore("/").or(B(k("*")))).and("*/").or(
- M("//").and(B(le))
+ I("/*").and(k("*").times.any(), Y(`
+`).as("newline"), I("*").notBefore("/").or(S(k("*")))).and("*/").or(
+ I("//").and(S(le))
),
[j]
);
@@ -2424,20 +2463,20 @@ const Q = "i", j = "g", R = (...t) => {
const s = n.match(/\n/g);
return s ? s.join("") : "";
});
-}, Dt = [], ms = 4, Tn = 2 * ms, Vo = (t, e) => {
+}, ft = [], gs = 4, jn = 2 * gs, Vo = (t, e) => {
const { script: n, template: s } = t;
if (!n && !s)
return;
const r = R(
- Ce(
+ Ee(
"if",
'v-if="',
- B(le).groupedAs("condition").and("?").and(B(le)).and(":"),
+ S(le).groupedAs("condition").and("?").and(S(le)).and(":"),
// ternary
"="
).and(
- B(
- Ce(
+ S(
+ Ee(
"&&",
"||",
k(`"'`)
@@ -2446,26 +2485,26 @@ const Q = "i", j = "g", R = (...t) => {
),
[j]
), o = R(
- Ce("&&", "||"),
+ Ee("&&", "||"),
[j]
- ), u = (i, c) => {
- i = X(i);
- const h = i.match(r);
- h && h.forEach((d) => {
+ ), u = (i, l) => {
+ i = Q(i);
+ const p = i.match(r);
+ p && p.forEach((d) => {
const E = (d.match(o) || []).length + 1;
- if (E > ms) {
- const C = T(i, d);
- Dt.push({
+ if (E > gs) {
+ const x = T(i, d);
+ ft.push({
filePath: e,
- message: `line #${C} ${E > Tn ? "" : ""}${c} has a complicated condition with ${E} blocks${E > Tn ? "" : ""}`
+ message: `line #${x} ${E > jn ? "" : ""}${l} has a complicated condition with ${E} blocks${E > jn ? "" : ""}`
});
}
});
};
n && u(n.content, "script"), s && u(s.content, "template");
-}, Go = () => {
+}, Ho = () => {
const t = [];
- return Dt.length > 0 && Dt.forEach((e) => {
+ return ft.length > 0 && ft.forEach((e) => {
t.push({
file: e.filePath,
rule: "rrd ~ complicated conditions",
@@ -2473,23 +2512,23 @@ const Q = "i", j = "g", R = (...t) => {
message: `${e.message} 🚨`
});
}), t;
-}, ft = [], Uo = (t, e) => {
+}, ht = [], Uo = (t, e) => {
if (!t)
return;
const n = /computed\s*\(\s*\(\s*\)\s*=>\s*\{([\s\S]*?)\}\s*\)/g, s = /\b(set|push|pop|shift|unshift|splice|reverse|sort)\b|(? {
const u = o[1];
if (s.test(u)) {
- const i = T(t.content.trim(), o[0]), c = u.trim(), h = c.length > 20 ? c.slice(0, 20) : c;
- ft.push({
+ const i = T(t.content.trim(), o[0]), l = u.trim(), p = l.length > 20 ? l.slice(0, 20) : l;
+ ht.push({
filePath: e,
- message: `line #${i} side effect detected in computed property (${h})`
+ message: `line #${i} side effect detected in computed property (${p})`
});
}
});
}, qo = () => {
const t = [];
- return ft.length > 0 && ft.forEach((e) => {
+ return ht.length > 0 && ht.forEach((e) => {
t.push({
file: e.filePath,
rule: "rrd ~ computed side effects",
@@ -2497,14 +2536,14 @@ const Q = "i", j = "g", R = (...t) => {
message: `${e.message} 🚨`
});
}), t;
-}, ht = [], bs = 5, Wn = 2 * bs, Zo = (t, e) => {
+}, pt = [], ms = 5, Tn = 2 * ms, Go = (t, e) => {
if (!t)
return;
- const n = R(H, "if", H, [j, Q]), s = R(H, "else", H, [j, Q]), r = R(H, "for", H, [j, Q]), o = R(H, "while", H, [j, Q]), u = R(H, "case", H, [j, Q]), i = X(t.content), c = i.match(n), h = i.match(s), d = i.match(r), E = i.match(o), C = i.match(u), m = (c?.length || 0) + (h?.length || 0) + (d?.length || 0) + (E?.length || 0) + (C?.length || 0);
- m > bs && ht.push({ filePath: e, message: `Cyclomatic complexity is ${m > Wn ? "very high" : "high"} (${m})${m > Wn ? "" : ""}` });
-}, Ko = () => {
+ const n = R(V, "if", V, [j, J]), s = R(V, "else", V, [j, J]), r = R(V, "for", V, [j, J]), o = R(V, "while", V, [j, J]), u = R(V, "case", V, [j, J]), i = Q(t.content), l = i.match(n), p = i.match(s), d = i.match(r), E = i.match(o), x = i.match(u), b = (l?.length || 0) + (p?.length || 0) + (d?.length || 0) + (E?.length || 0) + (x?.length || 0);
+ b > ms && pt.push({ filePath: e, message: `Cyclomatic complexity is ${b > Tn ? "very high" : "high"} (${b})${b > Tn ? "" : ""}` });
+}, Zo = () => {
const t = [];
- return ht.length > 0 && ht.forEach((e) => {
+ return pt.length > 0 && pt.forEach((e) => {
t.push({
file: e.filePath,
rule: "rrd ~ cyclomatic complexity",
@@ -2512,21 +2551,21 @@ const Q = "i", j = "g", R = (...t) => {
message: `${e.message} 🚨`
});
}), t;
-}, pt = [], In = 5, Yo = 3, Jo = (t, e) => {
+}, dt = [], Wn = 5, Ko = 3, Yo = (t, e) => {
if (!t)
return;
- const n = R(ds.times.atLeast(In).at.lineStart().or(W.times.atLeast(Yo * In).at.lineStart()), [j]), r = X(t.content).match(n);
+ const n = R(ps.times.atLeast(Wn).at.lineStart().or(W.times.atLeast(Ko * Wn).at.lineStart()), [j]), r = Q(t.content).match(n);
let o = 0;
r?.forEach((u) => {
const i = T(t.content, u, o);
- pt.push({
+ dt.push({
filePath: e,
message: `line #${i} indentation: ${u.length}`
}), o = i;
});
-}, Qo = () => {
+}, Jo = () => {
const t = [];
- return pt.length > 0 && pt.forEach((e) => {
+ return dt.length > 0 && dt.forEach((e) => {
t.push({
file: e.filePath,
rule: "rrd ~ deep indentation",
@@ -2534,14 +2573,14 @@ const Q = "i", j = "g", R = (...t) => {
message: `${e.message} 🚨`
});
}), t;
-}, dt = [], Xo = (t, e) => {
+}, gt = [], Qo = (t, e) => {
if (!t)
return;
- const n = R(H, "else", H, [j, Q]), r = X(t.content).match(n);
- r?.length && dt.push({ filePath: e, message: `else clauses found (${r.length})` });
-}, eu = () => {
+ const n = R(V, "else", V, [j, J]), r = Q(t.content).match(n);
+ r?.length && gt.push({ filePath: e, message: `else clauses found (${r.length})` });
+}, Xo = () => {
const t = [];
- return dt.length > 0 && dt.forEach((e) => {
+ return gt.length > 0 && gt.forEach((e) => {
t.push({
file: e.filePath,
rule: "rrd ~ else conditions",
@@ -2549,17 +2588,17 @@ const Q = "i", j = "g", R = (...t) => {
message: `${e.message} 🚨`
});
}), t;
-}, Te = [], tu = 5, nu = 8;
-function su({ funcName: t, funcBody: e, lineNumber: n, filePath: s, max: r }) {
+}, We = [], eu = 5, tu = 8;
+function nu({ funcName: t, funcBody: e, lineNumber: n, filePath: s, max: r }) {
const o = e.split(`
-`).length, u = uu(t);
+`).length, u = ou(t);
if (o > 2 * r) {
- Te.push({ filePath: s, message: `function (${u}#${n}) is too long: ${o} lines` });
+ We.push({ filePath: s, message: `function (${u}#${n}) is too long: ${o} lines` });
return;
}
- o >= r && Te.push({ filePath: s, message: `function (${u}#${n}) is too long: ${o} lines` });
+ o >= r && We.push({ filePath: s, message: `function (${u}#${n}) is too long: ${o} lines` });
}
-function ru(t, e) {
+function su(t, e) {
const n = /function\s+([a-zA-Z_$][0-9a-zA-Z_$]*)\s*\([^)]*\)\s*\{/g;
n.lastIndex = e;
const s = n.exec(t);
@@ -2568,67 +2607,67 @@ function ru(t, e) {
let u = 1, i = o;
for (; u > 0 && i < t.length; )
t[i] === "{" ? u++ : t[i] === "}" && u--, i++;
- const c = t.slice(o, i - 1).trim();
+ const l = t.slice(o, i - 1).trim();
return {
name: r,
- body: c,
+ body: l,
end: i
// Returns the position after the matched function
};
} else
return null;
}
-function ou(t, e) {
+function ru(t, e) {
const n = /const\s+([a-zA-Z_$][0-9a-zA-Z_$]*)\s*=\s*(async\s+)?\(([^)]*)\)\s*=>\s*/, s = t.slice(e), r = n.exec(s);
if (r) {
const [, o] = r, u = e + r.index + r[0].length;
- let i = u, c = "";
+ let i = u, l = "";
if (t[u] === "{") {
- let h = 1;
- for (i = u + 1; i < t.length && h > 0; )
- t[i] === "{" ? h++ : t[i] === "}" && h--, i++;
- c = t.slice(u + 1, i - 1).trim();
+ let p = 1;
+ for (i = u + 1; i < t.length && p > 0; )
+ t[i] === "{" ? p++ : t[i] === "}" && p--, i++;
+ l = t.slice(u + 1, i - 1).trim();
} else {
for (; i < t.length && t[i] !== ";"; )
i++;
- c = t.slice(u, i).trim();
+ l = t.slice(u, i).trim();
}
return {
name: o,
- body: c,
+ body: l,
end: i
// Position after the end of the function body
};
} else
return null;
}
-function uu(t) {
+function ou(t) {
return t.replace(/^const\s*/, "");
}
-const iu = (t, e, n) => {
+const uu = (t, e, n) => {
if (!t)
return;
const s = t.content, r = s.length;
let o = 0;
for (; o < r; ) {
- let u = "", i = "", c = !1;
- if (s.slice(o, o + nu) === "function") {
- const h = ru(s, o);
- h && (c = !0, u = h.name, i = h.body, o = h.end);
- }
- if (s.slice(o, o + tu) === "const") {
- const h = ou(s, o);
- h && (c = !0, u = h.name, i = h.body, o = h.end);
- }
- if (c) {
- const h = T(s.trim(), u);
- su({ funcName: u, funcBody: i, lineNumber: h, filePath: e, max: n });
+ let u = "", i = "", l = !1;
+ if (s.slice(o, o + tu) === "function") {
+ const p = su(s, o);
+ p && (l = !0, u = p.name, i = p.body, o = p.end);
+ }
+ if (s.slice(o, o + eu) === "const") {
+ const p = ru(s, o);
+ p && (l = !0, u = p.name, i = p.body, o = p.end);
+ }
+ if (l) {
+ const p = T(s.trim(), u);
+ nu({ funcName: u, funcBody: i, lineNumber: p, filePath: e, max: n });
} else
o++;
}
-}, au = (t) => {
+}, iu = (t) => {
const e = [];
- return Te.length > 0 && Te.forEach((n) => {
+ return We.length > 0 && We.forEach((n) => {
e.push({
file: n.filePath,
rule: "rrd ~ function size",
@@ -2636,23 +2675,23 @@ const iu = (t, e, n) => {
message: `${n.message} 🚨`
});
}), e;
-}, gt = [], cu = (t, e) => {
+}, mt = [], au = (t, e) => {
if (!t)
return;
- const n = R("<", M("img").or("picture"), [j]), s = t.content.match(n);
+ const n = R("<", I("img").or("picture"), [j]), s = t.content.match(n);
if (s?.length) {
let r = 0;
s.forEach((o) => {
const u = T(t.content, o, r), i = o.slice(1);
- gt.push({
+ mt.push({
filePath: e,
message: `line #${u} ${i} element found`
}), r = u;
});
}
-}, lu = () => {
+}, cu = () => {
const t = [];
- return gt.length > 0 && gt.forEach((e) => {
+ return mt.length > 0 && mt.forEach((e) => {
t.push({
file: e.filePath,
rule: "rrd ~ html image elements",
@@ -2660,14 +2699,14 @@ const iu = (t, e, n) => {
message: `${e.message} 🚨`
});
}), t;
-}, mt = [], Du = (t, e) => {
+}, bt = [], lu = (t, e) => {
if (!t)
return;
- const n = R("html link found` });
-}, fu = () => {
+ const n = R("html link found` });
+}, Du = () => {
const t = [];
- return mt.length > 0 && mt.forEach((e) => {
+ return bt.length > 0 && bt.forEach((e) => {
t.push({
file: e.filePath,
rule: "rrd ~ html link",
@@ -2675,24 +2714,24 @@ const iu = (t, e, n) => {
message: `${e.message} 🚨`
});
}), t;
-}, bt = [], hu = (t, e) => {
+}, Ct = [], fu = (t, e) => {
if (!t)
return;
- const s = X(t.content).split(`
+ const s = Q(t.content).split(`
`);
s.forEach((r, o) => {
const u = r.trim();
if (u.startsWith("if (") && !u.includes("{")) {
const i = s[o + 1]?.trim();
- (!i || !i.startsWith("{") && !u.endsWith("{")) && bt.push({
+ (!i || !i.startsWith("{") && !u.endsWith("{")) && Ct.push({
filePath: e,
message: `line #${o} if statement without curly braces: ${u}`
});
}
});
-}, pu = () => {
+}, hu = () => {
const t = [];
- return bt.length > 0 && bt.forEach((e) => {
+ return Ct.length > 0 && Ct.forEach((e) => {
t.push({
file: e.filePath,
rule: "rrd ~ if without curly braces",
@@ -2700,10 +2739,10 @@ const iu = (t, e, n) => {
message: `${e.message} 🚨`
});
}), t;
-}, Ft = [], du = (t, e) => {
+}, Ft = [], pu = (t, e) => {
if (!t)
return;
- const n = R(Ce(H), B(To).as("magicNumber"), Ce(")", gs), [j]);
+ const n = R(Ee(V), S(jo).as("magicNumber"), Ee(")", ds), [j]);
let s, r = 0;
for (; (s = n.exec(t.content)) !== null; ) {
const o = s.groups?.magicNumber, u = Number.parseInt(o ?? "0");
@@ -2715,7 +2754,7 @@ const iu = (t, e, n) => {
}), r = i;
}
}
-}, gu = () => {
+}, du = () => {
const t = [];
return Ft.length && Ft.forEach((e) => {
t.push({
@@ -2725,22 +2764,22 @@ const iu = (t, e, n) => {
message: `magic numbers found (${e.message}) 🚨`
});
}), t;
-}, Ct = [], mu = (t, e) => {
+}, Et = [], gu = (t, e) => {
if (!t)
return;
- const n = R(B(le), W, "?", W, B(le), W, ":", W, B(le));
- X(t.content).match(n)?.forEach((o) => {
+ const n = R(S(le), W, "?", W, S(le), W, ":", W, S(le));
+ Q(t.content).match(n)?.forEach((o) => {
if (o.split("?").length - 1 > 1) {
const u = T(t.content, o);
- Ct.push({
+ Et.push({
filePath: e,
message: `line #${u} has nested ternary`
});
}
});
-}, bu = () => {
+}, mu = () => {
const t = [];
- return Ct.length > 0 && Ct.forEach((e) => {
+ return Et.length > 0 && Et.forEach((e) => {
t.push({
file: e.filePath,
rule: "rrd ~ nested Ternary",
@@ -2748,21 +2787,21 @@ const iu = (t, e, n) => {
message: `${e.message} 🚨`
});
}), t;
-}, Et = [], Fu = (t, e) => {
+}, xt = [], bu = (t, e) => {
if (!t)
return;
const n = /style\s*=\s*['"][^'"]*['"]/g, s = [...t.content.matchAll(n)];
let r = 0;
s?.forEach((o) => {
const u = T(t.content.trim(), o[0], r);
- Et.push({
+ xt.push({
filePath: e,
message: `line #${u} Found inline style: ${o[0]}`
}), r = u;
});
}, Cu = () => {
const t = [];
- return Et.length > 0 && Et.forEach((e) => {
+ return xt.length > 0 && xt.forEach((e) => {
t.push({
file: e.filePath,
rule: "rrd ~ no Inline Styles",
@@ -2770,20 +2809,20 @@ const iu = (t, e, n) => {
message: `${e.message} 🚨`
});
}), t;
-}, xt = [], Eu = (t, e) => {
+}, wt = [], Fu = (t, e) => {
if (!t)
return;
const n = /(?:const|let)\s*\{\s*([^}]+?)\s*\}\s*=\s*(?:defineProps|props)\s*\(\s*(?:(?:\[[^\]]*\]|\{[^}]*\})\s*)?\)/g;
- X(t.content).match(n)?.forEach((o) => {
+ Q(t.content).match(n)?.forEach((o) => {
const u = T(t.content, o);
- xt.push({
+ wt.push({
filePath: e,
message: `line #${u} props destructuring found: ${o}`
});
});
-}, xu = () => {
+}, Eu = () => {
const t = [];
- return xt.length > 0 && xt.forEach((e) => {
+ return wt.length > 0 && wt.forEach((e) => {
t.push({
file: e.filePath,
rule: "rrd ~ no Prop Destructure",
@@ -2791,20 +2830,20 @@ const iu = (t, e, n) => {
message: `${e.message} 🚨`
});
}), t;
-}, wt = [], wu = (t, e) => {
+}, _t = [], xu = (t, e) => {
if (!t)
return;
const n = /\bvar\s+(\w+(\s*=[^;]*)?|\{[^}]*\}(\s*=[^;]*)?)\s*;?/g;
- X(t.content).match(n)?.forEach((o) => {
+ Q(t.content).match(n)?.forEach((o) => {
const u = T(t.content, o);
- wt.push({
+ _t.push({
filePath: e,
message: `line #${u} Avoid using 'var' for variable declarations: ${o}`
});
});
-}, _u = () => {
+}, wu = () => {
const t = [];
- return wt.length > 0 && wt.forEach((e) => {
+ return _t.length > 0 && _t.forEach((e) => {
t.push({
file: e.filePath,
rule: "rrd ~ No Var Declaration",
@@ -2812,31 +2851,31 @@ const iu = (t, e, n) => {
message: `${e.message} 🚨`
});
}), t;
-}, _t = [], Fs = 3, Mn = (t, e, n) => {
+}, yt = [], bs = 3, Mn = (t, e, n) => {
const s = e.split(",").map((r) => r.trim()).filter((r) => r.length > 0);
- s.length > Fs && _t.push({ filePath: n, message: `function ${t} has ${s.length} parameters` });
-}, yu = (t, e) => {
+ s.length > bs && yt.push({ filePath: n, message: `function ${t} has ${s.length} parameters` });
+}, _u = (t, e) => {
if (!t)
return;
const n = /function\s+([\w$]+)\s*\(([^)]*)\)\s*\{|const\s+([\w$]+)\s*=\s*\(([^)]*)\)\s*=>\s*\{/g;
let s;
for (; (s = n.exec(t.content)) !== null; )
s[1] && Mn(s[1], s[2], e), s[3] && Mn(s[3], s[4], e);
-}, Au = () => {
+}, yu = () => {
const t = [];
- return _t.length > 0 && _t.forEach((e) => {
+ return yt.length > 0 && yt.forEach((e) => {
t.push({
file: e.filePath,
rule: "rrd ~ parameter count",
- description: `👉 Max number of function parameters should be ${Fs}. See: https://vue-mess-detector.webmania.cc/rules/rrd/parameter-count.html`,
+ description: `👉 Max number of function parameters should be ${bs}. See: https://vue-mess-detector.webmania.cc/rules/rrd/parameter-count.html`,
message: `${e.message} 🚨`
});
}), t;
-}, yt = [], vu = (t, e) => {
- !t || t.setup || yt.push({ filePath: e, message: "Plain