diff --git a/dist/vue-mess-detector.es.js b/dist/vue-mess-detector.es.js index f51b4fda..a3b0884b 100644 --- a/dist/vue-mess-detector.es.js +++ b/dist/vue-mess-detector.es.js @@ -1,7 +1,7 @@ import _t from "yargs"; import { format as tt, inspect as wt } from "util"; -import Me, { normalize as Ct, resolve as Y, dirname as We, basename as Ot, extname as xt, relative as jt } from "path"; -import Pe, { readFileSync as De, statSync as nt, readdirSync as St, writeFile as vt } from "fs"; +import De, { normalize as Ct, resolve as K, dirname as Pe, basename as Ot, extname as xt, relative as jt } from "path"; +import Te, { readFileSync as Ue, statSync as nt, readdirSync as St, writeFile as vt } from "fs"; import { notStrictEqual as Nt, strictEqual as Ft } from "assert"; import { fileURLToPath as Rt } from "url"; import { parse as Lt } from "@vue/compiler-sfc"; @@ -30,15 +30,15 @@ function Bt() { * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC */ -function X(e) { +function H(e) { if (e !== e.toLowerCase() && e !== e.toUpperCase() || (e = e.toLowerCase()), e.indexOf("-") === -1 && e.indexOf("_") === -1) return e; { let n = "", i = !1; const c = e.match(/^-+/); for (let a = c ? c[0].length : 0; a < e.length; a++) { - let p = e.charAt(a); - i && (i = !1, p = p.toUpperCase()), a !== 0 && (p === "-" || p === "_") ? i = !0 : p !== "-" && p !== "_" && (n += p); + let h = e.charAt(a); + i && (i = !1, h = h.toUpperCase()), a !== 0 && (h === "-" || h === "_") ? i = !0 : h !== "-" && h !== "_" && (n += h); } return n; } @@ -48,8 +48,8 @@ function ot(e, t) { t = t || "-"; let i = ""; for (let c = 0; c < e.length; c++) { - const a = n.charAt(c), p = e.charAt(c); - a !== p && c > 0 ? i += `${t}${n.charAt(c)}` : i += p; + const a = n.charAt(c), h = e.charAt(c); + a !== h && c > 0 ? i += `${t}${n.charAt(c)}` : i += h; } return i; } @@ -63,12 +63,12 @@ function rt(e) { */ function It(e) { if (Array.isArray(e)) - return e.map((p) => typeof p != "string" ? p + "" : p); + return e.map((h) => typeof h != "string" ? h + "" : h); e = e.trim(); let t = 0, n = null, i = null, c = null; const a = []; - for (let p = 0; p < e.length; p++) { - if (n = i, i = e.charAt(p), i === " " && !c) { + for (let h = 0; h < e.length; h++) { + if (n = i, i = e.charAt(h), i === " " && !c) { n !== " " && t++; continue; } @@ -113,7 +113,7 @@ class zt { number: void 0, __: void 0, key: void 0 - }, n), c = It(t), a = typeof t == "string", p = Mt(Object.assign(/* @__PURE__ */ Object.create(null), i.alias)), d = Object.assign({ + }, n), c = It(t), a = typeof t == "string", h = Mt(Object.assign(/* @__PURE__ */ Object.create(null), i.alias)), d = Object.assign({ "boolean-negation": !0, "camel-case-expansion": !0, "combine-arrays": !1, @@ -144,7 +144,7 @@ class zt { nargs: /* @__PURE__ */ Object.create(null), coercions: /* @__PURE__ */ Object.create(null), keys: [] - }, P = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/, xe = new RegExp("^--" + d["negation-prefix"] + "(.+)"); + }, T = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/, je = new RegExp("^--" + d["negation-prefix"] + "(.+)"); [].concat(i.array || []).filter(Boolean).forEach(function(s) { const r = typeof s == "object" ? s.key : s, u = Object.keys(s).map(function(l) { return { @@ -172,7 +172,7 @@ class zt { f.configs[s] = !0; }) : typeof i.config == "object" && Object.entries(i.config).forEach(([s, r]) => { (typeof r == "boolean" || typeof r == "function") && (f.configs[s] = r); - })), dt(i.key, p, i.default, f.arrays), Object.keys(_).forEach(function(s) { + })), dt(i.key, h, i.default, f.arrays), Object.keys(_).forEach(function(s) { (f.aliases[s] || []).forEach(function(r) { _[r] = _[s]; }); @@ -183,23 +183,23 @@ class zt { const C = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }), Ge = {}; for (let s = 0; s < c.length; s++) { const r = c[s], u = r.replace(/^-{3,}/, "---"); - let l, o, g, h, m, O; + let l, o, g, p, m, O; if (r !== "--" && /^-/.test(r) && Ee(r)) - je(r); + Se(r); else if (u.match(/^---+(=|$)/)) { - je(r); + Se(r); continue; } else if (r.match(/^--.+=/) || !d["short-option-groups"] && r.match(/^-.+=/)) - h = r.match(/^--?([^=]+)=([\s\S]*)$/), h !== null && Array.isArray(h) && h.length >= 3 && (b(h[1], f.arrays) ? s = be(s, h[1], c, h[2]) : b(h[1], f.nargs) !== !1 ? s = $e(s, h[1], c, h[2]) : A(h[1], h[2], !0)); - else if (r.match(xe) && d["boolean-negation"]) - h = r.match(xe), h !== null && Array.isArray(h) && h.length >= 2 && (o = h[1], A(o, b(o, f.arrays) ? [!1] : !1)); + p = r.match(/^--?([^=]+)=([\s\S]*)$/), p !== null && Array.isArray(p) && p.length >= 3 && (b(p[1], f.arrays) ? s = be(s, p[1], c, p[2]) : b(p[1], f.nargs) !== !1 ? s = $e(s, p[1], c, p[2]) : A(p[1], p[2], !0)); + else if (r.match(je) && d["boolean-negation"]) + p = r.match(je), p !== null && Array.isArray(p) && p.length >= 2 && (o = p[1], A(o, b(o, f.arrays) ? [!1] : !1)); else if (r.match(/^--.+/) || !d["short-option-groups"] && r.match(/^-[^-]+/)) - h = r.match(/^--?(.+)/), h !== null && Array.isArray(h) && h.length >= 2 && (o = h[1], b(o, f.arrays) ? s = be(s, o, c) : b(o, f.nargs) !== !1 ? s = $e(s, o, c) : (m = c[s + 1], m !== void 0 && (!m.match(/^-/) || m.match(P)) && !b(o, f.bools) && !b(o, f.counts) || /^(true|false)$/.test(m) ? (A(o, m), s++) : A(o, Q(o)))); + p = r.match(/^--?(.+)/), p !== null && Array.isArray(p) && p.length >= 2 && (o = p[1], b(o, f.arrays) ? s = be(s, o, c) : b(o, f.nargs) !== !1 ? s = $e(s, o, c) : (m = c[s + 1], m !== void 0 && (!m.match(/^-/) || m.match(T)) && !b(o, f.bools) && !b(o, f.counts) || /^(true|false)$/.test(m) ? (A(o, m), s++) : A(o, Q(o)))); else if (r.match(/^-.\..+=/)) - h = r.match(/^-([^=]+)=([\s\S]*)$/), h !== null && Array.isArray(h) && h.length >= 3 && A(h[1], h[2]); - else if (r.match(/^-.\..+/) && !r.match(P)) - m = c[s + 1], h = r.match(/^-(.\..+)/), h !== null && Array.isArray(h) && h.length >= 2 && (o = h[1], m !== void 0 && !m.match(/^-/) && !b(o, f.bools) && !b(o, f.counts) ? (A(o, m), s++) : A(o, Q(o))); - else if (r.match(/^-[^-]+/) && !r.match(P)) { + p = r.match(/^-([^=]+)=([\s\S]*)$/), p !== null && Array.isArray(p) && p.length >= 3 && A(p[1], p[2]); + else if (r.match(/^-.\..+/) && !r.match(T)) + m = c[s + 1], p = r.match(/^-(.\..+)/), p !== null && Array.isArray(p) && p.length >= 2 && (o = p[1], m !== void 0 && !m.match(/^-/) && !b(o, f.bools) && !b(o, f.counts) ? (A(o, m), s++) : A(o, Q(o))); + else if (r.match(/^-[^-]+/) && !r.match(T)) { g = r.slice(1, -1).split(""), l = !1; for (let S = 0; S < g.length; S++) { if (m = r.slice(S + 2), g[S + 1] && g[S + 1] === "=") { @@ -220,8 +220,8 @@ class zt { } else A(g[S], Q(g[S])); } - o = r.slice(-1)[0], !l && o !== "-" && (b(o, f.arrays) ? s = be(s, o, c) : b(o, f.nargs) !== !1 ? s = $e(s, o, c) : (m = c[s + 1], m !== void 0 && (!/^(-|--)[^-]/.test(m) || m.match(P)) && !b(o, f.bools) && !b(o, f.counts) || /^(true|false)$/.test(m) ? (A(o, m), s++) : A(o, Q(o)))); - } else if (r.match(/^-[0-9]$/) && r.match(P) && b(r.slice(1), f.bools)) + o = r.slice(-1)[0], !l && o !== "-" && (b(o, f.arrays) ? s = be(s, o, c) : b(o, f.nargs) !== !1 ? s = $e(s, o, c) : (m = c[s + 1], m !== void 0 && (!/^(-|--)[^-]/.test(m) || m.match(T)) && !b(o, f.bools) && !b(o, f.counts) || /^(true|false)$/.test(m) ? (A(o, m), s++) : A(o, Q(o)))); + } else if (r.match(/^-[0-9]$/) && r.match(T) && b(r.slice(1), f.bools)) o = r.slice(1), A(o, Q(o)); else if (r === "--") { me = c.slice(s + 1); @@ -230,18 +230,18 @@ class zt { me = c.slice(s); break; } else - je(r); + Se(r); } Qe(C, !0), Qe(C, !1), ut(C), ht(), Ke(C, f.aliases, _, !0), pt(C), d["set-placeholder-key"] && gt(C), Object.keys(f.counts).forEach(function(s) { - Z(C, s.split(".")) || A(s, 0); + Y(C, s.split(".")) || A(s, 0); }), B && me.length && (C[G] = []), me.forEach(function(s) { C[G].push(s); }), d["camel-case-expansion"] && d["strip-dashed"] && Object.keys(C).filter((s) => s !== "--" && s.includes("-")).forEach((s) => { delete C[s]; - }), d["strip-aliased"] && [].concat(...Object.keys(p).map((s) => p[s])).forEach((s) => { - d["camel-case-expansion"] && s.includes("-") && delete C[s.split(".").map((r) => X(r)).join(".")], delete C[s]; + }), d["strip-aliased"] && [].concat(...Object.keys(h).map((s) => h[s])).forEach((s) => { + d["camel-case-expansion"] && s.includes("-") && delete C[s.split(".").map((r) => H(r)).join(".")], delete C[s]; }); - function je(s) { + function Se(s) { const r = ye("_", s); (typeof r == "string" || typeof r == "number") && C._.push(r); } @@ -249,53 +249,53 @@ class zt { let o, g = b(r, f.nargs); if (g = typeof g != "number" || isNaN(g) ? 1 : g, g === 0) return I(l) || (R = Error(q("Argument unexpected for: %s", r))), A(r, Q(r)), s; - let h = I(l) ? 0 : 1; + let p = I(l) ? 0 : 1; if (d["nargs-eats-options"]) - u.length - (s + 1) + h < g && (R = Error(q("Not enough arguments following: %s", r))), h = g; + u.length - (s + 1) + p < g && (R = Error(q("Not enough arguments following: %s", r))), p = g; else { - for (o = s + 1; o < u.length && (!u[o].match(/^-[^0-9]/) || u[o].match(P) || Ee(u[o])); o++) - h++; - h < g && (R = Error(q("Not enough arguments following: %s", r))); + for (o = s + 1; o < u.length && (!u[o].match(/^-[^0-9]/) || u[o].match(T) || Ee(u[o])); o++) + p++; + p < g && (R = Error(q("Not enough arguments following: %s", r))); } - let m = Math.min(h, g); + let m = Math.min(p, g); for (!I(l) && m > 0 && (A(r, l), m--), o = s + 1; o < m + s + 1; o++) A(r, u[o]); return s + m; } function be(s, r, u, l) { let o = [], g = l || u[s + 1]; - const h = b(r, f.nargs); + const p = b(r, f.nargs); if (b(r, f.bools) && !/^(true|false)$/.test(g)) o.push(!0); - else if (I(g) || I(l) && /^-/.test(g) && !P.test(g) && !Ee(g)) { + else if (I(g) || I(l) && /^-/.test(g) && !T.test(g) && !Ee(g)) { if (_[r] !== void 0) { const m = _[r]; o = Array.isArray(m) ? m : [m]; } } else { - I(l) || o.push(Se(r, l, !0)); - for (let m = s + 1; m < u.length && !(!d["greedy-arrays"] && o.length > 0 || h && typeof h == "number" && o.length >= h || (g = u[m], /^-/.test(g) && !P.test(g) && !Ee(g))); m++) - s = m, o.push(Se(r, g, a)); + I(l) || o.push(ve(r, l, !0)); + for (let m = s + 1; m < u.length && !(!d["greedy-arrays"] && o.length > 0 || p && typeof p == "number" && o.length >= p || (g = u[m], /^-/.test(g) && !T.test(g) && !Ee(g))); m++) + s = m, o.push(ve(r, g, a)); } - return typeof h == "number" && (h && o.length < h || isNaN(h) && o.length === 0) && (R = Error(q("Not enough arguments following: %s", r))), A(r, o), s; + return typeof p == "number" && (p && o.length < p || isNaN(p) && o.length === 0) && (R = Error(q("Not enough arguments following: %s", r))), A(r, o), s; } function A(s, r, u = a) { if (/-/.test(s) && d["camel-case-expansion"]) { - const g = s.split(".").map(function(h) { - return X(h); + const g = s.split(".").map(function(p) { + return H(p); }).join("."); qe(s, g); } - const l = Se(s, r, u), o = s.split("."); - H(C, o, l), f.aliases[s] && f.aliases[s].forEach(function(g) { - const h = g.split("."); - H(C, h, l); + const l = ve(s, r, u), o = s.split("."); + Z(C, o, l), f.aliases[s] && f.aliases[s].forEach(function(g) { + const p = g.split("."); + Z(C, p, l); }), o.length > 1 && d["dot-notation"] && (f.aliases[o[0]] || []).forEach(function(g) { - let h = g.split("."); + let p = g.split("."); const m = [].concat(o); - m.shift(), h = h.concat(m), (f.aliases[s] || []).includes(h.join(".")) || H(C, h, l); - }), b(s, f.normalize) && !b(s, f.arrays) && [s].concat(f.aliases[s] || []).forEach(function(h) { - Object.defineProperty(Ge, h, { + m.shift(), p = p.concat(m), (f.aliases[s] || []).includes(p.join(".")) || Z(C, p, l); + }), b(s, f.normalize) && !b(s, f.arrays) && [s].concat(f.aliases[s] || []).forEach(function(p) { + Object.defineProperty(Ge, p, { enumerable: !0, get() { return r; @@ -309,12 +309,12 @@ class zt { function qe(s, r) { f.aliases[s] && f.aliases[s].length || (f.aliases[s] = [r], de[r] = !0), f.aliases[r] && f.aliases[r].length || qe(r, s); } - function Se(s, r, u) { + function ve(s, r, u) { u && (r = Dt(r)), (b(s, f.bools) || b(s, f.counts)) && typeof r == "string" && (r = r === "true"); let l = Array.isArray(r) ? r.map(function(o) { return ye(s, o); }) : ye(s, r); - return b(s, f.counts) && (I(l) || typeof l == "boolean") && (l = Ne()), b(s, f.normalize) && b(s, f.arrays) && (Array.isArray(r) ? l = r.map((o) => z.normalize(o)) : l = z.normalize(r)), l; + return b(s, f.counts) && (I(l) || typeof l == "boolean") && (l = Fe()), b(s, f.normalize) && b(s, f.arrays) && (Array.isArray(r) ? l = r.map((o) => z.normalize(o)) : l = z.normalize(r)), l; } function ye(s, r) { return !d["parse-positional-numbers"] && s === "_" || !b(s, f.strings) && !b(s, f.bools) && !Array.isArray(r) && (rt(r) && d["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${r}`))) || !I(r) && b(s, f.numbers)) && (r = Number(r)), r; @@ -326,10 +326,10 @@ class zt { if (l) try { let o = null; - const g = z.resolve(z.cwd(), l), h = f.configs[u]; - if (typeof h == "function") { + const g = z.resolve(z.cwd(), l), p = f.configs[u]; + if (typeof p == "function") { try { - o = h(g); + o = p(g); } catch (m) { o = m; } @@ -339,21 +339,21 @@ class zt { } } else o = z.require(g); - ve(o); + Ne(o); } catch (o) { o.name === "PermissionDenied" ? R = o : s[u] && (R = Error(q("Invalid JSON config file: %s", l))); } }); } - function ve(s, r) { + function Ne(s, r) { Object.keys(s).forEach(function(u) { const l = s[u], o = r ? r + "." + u : u; - typeof l == "object" && l !== null && !Array.isArray(l) && d["dot-notation"] ? ve(l, o) : (!Z(C, o.split(".")) || b(o, f.arrays) && d["combine-arrays"]) && A(o, l); + typeof l == "object" && l !== null && !Array.isArray(l) && d["dot-notation"] ? Ne(l, o) : (!Y(C, o.split(".")) || b(o, f.arrays) && d["combine-arrays"]) && A(o, l); }); } function ht() { typeof N < "u" && N.forEach(function(s) { - ve(s); + Ne(s); }); } function Qe(s, r) { @@ -362,10 +362,10 @@ class zt { const u = typeof w == "string" ? w : "", l = z.env(); Object.keys(l).forEach(function(o) { if (u === "" || o.lastIndexOf(u, 0) === 0) { - const g = o.split("__").map(function(h, m) { - return m === 0 && (h = h.substring(u.length)), X(h); + const g = o.split("__").map(function(p, m) { + return m === 0 && (p = p.substring(u.length)), H(p); }); - (r && f.configs[g.join(".")] || !r) && !Z(s, g) && A(g.join("."), l[o]); + (r && f.configs[g.join(".")] || !r) && !Y(s, g) && A(g.join("."), l[o]); } }); } @@ -391,12 +391,12 @@ class zt { } function Ke(s, r, u, l = !1) { Object.keys(u).forEach(function(o) { - Z(s, o.split(".")) || (H(s, o.split("."), u[o]), l && (Ve[o] = !0), (r[o] || []).forEach(function(g) { - Z(s, g.split(".")) || H(s, g.split("."), u[o]); + Y(s, o.split(".")) || (Z(s, o.split("."), u[o]), l && (Ve[o] = !0), (r[o] || []).forEach(function(g) { + Y(s, g.split(".")) || Z(s, g.split("."), u[o]); })); }); } - function Z(s, r) { + function Y(s, r) { let u = s; d["dot-notation"] || (r = [r.join(".")]), r.slice(0, -1).forEach(function(o) { u = u[o] || {}; @@ -404,21 +404,21 @@ class zt { const l = r[r.length - 1]; return typeof u != "object" ? !1 : l in u; } - function H(s, r, u) { + function Z(s, r, u) { let l = s; d["dot-notation"] || (r = [r.join(".")]), r.slice(0, -1).forEach(function(O) { O = Ze(O), typeof l == "object" && l[O] === void 0 && (l[O] = {}), typeof l[O] != "object" || Array.isArray(l[O]) ? (Array.isArray(l[O]) ? l[O].push({}) : l[O] = [l[O], {}], l = l[O][l[O].length - 1]) : l = l[O]; }); - const o = Ze(r[r.length - 1]), g = b(r.join("."), f.arrays), h = Array.isArray(u); + const o = Ze(r[r.length - 1]), g = b(r.join("."), f.arrays), p = Array.isArray(u); let m = d["duplicate-arguments-array"]; - !m && b(o, f.nargs) && (m = !0, (!I(l[o]) && f.nargs[o] === 1 || Array.isArray(l[o]) && l[o].length === f.nargs[o]) && (l[o] = void 0)), u === Ne() ? l[o] = Ne(l[o]) : Array.isArray(l[o]) ? m && g && h ? l[o] = d["flatten-duplicate-arrays"] ? l[o].concat(u) : (Array.isArray(l[o][0]) ? l[o] : [l[o]]).concat([u]) : !m && !!g == !!h ? l[o] = u : l[o] = l[o].concat([u]) : l[o] === void 0 && g ? l[o] = h ? u : [u] : m && !(l[o] === void 0 || b(o, f.counts) || b(o, f.bools)) ? l[o] = [l[o], u] : l[o] = u; + !m && b(o, f.nargs) && (m = !0, (!I(l[o]) && f.nargs[o] === 1 || Array.isArray(l[o]) && l[o].length === f.nargs[o]) && (l[o] = void 0)), u === Fe() ? l[o] = Fe(l[o]) : Array.isArray(l[o]) ? m && g && p ? l[o] = d["flatten-duplicate-arrays"] ? l[o].concat(u) : (Array.isArray(l[o][0]) ? l[o] : [l[o]]).concat([u]) : !m && !!g == !!p ? l[o] = u : l[o] = l[o].concat([u]) : l[o] === void 0 && g ? l[o] = p ? u : [u] : m && !(l[o] === void 0 || b(o, f.counts) || b(o, f.bools)) ? l[o] = [l[o], u] : l[o] = u; } function dt(...s) { s.forEach(function(r) { Object.keys(r || {}).forEach(function(u) { - f.aliases[u] || (f.aliases[u] = [].concat(p[u] || []), f.aliases[u].concat(u).forEach(function(l) { + f.aliases[u] || (f.aliases[u] = [].concat(h[u] || []), f.aliases[u].concat(u).forEach(function(l) { if (/-/.test(l) && d["camel-case-expansion"]) { - const o = X(l); + const o = H(l); o !== u && f.aliases[u].indexOf(o) === -1 && (f.aliases[u].push(o), de[o] = !0); } }), f.aliases[u].concat(u).forEach(function(l) { @@ -451,7 +451,7 @@ class zt { }); } function $t(s) { - if (s.match(P) || !s.match(/^-[^-]+/)) + if (s.match(T) || !s.match(/^-[^-]+/)) return !1; let r = !0, u; const l = s.slice(1).split(""); @@ -469,7 +469,7 @@ class zt { return d["unknown-options-as-args"] && bt(s); } function bt(s) { - return s = s.replace(/^-{3,}/, "--"), s.match(P) || $t(s) ? !1 : !mt(s, /^-+([^=]+?)=[\s\S]*$/, xe, /^-+([^=]+?)$/, /^-+([^=]+?)-$/, /^-+([^=]+?\d+)$/, /^-+([^=]+?)\W+.*$/); + return s = s.replace(/^-{3,}/, "--"), s.match(T) || $t(s) ? !1 : !mt(s, /^-+([^=]+?)=[\s\S]*$/, je, /^-+([^=]+?)$/, /^-+([^=]+?)-$/, /^-+([^=]+?\d+)$/, /^-+([^=]+?)\W+.*$/); } function Q(s) { return !b(s, f.bools) && !b(s, f.counts) && `${s}` in _ ? _[s] : yt(Et(s)); @@ -519,14 +519,14 @@ function Mt(e) { } } return t.forEach(function(c) { - c = c.filter(function(p, d, _) { - return _.indexOf(p) === d; + c = c.filter(function(h, d, _) { + return _.indexOf(h) === d; }); const a = c.pop(); a !== void 0 && typeof a == "string" && (n[a] = c); }), n; } -function Ne(e) { +function Fe(e) { return e !== void 0 ? e + 1 : 1; } function Ze(e) { @@ -543,8 +543,8 @@ function Dt(e) { * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC */ -var Fe, Re, Le; -const He = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12, Xe = (Re = (Fe = process == null ? void 0 : process.versions) === null || Fe === void 0 ? void 0 : Fe.node) !== null && Re !== void 0 ? Re : (Le = process == null ? void 0 : process.version) === null || Le === void 0 ? void 0 : Le.slice(1); +var Re, Le, We; +const He = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12, Xe = (Le = (Re = process == null ? void 0 : process.versions) === null || Re === void 0 ? void 0 : Re.node) !== null && Le !== void 0 ? Le : (We = process == null ? void 0 : process.version) === null || We === void 0 ? void 0 : We.slice(1); if (Xe && Number(Xe.match(/^([^.]+)/)[1]) < He) throw Error(`yargs parser supports a minimum Node.js version of ${He}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`); const Ut = process ? process.env : {}, it = new zt({ @@ -552,14 +552,14 @@ const Ut = process ? process.env : {}, it = new zt({ env: () => Ut, format: tt, normalize: Ct, - resolve: Y, + resolve: K, // TODO: figure out a way to combine ESM and CJS coverage, such that // we can exercise all the lines below: require: (e) => { if (typeof require < "u") return require(e); if (e.match(/\.json$/)) - return JSON.parse(De(e, "utf8")); + return JSON.parse(Ue(e, "utf8")); throw Error("only .json config files are supported in ESM"); } }), ge = function(t, n) { @@ -568,7 +568,7 @@ const Ut = process ? process.env : {}, it = new zt({ ge.detailed = function(e, t) { return it.parse(e.slice(), t); }; -ge.camelCase = X; +ge.camelCase = H; ge.decamelize = ot; ge.looksLikeNumber = rt; const Vt = { @@ -603,10 +603,10 @@ class Qt { return n.forEach((c) => { c.length > 1 && F.stringWidth(c[0]) > i && (i = Math.min(Math.floor(this.width * 0.5), F.stringWidth(c[0]))); }), n.forEach((c) => { - this.div(...c.map((a, p) => ({ + this.div(...c.map((a, h) => ({ text: a.trim(), padding: this.measurePadding(a), - width: p === 0 && c.length > 1 ? i : void 0 + width: h === 0 && c.length > 1 ? i : void 0 }))); }), this.rows[this.rows.length - 1]; } @@ -630,10 +630,10 @@ class Qt { rowToString(t, n) { return this.rasterize(t).forEach((i, c) => { let a = ""; - i.forEach((p, d) => { + i.forEach((h, d) => { const { width: _ } = t[d], N = this.negatePadding(t[d]); - let w = p; - if (N > F.stringWidth(p) && (w += " ".repeat(N - F.stringWidth(p))), t[d].align && t[d].align !== "left" && this.wrap) { + let w = h; + if (N > F.stringWidth(h) && (w += " ".repeat(N - F.stringWidth(h))), t[d].align && t[d].align !== "left" && this.wrap) { const G = Vt[t[d].align]; w = G(w, N), F.stringWidth(w) < N && (w += " ".repeat((_ || 0) - F.stringWidth(w) - 1)); } @@ -648,19 +648,19 @@ class Qt { // if the full 'source' can render in // the target line, do so. renderInline(t, n) { - const i = t.match(/^ */), c = i ? i[0].length : 0, a = n.text, p = F.stringWidth(a.trimRight()); - return n.span ? this.wrap ? c < p ? t : (n.hidden = !0, a.trimRight() + " ".repeat(c - p) + t.trimLeft()) : (n.hidden = !0, a + t) : t; + const i = t.match(/^ */), c = i ? i[0].length : 0, a = n.text, h = F.stringWidth(a.trimRight()); + return n.span ? this.wrap ? c < h ? t : (n.hidden = !0, a.trimRight() + " ".repeat(c - h) + t.trimLeft()) : (n.hidden = !0, a + t) : t; } rasterize(t) { const n = [], i = this.columnWidths(t); let c; - return t.forEach((a, p) => { - a.width = i[p], this.wrap ? c = F.wrap(a.text, this.negatePadding(a), { hard: !0 }).split(` + return t.forEach((a, h) => { + a.width = i[h], this.wrap ? c = F.wrap(a.text, this.negatePadding(a), { hard: !0 }).split(` `) : c = a.text.split(` `), a.border && (c.unshift("." + "-".repeat(this.negatePadding(a) + 2) + "."), c.push("'" + "-".repeat(this.negatePadding(a) + 2) + "'")), a.padding && (c.unshift(...new Array(a.padding[Gt] || 0).fill("")), c.push(...new Array(a.padding[qt] || 0).fill(""))), c.forEach((d, _) => { n[_] || n.push([]); const N = n[_]; - for (let w = 0; w < p; w++) + for (let w = 0; w < h; w++) N[w] === void 0 && N.push(""); N.push(d); }); @@ -672,13 +672,13 @@ class Qt { } columnWidths(t) { if (!this.wrap) - return t.map((p) => p.width || F.stringWidth(p.text)); + return t.map((h) => h.width || F.stringWidth(h.text)); let n = t.length, i = this.width; - const c = t.map((p) => { - if (p.width) - return n--, i -= p.width, p.width; + const c = t.map((h) => { + if (h.width) + return n--, i -= h.width, h.width; }), a = n ? Math.floor(i / n) : 0; - return c.map((p, d) => p === void 0 ? Math.max(a, Kt(t[d])) : p); + return c.map((h, d) => h === void 0 ? Math.max(a, Kt(t[d])) : h); } } function Je(e, t, n) { @@ -729,21 +729,21 @@ function kt(e) { }); } function en(e, t) { - let n = Y(".", e), i; - for (nt(n).isDirectory() || (n = We(n)); ; ) { + let n = K(".", e), i; + for (nt(n).isDirectory() || (n = Pe(n)); ; ) { if (i = t(n, St(n)), i) - return Y(n, i); - if (n = We(i = n), i === n) + return K(n, i); + if (n = Pe(i = n), i === n) break; } } const tn = { fs: { - readFileSync: De, + readFileSync: Ue, writeFile: vt }, format: tt, - resolve: Y, + resolve: K, exists: (e) => { try { return nt(e).isFile(); @@ -775,8 +775,8 @@ class nn { let a = function() { }; typeof t[t.length - 1] == "function" && (a = t.pop()), this.cache[this.locale] || this._readLocaleFile(); - let p = c === 1 ? n : i; - this.cache[this.locale][n] && (p = this.cache[this.locale][n][c === 1 ? "one" : "other"]), !this.cache[this.locale][n] && this.updateFiles ? (this.cache[this.locale][n] = { + let h = c === 1 ? n : i; + this.cache[this.locale][n] && (h = this.cache[this.locale][n][c === 1 ? "one" : "other"]), !this.cache[this.locale][n] && this.updateFiles ? (this.cache[this.locale][n] = { one: n, other: i }, this._enqueueWrite({ @@ -784,8 +784,8 @@ class nn { locale: this.locale, cb: a })) : a(); - const d = [p]; - return ~p.indexOf("%d") && d.push(c), L.format.apply(L.format, d.concat(t)); + const d = [h]; + return ~h.indexOf("%d") && d.push(c), L.format.apply(L.format, d.concat(t)); } setLocale(t) { this.locale = t; @@ -801,16 +801,16 @@ class nn { _taggedLiteral(t, ...n) { let i = ""; return t.forEach(function(c, a) { - const p = n[a + 1]; - i += c, typeof p < "u" && (i += "%s"); + const h = n[a + 1]; + i += c, typeof h < "u" && (i += "%s"); }), this.__.apply(this, [i].concat([].slice.call(n, 1))); } _enqueueWrite(t) { this.writeQueue.push(t), this.writeQueue.length === 1 && this._processWriteQueue(); } _processWriteQueue() { - const t = this, n = this.writeQueue[0], i = n.directory, c = n.locale, a = n.cb, p = this._resolveLocaleFile(i, c), d = JSON.stringify(this.cache[c], null, 2); - L.fs.writeFile(p, d, "utf-8", function(_) { + const t = this, n = this.writeQueue[0], i = n.directory, c = n.locale, a = n.cb, h = this._resolveLocaleFile(i, c), d = JSON.stringify(this.cache[c], null, 2); + L.fs.writeFile(h, d, "utf-8", function(_) { t.writeQueue.shift(), t.writeQueue.length > 0 && t._processWriteQueue(), a(_); }); } @@ -859,139 +859,152 @@ try { pe = process.cwd(); } const cn = pe.substring(0, pe.lastIndexOf("node_modules")); -Nt, Ft, wt, cn || process.cwd(), Ot, We, xt, jt, Y, process.cwd, process.exit, process.nextTick, typeof process.stdout.columns < "u" && process.stdout.columns, De, on({ - directory: Y(pe, "../../../locales"), +Nt, Ft, wt, cn || process.cwd(), Ot, Pe, xt, jt, K, process.cwd, process.exit, process.nextTick, typeof process.stdout.columns < "u" && process.stdout.columns, Ue, on({ + directory: K(pe, "../../../locales"), updateFiles: !1 }); -const Te = "\x1B[44m", T = "\x1B[43m", v = "\x1B[41m", ln = "\x1B[42m", E = "\x1B[0m", x = "\x1B[33m", j = "\x1B[36m", y = "\x1B[0m", Be = 100, J = [], an = (e, t) => { +const Be = "\x1B[44m", P = "\x1B[43m", v = "\x1B[41m", ln = "\x1B[42m", E = "\x1B[0m", x = "\x1B[33m", j = "\x1B[36m", y = "\x1B[0m", Ie = 100, X = [], an = (e, t) => { const n = e.content.split(` `); - n.length > Be && J.push({ fileName: t, scriptLength: n.length }); -}, fn = () => (J.length > 0 && (console.log( + n.length > Ie && X.push({ fileName: t, scriptLength: n.length }); +}, fn = () => (X.length > 0 && (console.log( ` -${j}rrd${y} ${v}Long