From 536f11901339104d65710069550f8a500fc44bd1 Mon Sep 17 00:00:00 2001 From: rrd108 Date: Wed, 31 Jul 2024 17:56:40 +0200 Subject: [PATCH] chore update dist --- dist/vue-mess-detector.es.js | 1147 +++++++++++++++++---------------- dist/vue-mess-detector.umd.js | 96 +-- 2 files changed, 636 insertions(+), 607 deletions(-) diff --git a/dist/vue-mess-detector.es.js b/dist/vue-mess-detector.es.js index d14c31a6..065013cd 100644 --- a/dist/vue-mess-detector.es.js +++ b/dist/vue-mess-detector.es.js @@ -1,29 +1,29 @@ -import Dt from "yargs"; -import { format as bt, inspect as Gt } from "util"; -import nt, { normalize as qt, resolve as te, dirname as Xe, basename as Zt, extname as Kt, relative as Qt } from "path"; -import Ye, { readFileSync as ot, statSync as yt, readdirSync as Xt, writeFile as Yt } from "fs"; -import { notStrictEqual as Ht, strictEqual as kt } from "assert"; -import { fileURLToPath as Jt } from "url"; -import { parse as en } from "@vue/compiler-sfc"; -class xe extends Error { +import qt from "yargs"; +import { format as Et, inspect as Zt } from "util"; +import st, { normalize as Kt, resolve as te, dirname as ke, basename as Qt, extname as Xt, relative as Yt } from "path"; +import Je, { readFileSync as rt, statSync as Ct, readdirSync as Ht, writeFile as kt } from "fs"; +import { notStrictEqual as Jt, strictEqual as en } from "assert"; +import { fileURLToPath as tn } from "url"; +import { parse as nn } from "@vue/compiler-sfc"; +class Se extends Error { constructor(t) { - super(t || "yargs error"), this.name = "YError", Error.captureStackTrace && Error.captureStackTrace(this, xe); + super(t || "yargs error"), this.name = "YError", Error.captureStackTrace && Error.captureStackTrace(this, Se); } } -function Et() { - return tn() ? 0 : 1; +function At() { + return on() ? 0 : 1; } -function tn() { - return nn() && !process.defaultApp; +function on() { + return sn() && !process.defaultApp; } -function nn() { +function sn() { return !!process.versions.electron; } -function on(e) { - return e.slice(Et() + 1); +function rn(e) { + return e.slice(At() + 1); } -function sn() { - return process.argv[Et()]; +function cn() { + return process.argv[At()]; } /** * @license @@ -43,7 +43,7 @@ function se(e) { return n; } } -function Ct(e, t) { +function vt(e, t) { const n = e.toLowerCase(); t = t || "-"; let s = ""; @@ -53,7 +53,7 @@ function Ct(e, t) { } return s; } -function At(e) { +function _t(e) { return e == null ? !1 : typeof e == "number" || /^0x[0-9a-f]+$/i.test(e) ? !0 : /^0[^.]/.test(e) ? !1 : /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e); } /** @@ -61,7 +61,7 @@ function At(e) { * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC */ -function rn(e) { +function ln(e) { if (Array.isArray(e)) return e.map((h) => typeof h != "string" ? h + "" : h); e = e.trim(); @@ -91,7 +91,7 @@ var z; * SPDX-License-Identifier: ISC */ let Z; -class cn { +class an { constructor(t) { Z = t; } @@ -113,7 +113,7 @@ class cn { number: void 0, __: void 0, key: void 0 - }, n), c = rn(t), a = typeof t == "string", h = ln(Object.assign(/* @__PURE__ */ Object.create(null), s.alias)), g = Object.assign({ + }, n), c = ln(t), a = typeof t == "string", h = un(Object.assign(/* @__PURE__ */ Object.create(null), s.alias)), d = Object.assign({ "boolean-negation": !0, "camel-case-expansion": !0, "combine-arrays": !1, @@ -132,7 +132,7 @@ class cn { "strip-aliased": !1, "strip-dashed": !1, "unknown-options-as-args": !1 - }, s.configuration), C = Object.assign(/* @__PURE__ */ Object.create(null), s.default), R = s.configObjects || [], x = s.envPrefix, G = g["populate--"], Y = G ? "--" : "_", Fe = /* @__PURE__ */ Object.create(null), st = /* @__PURE__ */ Object.create(null), H = s.__ || Z.format, u = { + }, s.configuration), C = Object.assign(/* @__PURE__ */ Object.create(null), s.default), j = s.configObjects || [], w = s.envPrefix, G = d["populate--"], Y = G ? "--" : "_", Te = /* @__PURE__ */ Object.create(null), it = /* @__PURE__ */ Object.create(null), H = s.__ || Z.format, u = { aliases: /* @__PURE__ */ Object.create(null), arrays: /* @__PURE__ */ Object.create(null), bools: /* @__PURE__ */ Object.create(null), @@ -144,7 +144,7 @@ class cn { nargs: /* @__PURE__ */ Object.create(null), coercions: /* @__PURE__ */ Object.create(null), keys: [] - }, D = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/, Ve = new RegExp("^--" + g["negation-prefix"] + "(.+)"); + }, D = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/, Ge = new RegExp("^--" + d["negation-prefix"] + "(.+)"); [].concat(s.array || []).filter(Boolean).forEach(function(o) { const i = typeof o == "object" ? o.key : o, f = Object.keys(o).map(function(l) { return { @@ -172,130 +172,130 @@ class cn { u.configs[o] = !0; }) : typeof s.config == "object" && Object.entries(s.config).forEach(([o, i]) => { (typeof i == "boolean" || typeof i == "function") && (u.configs[o] = i); - })), It(s.key, h, s.default, u.arrays), Object.keys(C).forEach(function(o) { + })), Pt(s.key, h, s.default, u.arrays), Object.keys(C).forEach(function(o) { (u.aliases[o] || []).forEach(function(i) { C[i] = C[o]; }); }); let P = null; - Ut(); - let Re = []; - const O = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }), rt = {}; + Gt(); + let We = []; + const F = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }), ct = {}; for (let o = 0; o < c.length; o++) { const i = c[o], f = i.replace(/^-{3,}/, "---"); - let l, r, d, p, m, F; - if (i !== "--" && /^-/.test(i) && Ie(i)) - Ue(i); + let l, r, g, p, m, R; + if (i !== "--" && /^-/.test(i) && Me(i)) + qe(i); else if (f.match(/^---+(=|$)/)) { - Ue(i); + qe(i); continue; - } else if (i.match(/^--.+=/) || !g["short-option-groups"] && i.match(/^-.+=/)) - p = i.match(/^--?([^=]+)=([\s\S]*)$/), p !== null && Array.isArray(p) && p.length >= 3 && (E(p[1], u.arrays) ? o = Te(o, p[1], c, p[2]) : E(p[1], u.nargs) !== !1 ? o = Le(o, p[1], c, p[2]) : v(p[1], p[2], !0)); - else if (i.match(Ve) && g["boolean-negation"]) - p = i.match(Ve), p !== null && Array.isArray(p) && p.length >= 2 && (r = p[1], v(r, E(r, u.arrays) ? [!1] : !1)); - else if (i.match(/^--.+/) || !g["short-option-groups"] && i.match(/^-[^-]+/)) - p = i.match(/^--?(.+)/), p !== null && Array.isArray(p) && p.length >= 2 && (r = p[1], E(r, u.arrays) ? o = Te(o, r, c) : E(r, u.nargs) !== !1 ? o = Le(o, r, c) : (m = c[o + 1], m !== void 0 && (!m.match(/^-/) || m.match(D)) && !E(r, u.bools) && !E(r, u.counts) || /^(true|false)$/.test(m) ? (v(r, m), o++) : v(r, J(r)))); + } else if (i.match(/^--.+=/) || !d["short-option-groups"] && i.match(/^-.+=/)) + p = i.match(/^--?([^=]+)=([\s\S]*)$/), p !== null && Array.isArray(p) && p.length >= 3 && (E(p[1], u.arrays) ? o = Be(o, p[1], c, p[2]) : E(p[1], u.nargs) !== !1 ? o = Ie(o, p[1], c, p[2]) : x(p[1], p[2], !0)); + else if (i.match(Ge) && d["boolean-negation"]) + p = i.match(Ge), p !== null && Array.isArray(p) && p.length >= 2 && (r = p[1], x(r, E(r, u.arrays) ? [!1] : !1)); + else if (i.match(/^--.+/) || !d["short-option-groups"] && i.match(/^-[^-]+/)) + p = i.match(/^--?(.+)/), p !== null && Array.isArray(p) && p.length >= 2 && (r = p[1], E(r, u.arrays) ? o = Be(o, r, c) : E(r, u.nargs) !== !1 ? o = Ie(o, r, c) : (m = c[o + 1], m !== void 0 && (!m.match(/^-/) || m.match(D)) && !E(r, u.bools) && !E(r, u.counts) || /^(true|false)$/.test(m) ? (x(r, m), o++) : x(r, J(r)))); else if (i.match(/^-.\..+=/)) - p = i.match(/^-([^=]+)=([\s\S]*)$/), p !== null && Array.isArray(p) && p.length >= 3 && v(p[1], p[2]); + p = i.match(/^-([^=]+)=([\s\S]*)$/), p !== null && Array.isArray(p) && p.length >= 3 && x(p[1], p[2]); else if (i.match(/^-.\..+/) && !i.match(D)) - m = c[o + 1], p = i.match(/^-(.\..+)/), p !== null && Array.isArray(p) && p.length >= 2 && (r = p[1], m !== void 0 && !m.match(/^-/) && !E(r, u.bools) && !E(r, u.counts) ? (v(r, m), o++) : v(r, J(r))); + m = c[o + 1], p = i.match(/^-(.\..+)/), p !== null && Array.isArray(p) && p.length >= 2 && (r = p[1], m !== void 0 && !m.match(/^-/) && !E(r, u.bools) && !E(r, u.counts) ? (x(r, m), o++) : x(r, J(r))); else if (i.match(/^-[^-]+/) && !i.match(D)) { - d = i.slice(1, -1).split(""), l = !1; - for (let L = 0; L < d.length; L++) { - if (m = i.slice(L + 2), d[L + 1] && d[L + 1] === "=") { - F = i.slice(L + 3), r = d[L], E(r, u.arrays) ? o = Te(o, r, c, F) : E(r, u.nargs) !== !1 ? o = Le(o, r, c, F) : v(r, F), l = !0; + g = i.slice(1, -1).split(""), l = !1; + for (let L = 0; L < g.length; L++) { + if (m = i.slice(L + 2), g[L + 1] && g[L + 1] === "=") { + R = i.slice(L + 3), r = g[L], E(r, u.arrays) ? o = Be(o, r, c, R) : E(r, u.nargs) !== !1 ? o = Ie(o, r, c, R) : x(r, R), l = !0; break; } if (m === "-") { - v(d[L], m); + x(g[L], m); continue; } - if (/[A-Za-z]/.test(d[L]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(m) && E(m, u.bools) === !1) { - v(d[L], m), l = !0; + if (/[A-Za-z]/.test(g[L]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(m) && E(m, u.bools) === !1) { + x(g[L], m), l = !0; break; } - if (d[L + 1] && d[L + 1].match(/\W/)) { - v(d[L], m), l = !0; + if (g[L + 1] && g[L + 1].match(/\W/)) { + x(g[L], m), l = !0; break; } else - v(d[L], J(d[L])); + x(g[L], J(g[L])); } - r = i.slice(-1)[0], !l && r !== "-" && (E(r, u.arrays) ? o = Te(o, r, c) : E(r, u.nargs) !== !1 ? o = Le(o, r, c) : (m = c[o + 1], m !== void 0 && (!/^(-|--)[^-]/.test(m) || m.match(D)) && !E(r, u.bools) && !E(r, u.counts) || /^(true|false)$/.test(m) ? (v(r, m), o++) : v(r, J(r)))); + r = i.slice(-1)[0], !l && r !== "-" && (E(r, u.arrays) ? o = Be(o, r, c) : E(r, u.nargs) !== !1 ? o = Ie(o, r, c) : (m = c[o + 1], m !== void 0 && (!/^(-|--)[^-]/.test(m) || m.match(D)) && !E(r, u.bools) && !E(r, u.counts) || /^(true|false)$/.test(m) ? (x(r, m), o++) : x(r, J(r)))); } else if (i.match(/^-[0-9]$/) && i.match(D) && E(i.slice(1), u.bools)) - r = i.slice(1), v(r, J(r)); + r = i.slice(1), x(r, J(r)); else if (i === "--") { - Re = c.slice(o + 1); + We = c.slice(o + 1); break; - } else if (g["halt-at-non-option"]) { - Re = c.slice(o); + } else if (d["halt-at-non-option"]) { + We = c.slice(o); break; } else - Ue(i); + qe(i); } - ct(O, !0), ct(O, !1), Rt(O), Lt(), lt(O, u.aliases, C, !0), Tt(O), g["set-placeholder-key"] && Wt(O), Object.keys(u.counts).forEach(function(o) { - ne(O, o.split(".")) || v(o, 0); - }), G && Re.length && (O[Y] = []), Re.forEach(function(o) { - O[Y].push(o); - }), g["camel-case-expansion"] && g["strip-dashed"] && Object.keys(O).filter((o) => o !== "--" && o.includes("-")).forEach((o) => { - delete O[o]; - }), g["strip-aliased"] && [].concat(...Object.keys(h).map((o) => h[o])).forEach((o) => { - g["camel-case-expansion"] && o.includes("-") && delete O[o.split(".").map((i) => se(i)).join(".")], delete O[o]; + at(F, !0), at(F, !1), Tt(F), Wt(), ut(F, u.aliases, C, !0), It(F), d["set-placeholder-key"] && Bt(F), Object.keys(u.counts).forEach(function(o) { + ne(F, o.split(".")) || x(o, 0); + }), G && We.length && (F[Y] = []), We.forEach(function(o) { + F[Y].push(o); + }), d["camel-case-expansion"] && d["strip-dashed"] && Object.keys(F).filter((o) => o !== "--" && o.includes("-")).forEach((o) => { + delete F[o]; + }), d["strip-aliased"] && [].concat(...Object.keys(h).map((o) => h[o])).forEach((o) => { + d["camel-case-expansion"] && o.includes("-") && delete F[o.split(".").map((i) => se(i)).join(".")], delete F[o]; }); - function Ue(o) { - const i = We("_", o); - (typeof i == "string" || typeof i == "number") && O._.push(i); + function qe(o) { + const i = Pe("_", o); + (typeof i == "string" || typeof i == "number") && F._.push(i); } - function Le(o, i, f, l) { - let r, d = E(i, u.nargs); - if (d = typeof d != "number" || isNaN(d) ? 1 : d, d === 0) - return q(l) || (P = Error(H("Argument unexpected for: %s", i))), v(i, J(i)), o; + function Ie(o, i, f, l) { + let r, g = E(i, u.nargs); + if (g = typeof g != "number" || isNaN(g) ? 1 : g, g === 0) + return q(l) || (P = Error(H("Argument unexpected for: %s", i))), x(i, J(i)), o; let p = q(l) ? 0 : 1; - if (g["nargs-eats-options"]) - f.length - (o + 1) + p < d && (P = Error(H("Not enough arguments following: %s", i))), p = d; + if (d["nargs-eats-options"]) + f.length - (o + 1) + p < g && (P = Error(H("Not enough arguments following: %s", i))), p = g; else { - for (r = o + 1; r < f.length && (!f[r].match(/^-[^0-9]/) || f[r].match(D) || Ie(f[r])); r++) + for (r = o + 1; r < f.length && (!f[r].match(/^-[^0-9]/) || f[r].match(D) || Me(f[r])); r++) p++; - p < d && (P = Error(H("Not enough arguments following: %s", i))); + p < g && (P = Error(H("Not enough arguments following: %s", i))); } - let m = Math.min(p, d); - for (!q(l) && m > 0 && (v(i, l), m--), r = o + 1; r < m + o + 1; r++) - v(i, f[r]); + let m = Math.min(p, g); + for (!q(l) && m > 0 && (x(i, l), m--), r = o + 1; r < m + o + 1; r++) + x(i, f[r]); return o + m; } - function Te(o, i, f, l) { - let r = [], d = l || f[o + 1]; + function Be(o, i, f, l) { + let r = [], g = l || f[o + 1]; const p = E(i, u.nargs); - if (E(i, u.bools) && !/^(true|false)$/.test(d)) + if (E(i, u.bools) && !/^(true|false)$/.test(g)) r.push(!0); - else if (q(d) || q(l) && /^-/.test(d) && !D.test(d) && !Ie(d)) { + else if (q(g) || q(l) && /^-/.test(g) && !D.test(g) && !Me(g)) { if (C[i] !== void 0) { const m = C[i]; r = Array.isArray(m) ? m : [m]; } } else { - q(l) || r.push(De(i, l, !0)); - for (let m = o + 1; m < f.length && !(!g["greedy-arrays"] && r.length > 0 || p && typeof p == "number" && r.length >= p || (d = f[m], /^-/.test(d) && !D.test(d) && !Ie(d))); m++) - o = m, r.push(De(i, d, a)); + q(l) || r.push(Ze(i, l, !0)); + for (let m = o + 1; m < f.length && !(!d["greedy-arrays"] && r.length > 0 || p && typeof p == "number" && r.length >= p || (g = f[m], /^-/.test(g) && !D.test(g) && !Me(g))); m++) + o = m, r.push(Ze(i, g, a)); } - return typeof p == "number" && (p && r.length < p || isNaN(p) && r.length === 0) && (P = Error(H("Not enough arguments following: %s", i))), v(i, r), o; + return typeof p == "number" && (p && r.length < p || isNaN(p) && r.length === 0) && (P = Error(H("Not enough arguments following: %s", i))), x(i, r), o; } - function v(o, i, f = a) { - if (/-/.test(o) && g["camel-case-expansion"]) { - const d = o.split(".").map(function(p) { + function x(o, i, f = a) { + if (/-/.test(o) && d["camel-case-expansion"]) { + const g = o.split(".").map(function(p) { return se(p); }).join("."); - it(o, d); + lt(o, g); } - const l = De(o, i, f), r = o.split("."); - oe(O, r, l), u.aliases[o] && u.aliases[o].forEach(function(d) { - const p = d.split("."); - oe(O, p, l); - }), r.length > 1 && g["dot-notation"] && (u.aliases[r[0]] || []).forEach(function(d) { - let p = d.split("."); + const l = Ze(o, i, f), r = o.split("."); + oe(F, r, l), u.aliases[o] && u.aliases[o].forEach(function(g) { + const p = g.split("."); + oe(F, p, l); + }), r.length > 1 && d["dot-notation"] && (u.aliases[r[0]] || []).forEach(function(g) { + let p = g.split("."); const m = [].concat(r); - m.shift(), p = p.concat(m), (u.aliases[o] || []).includes(p.join(".")) || oe(O, p, l); + m.shift(), p = p.concat(m), (u.aliases[o] || []).includes(p.join(".")) || oe(F, p, l); }), E(o, u.normalize) && !E(o, u.arrays) && [o].concat(u.aliases[o] || []).forEach(function(p) { - Object.defineProperty(rt, p, { + Object.defineProperty(ct, p, { enumerable: !0, get() { return i; @@ -306,30 +306,30 @@ class cn { }); }); } - function it(o, i) { - u.aliases[o] && u.aliases[o].length || (u.aliases[o] = [i], Fe[i] = !0), u.aliases[i] && u.aliases[i].length || it(i, o); + function lt(o, i) { + u.aliases[o] && u.aliases[o].length || (u.aliases[o] = [i], Te[i] = !0), u.aliases[i] && u.aliases[i].length || lt(i, o); } - function De(o, i, f) { - f && (i = an(i)), (E(o, u.bools) || E(o, u.counts)) && typeof i == "string" && (i = i === "true"); + function Ze(o, i, f) { + f && (i = fn(i)), (E(o, u.bools) || E(o, u.counts)) && typeof i == "string" && (i = i === "true"); let l = Array.isArray(i) ? i.map(function(r) { - return We(o, r); - }) : We(o, i); - return E(o, u.counts) && (q(l) || typeof l == "boolean") && (l = qe()), E(o, u.normalize) && E(o, u.arrays) && (Array.isArray(i) ? l = i.map((r) => Z.normalize(r)) : l = Z.normalize(i)), l; + return Pe(o, r); + }) : Pe(o, i); + return E(o, u.counts) && (q(l) || typeof l == "boolean") && (l = Qe()), E(o, u.normalize) && E(o, u.arrays) && (Array.isArray(i) ? l = i.map((r) => Z.normalize(r)) : l = Z.normalize(i)), l; } - function We(o, i) { - return !g["parse-positional-numbers"] && o === "_" || !E(o, u.strings) && !E(o, u.bools) && !Array.isArray(i) && (At(i) && g["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${i}`))) || !q(i) && E(o, u.numbers)) && (i = Number(i)), i; + function Pe(o, i) { + return !d["parse-positional-numbers"] && o === "_" || !E(o, u.strings) && !E(o, u.bools) && !Array.isArray(i) && (_t(i) && d["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${i}`))) || !q(i) && E(o, u.numbers)) && (i = Number(i)), i; } - function Rt(o) { + function Tt(o) { const i = /* @__PURE__ */ Object.create(null); - lt(i, u.aliases, C), Object.keys(u.configs).forEach(function(f) { + ut(i, u.aliases, C), Object.keys(u.configs).forEach(function(f) { const l = o[f] || i[f]; if (l) try { let r = null; - const d = Z.resolve(Z.cwd(), l), p = u.configs[f]; + const g = Z.resolve(Z.cwd(), l), p = u.configs[f]; if (typeof p == "function") { try { - r = p(d); + r = p(g); } catch (m) { r = m; } @@ -338,67 +338,67 @@ class cn { return; } } else - r = Z.require(d); - Ge(r); + r = Z.require(g); + Ke(r); } catch (r) { r.name === "PermissionDenied" ? P = r : o[f] && (P = Error(H("Invalid JSON config file: %s", l))); } }); } - function Ge(o, i) { + function Ke(o, i) { Object.keys(o).forEach(function(f) { const l = o[f], r = i ? i + "." + f : f; - typeof l == "object" && l !== null && !Array.isArray(l) && g["dot-notation"] ? Ge(l, r) : (!ne(O, r.split(".")) || E(r, u.arrays) && g["combine-arrays"]) && v(r, l); + typeof l == "object" && l !== null && !Array.isArray(l) && d["dot-notation"] ? Ke(l, r) : (!ne(F, r.split(".")) || E(r, u.arrays) && d["combine-arrays"]) && x(r, l); }); } - function Lt() { - typeof R < "u" && R.forEach(function(o) { - Ge(o); + function Wt() { + typeof j < "u" && j.forEach(function(o) { + Ke(o); }); } - function ct(o, i) { - if (typeof x > "u") + function at(o, i) { + if (typeof w > "u") return; - const f = typeof x == "string" ? x : "", l = Z.env(); + const f = typeof w == "string" ? w : "", l = Z.env(); Object.keys(l).forEach(function(r) { if (f === "" || r.lastIndexOf(f, 0) === 0) { - const d = r.split("__").map(function(p, m) { + const g = r.split("__").map(function(p, m) { return m === 0 && (p = p.substring(f.length)), se(p); }); - (i && u.configs[d.join(".")] || !i) && !ne(o, d) && v(d.join("."), l[r]); + (i && u.configs[g.join(".")] || !i) && !ne(o, g) && x(g.join("."), l[r]); } }); } - function Tt(o) { + function It(o) { let i; const f = /* @__PURE__ */ new Set(); Object.keys(o).forEach(function(l) { if (!f.has(l) && (i = E(l, u.coercions), typeof i == "function")) try { - const r = We(l, i(o[l])); - [].concat(u.aliases[l] || [], l).forEach((d) => { - f.add(d), o[d] = r; + const r = Pe(l, i(o[l])); + [].concat(u.aliases[l] || [], l).forEach((g) => { + f.add(g), o[g] = r; }); } catch (r) { P = r; } }); } - function Wt(o) { + function Bt(o) { return u.keys.forEach((i) => { ~i.indexOf(".") || typeof o[i] > "u" && (o[i] = void 0); }), o; } - function lt(o, i, f, l = !1) { + function ut(o, i, f, l = !1) { Object.keys(f).forEach(function(r) { - ne(o, r.split(".")) || (oe(o, r.split("."), f[r]), l && (st[r] = !0), (i[r] || []).forEach(function(d) { - ne(o, d.split(".")) || oe(o, d.split("."), f[r]); + ne(o, r.split(".")) || (oe(o, r.split("."), f[r]), l && (it[r] = !0), (i[r] || []).forEach(function(g) { + ne(o, g.split(".")) || oe(o, g.split("."), f[r]); })); }); } function ne(o, i) { let f = o; - g["dot-notation"] || (i = [i.join(".")]), i.slice(0, -1).forEach(function(r) { + d["dot-notation"] || (i = [i.join(".")]), i.slice(0, -1).forEach(function(r) { f = f[r] || {}; }); const l = i[i.length - 1]; @@ -406,25 +406,25 @@ class cn { } function oe(o, i, f) { let l = o; - g["dot-notation"] || (i = [i.join(".")]), i.slice(0, -1).forEach(function(F) { - F = ut(F), typeof l == "object" && l[F] === void 0 && (l[F] = {}), typeof l[F] != "object" || Array.isArray(l[F]) ? (Array.isArray(l[F]) ? l[F].push({}) : l[F] = [l[F], {}], l = l[F][l[F].length - 1]) : l = l[F]; + d["dot-notation"] || (i = [i.join(".")]), i.slice(0, -1).forEach(function(R) { + R = ht(R), typeof l == "object" && l[R] === void 0 && (l[R] = {}), typeof l[R] != "object" || Array.isArray(l[R]) ? (Array.isArray(l[R]) ? l[R].push({}) : l[R] = [l[R], {}], l = l[R][l[R].length - 1]) : l = l[R]; }); - const r = ut(i[i.length - 1]), d = E(i.join("."), u.arrays), p = Array.isArray(f); - let m = g["duplicate-arguments-array"]; - !m && E(r, u.nargs) && (m = !0, (!q(l[r]) && u.nargs[r] === 1 || Array.isArray(l[r]) && l[r].length === u.nargs[r]) && (l[r] = void 0)), f === qe() ? l[r] = qe(l[r]) : Array.isArray(l[r]) ? m && d && p ? l[r] = g["flatten-duplicate-arrays"] ? l[r].concat(f) : (Array.isArray(l[r][0]) ? l[r] : [l[r]]).concat([f]) : !m && !!d == !!p ? l[r] = f : l[r] = l[r].concat([f]) : l[r] === void 0 && d ? l[r] = p ? f : [f] : m && !(l[r] === void 0 || E(r, u.counts) || E(r, u.bools)) ? l[r] = [l[r], f] : l[r] = f; + const r = ht(i[i.length - 1]), g = E(i.join("."), u.arrays), p = Array.isArray(f); + let m = d["duplicate-arguments-array"]; + !m && E(r, u.nargs) && (m = !0, (!q(l[r]) && u.nargs[r] === 1 || Array.isArray(l[r]) && l[r].length === u.nargs[r]) && (l[r] = void 0)), f === Qe() ? l[r] = Qe(l[r]) : Array.isArray(l[r]) ? m && g && p ? l[r] = d["flatten-duplicate-arrays"] ? l[r].concat(f) : (Array.isArray(l[r][0]) ? l[r] : [l[r]]).concat([f]) : !m && !!g == !!p ? l[r] = f : l[r] = l[r].concat([f]) : l[r] === void 0 && g ? l[r] = p ? f : [f] : m && !(l[r] === void 0 || E(r, u.counts) || E(r, u.bools)) ? l[r] = [l[r], f] : l[r] = f; } - function It(...o) { + function Pt(...o) { o.forEach(function(i) { Object.keys(i || {}).forEach(function(f) { u.aliases[f] || (u.aliases[f] = [].concat(h[f] || []), u.aliases[f].concat(f).forEach(function(l) { - if (/-/.test(l) && g["camel-case-expansion"]) { + if (/-/.test(l) && d["camel-case-expansion"]) { const r = se(l); - r !== f && u.aliases[f].indexOf(r) === -1 && (u.aliases[f].push(r), Fe[r] = !0); + r !== f && u.aliases[f].indexOf(r) === -1 && (u.aliases[f].push(r), Te[r] = !0); } }), u.aliases[f].concat(f).forEach(function(l) { - if (l.length > 1 && /[A-Z]/.test(l) && g["camel-case-expansion"]) { - const r = Ct(l, "-"); - r !== f && u.aliases[f].indexOf(r) === -1 && (u.aliases[f].push(r), Fe[r] = !0); + if (l.length > 1 && /[A-Z]/.test(l) && d["camel-case-expansion"]) { + const r = vt(l, "-"); + r !== f && u.aliases[f].indexOf(r) === -1 && (u.aliases[f].push(r), Te[r] = !0); } }), u.aliases[f].forEach(function(l) { u.aliases[l] = [f].concat(u.aliases[f].filter(function(r) { @@ -435,28 +435,28 @@ class cn { }); } function E(o, i) { - const f = [].concat(u.aliases[o] || [], o), l = Object.keys(i), r = f.find((d) => l.includes(d)); + const f = [].concat(u.aliases[o] || [], o), l = Object.keys(i), r = f.find((g) => l.includes(g)); return r ? i[r] : !1; } - function at(o) { + function ft(o) { const i = Object.keys(u); return [].concat(i.map((l) => u[l])).some(function(l) { return Array.isArray(l) ? l.includes(o) : l[o]; }); } - function Bt(o, ...i) { + function Mt(o, ...i) { return [].concat(...i).some(function(l) { const r = o.match(l); - return r && at(r[1]); + return r && ft(r[1]); }); } - function Pt(o) { + function zt(o) { if (o.match(D) || !o.match(/^-[^-]+/)) return !1; let i = !0, f; const l = o.slice(1).split(""); for (let r = 0; r < l.length; r++) { - if (f = o.slice(r + 2), !at(l[r])) { + if (f = o.slice(r + 2), !ft(l[r])) { i = !1; break; } @@ -465,16 +465,16 @@ class cn { } return i; } - function Ie(o) { - return g["unknown-options-as-args"] && Mt(o); + function Me(o) { + return d["unknown-options-as-args"] && Vt(o); } - function Mt(o) { - return o = o.replace(/^-{3,}/, "--"), o.match(D) || Pt(o) ? !1 : !Bt(o, /^-+([^=]+?)=[\s\S]*$/, Ve, /^-+([^=]+?)$/, /^-+([^=]+?)-$/, /^-+([^=]+?\d+)$/, /^-+([^=]+?)\W+.*$/); + function Vt(o) { + return o = o.replace(/^-{3,}/, "--"), o.match(D) || zt(o) ? !1 : !Mt(o, /^-+([^=]+?)=[\s\S]*$/, Ge, /^-+([^=]+?)$/, /^-+([^=]+?)-$/, /^-+([^=]+?\d+)$/, /^-+([^=]+?)\W+.*$/); } function J(o) { - return !E(o, u.bools) && !E(o, u.counts) && `${o}` in C ? C[o] : zt(Vt(o)); + return !E(o, u.bools) && !E(o, u.counts) && `${o}` in C ? C[o] : Ut(Dt(o)); } - function zt(o) { + function Ut(o) { return { [z.BOOLEAN]: !0, [z.STRING]: "", @@ -482,27 +482,27 @@ class cn { [z.ARRAY]: [] }[o]; } - function Vt(o) { + function Dt(o) { let i = z.BOOLEAN; return E(o, u.strings) ? i = z.STRING : E(o, u.numbers) ? i = z.NUMBER : E(o, u.bools) ? i = z.BOOLEAN : E(o, u.arrays) && (i = z.ARRAY), i; } function q(o) { return o === void 0; } - function Ut() { + function Gt() { Object.keys(u.counts).find((o) => E(o, u.arrays) ? (P = Error(H("Invalid configuration: %s, opts.count excludes opts.array.", o)), !0) : E(o, u.nargs) ? (P = Error(H("Invalid configuration: %s, opts.count excludes opts.narg.", o)), !0) : !1); } return { aliases: Object.assign({}, u.aliases), - argv: Object.assign(rt, O), - configuration: g, - defaulted: Object.assign({}, st), + argv: Object.assign(ct, F), + configuration: d, + defaulted: Object.assign({}, it), error: P, - newAliases: Object.assign({}, Fe) + newAliases: Object.assign({}, Te) }; } } -function ln(e) { +function un(e) { const t = [], n = /* @__PURE__ */ Object.create(null); let s = !0; for (Object.keys(e).forEach(function(c) { @@ -511,28 +511,28 @@ function ln(e) { s = !1; for (let c = 0; c < t.length; c++) for (let a = c + 1; a < t.length; a++) - if (t[c].filter(function(g) { - return t[a].indexOf(g) !== -1; + if (t[c].filter(function(d) { + return t[a].indexOf(d) !== -1; }).length) { t[c] = t[c].concat(t[a]), t.splice(a, 1), s = !0; break; } } return t.forEach(function(c) { - c = c.filter(function(h, g, C) { - return C.indexOf(h) === g; + c = c.filter(function(h, d, C) { + return C.indexOf(h) === d; }); const a = c.pop(); a !== void 0 && typeof a == "string" && (n[a] = c); }), n; } -function qe(e) { +function Qe(e) { return e !== void 0 ? e + 1 : 1; } -function ut(e) { +function ht(e) { return e === "__proto__" ? "___proto___" : e; } -function an(e) { +function fn(e) { return typeof e == "string" && (e[0] === "'" || e[0] === '"') && e[e.length - 1] === e[0] ? e.substring(1, e.length - 1) : e; } /** @@ -543,15 +543,15 @@ function an(e) { * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC */ -var Ze, Ke, Qe; -const ft = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12, ht = (Ke = (Ze = process == null ? void 0 : process.versions) === null || Ze === void 0 ? void 0 : Ze.node) !== null && Ke !== void 0 ? Ke : (Qe = process == null ? void 0 : process.version) === null || Qe === void 0 ? void 0 : Qe.slice(1); -if (ht && Number(ht.match(/^([^.]+)/)[1]) < ft) - throw Error(`yargs parser supports a minimum Node.js version of ${ft}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`); -const un = process ? process.env : {}, _t = new cn({ +var Xe, Ye, He; +const pt = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12, dt = (Ye = (Xe = process == null ? void 0 : process.versions) === null || Xe === void 0 ? void 0 : Xe.node) !== null && Ye !== void 0 ? Ye : (He = process == null ? void 0 : process.version) === null || He === void 0 ? void 0 : He.slice(1); +if (dt && Number(dt.match(/^([^.]+)/)[1]) < pt) + throw Error(`yargs parser supports a minimum Node.js version of ${pt}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`); +const hn = process ? process.env : {}, xt = new an({ cwd: process.cwd, - env: () => un, - format: bt, - normalize: qt, + env: () => hn, + format: Et, + normalize: Kt, resolve: te, // TODO: figure out a way to combine ESM and CJS coverage, such that // we can exercise all the lines below: @@ -559,23 +559,23 @@ const un = process ? process.env : {}, _t = new cn({ if (typeof require < "u") return require(e); if (e.match(/\.json$/)) - return JSON.parse(ot(e, "utf8")); + return JSON.parse(rt(e, "utf8")); throw Error("only .json config files are supported in ESM"); } -}), je = function(t, n) { - return _t.parse(t.slice(), n).argv; +}), Le = function(t, n) { + return xt.parse(t.slice(), n).argv; }; -je.detailed = function(e, t) { - return _t.parse(e.slice(), t); +Le.detailed = function(e, t) { + return xt.parse(e.slice(), t); }; -je.camelCase = se; -je.decamelize = Ct; -je.looksLikeNumber = At; -const fn = { - right: $n, - center: bn -}, hn = 0, Be = 1, pn = 2, Pe = 3; -class gn { +Le.camelCase = se; +Le.decamelize = vt; +Le.looksLikeNumber = _t; +const pn = { + right: bn, + center: En +}, dn = 0, ze = 1, gn = 2, Ve = 3; +class mn { constructor(t) { var n; this.width = t.width, this.wrap = (n = t.wrap) !== null && n !== void 0 ? n : !0, this.rows = []; @@ -630,15 +630,15 @@ class gn { rowToString(t, n) { return this.rasterize(t).forEach((s, c) => { let a = ""; - s.forEach((h, g) => { - const { width: C } = t[g], R = this.negatePadding(t[g]); - let x = h; - if (R > T.stringWidth(h) && (x += " ".repeat(R - T.stringWidth(h))), t[g].align && t[g].align !== "left" && this.wrap) { - const Y = fn[t[g].align]; - x = Y(x, R), T.stringWidth(x) < R && (x += " ".repeat((C || 0) - T.stringWidth(x) - 1)); + s.forEach((h, d) => { + const { width: C } = t[d], j = this.negatePadding(t[d]); + let w = h; + if (j > T.stringWidth(h) && (w += " ".repeat(j - T.stringWidth(h))), t[d].align && t[d].align !== "left" && this.wrap) { + const Y = pn[t[d].align]; + w = Y(w, j), T.stringWidth(w) < j && (w += " ".repeat((C || 0) - T.stringWidth(w) - 1)); } - const G = t[g].padding || [0, 0, 0, 0]; - G[Pe] && (a += " ".repeat(G[Pe])), a += pt(t[g], x, "| "), a += x, a += pt(t[g], x, " |"), G[Be] && (a += " ".repeat(G[Be])), c === 0 && n.length > 0 && (a = this.renderInline(a, n[n.length - 1])); + const G = t[d].padding || [0, 0, 0, 0]; + G[Ve] && (a += " ".repeat(G[Ve])), a += gt(t[d], w, "| "), a += w, a += gt(t[d], w, " |"), G[ze] && (a += " ".repeat(G[ze])), c === 0 && n.length > 0 && (a = this.renderInline(a, n[n.length - 1])); }), n.push({ text: a.replace(/ +$/, ""), span: t.span @@ -657,18 +657,18 @@ class gn { return t.forEach((a, h) => { a.width = s[h], this.wrap ? c = T.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[hn] || 0).fill("")), c.push(...new Array(a.padding[pn] || 0).fill(""))), c.forEach((g, C) => { +`), a.border && (c.unshift("." + "-".repeat(this.negatePadding(a) + 2) + "."), c.push("'" + "-".repeat(this.negatePadding(a) + 2) + "'")), a.padding && (c.unshift(...new Array(a.padding[dn] || 0).fill("")), c.push(...new Array(a.padding[gn] || 0).fill(""))), c.forEach((d, C) => { n[C] || n.push([]); - const R = n[C]; - for (let x = 0; x < h; x++) - R[x] === void 0 && R.push(""); - R.push(g); + const j = n[C]; + for (let w = 0; w < h; w++) + j[w] === void 0 && j.push(""); + j.push(d); }); }), n; } negatePadding(t) { let n = t.width || 0; - return t.padding && (n -= (t.padding[Pe] || 0) + (t.padding[Be] || 0)), t.border && (n -= 4), n; + return t.padding && (n -= (t.padding[Ve] || 0) + (t.padding[ze] || 0)), t.border && (n -= 4), n; } columnWidths(t) { if (!this.wrap) @@ -678,82 +678,82 @@ class gn { if (h.width) return n--, s -= h.width, h.width; }), a = n ? Math.floor(s / n) : 0; - return c.map((h, g) => h === void 0 ? Math.max(a, dn(t[g])) : h); + return c.map((h, d) => h === void 0 ? Math.max(a, $n(t[d])) : h); } } -function pt(e, t, n) { +function gt(e, t, n) { return e.border ? /[.']-+[.']/.test(t) ? "" : t.trim().length !== 0 ? n : " " : ""; } -function dn(e) { - const t = e.padding || [], n = 1 + (t[Pe] || 0) + (t[Be] || 0); +function $n(e) { + const t = e.padding || [], n = 1 + (t[Ve] || 0) + (t[ze] || 0); return e.border ? n + 4 : n; } -function mn() { +function yn() { return typeof process == "object" && process.stdout && process.stdout.columns ? process.stdout.columns : 80; } -function $n(e, t) { +function bn(e, t) { e = e.trim(); const n = T.stringWidth(e); return n < t ? " ".repeat(t - n) + e : e; } -function bn(e, t) { +function En(e, t) { e = e.trim(); const n = T.stringWidth(e); return n >= t ? e : " ".repeat(t - n >> 1) + e; } let T; -function yn(e, t) { - return T = t, new gn({ - width: e?.width || mn(), +function Cn(e, t) { + return T = t, new mn({ + width: e?.width || yn(), wrap: e?.wrap }); } -const vt = new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g"); -function wt(e) { - return e.replace(vt, ""); +const wt = new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g"); +function Ot(e) { + return e.replace(wt, ""); } -function En(e, t) { - const [n, s] = e.match(vt) || ["", ""]; - e = wt(e); +function An(e, t) { + const [n, s] = e.match(wt) || ["", ""]; + e = Ot(e); let c = ""; for (let a = 0; a < e.length; a++) a !== 0 && a % t === 0 && (c += ` `), c += e.charAt(a); return n && s && (c = `${n}${c}${s}`), c; } -function Cn(e) { - return yn(e, { +function vn(e) { + return Cn(e, { stringWidth: (t) => [...t].length, - stripAnsi: wt, - wrap: En + stripAnsi: Ot, + wrap: An }); } -function An(e, t) { +function _n(e, t) { let n = te(".", e), s; - for (yt(n).isDirectory() || (n = Xe(n)); ; ) { - if (s = t(n, Xt(n)), s) + for (Ct(n).isDirectory() || (n = ke(n)); ; ) { + if (s = t(n, Ht(n)), s) return te(n, s); - if (n = Xe(s = n), s === n) + if (n = ke(s = n), s === n) break; } } -const _n = { +const xn = { fs: { - readFileSync: ot, - writeFile: Yt + readFileSync: rt, + writeFile: kt }, - format: bt, + format: Et, resolve: te, exists: (e) => { try { - return yt(e).isFile(); + return Ct(e).isFile(); } catch { return !1; } } }; let M; -class vn { +class wn { constructor(t) { t = t || {}, this.directory = t.directory || "./locales", this.updateFiles = typeof t.updateFiles == "boolean" ? t.updateFiles : !0, this.locale = t.locale || "en", this.fallbackToLanguage = typeof t.fallbackToLanguage == "boolean" ? t.fallbackToLanguage : !0, this.cache = /* @__PURE__ */ Object.create(null), this.writeQueue = []; } @@ -784,8 +784,8 @@ class vn { locale: this.locale, cb: a })) : a(); - const g = [h]; - return ~h.indexOf("%d") && g.push(c), M.format.apply(M.format, g.concat(t)); + const d = [h]; + return ~h.indexOf("%d") && d.push(c), M.format.apply(M.format, d.concat(t)); } setLocale(t) { this.locale = t; @@ -809,8 +809,8 @@ class vn { this.writeQueue.push(t), this.writeQueue.length === 1 && this._processWriteQueue(); } _processWriteQueue() { - const t = this, n = this.writeQueue[0], s = n.directory, c = n.locale, a = n.cb, h = this._resolveLocaleFile(s, c), g = JSON.stringify(this.cache[c], null, 2); - M.fs.writeFile(h, g, "utf-8", function(C) { + const t = this, n = this.writeQueue[0], s = n.directory, c = n.locale, a = n.cb, h = this._resolveLocaleFile(s, c), d = JSON.stringify(this.cache[c], null, 2); + M.fs.writeFile(h, d, "utf-8", function(C) { t.writeQueue.shift(), t.writeQueue.length > 0 && t._processWriteQueue(), a(C); }); } @@ -839,9 +839,9 @@ class vn { return M.exists(t); } } -function wn(e, t) { +function On(e, t) { M = t; - const n = new vn(e); + const n = new wn(e); return { __: n.__.bind(n), __n: n.__n.bind(n), @@ -851,243 +851,268 @@ function wn(e, t) { locale: n.locale }; } -const xn = (e) => wn(e, _n), Sn = "require is not supported by ESM", gt = "loading a directory of commands is not supported yet for ESM"; -let Oe; +const Sn = (e) => On(e, xn), Nn = "require is not supported by ESM", mt = "loading a directory of commands is not supported yet for ESM"; +let Fe; try { - Oe = Jt(import.meta.url); + Fe = tn(import.meta.url); } catch { - Oe = process.cwd(); + Fe = process.cwd(); } -const Nn = Oe.substring(0, Oe.lastIndexOf("node_modules")); -Ht, kt, Gt, Nn || process.cwd(), Zt, Xe, Kt, Qt, te, process.cwd, process.exit, process.nextTick, typeof process.stdout.columns < "u" && process.stdout.columns, ot, xn({ - directory: te(Oe, "../../../locales"), +const jn = Fe.substring(0, Fe.lastIndexOf("node_modules")); +Jt, en, Zt, jn || process.cwd(), Qt, ke, Xt, Yt, te, process.cwd, process.exit, process.nextTick, typeof process.stdout.columns < "u" && process.stdout.columns, rt, Sn({ + directory: te(Fe, "../../../locales"), updateFiles: !1 }); -const He = "\x1B[44m", A = "\x1B[43m", j = "\x1B[41m", On = "\x1B[42m", b = "\x1B[0m", _ = "\x1B[33m", w = "\x1B[36m", $ = "\x1B[0m", ke = 100, re = [], jn = (e, t) => { +const re = "\x1B[44m", A = "\x1B[43m", N = "\x1B[41m", Fn = "\x1B[42m", $ = "\x1B[0m", v = "\x1B[33m", _ = "\x1B[36m", y = "\x1B[0m", Rn = { + "vue-caution": ["implicitParentChildCommunication"], + "vue-essential": ["globalStyle", "simpleProp", "singleNameComponent", "vforNoKey", "vifWithVfor"], + "vue-recommended": ["topLevelElementOrder"], + "vue-strong": [ + "componentFilenameCasing", + "componentFiles", + "directiveShorthands", + "propNameCasing", + "quotedAttributeValues", + "selfClosingComponents", + "simpleComputed", + "templateSimpleExpression", + "fullWordComponentName" + ], + rrd: [ + "cyclomaticComplexity", + "elseCondition", + "functionSize", + "parameterCount", + "plainScript", + "scriptLenght", + "shortVariableName", + "tooManyProps" + ] +}, Re = Object.keys(Rn), et = 100, ie = [], Ln = (e, t) => { if (!e) return; const n = e.content.split(` `); - n.length > ke && re.push({ fileName: t, scriptLength: n.length }); -}, Fn = () => (re.length > 0 && (console.log( + n.length > et && ie.push({ fileName: t, scriptLength: n.length }); +}, Tn = () => (ie.length > 0 && (console.log( ` -${w}rrd${$} ${j}Long