diff --git a/.gitignore b/.gitignore index e44428f..090fd7a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ node_modules # dotenv environment variables file .env .env.test + +# VSCode +.vscode diff --git a/dist/index.js b/dist/index.js index 8429d23..43623cb 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,32 +1,32 @@ "use strict"; -var H = Object.getOwnPropertySymbols; -var J = Object.prototype.hasOwnProperty, Y = Object.prototype.propertyIsEnumerable; -var W = (e, t) => { - var n = {}; - for (var s in e) - J.call(e, s) && t.indexOf(s) < 0 && (n[s] = e[s]); - if (e != null && H) - for (var s of H(e)) - t.indexOf(s) < 0 && Y.call(e, s) && (n[s] = e[s]); - return n; +var B = Object.getOwnPropertySymbols; +var q = Object.prototype.hasOwnProperty, z = Object.prototype.propertyIsEnumerable; +var x = (e, t) => { + var r = {}; + for (var n in e) + q.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]); + if (e != null && B) + for (var n of B(e)) + t.indexOf(n) < 0 && z.call(e, n) && (r[n] = e[n]); + return r; }; -var assert_1 = require("assert"), require$$0 = require("os"), fs = require("fs"), require$$1 = require("path"), http = require("http"), https = require("https"); +var assert = require("assert"), require$$0 = require("os"), fs = require("fs"), require$$1 = require("path"), http = require("http"), https = require("https"); require("net"); var tls = require("tls"), events = require("events"), util_1 = require("util"), Stream = require("stream"), Url = require("url"), zlib = require("zlib"), string_decoder_1 = require("string_decoder"), require$$0$1 = require("child_process"), timers_1 = require("timers"); function _interopDefaultLegacy(e) { return e && typeof e == "object" && "default" in e ? e : { default: e }; } -var assert_1__default = /* @__PURE__ */ _interopDefaultLegacy(assert_1), require$$0__default = /* @__PURE__ */ _interopDefaultLegacy(require$$0), fs__default = /* @__PURE__ */ _interopDefaultLegacy(fs), require$$1__default = /* @__PURE__ */ _interopDefaultLegacy(require$$1), http__default = /* @__PURE__ */ _interopDefaultLegacy(http), https__default = /* @__PURE__ */ _interopDefaultLegacy(https), tls__default = /* @__PURE__ */ _interopDefaultLegacy(tls), events__default = /* @__PURE__ */ _interopDefaultLegacy(events), util_1__default = /* @__PURE__ */ _interopDefaultLegacy(util_1), Stream__default = /* @__PURE__ */ _interopDefaultLegacy(Stream), Url__default = /* @__PURE__ */ _interopDefaultLegacy(Url), zlib__default = /* @__PURE__ */ _interopDefaultLegacy(zlib), string_decoder_1__default = /* @__PURE__ */ _interopDefaultLegacy(string_decoder_1), require$$0__default$1 = /* @__PURE__ */ _interopDefaultLegacy(require$$0$1), timers_1__default = /* @__PURE__ */ _interopDefaultLegacy(timers_1), commonjsGlobal = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}; +var assert__default = /* @__PURE__ */ _interopDefaultLegacy(assert), require$$0__default = /* @__PURE__ */ _interopDefaultLegacy(require$$0), fs__default = /* @__PURE__ */ _interopDefaultLegacy(fs), require$$1__default = /* @__PURE__ */ _interopDefaultLegacy(require$$1), http__default = /* @__PURE__ */ _interopDefaultLegacy(http), https__default = /* @__PURE__ */ _interopDefaultLegacy(https), tls__default = /* @__PURE__ */ _interopDefaultLegacy(tls), events__default = /* @__PURE__ */ _interopDefaultLegacy(events), util_1__default = /* @__PURE__ */ _interopDefaultLegacy(util_1), Stream__default = /* @__PURE__ */ _interopDefaultLegacy(Stream), Url__default = /* @__PURE__ */ _interopDefaultLegacy(Url), zlib__default = /* @__PURE__ */ _interopDefaultLegacy(zlib), string_decoder_1__default = /* @__PURE__ */ _interopDefaultLegacy(string_decoder_1), require$$0__default$1 = /* @__PURE__ */ _interopDefaultLegacy(require$$0$1), timers_1__default = /* @__PURE__ */ _interopDefaultLegacy(timers_1), commonjsGlobal = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}; function getAugmentedNamespace(e) { if (e.__esModule) return e; var t = Object.defineProperty({}, "__esModule", { value: !0 }); - return Object.keys(e).forEach(function(n) { - var s = Object.getOwnPropertyDescriptor(e, n); - Object.defineProperty(t, n, s.get ? s : { + return Object.keys(e).forEach(function(r) { + var n = Object.getOwnPropertyDescriptor(e, r); + Object.defineProperty(t, r, n.get ? n : { enumerable: !0, get: function() { - return e[n]; + return e[r]; } }); }), t; @@ -37,272 +37,272 @@ function createCommonjsModule(e) { } var utils$2 = createCommonjsModule(function(e, t) { Object.defineProperty(t, "__esModule", { value: !0 }), t.toCommandValue = void 0; - function n(s) { - return s == null ? "" : typeof s == "string" || s instanceof String ? s : JSON.stringify(s); + function r(n) { + return n == null ? "" : typeof n == "string" || n instanceof String ? n : JSON.stringify(n); } - t.toCommandValue = n; + t.toCommandValue = r; }), command = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(_, E, P, G) { - G === void 0 && (G = P), Object.defineProperty(_, G, { enumerable: !0, get: function() { - return E[P]; + var r = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(T, _, E, P) { + P === void 0 && (P = E), Object.defineProperty(T, P, { enumerable: !0, get: function() { + return _[E]; } }); - } : function(_, E, P, G) { - G === void 0 && (G = P), _[G] = E[P]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(_, E) { - Object.defineProperty(_, "default", { enumerable: !0, value: E }); - } : function(_, E) { - _.default = E; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(_) { - if (_ && _.__esModule) - return _; - var E = {}; - if (_ != null) - for (var P in _) - P !== "default" && Object.hasOwnProperty.call(_, P) && n(E, _, P); - return s(E, _), E; + } : function(T, _, E, P) { + P === void 0 && (P = E), T[P] = _[E]; + }), n = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(T, _) { + Object.defineProperty(T, "default", { enumerable: !0, value: _ }); + } : function(T, _) { + T.default = _; + }), s = commonjsGlobal && commonjsGlobal.__importStar || function(T) { + if (T && T.__esModule) + return T; + var _ = {}; + if (T != null) + for (var E in T) + E !== "default" && Object.hasOwnProperty.call(T, E) && r(_, T, E); + return n(_, T), _; }; Object.defineProperty(t, "__esModule", { value: !0 }), t.issue = t.issueCommand = void 0; - const i = o(require$$0__default.default); - function p(_, E, P) { - const G = new h(_, E, P); - process.stdout.write(G.toString() + i.EOL); + const o = s(require$$0__default.default); + function a(T, _, E) { + const P = new f(T, _, E); + process.stdout.write(P.toString() + o.EOL); } - t.issueCommand = p; - function a(_, E = "") { - p(_, {}, E); + t.issueCommand = a; + function i(T, _ = "") { + a(T, {}, _); } - t.issue = a; + t.issue = i; const u = "::"; - class h { - constructor(E, P, G) { - E || (E = "missing.command"), this.command = E, this.properties = P, this.message = G; + class f { + constructor(_, E, P) { + _ || (_ = "missing.command"), this.command = _, this.properties = E, this.message = P; } toString() { - let E = u + this.command; + let _ = u + this.command; if (this.properties && Object.keys(this.properties).length > 0) { - E += " "; - let P = !0; - for (const G in this.properties) - if (this.properties.hasOwnProperty(G)) { - const d = this.properties[G]; - d && (P ? P = !1 : E += ",", E += `${G}=${y(d)}`); + _ += " "; + let E = !0; + for (const P in this.properties) + if (this.properties.hasOwnProperty(P)) { + const p = this.properties[P]; + p && (E ? E = !1 : _ += ",", _ += `${P}=${h(p)}`); } } - return E += `${u}${b(this.message)}`, E; + return _ += `${u}${w(this.message)}`, _; } } - function b(_) { - return utils$2.toCommandValue(_).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); + function w(T) { + return utils$2.toCommandValue(T).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); } - function y(_) { - return utils$2.toCommandValue(_).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); + function h(T) { + return utils$2.toCommandValue(T).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); } }), fileCommand = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(u, h, b, y) { - y === void 0 && (y = b), Object.defineProperty(u, y, { enumerable: !0, get: function() { - return h[b]; + var r = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(u, f, w, h) { + h === void 0 && (h = w), Object.defineProperty(u, h, { enumerable: !0, get: function() { + return f[w]; } }); - } : function(u, h, b, y) { - y === void 0 && (y = b), u[y] = h[b]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(u, h) { - Object.defineProperty(u, "default", { enumerable: !0, value: h }); - } : function(u, h) { - u.default = h; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(u) { + } : function(u, f, w, h) { + h === void 0 && (h = w), u[h] = f[w]; + }), n = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(u, f) { + Object.defineProperty(u, "default", { enumerable: !0, value: f }); + } : function(u, f) { + u.default = f; + }), s = commonjsGlobal && commonjsGlobal.__importStar || function(u) { if (u && u.__esModule) return u; - var h = {}; + var f = {}; if (u != null) - for (var b in u) - b !== "default" && Object.hasOwnProperty.call(u, b) && n(h, u, b); - return s(h, u), h; + for (var w in u) + w !== "default" && Object.hasOwnProperty.call(u, w) && r(f, u, w); + return n(f, u), f; }; Object.defineProperty(t, "__esModule", { value: !0 }), t.issueCommand = void 0; - const i = o(fs__default.default), p = o(require$$0__default.default); - function a(u, h) { - const b = process.env[`GITHUB_${u}`]; - if (!b) + const o = s(fs__default.default), a = s(require$$0__default.default); + function i(u, f) { + const w = process.env[`GITHUB_${u}`]; + if (!w) throw new Error(`Unable to find environment variable for file command ${u}`); - if (!i.existsSync(b)) - throw new Error(`Missing file at path: ${b}`); - i.appendFileSync(b, `${utils$2.toCommandValue(h)}${p.EOL}`, { + if (!o.existsSync(w)) + throw new Error(`Missing file at path: ${w}`); + o.appendFileSync(w, `${utils$2.toCommandValue(f)}${a.EOL}`, { encoding: "utf8" }); } - t.issueCommand = a; + t.issueCommand = i; }), core = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(S, j, U, F) { - F === void 0 && (F = U), Object.defineProperty(S, F, { enumerable: !0, get: function() { - return j[U]; + var r = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(O, R, C, D) { + D === void 0 && (D = C), Object.defineProperty(O, D, { enumerable: !0, get: function() { + return R[C]; } }); - } : function(S, j, U, F) { - F === void 0 && (F = U), S[F] = j[U]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(S, j) { - Object.defineProperty(S, "default", { enumerable: !0, value: j }); - } : function(S, j) { - S.default = j; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(S) { - if (S && S.__esModule) - return S; - var j = {}; - if (S != null) - for (var U in S) - U !== "default" && Object.hasOwnProperty.call(S, U) && n(j, S, U); - return s(j, S), j; - }, i = commonjsGlobal && commonjsGlobal.__awaiter || function(S, j, U, F) { - function I(B) { - return B instanceof U ? B : new U(function(N) { - N(B); + } : function(O, R, C, D) { + D === void 0 && (D = C), O[D] = R[C]; + }), n = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(O, R) { + Object.defineProperty(O, "default", { enumerable: !0, value: R }); + } : function(O, R) { + O.default = R; + }), s = commonjsGlobal && commonjsGlobal.__importStar || function(O) { + if (O && O.__esModule) + return O; + var R = {}; + if (O != null) + for (var C in O) + C !== "default" && Object.hasOwnProperty.call(O, C) && r(R, O, C); + return n(R, O), R; + }, o = commonjsGlobal && commonjsGlobal.__awaiter || function(O, R, C, D) { + function k(j) { + return j instanceof C ? j : new C(function(F) { + F(j); }); } - return new (U || (U = Promise))(function(B, N) { - function V(M) { + return new (C || (C = Promise))(function(j, F) { + function M(U) { try { - q(F.next(M)); - } catch (z) { - N(z); + I(D.next(U)); + } catch (L) { + F(L); } } - function K(M) { + function N(U) { try { - q(F.throw(M)); - } catch (z) { - N(z); + I(D.throw(U)); + } catch (L) { + F(L); } } - function q(M) { - M.done ? B(M.value) : I(M.value).then(V, K); + function I(U) { + U.done ? j(U.value) : k(U.value).then(M, N); } - q((F = F.apply(S, j || [])).next()); + I((D = D.apply(O, R || [])).next()); }); }; Object.defineProperty(t, "__esModule", { value: !0 }), t.getState = t.saveState = t.group = t.endGroup = t.startGroup = t.info = t.warning = t.error = t.debug = t.isDebug = t.setFailed = t.setCommandEcho = t.setOutput = t.getBooleanInput = t.getMultilineInput = t.getInput = t.addPath = t.setSecret = t.exportVariable = t.ExitCode = void 0; - const p = o(require$$0__default.default), a = o(require$$1__default.default); + const a = s(require$$0__default.default), i = s(require$$1__default.default); var u; - (function(S) { - S[S.Success = 0] = "Success", S[S.Failure = 1] = "Failure"; + (function(O) { + O[O.Success = 0] = "Success", O[O.Failure = 1] = "Failure"; })(u = t.ExitCode || (t.ExitCode = {})); - function h(S, j) { - const U = utils$2.toCommandValue(j); - if (process.env[S] = U, process.env.GITHUB_ENV || "") { - const I = "_GitHubActionsFileCommandDelimeter_", B = `${S}<<${I}${p.EOL}${U}${p.EOL}${I}`; - fileCommand.issueCommand("ENV", B); + function f(O, R) { + const C = utils$2.toCommandValue(R); + if (process.env[O] = C, process.env.GITHUB_ENV || "") { + const k = "_GitHubActionsFileCommandDelimeter_", j = `${O}<<${k}${a.EOL}${C}${a.EOL}${k}`; + fileCommand.issueCommand("ENV", j); } else - command.issueCommand("set-env", { name: S }, U); - } - t.exportVariable = h; - function b(S) { - command.issueCommand("add-mask", {}, S); - } - t.setSecret = b; - function y(S) { - process.env.GITHUB_PATH || "" ? fileCommand.issueCommand("PATH", S) : command.issueCommand("add-path", {}, S), process.env.PATH = `${S}${a.delimiter}${process.env.PATH}`; - } - t.addPath = y; - function _(S, j) { - const U = process.env[`INPUT_${S.replace(/ /g, "_").toUpperCase()}`] || ""; - if (j && j.required && !U) - throw new Error(`Input required and not supplied: ${S}`); - return j && j.trimWhitespace === !1 ? U : U.trim(); - } - t.getInput = _; - function E(S, j) { - return _(S, j).split(` -`).filter((F) => F !== ""); - } - t.getMultilineInput = E; - function P(S, j) { - const U = ["true", "True", "TRUE"], F = ["false", "False", "FALSE"], I = _(S, j); - if (U.includes(I)) + command.issueCommand("set-env", { name: O }, C); + } + t.exportVariable = f; + function w(O) { + command.issueCommand("add-mask", {}, O); + } + t.setSecret = w; + function h(O) { + process.env.GITHUB_PATH || "" ? fileCommand.issueCommand("PATH", O) : command.issueCommand("add-path", {}, O), process.env.PATH = `${O}${i.delimiter}${process.env.PATH}`; + } + t.addPath = h; + function T(O, R) { + const C = process.env[`INPUT_${O.replace(/ /g, "_").toUpperCase()}`] || ""; + if (R && R.required && !C) + throw new Error(`Input required and not supplied: ${O}`); + return R && R.trimWhitespace === !1 ? C : C.trim(); + } + t.getInput = T; + function _(O, R) { + return T(O, R).split(` +`).filter((D) => D !== ""); + } + t.getMultilineInput = _; + function E(O, R) { + const C = ["true", "True", "TRUE"], D = ["false", "False", "FALSE"], k = T(O, R); + if (C.includes(k)) return !0; - if (F.includes(I)) + if (D.includes(k)) return !1; - throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${S} + throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${O} Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } - t.getBooleanInput = P; - function G(S, j) { - process.stdout.write(p.EOL), command.issueCommand("set-output", { name: S }, j); + t.getBooleanInput = E; + function P(O, R) { + process.stdout.write(a.EOL), command.issueCommand("set-output", { name: O }, R); } - t.setOutput = G; - function d(S) { - command.issue("echo", S ? "on" : "off"); + t.setOutput = P; + function p(O) { + command.issue("echo", O ? "on" : "off"); } - t.setCommandEcho = d; - function f(S) { - process.exitCode = u.Failure, g(S); + t.setCommandEcho = p; + function l(O) { + process.exitCode = u.Failure, d(O); } - t.setFailed = f; - function w() { + t.setFailed = l; + function g() { return process.env.RUNNER_DEBUG === "1"; } - t.isDebug = w; - function m(S) { - command.issueCommand("debug", {}, S); + t.isDebug = g; + function m(O) { + command.issueCommand("debug", {}, O); } t.debug = m; - function g(S) { - command.issue("error", S instanceof Error ? S.toString() : S); + function d(O) { + command.issue("error", O instanceof Error ? O.toString() : O); } - t.error = g; - function T(S) { - command.issue("warning", S instanceof Error ? S.toString() : S); + t.error = d; + function b(O) { + command.issue("warning", O instanceof Error ? O.toString() : O); } - t.warning = T; - function v(S) { - process.stdout.write(S + p.EOL); + t.warning = b; + function y(O) { + process.stdout.write(O + a.EOL); } - t.info = v; - function O(S) { - command.issue("group", S); + t.info = y; + function v(O) { + command.issue("group", O); } - t.startGroup = O; - function $() { + t.startGroup = v; + function A() { command.issue("endgroup"); } - t.endGroup = $; - function A(S, j) { - return i(this, void 0, void 0, function* () { - O(S); - let U; + t.endGroup = A; + function S(O, R) { + return o(this, void 0, void 0, function* () { + v(O); + let C; try { - U = yield j(); + C = yield R(); } finally { - $(); + A(); } - return U; + return C; }); } - t.group = A; - function k(S, j) { - command.issueCommand("save-state", { name: S }, j); + t.group = S; + function G(O, R) { + command.issueCommand("save-state", { name: O }, R); } - t.saveState = k; - function D(S) { - return process.env[`STATE_${S}`] || ""; + t.saveState = G; + function $(O) { + return process.env[`STATE_${O}`] || ""; } - t.getState = D; + t.getState = $; }), context = createCommonjsModule(function(e, t) { Object.defineProperty(t, "__esModule", { value: !0 }), t.Context = void 0; - class n { + class r { constructor() { if (this.payload = {}, process.env.GITHUB_EVENT_PATH) if (fs__default.default.existsSync(process.env.GITHUB_EVENT_PATH)) this.payload = JSON.parse(fs__default.default.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); else { - const o = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${o} does not exist${require$$0__default.default.EOL}`); + const s = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${s} does not exist${require$$0__default.default.EOL}`); } this.eventName = process.env.GITHUB_EVENT_NAME, this.sha = process.env.GITHUB_SHA, this.ref = process.env.GITHUB_REF, this.workflow = process.env.GITHUB_WORKFLOW, this.action = process.env.GITHUB_ACTION, this.actor = process.env.GITHUB_ACTOR, this.job = process.env.GITHUB_JOB, this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10), this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); } get issue() { - const o = this.payload; - return Object.assign(Object.assign({}, this.repo), { number: (o.issue || o.pull_request || o).number }); + const s = this.payload; + return Object.assign(Object.assign({}, this.repo), { number: (s.issue || s.pull_request || s).number }); } get repo() { if (process.env.GITHUB_REPOSITORY) { - const [o, i] = process.env.GITHUB_REPOSITORY.split("/"); - return { owner: o, repo: i }; + const [s, o] = process.env.GITHUB_REPOSITORY.split("/"); + return { owner: s, repo: o }; } if (this.payload.repository) return { @@ -312,14 +312,14 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"); } } - t.Context = n; + t.Context = r; }); function getProxyUrl(e) { - let t = e.protocol === "https:", n; + let t = e.protocol === "https:", r; if (checkBypass(e)) - return n; - let s; - return t ? s = process.env.https_proxy || process.env.HTTPS_PROXY : s = process.env.http_proxy || process.env.HTTP_PROXY, s && (n = new URL(s)), n; + return r; + let n; + return t ? n = process.env.https_proxy || process.env.HTTPS_PROXY : n = process.env.http_proxy || process.env.HTTP_PROXY, n && (r = new URL(n)), r; } var getProxyUrl_1 = getProxyUrl; function checkBypass(e) { @@ -328,12 +328,12 @@ function checkBypass(e) { let t = process.env.no_proxy || process.env.NO_PROXY || ""; if (!t) return !1; - let n; - e.port ? n = Number(e.port) : e.protocol === "http:" ? n = 80 : e.protocol === "https:" && (n = 443); - let s = [e.hostname.toUpperCase()]; - typeof n == "number" && s.push(`${s[0]}:${n}`); - for (let o of t.split(",").map((i) => i.trim().toUpperCase()).filter((i) => i)) - if (s.some((i) => i === o)) + let r; + e.port ? r = Number(e.port) : e.protocol === "http:" ? r = 80 : e.protocol === "https:" && (r = 443); + let n = [e.hostname.toUpperCase()]; + typeof r == "number" && n.push(`${n[0]}:${r}`); + for (let s of t.split(",").map((o) => o.trim().toUpperCase()).filter((o) => o)) + if (n.some((o) => o === s)) return !0; return !1; } @@ -359,36 +359,36 @@ function httpsOverHttps(e) { } function TunnelingAgent(e) { var t = this; - t.options = e || {}, t.proxyOptions = t.options.proxy || {}, t.maxSockets = t.options.maxSockets || http__default.default.Agent.defaultMaxSockets, t.requests = [], t.sockets = [], t.on("free", function(s, o, i, p) { - for (var a = toOptions(o, i, p), u = 0, h = t.requests.length; u < h; ++u) { - var b = t.requests[u]; - if (b.host === a.host && b.port === a.port) { - t.requests.splice(u, 1), b.request.onSocket(s); + t.options = e || {}, t.proxyOptions = t.options.proxy || {}, t.maxSockets = t.options.maxSockets || http__default.default.Agent.defaultMaxSockets, t.requests = [], t.sockets = [], t.on("free", function(n, s, o, a) { + for (var i = toOptions(s, o, a), u = 0, f = t.requests.length; u < f; ++u) { + var w = t.requests[u]; + if (w.host === i.host && w.port === i.port) { + t.requests.splice(u, 1), w.request.onSocket(n); return; } } - s.destroy(), t.removeSocket(s); + n.destroy(), t.removeSocket(n); }); } -util_1__default.default.inherits(TunnelingAgent, events__default.default.EventEmitter), TunnelingAgent.prototype.addRequest = function(t, n, s, o) { - var i = this, p = mergeOptions({ request: t }, i.options, toOptions(n, s, o)); - if (i.sockets.length >= this.maxSockets) { - i.requests.push(p); +util_1__default.default.inherits(TunnelingAgent, events__default.default.EventEmitter), TunnelingAgent.prototype.addRequest = function(t, r, n, s) { + var o = this, a = mergeOptions({ request: t }, o.options, toOptions(r, n, s)); + if (o.sockets.length >= this.maxSockets) { + o.requests.push(a); return; } - i.createSocket(p, function(a) { - a.on("free", u), a.on("close", h), a.on("agentRemove", h), t.onSocket(a); + o.createSocket(a, function(i) { + i.on("free", u), i.on("close", f), i.on("agentRemove", f), t.onSocket(i); function u() { - i.emit("free", a, p); + o.emit("free", i, a); } - function h(b) { - i.removeSocket(a), a.removeListener("free", u), a.removeListener("close", h), a.removeListener("agentRemove", h); + function f(w) { + o.removeSocket(i), i.removeListener("free", u), i.removeListener("close", f), i.removeListener("agentRemove", f); } }); -}, TunnelingAgent.prototype.createSocket = function(t, n) { - var s = this, o = {}; - s.sockets.push(o); - var i = mergeOptions({}, s.proxyOptions, { +}, TunnelingAgent.prototype.createSocket = function(t, r) { + var n = this, s = {}; + n.sockets.push(s); + var o = mergeOptions({}, n.proxyOptions, { method: "CONNECT", path: t.host + ":" + t.port, agent: !1, @@ -396,72 +396,72 @@ util_1__default.default.inherits(TunnelingAgent, events__default.default.EventEm host: t.host + ":" + t.port } }); - t.localAddress && (i.localAddress = t.localAddress), i.proxyAuth && (i.headers = i.headers || {}, i.headers["Proxy-Authorization"] = "Basic " + new Buffer(i.proxyAuth).toString("base64")), debug("making CONNECT request"); - var p = s.request(i); - p.useChunkedEncodingByDefault = !1, p.once("response", a), p.once("upgrade", u), p.once("connect", h), p.once("error", b), p.end(); - function a(y) { - y.upgrade = !0; + t.localAddress && (o.localAddress = t.localAddress), o.proxyAuth && (o.headers = o.headers || {}, o.headers["Proxy-Authorization"] = "Basic " + new Buffer(o.proxyAuth).toString("base64")), debug("making CONNECT request"); + var a = n.request(o); + a.useChunkedEncodingByDefault = !1, a.once("response", i), a.once("upgrade", u), a.once("connect", f), a.once("error", w), a.end(); + function i(h) { + h.upgrade = !0; } - function u(y, _, E) { + function u(h, T, _) { process.nextTick(function() { - h(y, _, E); + f(h, T, _); }); } - function h(y, _, E) { - if (p.removeAllListeners(), _.removeAllListeners(), y.statusCode !== 200) { - debug("tunneling socket could not be established, statusCode=%d", y.statusCode), _.destroy(); - var P = new Error("tunneling socket could not be established, statusCode=" + y.statusCode); - P.code = "ECONNRESET", t.request.emit("error", P), s.removeSocket(o); + function f(h, T, _) { + if (a.removeAllListeners(), T.removeAllListeners(), h.statusCode !== 200) { + debug("tunneling socket could not be established, statusCode=%d", h.statusCode), T.destroy(); + var E = new Error("tunneling socket could not be established, statusCode=" + h.statusCode); + E.code = "ECONNRESET", t.request.emit("error", E), n.removeSocket(s); return; } - if (E.length > 0) { - debug("got illegal response body from proxy"), _.destroy(); - var P = new Error("got illegal response body from proxy"); - P.code = "ECONNRESET", t.request.emit("error", P), s.removeSocket(o); + if (_.length > 0) { + debug("got illegal response body from proxy"), T.destroy(); + var E = new Error("got illegal response body from proxy"); + E.code = "ECONNRESET", t.request.emit("error", E), n.removeSocket(s); return; } - return debug("tunneling connection has established"), s.sockets[s.sockets.indexOf(o)] = _, n(_); + return debug("tunneling connection has established"), n.sockets[n.sockets.indexOf(s)] = T, r(T); } - function b(y) { - p.removeAllListeners(), debug(`tunneling socket could not be established, cause=%s -`, y.message, y.stack); - var _ = new Error("tunneling socket could not be established, cause=" + y.message); - _.code = "ECONNRESET", t.request.emit("error", _), s.removeSocket(o); + function w(h) { + a.removeAllListeners(), debug(`tunneling socket could not be established, cause=%s +`, h.message, h.stack); + var T = new Error("tunneling socket could not be established, cause=" + h.message); + T.code = "ECONNRESET", t.request.emit("error", T), n.removeSocket(s); } }, TunnelingAgent.prototype.removeSocket = function(t) { - var n = this.sockets.indexOf(t); - if (n !== -1) { - this.sockets.splice(n, 1); - var s = this.requests.shift(); - s && this.createSocket(s, function(o) { - s.request.onSocket(o); + var r = this.sockets.indexOf(t); + if (r !== -1) { + this.sockets.splice(r, 1); + var n = this.requests.shift(); + n && this.createSocket(n, function(s) { + n.request.onSocket(s); }); } }; function createSecureSocket(e, t) { - var n = this; - TunnelingAgent.prototype.createSocket.call(n, e, function(s) { - var o = e.request.getHeader("host"), i = mergeOptions({}, n.options, { - socket: s, - servername: o ? o.replace(/:.*$/, "") : e.host - }), p = tls__default.default.connect(0, i); - n.sockets[n.sockets.indexOf(s)] = p, t(p); + var r = this; + TunnelingAgent.prototype.createSocket.call(r, e, function(n) { + var s = e.request.getHeader("host"), o = mergeOptions({}, r.options, { + socket: n, + servername: s ? s.replace(/:.*$/, "") : e.host + }), a = tls__default.default.connect(0, o); + r.sockets[r.sockets.indexOf(n)] = a, t(a); }); } -function toOptions(e, t, n) { +function toOptions(e, t, r) { return typeof e == "string" ? { host: e, port: t, - localAddress: n + localAddress: r } : e; } function mergeOptions(e) { - for (var t = 1, n = arguments.length; t < n; ++t) { - var s = arguments[t]; - if (typeof s == "object") - for (var o = Object.keys(s), i = 0, p = o.length; i < p; ++i) { - var a = o[i]; - s[a] !== void 0 && (e[a] = s[a]); + for (var t = 1, r = arguments.length; t < r; ++t) { + var n = arguments[t]; + if (typeof n == "object") + for (var s = Object.keys(n), o = 0, a = s.length; o < a; ++o) { + var i = s[o]; + n[i] !== void 0 && (e[i] = n[i]); } } return e; @@ -480,209 +480,209 @@ var debug_1 = debug, tunnel$1 = { debug: debug_1 }, tunnel = tunnel$1, httpClient = createCommonjsModule(function(e, t) { Object.defineProperty(t, "__esModule", { value: !0 }); - let n; + let r; + var n; + (function(p) { + p[p.OK = 200] = "OK", p[p.MultipleChoices = 300] = "MultipleChoices", p[p.MovedPermanently = 301] = "MovedPermanently", p[p.ResourceMoved = 302] = "ResourceMoved", p[p.SeeOther = 303] = "SeeOther", p[p.NotModified = 304] = "NotModified", p[p.UseProxy = 305] = "UseProxy", p[p.SwitchProxy = 306] = "SwitchProxy", p[p.TemporaryRedirect = 307] = "TemporaryRedirect", p[p.PermanentRedirect = 308] = "PermanentRedirect", p[p.BadRequest = 400] = "BadRequest", p[p.Unauthorized = 401] = "Unauthorized", p[p.PaymentRequired = 402] = "PaymentRequired", p[p.Forbidden = 403] = "Forbidden", p[p.NotFound = 404] = "NotFound", p[p.MethodNotAllowed = 405] = "MethodNotAllowed", p[p.NotAcceptable = 406] = "NotAcceptable", p[p.ProxyAuthenticationRequired = 407] = "ProxyAuthenticationRequired", p[p.RequestTimeout = 408] = "RequestTimeout", p[p.Conflict = 409] = "Conflict", p[p.Gone = 410] = "Gone", p[p.TooManyRequests = 429] = "TooManyRequests", p[p.InternalServerError = 500] = "InternalServerError", p[p.NotImplemented = 501] = "NotImplemented", p[p.BadGateway = 502] = "BadGateway", p[p.ServiceUnavailable = 503] = "ServiceUnavailable", p[p.GatewayTimeout = 504] = "GatewayTimeout"; + })(n = t.HttpCodes || (t.HttpCodes = {})); var s; - (function(d) { - d[d.OK = 200] = "OK", d[d.MultipleChoices = 300] = "MultipleChoices", d[d.MovedPermanently = 301] = "MovedPermanently", d[d.ResourceMoved = 302] = "ResourceMoved", d[d.SeeOther = 303] = "SeeOther", d[d.NotModified = 304] = "NotModified", d[d.UseProxy = 305] = "UseProxy", d[d.SwitchProxy = 306] = "SwitchProxy", d[d.TemporaryRedirect = 307] = "TemporaryRedirect", d[d.PermanentRedirect = 308] = "PermanentRedirect", d[d.BadRequest = 400] = "BadRequest", d[d.Unauthorized = 401] = "Unauthorized", d[d.PaymentRequired = 402] = "PaymentRequired", d[d.Forbidden = 403] = "Forbidden", d[d.NotFound = 404] = "NotFound", d[d.MethodNotAllowed = 405] = "MethodNotAllowed", d[d.NotAcceptable = 406] = "NotAcceptable", d[d.ProxyAuthenticationRequired = 407] = "ProxyAuthenticationRequired", d[d.RequestTimeout = 408] = "RequestTimeout", d[d.Conflict = 409] = "Conflict", d[d.Gone = 410] = "Gone", d[d.TooManyRequests = 429] = "TooManyRequests", d[d.InternalServerError = 500] = "InternalServerError", d[d.NotImplemented = 501] = "NotImplemented", d[d.BadGateway = 502] = "BadGateway", d[d.ServiceUnavailable = 503] = "ServiceUnavailable", d[d.GatewayTimeout = 504] = "GatewayTimeout"; - })(s = t.HttpCodes || (t.HttpCodes = {})); + (function(p) { + p.Accept = "accept", p.ContentType = "content-type"; + })(s = t.Headers || (t.Headers = {})); var o; - (function(d) { - d.Accept = "accept", d.ContentType = "content-type"; - })(o = t.Headers || (t.Headers = {})); - var i; - (function(d) { - d.ApplicationJson = "application/json"; - })(i = t.MediaTypes || (t.MediaTypes = {})); - function p(d) { - let f = proxy.getProxyUrl(new URL(d)); - return f ? f.href : ""; - } - t.getProxyUrl = p; - const a = [ - s.MovedPermanently, - s.ResourceMoved, - s.SeeOther, - s.TemporaryRedirect, - s.PermanentRedirect + (function(p) { + p.ApplicationJson = "application/json"; + })(o = t.MediaTypes || (t.MediaTypes = {})); + function a(p) { + let l = proxy.getProxyUrl(new URL(p)); + return l ? l.href : ""; + } + t.getProxyUrl = a; + const i = [ + n.MovedPermanently, + n.ResourceMoved, + n.SeeOther, + n.TemporaryRedirect, + n.PermanentRedirect ], u = [ - s.BadGateway, - s.ServiceUnavailable, - s.GatewayTimeout - ], h = ["OPTIONS", "GET", "DELETE", "HEAD"], b = 10, y = 5; - class _ extends Error { - constructor(f, w) { - super(f); - this.name = "HttpClientError", this.statusCode = w, Object.setPrototypeOf(this, _.prototype); + n.BadGateway, + n.ServiceUnavailable, + n.GatewayTimeout + ], f = ["OPTIONS", "GET", "DELETE", "HEAD"], w = 10, h = 5; + class T extends Error { + constructor(l, g) { + super(l); + this.name = "HttpClientError", this.statusCode = g, Object.setPrototypeOf(this, T.prototype); } } - t.HttpClientError = _; - class E { - constructor(f) { - this.message = f; + t.HttpClientError = T; + class _ { + constructor(l) { + this.message = l; } readBody() { - return new Promise(async (f, w) => { + return new Promise(async (l, g) => { let m = Buffer.alloc(0); - this.message.on("data", (g) => { - m = Buffer.concat([m, g]); + this.message.on("data", (d) => { + m = Buffer.concat([m, d]); }), this.message.on("end", () => { - f(m.toString()); + l(m.toString()); }); }); } } - t.HttpClientResponse = E; - function P(d) { - return new URL(d).protocol === "https:"; + t.HttpClientResponse = _; + function E(p) { + return new URL(p).protocol === "https:"; } - t.isHttps = P; - class G { - constructor(f, w, m) { - this._ignoreSslError = !1, this._allowRedirects = !0, this._allowRedirectDowngrade = !1, this._maxRedirects = 50, this._allowRetries = !1, this._maxRetries = 1, this._keepAlive = !1, this._disposed = !1, this.userAgent = f, this.handlers = w || [], this.requestOptions = m, m && (m.ignoreSslError != null && (this._ignoreSslError = m.ignoreSslError), this._socketTimeout = m.socketTimeout, m.allowRedirects != null && (this._allowRedirects = m.allowRedirects), m.allowRedirectDowngrade != null && (this._allowRedirectDowngrade = m.allowRedirectDowngrade), m.maxRedirects != null && (this._maxRedirects = Math.max(m.maxRedirects, 0)), m.keepAlive != null && (this._keepAlive = m.keepAlive), m.allowRetries != null && (this._allowRetries = m.allowRetries), m.maxRetries != null && (this._maxRetries = m.maxRetries)); + t.isHttps = E; + class P { + constructor(l, g, m) { + this._ignoreSslError = !1, this._allowRedirects = !0, this._allowRedirectDowngrade = !1, this._maxRedirects = 50, this._allowRetries = !1, this._maxRetries = 1, this._keepAlive = !1, this._disposed = !1, this.userAgent = l, this.handlers = g || [], this.requestOptions = m, m && (m.ignoreSslError != null && (this._ignoreSslError = m.ignoreSslError), this._socketTimeout = m.socketTimeout, m.allowRedirects != null && (this._allowRedirects = m.allowRedirects), m.allowRedirectDowngrade != null && (this._allowRedirectDowngrade = m.allowRedirectDowngrade), m.maxRedirects != null && (this._maxRedirects = Math.max(m.maxRedirects, 0)), m.keepAlive != null && (this._keepAlive = m.keepAlive), m.allowRetries != null && (this._allowRetries = m.allowRetries), m.maxRetries != null && (this._maxRetries = m.maxRetries)); } - options(f, w) { - return this.request("OPTIONS", f, null, w || {}); + options(l, g) { + return this.request("OPTIONS", l, null, g || {}); } - get(f, w) { - return this.request("GET", f, null, w || {}); + get(l, g) { + return this.request("GET", l, null, g || {}); } - del(f, w) { - return this.request("DELETE", f, null, w || {}); + del(l, g) { + return this.request("DELETE", l, null, g || {}); } - post(f, w, m) { - return this.request("POST", f, w, m || {}); + post(l, g, m) { + return this.request("POST", l, g, m || {}); } - patch(f, w, m) { - return this.request("PATCH", f, w, m || {}); + patch(l, g, m) { + return this.request("PATCH", l, g, m || {}); } - put(f, w, m) { - return this.request("PUT", f, w, m || {}); + put(l, g, m) { + return this.request("PUT", l, g, m || {}); } - head(f, w) { - return this.request("HEAD", f, null, w || {}); + head(l, g) { + return this.request("HEAD", l, null, g || {}); } - sendStream(f, w, m, g) { - return this.request(f, w, m, g); + sendStream(l, g, m, d) { + return this.request(l, g, m, d); } - async getJson(f, w = {}) { - w[o.Accept] = this._getExistingOrDefaultHeader(w, o.Accept, i.ApplicationJson); - let m = await this.get(f, w); + async getJson(l, g = {}) { + g[s.Accept] = this._getExistingOrDefaultHeader(g, s.Accept, o.ApplicationJson); + let m = await this.get(l, g); return this._processResponse(m, this.requestOptions); } - async postJson(f, w, m = {}) { - let g = JSON.stringify(w, null, 2); - m[o.Accept] = this._getExistingOrDefaultHeader(m, o.Accept, i.ApplicationJson), m[o.ContentType] = this._getExistingOrDefaultHeader(m, o.ContentType, i.ApplicationJson); - let T = await this.post(f, g, m); - return this._processResponse(T, this.requestOptions); + async postJson(l, g, m = {}) { + let d = JSON.stringify(g, null, 2); + m[s.Accept] = this._getExistingOrDefaultHeader(m, s.Accept, o.ApplicationJson), m[s.ContentType] = this._getExistingOrDefaultHeader(m, s.ContentType, o.ApplicationJson); + let b = await this.post(l, d, m); + return this._processResponse(b, this.requestOptions); } - async putJson(f, w, m = {}) { - let g = JSON.stringify(w, null, 2); - m[o.Accept] = this._getExistingOrDefaultHeader(m, o.Accept, i.ApplicationJson), m[o.ContentType] = this._getExistingOrDefaultHeader(m, o.ContentType, i.ApplicationJson); - let T = await this.put(f, g, m); - return this._processResponse(T, this.requestOptions); + async putJson(l, g, m = {}) { + let d = JSON.stringify(g, null, 2); + m[s.Accept] = this._getExistingOrDefaultHeader(m, s.Accept, o.ApplicationJson), m[s.ContentType] = this._getExistingOrDefaultHeader(m, s.ContentType, o.ApplicationJson); + let b = await this.put(l, d, m); + return this._processResponse(b, this.requestOptions); } - async patchJson(f, w, m = {}) { - let g = JSON.stringify(w, null, 2); - m[o.Accept] = this._getExistingOrDefaultHeader(m, o.Accept, i.ApplicationJson), m[o.ContentType] = this._getExistingOrDefaultHeader(m, o.ContentType, i.ApplicationJson); - let T = await this.patch(f, g, m); - return this._processResponse(T, this.requestOptions); + async patchJson(l, g, m = {}) { + let d = JSON.stringify(g, null, 2); + m[s.Accept] = this._getExistingOrDefaultHeader(m, s.Accept, o.ApplicationJson), m[s.ContentType] = this._getExistingOrDefaultHeader(m, s.ContentType, o.ApplicationJson); + let b = await this.patch(l, d, m); + return this._processResponse(b, this.requestOptions); } - async request(f, w, m, g) { + async request(l, g, m, d) { if (this._disposed) throw new Error("Client has already been disposed."); - let T = new URL(w), v = this._prepareRequest(f, T, g), O = this._allowRetries && h.indexOf(f) != -1 ? this._maxRetries + 1 : 1, $ = 0, A; - for (; $ < O; ) { - if (A = await this.requestRaw(v, m), A && A.message && A.message.statusCode === s.Unauthorized) { - let D; - for (let S = 0; S < this.handlers.length; S++) - if (this.handlers[S].canHandleAuthentication(A)) { - D = this.handlers[S]; + let b = new URL(g), y = this._prepareRequest(l, b, d), v = this._allowRetries && f.indexOf(l) != -1 ? this._maxRetries + 1 : 1, A = 0, S; + for (; A < v; ) { + if (S = await this.requestRaw(y, m), S && S.message && S.message.statusCode === n.Unauthorized) { + let $; + for (let O = 0; O < this.handlers.length; O++) + if (this.handlers[O].canHandleAuthentication(S)) { + $ = this.handlers[O]; break; } - return D ? D.handleAuthentication(this, v, m) : A; + return $ ? $.handleAuthentication(this, y, m) : S; } - let k = this._maxRedirects; - for (; a.indexOf(A.message.statusCode) != -1 && this._allowRedirects && k > 0; ) { - const D = A.message.headers.location; - if (!D) + let G = this._maxRedirects; + for (; i.indexOf(S.message.statusCode) != -1 && this._allowRedirects && G > 0; ) { + const $ = S.message.headers.location; + if (!$) break; - let S = new URL(D); - if (T.protocol == "https:" && T.protocol != S.protocol && !this._allowRedirectDowngrade) + let O = new URL($); + if (b.protocol == "https:" && b.protocol != O.protocol && !this._allowRedirectDowngrade) throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); - if (await A.readBody(), S.hostname !== T.hostname) - for (let j in g) - j.toLowerCase() === "authorization" && delete g[j]; - v = this._prepareRequest(f, S, g), A = await this.requestRaw(v, m), k--; + if (await S.readBody(), O.hostname !== b.hostname) + for (let R in d) + R.toLowerCase() === "authorization" && delete d[R]; + y = this._prepareRequest(l, O, d), S = await this.requestRaw(y, m), G--; } - if (u.indexOf(A.message.statusCode) == -1) - return A; - $ += 1, $ < O && (await A.readBody(), await this._performExponentialBackoff($)); + if (u.indexOf(S.message.statusCode) == -1) + return S; + A += 1, A < v && (await S.readBody(), await this._performExponentialBackoff(A)); } - return A; + return S; } dispose() { this._agent && this._agent.destroy(), this._disposed = !0; } - requestRaw(f, w) { - return new Promise((m, g) => { - let T = function(v, O) { - v && g(v), m(O); + requestRaw(l, g) { + return new Promise((m, d) => { + let b = function(y, v) { + y && d(y), m(v); }; - this.requestRawWithCallback(f, w, T); + this.requestRawWithCallback(l, g, b); }); } - requestRawWithCallback(f, w, m) { - let g; - typeof w == "string" && (f.options.headers["Content-Length"] = Buffer.byteLength(w, "utf8")); - let T = !1, v = ($, A) => { - T || (T = !0, m($, A)); - }, O = f.httpModule.request(f.options, ($) => { - let A = new E($); - v(null, A); + requestRawWithCallback(l, g, m) { + let d; + typeof g == "string" && (l.options.headers["Content-Length"] = Buffer.byteLength(g, "utf8")); + let b = !1, y = (A, S) => { + b || (b = !0, m(A, S)); + }, v = l.httpModule.request(l.options, (A) => { + let S = new _(A); + y(null, S); }); - O.on("socket", ($) => { - g = $; - }), O.setTimeout(this._socketTimeout || 3 * 6e4, () => { - g && g.end(), v(new Error("Request timeout: " + f.options.path), null); - }), O.on("error", function($) { - v($, null); - }), w && typeof w == "string" && O.write(w, "utf8"), w && typeof w != "string" ? (w.on("close", function() { - O.end(); - }), w.pipe(O)) : O.end(); + v.on("socket", (A) => { + d = A; + }), v.setTimeout(this._socketTimeout || 3 * 6e4, () => { + d && d.end(), y(new Error("Request timeout: " + l.options.path), null); + }), v.on("error", function(A) { + y(A, null); + }), g && typeof g == "string" && v.write(g, "utf8"), g && typeof g != "string" ? (g.on("close", function() { + v.end(); + }), g.pipe(v)) : v.end(); } - getAgent(f) { - let w = new URL(f); - return this._getAgent(w); + getAgent(l) { + let g = new URL(l); + return this._getAgent(g); } - _prepareRequest(f, w, m) { - const g = {}; - g.parsedUrl = w; - const T = g.parsedUrl.protocol === "https:"; - g.httpModule = T ? https__default.default : http__default.default; - const v = T ? 443 : 80; - return g.options = {}, g.options.host = g.parsedUrl.hostname, g.options.port = g.parsedUrl.port ? parseInt(g.parsedUrl.port) : v, g.options.path = (g.parsedUrl.pathname || "") + (g.parsedUrl.search || ""), g.options.method = f, g.options.headers = this._mergeHeaders(m), this.userAgent != null && (g.options.headers["user-agent"] = this.userAgent), g.options.agent = this._getAgent(g.parsedUrl), this.handlers && this.handlers.forEach((O) => { - O.prepareRequest(g.options); - }), g; + _prepareRequest(l, g, m) { + const d = {}; + d.parsedUrl = g; + const b = d.parsedUrl.protocol === "https:"; + d.httpModule = b ? https__default.default : http__default.default; + const y = b ? 443 : 80; + return d.options = {}, d.options.host = d.parsedUrl.hostname, d.options.port = d.parsedUrl.port ? parseInt(d.parsedUrl.port) : y, d.options.path = (d.parsedUrl.pathname || "") + (d.parsedUrl.search || ""), d.options.method = l, d.options.headers = this._mergeHeaders(m), this.userAgent != null && (d.options.headers["user-agent"] = this.userAgent), d.options.agent = this._getAgent(d.parsedUrl), this.handlers && this.handlers.forEach((v) => { + v.prepareRequest(d.options); + }), d; } - _mergeHeaders(f) { - const w = (m) => Object.keys(m).reduce((g, T) => (g[T.toLowerCase()] = m[T], g), {}); - return this.requestOptions && this.requestOptions.headers ? Object.assign({}, w(this.requestOptions.headers), w(f)) : w(f || {}); + _mergeHeaders(l) { + const g = (m) => Object.keys(m).reduce((d, b) => (d[b.toLowerCase()] = m[b], d), {}); + return this.requestOptions && this.requestOptions.headers ? Object.assign({}, g(this.requestOptions.headers), g(l)) : g(l || {}); } - _getExistingOrDefaultHeader(f, w, m) { - const g = (v) => Object.keys(v).reduce((O, $) => (O[$.toLowerCase()] = v[$], O), {}); - let T; - return this.requestOptions && this.requestOptions.headers && (T = g(this.requestOptions.headers)[w]), f[w] || T || m; + _getExistingOrDefaultHeader(l, g, m) { + const d = (y) => Object.keys(y).reduce((v, A) => (v[A.toLowerCase()] = y[A], v), {}); + let b; + return this.requestOptions && this.requestOptions.headers && (b = d(this.requestOptions.headers)[g]), l[g] || b || m; } - _getAgent(f) { - let w, m = proxy.getProxyUrl(f), g = m && m.hostname; - if (this._keepAlive && g && (w = this._proxyAgent), this._keepAlive && !g && (w = this._agent), w) - return w; - const T = f.protocol === "https:"; - let v = 100; - if (this.requestOptions && (v = this.requestOptions.maxSockets || http__default.default.globalAgent.maxSockets), g) { - n || (n = tunnel); - const O = { - maxSockets: v, + _getAgent(l) { + let g, m = proxy.getProxyUrl(l), d = m && m.hostname; + if (this._keepAlive && d && (g = this._proxyAgent), this._keepAlive && !d && (g = this._agent), g) + return g; + const b = l.protocol === "https:"; + let y = 100; + if (this.requestOptions && (y = this.requestOptions.maxSockets || http__default.default.globalAgent.maxSockets), d) { + r || (r = tunnel); + const v = { + maxSockets: y, keepAlive: this._keepAlive, proxy: { proxyAuth: `${m.username}:${m.password}`, @@ -690,89 +690,89 @@ var debug_1 = debug, tunnel$1 = { port: m.port } }; - let $; - const A = m.protocol === "https:"; - T ? $ = A ? n.httpsOverHttps : n.httpsOverHttp : $ = A ? n.httpOverHttps : n.httpOverHttp, w = $(O), this._proxyAgent = w; + let A; + const S = m.protocol === "https:"; + b ? A = S ? r.httpsOverHttps : r.httpsOverHttp : A = S ? r.httpOverHttps : r.httpOverHttp, g = A(v), this._proxyAgent = g; } - if (this._keepAlive && !w) { - const O = { keepAlive: this._keepAlive, maxSockets: v }; - w = T ? new https__default.default.Agent(O) : new http__default.default.Agent(O), this._agent = w; + if (this._keepAlive && !g) { + const v = { keepAlive: this._keepAlive, maxSockets: y }; + g = b ? new https__default.default.Agent(v) : new http__default.default.Agent(v), this._agent = g; } - return w || (w = T ? https__default.default.globalAgent : http__default.default.globalAgent), T && this._ignoreSslError && (w.options = Object.assign(w.options || {}, { + return g || (g = b ? https__default.default.globalAgent : http__default.default.globalAgent), b && this._ignoreSslError && (g.options = Object.assign(g.options || {}, { rejectUnauthorized: !1 - })), w; + })), g; } - _performExponentialBackoff(f) { - f = Math.min(b, f); - const w = y * Math.pow(2, f); - return new Promise((m) => setTimeout(() => m(), w)); + _performExponentialBackoff(l) { + l = Math.min(w, l); + const g = h * Math.pow(2, l); + return new Promise((m) => setTimeout(() => m(), g)); } - static dateTimeDeserializer(f, w) { - if (typeof w == "string") { - let m = new Date(w); + static dateTimeDeserializer(l, g) { + if (typeof g == "string") { + let m = new Date(g); if (!isNaN(m.valueOf())) return m; } - return w; + return g; } - async _processResponse(f, w) { - return new Promise(async (m, g) => { - const T = f.message.statusCode, v = { - statusCode: T, + async _processResponse(l, g) { + return new Promise(async (m, d) => { + const b = l.message.statusCode, y = { + statusCode: b, result: null, headers: {} }; - T == s.NotFound && m(v); - let O, $; + b == n.NotFound && m(y); + let v, A; try { - $ = await f.readBody(), $ && $.length > 0 && (w && w.deserializeDates ? O = JSON.parse($, G.dateTimeDeserializer) : O = JSON.parse($), v.result = O), v.headers = f.message.headers; - } catch (A) { + A = await l.readBody(), A && A.length > 0 && (g && g.deserializeDates ? v = JSON.parse(A, P.dateTimeDeserializer) : v = JSON.parse(A), y.result = v), y.headers = l.message.headers; + } catch (S) { } - if (T > 299) { - let A; - O && O.message ? A = O.message : $ && $.length > 0 ? A = $ : A = "Failed request: (" + T + ")"; - let k = new _(A, T); - k.result = v.result, g(k); + if (b > 299) { + let S; + v && v.message ? S = v.message : A && A.length > 0 ? S = A : S = "Failed request: (" + b + ")"; + let G = new T(S, b); + G.result = y.result, d(G); } else - m(v); + m(y); }); } } - t.HttpClient = G; + t.HttpClient = P; }), utils$1 = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(h, b, y, _) { - _ === void 0 && (_ = y), Object.defineProperty(h, _, { enumerable: !0, get: function() { - return b[y]; + var r = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(f, w, h, T) { + T === void 0 && (T = h), Object.defineProperty(f, T, { enumerable: !0, get: function() { + return w[h]; } }); - } : function(h, b, y, _) { - _ === void 0 && (_ = y), h[_] = b[y]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(h, b) { - Object.defineProperty(h, "default", { enumerable: !0, value: b }); - } : function(h, b) { - h.default = b; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(h) { - if (h && h.__esModule) - return h; - var b = {}; - if (h != null) - for (var y in h) - Object.hasOwnProperty.call(h, y) && n(b, h, y); - return s(b, h), b; + } : function(f, w, h, T) { + T === void 0 && (T = h), f[T] = w[h]; + }), n = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(f, w) { + Object.defineProperty(f, "default", { enumerable: !0, value: w }); + } : function(f, w) { + f.default = w; + }), s = commonjsGlobal && commonjsGlobal.__importStar || function(f) { + if (f && f.__esModule) + return f; + var w = {}; + if (f != null) + for (var h in f) + Object.hasOwnProperty.call(f, h) && r(w, f, h); + return n(w, f), w; }; Object.defineProperty(t, "__esModule", { value: !0 }), t.getApiBaseUrl = t.getProxyAgent = t.getAuthString = void 0; - const i = o(httpClient); - function p(h, b) { - if (!h && !b.auth) + const o = s(httpClient); + function a(f, w) { + if (!f && !w.auth) throw new Error("Parameter token or opts.auth is required"); - if (h && b.auth) + if (f && w.auth) throw new Error("Parameters token and opts.auth may not both be specified"); - return typeof b.auth == "string" ? b.auth : `token ${h}`; + return typeof w.auth == "string" ? w.auth : `token ${f}`; } - t.getAuthString = p; - function a(h) { - return new i.HttpClient().getAgent(h); + t.getAuthString = a; + function i(f) { + return new o.HttpClient().getAgent(f); } - t.getProxyAgent = a; + t.getProxyAgent = i; function u() { return process.env.GITHUB_API_URL || "https://api.github.com"; } @@ -782,60 +782,60 @@ function getUserAgent() { return typeof navigator == "object" && "userAgent" in navigator ? navigator.userAgent : typeof process == "object" && "version" in process ? `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})` : ""; } var register_1 = register; -function register(e, t, n, s) { - if (typeof n != "function") +function register(e, t, r, n) { + if (typeof r != "function") throw new Error("method for before hook must be a function"); - return s || (s = {}), Array.isArray(t) ? t.reverse().reduce(function(o, i) { - return register.bind(null, e, i, o, s); - }, n)() : Promise.resolve().then(function() { - return e.registry[t] ? e.registry[t].reduce(function(o, i) { - return i.hook.bind(null, o, s); - }, n)() : n(s); + return n || (n = {}), Array.isArray(t) ? t.reverse().reduce(function(s, o) { + return register.bind(null, e, o, s, n); + }, r)() : Promise.resolve().then(function() { + return e.registry[t] ? e.registry[t].reduce(function(s, o) { + return o.hook.bind(null, s, n); + }, r)() : r(n); }); } var add = addHook; -function addHook(e, t, n, s) { - var o = s; - e.registry[n] || (e.registry[n] = []), t === "before" && (s = function(i, p) { - return Promise.resolve().then(o.bind(null, p)).then(i.bind(null, p)); - }), t === "after" && (s = function(i, p) { - var a; - return Promise.resolve().then(i.bind(null, p)).then(function(u) { - return a = u, o(a, p); +function addHook(e, t, r, n) { + var s = n; + e.registry[r] || (e.registry[r] = []), t === "before" && (n = function(o, a) { + return Promise.resolve().then(s.bind(null, a)).then(o.bind(null, a)); + }), t === "after" && (n = function(o, a) { + var i; + return Promise.resolve().then(o.bind(null, a)).then(function(u) { + return i = u, s(i, a); }).then(function() { - return a; + return i; }); - }), t === "error" && (s = function(i, p) { - return Promise.resolve().then(i.bind(null, p)).catch(function(a) { - return o(a, p); + }), t === "error" && (n = function(o, a) { + return Promise.resolve().then(o.bind(null, a)).catch(function(i) { + return s(i, a); }); - }), e.registry[n].push({ - hook: s, - orig: o + }), e.registry[r].push({ + hook: n, + orig: s }); } var remove = removeHook; -function removeHook(e, t, n) { +function removeHook(e, t, r) { if (!!e.registry[t]) { - var s = e.registry[t].map(function(o) { - return o.orig; - }).indexOf(n); - s !== -1 && e.registry[t].splice(s, 1); + var n = e.registry[t].map(function(s) { + return s.orig; + }).indexOf(r); + n !== -1 && e.registry[t].splice(n, 1); } } var bind = Function.bind, bindable = bind.bind(bind); -function bindApi(e, t, n) { - var s = bindable(remove, null).apply(null, n ? [t, n] : [t]); - e.api = { remove: s }, e.remove = s, ["before", "error", "after", "wrap"].forEach(function(o) { - var i = n ? [t, o, n] : [t, o]; - e[o] = e.api[o] = bindable(add, null).apply(null, i); +function bindApi(e, t, r) { + var n = bindable(remove, null).apply(null, r ? [t, r] : [t]); + e.api = { remove: n }, e.remove = n, ["before", "error", "after", "wrap"].forEach(function(s) { + var o = r ? [t, s, r] : [t, s]; + e[s] = e.api[s] = bindable(add, null).apply(null, o); }); } function HookSingular() { var e = "h", t = { registry: {} - }, n = register_1.bind(null, t, e); - return bindApi(n, t, e), n; + }, r = register_1.bind(null, t, e); + return bindApi(r, t, e), r; } function HookCollection() { var e = { @@ -860,36 +860,36 @@ function isObject$1(e) { return Object.prototype.toString.call(e) === "[object Object]"; } function isPlainObject(e) { - var t, n; - return isObject$1(e) === !1 ? !1 : (t = e.constructor, t === void 0 ? !0 : (n = t.prototype, !(isObject$1(n) === !1 || n.hasOwnProperty("isPrototypeOf") === !1))); + var t, r; + return isObject$1(e) === !1 ? !1 : (t = e.constructor, t === void 0 ? !0 : (r = t.prototype, !(isObject$1(r) === !1 || r.hasOwnProperty("isPrototypeOf") === !1))); } function lowercaseKeys(e) { - return e ? Object.keys(e).reduce((t, n) => (t[n.toLowerCase()] = e[n], t), {}) : {}; + return e ? Object.keys(e).reduce((t, r) => (t[r.toLowerCase()] = e[r], t), {}) : {}; } function mergeDeep(e, t) { - const n = Object.assign({}, e); - return Object.keys(t).forEach((s) => { - isPlainObject(t[s]) ? s in e ? n[s] = mergeDeep(e[s], t[s]) : Object.assign(n, { [s]: t[s] }) : Object.assign(n, { [s]: t[s] }); - }), n; + const r = Object.assign({}, e); + return Object.keys(t).forEach((n) => { + isPlainObject(t[n]) ? n in e ? r[n] = mergeDeep(e[n], t[n]) : Object.assign(r, { [n]: t[n] }) : Object.assign(r, { [n]: t[n] }); + }), r; } function removeUndefinedProperties(e) { for (const t in e) e[t] === void 0 && delete e[t]; return e; } -function merge(e, t, n) { +function merge(e, t, r) { if (typeof t == "string") { - let [o, i] = t.split(" "); - n = Object.assign(i ? { method: o, url: i } : { url: o }, n); + let [s, o] = t.split(" "); + r = Object.assign(o ? { method: s, url: o } : { url: s }, r); } else - n = Object.assign({}, t); - n.headers = lowercaseKeys(n.headers), removeUndefinedProperties(n), removeUndefinedProperties(n.headers); - const s = mergeDeep(e || {}, n); - return e && e.mediaType.previews.length && (s.mediaType.previews = e.mediaType.previews.filter((o) => !s.mediaType.previews.includes(o)).concat(s.mediaType.previews)), s.mediaType.previews = s.mediaType.previews.map((o) => o.replace(/-preview/, "")), s; + r = Object.assign({}, t); + r.headers = lowercaseKeys(r.headers), removeUndefinedProperties(r), removeUndefinedProperties(r.headers); + const n = mergeDeep(e || {}, r); + return e && e.mediaType.previews.length && (n.mediaType.previews = e.mediaType.previews.filter((s) => !n.mediaType.previews.includes(s)).concat(n.mediaType.previews)), n.mediaType.previews = n.mediaType.previews.map((s) => s.replace(/-preview/, "")), n; } function addQueryParameters(e, t) { - const n = /\?/.test(e) ? "&" : "?", s = Object.keys(t); - return s.length === 0 ? e : e + n + s.map((o) => o === "q" ? "q=" + t.q.split("+").map(encodeURIComponent).join("+") : `${o}=${encodeURIComponent(t[o])}`).join("&"); + const r = /\?/.test(e) ? "&" : "?", n = Object.keys(t); + return n.length === 0 ? e : e + r + n.map((s) => s === "q" ? "q=" + t.q.split("+").map(encodeURIComponent).join("+") : `${s}=${encodeURIComponent(t[s])}`).join("&"); } const urlVariableRegex = /\{[^}]+\}/g; function removeNonChars(e) { @@ -897,10 +897,10 @@ function removeNonChars(e) { } function extractUrlVariableNames(e) { const t = e.match(urlVariableRegex); - return t ? t.map(removeNonChars).reduce((n, s) => n.concat(s), []) : []; + return t ? t.map(removeNonChars).reduce((r, n) => r.concat(n), []) : []; } function omit(e, t) { - return Object.keys(e).filter((n) => !t.includes(n)).reduce((n, s) => (n[s] = e[s], n), {}); + return Object.keys(e).filter((r) => !t.includes(r)).reduce((r, n) => (r[n] = e[n], r), {}); } function encodeReserved(e) { return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t) { @@ -912,8 +912,8 @@ function encodeUnreserved(e) { return "%" + t.charCodeAt(0).toString(16).toUpperCase(); }); } -function encodeValue(e, t, n) { - return t = e === "+" || e === "#" ? encodeReserved(t) : encodeUnreserved(t), n ? encodeUnreserved(n) + "=" + t : t; +function encodeValue(e, t, r) { + return t = e === "+" || e === "#" ? encodeReserved(t) : encodeUnreserved(t), r ? encodeUnreserved(r) + "=" + t : t; } function isDefined(e) { return e != null; @@ -921,28 +921,28 @@ function isDefined(e) { function isKeyOperator(e) { return e === ";" || e === "&" || e === "?"; } -function getValues(e, t, n, s) { - var o = e[n], i = []; - if (isDefined(o) && o !== "") - if (typeof o == "string" || typeof o == "number" || typeof o == "boolean") - o = o.toString(), s && s !== "*" && (o = o.substring(0, parseInt(s, 10))), i.push(encodeValue(t, o, isKeyOperator(t) ? n : "")); - else if (s === "*") - Array.isArray(o) ? o.filter(isDefined).forEach(function(p) { - i.push(encodeValue(t, p, isKeyOperator(t) ? n : "")); - }) : Object.keys(o).forEach(function(p) { - isDefined(o[p]) && i.push(encodeValue(t, o[p], p)); +function getValues(e, t, r, n) { + var s = e[r], o = []; + if (isDefined(s) && s !== "") + if (typeof s == "string" || typeof s == "number" || typeof s == "boolean") + s = s.toString(), n && n !== "*" && (s = s.substring(0, parseInt(n, 10))), o.push(encodeValue(t, s, isKeyOperator(t) ? r : "")); + else if (n === "*") + Array.isArray(s) ? s.filter(isDefined).forEach(function(a) { + o.push(encodeValue(t, a, isKeyOperator(t) ? r : "")); + }) : Object.keys(s).forEach(function(a) { + isDefined(s[a]) && o.push(encodeValue(t, s[a], a)); }); else { - const p = []; - Array.isArray(o) ? o.filter(isDefined).forEach(function(a) { - p.push(encodeValue(t, a)); - }) : Object.keys(o).forEach(function(a) { - isDefined(o[a]) && (p.push(encodeUnreserved(a)), p.push(encodeValue(t, o[a].toString()))); - }), isKeyOperator(t) ? i.push(encodeUnreserved(n) + "=" + p.join(",")) : p.length !== 0 && i.push(p.join(",")); + const a = []; + Array.isArray(s) ? s.filter(isDefined).forEach(function(i) { + a.push(encodeValue(t, i)); + }) : Object.keys(s).forEach(function(i) { + isDefined(s[i]) && (a.push(encodeUnreserved(i)), a.push(encodeValue(t, s[i].toString()))); + }), isKeyOperator(t) ? o.push(encodeUnreserved(r) + "=" + a.join(",")) : a.length !== 0 && o.push(a.join(",")); } else - t === ";" ? isDefined(o) && i.push(encodeUnreserved(n)) : o === "" && (t === "&" || t === "?") ? i.push(encodeUnreserved(n) + "=") : o === "" && i.push(""); - return i; + t === ";" ? isDefined(s) && o.push(encodeUnreserved(r)) : s === "" && (t === "&" || t === "?") ? o.push(encodeUnreserved(r) + "=") : s === "" && o.push(""); + return o; } function parseUrl(e) { return { @@ -950,25 +950,25 @@ function parseUrl(e) { }; } function expand(e, t) { - var n = ["+", "#", ".", "/", ";", "?", "&"]; - return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function(s, o, i) { - if (o) { - let a = ""; + var r = ["+", "#", ".", "/", ";", "?", "&"]; + return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function(n, s, o) { + if (s) { + let i = ""; const u = []; - if (n.indexOf(o.charAt(0)) !== -1 && (a = o.charAt(0), o = o.substr(1)), o.split(/,/g).forEach(function(h) { - var b = /([^:\*]*)(?::(\d+)|(\*))?/.exec(h); - u.push(getValues(t, a, b[1], b[2] || b[3])); - }), a && a !== "+") { - var p = ","; - return a === "?" ? p = "&" : a !== "#" && (p = a), (u.length !== 0 ? a : "") + u.join(p); + if (r.indexOf(s.charAt(0)) !== -1 && (i = s.charAt(0), s = s.substr(1)), s.split(/,/g).forEach(function(f) { + var w = /([^:\*]*)(?::(\d+)|(\*))?/.exec(f); + u.push(getValues(t, i, w[1], w[2] || w[3])); + }), i && i !== "+") { + var a = ","; + return i === "?" ? a = "&" : i !== "#" && (a = i), (u.length !== 0 ? i : "") + u.join(a); } else return u.join(","); } else - return encodeReserved(i); + return encodeReserved(o); }); } function parse(e) { - let t = e.method.toUpperCase(), n = (e.url || "/").replace(/:([a-z]\w+)/g, "{$1}"), s = Object.assign({}, e.headers), o, i = omit(e, [ + let t = e.method.toUpperCase(), r = (e.url || "/").replace(/:([a-z]\w+)/g, "{$1}"), n = Object.assign({}, e.headers), s, o = omit(e, [ "method", "baseUrl", "url", @@ -976,27 +976,27 @@ function parse(e) { "request", "mediaType" ]); - const p = extractUrlVariableNames(n); - n = parseUrl(n).expand(i), /^http/.test(n) || (n = e.baseUrl + n); - const a = Object.keys(e).filter((b) => p.includes(b)).concat("baseUrl"), u = omit(i, a); - if (!/application\/octet-stream/i.test(s.accept) && (e.mediaType.format && (s.accept = s.accept.split(/,/).map((b) => b.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${e.mediaType.format}`)).join(",")), e.mediaType.previews.length)) { - const b = s.accept.match(/[\w-]+(?=-preview)/g) || []; - s.accept = b.concat(e.mediaType.previews).map((y) => { - const _ = e.mediaType.format ? `.${e.mediaType.format}` : "+json"; - return `application/vnd.github.${y}-preview${_}`; + const a = extractUrlVariableNames(r); + r = parseUrl(r).expand(o), /^http/.test(r) || (r = e.baseUrl + r); + const i = Object.keys(e).filter((w) => a.includes(w)).concat("baseUrl"), u = omit(o, i); + if (!/application\/octet-stream/i.test(n.accept) && (e.mediaType.format && (n.accept = n.accept.split(/,/).map((w) => w.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${e.mediaType.format}`)).join(",")), e.mediaType.previews.length)) { + const w = n.accept.match(/[\w-]+(?=-preview)/g) || []; + n.accept = w.concat(e.mediaType.previews).map((h) => { + const T = e.mediaType.format ? `.${e.mediaType.format}` : "+json"; + return `application/vnd.github.${h}-preview${T}`; }).join(","); } - return ["GET", "HEAD"].includes(t) ? n = addQueryParameters(n, u) : "data" in u ? o = u.data : Object.keys(u).length ? o = u : s["content-length"] = 0, !s["content-type"] && typeof o != "undefined" && (s["content-type"] = "application/json; charset=utf-8"), ["PATCH", "PUT"].includes(t) && typeof o == "undefined" && (o = ""), Object.assign({ method: t, url: n, headers: s }, typeof o != "undefined" ? { body: o } : null, e.request ? { request: e.request } : null); + return ["GET", "HEAD"].includes(t) ? r = addQueryParameters(r, u) : "data" in u ? s = u.data : Object.keys(u).length ? s = u : n["content-length"] = 0, !n["content-type"] && typeof s != "undefined" && (n["content-type"] = "application/json; charset=utf-8"), ["PATCH", "PUT"].includes(t) && typeof s == "undefined" && (s = ""), Object.assign({ method: t, url: r, headers: n }, typeof s != "undefined" ? { body: s } : null, e.request ? { request: e.request } : null); } -function endpointWithDefaults(e, t, n) { - return parse(merge(e, t, n)); +function endpointWithDefaults(e, t, r) { + return parse(merge(e, t, r)); } function withDefaults$2(e, t) { - const n = merge(e, t), s = endpointWithDefaults.bind(null, n); - return Object.assign(s, { - DEFAULTS: n, - defaults: withDefaults$2.bind(null, n), - merge: merge.bind(null, n), + const r = merge(e, t), n = endpointWithDefaults.bind(null, r); + return Object.assign(n, { + DEFAULTS: r, + defaults: withDefaults$2.bind(null, r), + merge: merge.bind(null, r), parse }); } @@ -1015,19 +1015,19 @@ const VERSION$5 = "6.0.10", userAgent = `octokit-endpoint.js/${VERSION$5} ${getU class Blob { constructor() { this[TYPE] = ""; - const t = arguments[0], n = arguments[1], s = []; - let o = 0; + const t = arguments[0], r = arguments[1], n = []; + let s = 0; if (t) { - const p = t, a = Number(p.length); - for (let u = 0; u < a; u++) { - const h = p[u]; - let b; - h instanceof Buffer ? b = h : ArrayBuffer.isView(h) ? b = Buffer.from(h.buffer, h.byteOffset, h.byteLength) : h instanceof ArrayBuffer ? b = Buffer.from(h) : h instanceof Blob ? b = h[BUFFER] : b = Buffer.from(typeof h == "string" ? h : String(h)), o += b.length, s.push(b); + const a = t, i = Number(a.length); + for (let u = 0; u < i; u++) { + const f = a[u]; + let w; + f instanceof Buffer ? w = f : ArrayBuffer.isView(f) ? w = Buffer.from(f.buffer, f.byteOffset, f.byteLength) : f instanceof ArrayBuffer ? w = Buffer.from(f) : f instanceof Blob ? w = f[BUFFER] : w = Buffer.from(typeof f == "string" ? f : String(f)), s += w.length, n.push(w); } } - this[BUFFER] = Buffer.concat(s); - let i = n && n.type !== void 0 && String(n.type).toLowerCase(); - i && !/[^\u0020-\u007E]/.test(i) && (this[TYPE] = i); + this[BUFFER] = Buffer.concat(n); + let o = r && r.type !== void 0 && String(r.type).toLowerCase(); + o && !/[^\u0020-\u007E]/.test(o) && (this[TYPE] = o); } get size() { return this[BUFFER].length; @@ -1039,8 +1039,8 @@ class Blob { return Promise.resolve(this[BUFFER].toString()); } arrayBuffer() { - const t = this[BUFFER], n = t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength); - return Promise.resolve(n); + const t = this[BUFFER], r = t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength); + return Promise.resolve(r); } stream() { const t = new Readable(); @@ -1051,11 +1051,11 @@ class Blob { return "[object Blob]"; } slice() { - const t = this.size, n = arguments[0], s = arguments[1]; - let o, i; - n === void 0 ? o = 0 : n < 0 ? o = Math.max(t + n, 0) : o = Math.min(n, t), s === void 0 ? i = t : s < 0 ? i = Math.max(t + s, 0) : i = Math.min(s, t); - const p = Math.max(i - o, 0), u = this[BUFFER].slice(o, o + p), h = new Blob([], { type: arguments[2] }); - return h[BUFFER] = u, h; + const t = this.size, r = arguments[0], n = arguments[1]; + let s, o; + r === void 0 ? s = 0 : r < 0 ? s = Math.max(t + r, 0) : s = Math.min(r, t), n === void 0 ? o = t : n < 0 ? o = Math.max(t + n, 0) : o = Math.min(n, t); + const a = Math.max(o - s, 0), u = this[BUFFER].slice(s, s + a), f = new Blob([], { type: arguments[2] }); + return f[BUFFER] = u, f; } } Object.defineProperties(Blob.prototype, { @@ -1068,8 +1068,8 @@ Object.defineProperties(Blob.prototype, { enumerable: !1, configurable: !0 }); -function FetchError(e, t, n) { - Error.call(this, e), this.message = e, this.type = t, n && (this.code = this.errno = n.code), Error.captureStackTrace(this, this.constructor); +function FetchError(e, t, r) { + Error.call(this, e), this.message = e, this.type = t, r && (this.code = this.errno = r.code), Error.captureStackTrace(this, this.constructor); } FetchError.prototype = Object.create(Error.prototype), FetchError.prototype.constructor = FetchError, FetchError.prototype.name = "FetchError"; let convert; @@ -1079,16 +1079,16 @@ try { } const INTERNALS = Symbol("Body internals"), PassThrough = Stream__default.default.PassThrough; function Body(e) { - var t = this, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = n.size; - let o = s === void 0 ? 0 : s; - var i = n.timeout; - let p = i === void 0 ? 0 : i; + var t = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = r.size; + let s = n === void 0 ? 0 : n; + var o = r.timeout; + let a = o === void 0 ? 0 : o; e == null ? e = null : isURLSearchParams(e) ? e = Buffer.from(e.toString()) : isBlob(e) || Buffer.isBuffer(e) || (Object.prototype.toString.call(e) === "[object ArrayBuffer]" ? e = Buffer.from(e) : ArrayBuffer.isView(e) ? e = Buffer.from(e.buffer, e.byteOffset, e.byteLength) : e instanceof Stream__default.default || (e = Buffer.from(String(e)))), this[INTERNALS] = { body: e, disturbed: !1, error: null - }, this.size = o, this.timeout = p, e instanceof Stream__default.default && e.on("error", function(a) { - const u = a.name === "AbortError" ? a : new FetchError(`Invalid response body while trying to fetch ${t.url}: ${a.message}`, "system", a); + }, this.size = s, this.timeout = a, e instanceof Stream__default.default && e.on("error", function(i) { + const u = i.name === "AbortError" ? i : new FetchError(`Invalid response body while trying to fetch ${t.url}: ${i.message}`, "system", i); t[INTERNALS].error = u; }); } @@ -1119,8 +1119,8 @@ Body.prototype = { return consumeBody.call(this).then(function(t) { try { return JSON.parse(t.toString()); - } catch (n) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${e.url} reason: ${n.message}`, "invalid-json")); + } catch (r) { + return Body.Promise.reject(new FetchError(`invalid json response body at ${e.url} reason: ${r.message}`, "invalid-json")); } }); }, @@ -1148,8 +1148,8 @@ Body.prototype = { }), Body.mixIn = function(e) { for (const t of Object.getOwnPropertyNames(Body.prototype)) if (!(t in e)) { - const n = Object.getOwnPropertyDescriptor(Body.prototype, t); - Object.defineProperty(e, t, n); + const r = Object.getOwnPropertyDescriptor(Body.prototype, t); + Object.defineProperty(e, t, r); } }; function consumeBody() { @@ -1165,28 +1165,28 @@ function consumeBody() { return Body.Promise.resolve(t); if (!(t instanceof Stream__default.default)) return Body.Promise.resolve(Buffer.alloc(0)); - let n = [], s = 0, o = !1; - return new Body.Promise(function(i, p) { - let a; - e.timeout && (a = setTimeout(function() { - o = !0, p(new FetchError(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`, "body-timeout")); + let r = [], n = 0, s = !1; + return new Body.Promise(function(o, a) { + let i; + e.timeout && (i = setTimeout(function() { + s = !0, a(new FetchError(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`, "body-timeout")); }, e.timeout)), t.on("error", function(u) { - u.name === "AbortError" ? (o = !0, p(u)) : p(new FetchError(`Invalid response body while trying to fetch ${e.url}: ${u.message}`, "system", u)); + u.name === "AbortError" ? (s = !0, a(u)) : a(new FetchError(`Invalid response body while trying to fetch ${e.url}: ${u.message}`, "system", u)); }), t.on("data", function(u) { - if (!(o || u === null)) { - if (e.size && s + u.length > e.size) { - o = !0, p(new FetchError(`content size at ${e.url} over limit: ${e.size}`, "max-size")); + if (!(s || u === null)) { + if (e.size && n + u.length > e.size) { + s = !0, a(new FetchError(`content size at ${e.url} over limit: ${e.size}`, "max-size")); return; } - s += u.length, n.push(u); + n += u.length, r.push(u); } }), t.on("end", function() { - if (!o) { - clearTimeout(a); + if (!s) { + clearTimeout(i); try { - i(Buffer.concat(n, s)); + o(Buffer.concat(r, n)); } catch (u) { - p(new FetchError(`Could not create Buffer from response body for ${e.url}: ${u.message}`, "system", u)); + a(new FetchError(`Could not create Buffer from response body for ${e.url}: ${u.message}`, "system", u)); } } }); @@ -1195,9 +1195,9 @@ function consumeBody() { function convertBody(e, t) { if (typeof convert != "function") throw new Error("The package `encoding` must be installed to use the textConverted() function"); - const n = t.get("content-type"); - let s = "utf-8", o, i; - return n && (o = /charset=([^;]*)/i.exec(n)), i = e.slice(0, 1024).toString(), !o && i && (o = / 0 && arguments[0] !== void 0 ? arguments[0] : void 0; if (this[MAP] = Object.create(null), t instanceof Headers) { - const n = t.raw(), s = Object.keys(n); - for (const o of s) - for (const i of n[o]) - this.append(o, i); + const r = t.raw(), n = Object.keys(r); + for (const s of n) + for (const o of r[s]) + this.append(s, o); return; } if (t != null) if (typeof t == "object") { - const n = t[Symbol.iterator]; - if (n != null) { - if (typeof n != "function") + const r = t[Symbol.iterator]; + if (r != null) { + if (typeof r != "function") throw new TypeError("Header pairs must be iterable"); - const s = []; - for (const o of t) { - if (typeof o != "object" || typeof o[Symbol.iterator] != "function") + const n = []; + for (const s of t) { + if (typeof s != "object" || typeof s[Symbol.iterator] != "function") throw new TypeError("Each header pair must be iterable"); - s.push(Array.from(o)); + n.push(Array.from(s)); } - for (const o of s) { - if (o.length !== 2) + for (const s of n) { + if (s.length !== 2) throw new TypeError("Each header pair must be a name/value tuple"); - this.append(o[0], o[1]); + this.append(s[0], s[1]); } } else - for (const s of Object.keys(t)) { - const o = t[s]; - this.append(s, o); + for (const n of Object.keys(t)) { + const s = t[n]; + this.append(n, s); } } else throw new TypeError("Provided initializer must be an object"); } get(t) { t = `${t}`, validateName(t); - const n = find(this[MAP], t); - return n === void 0 ? null : this[MAP][n].join(", "); + const r = find(this[MAP], t); + return r === void 0 ? null : this[MAP][r].join(", "); } forEach(t) { - let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0, s = getHeaders(this), o = 0; - for (; o < s.length; ) { - var i = s[o]; - const p = i[0], a = i[1]; - t.call(n, a, p, this), s = getHeaders(this), o++; + let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0, n = getHeaders(this), s = 0; + for (; s < n.length; ) { + var o = n[s]; + const a = o[0], i = o[1]; + t.call(r, i, a, this), n = getHeaders(this), s++; } } - set(t, n) { - t = `${t}`, n = `${n}`, validateName(t), validateValue(n); - const s = find(this[MAP], t); - this[MAP][s !== void 0 ? s : t] = [n]; + set(t, r) { + t = `${t}`, r = `${r}`, validateName(t), validateValue(r); + const n = find(this[MAP], t); + this[MAP][n !== void 0 ? n : t] = [r]; } - append(t, n) { - t = `${t}`, n = `${n}`, validateName(t), validateValue(n); - const s = find(this[MAP], t); - s !== void 0 ? this[MAP][s].push(n) : this[MAP][t] = [n]; + append(t, r) { + t = `${t}`, r = `${r}`, validateName(t), validateValue(r); + const n = find(this[MAP], t); + n !== void 0 ? this[MAP][n].push(r) : this[MAP][t] = [r]; } has(t) { return t = `${t}`, validateName(t), find(this[MAP], t) !== void 0; } delete(t) { t = `${t}`, validateName(t); - const n = find(this[MAP], t); - n !== void 0 && delete this[MAP][n]; + const r = find(this[MAP], t); + r !== void 0 && delete this[MAP][r]; } raw() { return this[MAP]; @@ -1336,34 +1336,34 @@ Headers.prototype.entries = Headers.prototype[Symbol.iterator], Object.definePro }); function getHeaders(e) { let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "key+value"; - return Object.keys(e[MAP]).sort().map(t === "key" ? function(s) { - return s.toLowerCase(); - } : t === "value" ? function(s) { - return e[MAP][s].join(", "); - } : function(s) { - return [s.toLowerCase(), e[MAP][s].join(", ")]; + return Object.keys(e[MAP]).sort().map(t === "key" ? function(n) { + return n.toLowerCase(); + } : t === "value" ? function(n) { + return e[MAP][n].join(", "); + } : function(n) { + return [n.toLowerCase(), e[MAP][n].join(", ")]; }); } const INTERNAL = Symbol("internal"); function createHeadersIterator(e, t) { - const n = Object.create(HeadersIteratorPrototype); - return n[INTERNAL] = { + const r = Object.create(HeadersIteratorPrototype); + return r[INTERNAL] = { target: e, kind: t, index: 0 - }, n; + }, r; } const HeadersIteratorPrototype = Object.setPrototypeOf({ next() { if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) throw new TypeError("Value of `this` is not a HeadersIterator"); var e = this[INTERNAL]; - const t = e.target, n = e.kind, s = e.index, o = getHeaders(t, n), i = o.length; - return s >= i ? { + const t = e.target, r = e.kind, n = e.index, s = getHeaders(t, r), o = s.length; + return n >= o ? { value: void 0, done: !0 - } : (this[INTERNAL].index = s + 1, { - value: o[s], + } : (this[INTERNAL].index = n + 1, { + value: s[n], done: !1 }); } @@ -1375,36 +1375,36 @@ Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { configurable: !0 }); function exportNodeCompatibleHeaders(e) { - const t = Object.assign({ __proto__: null }, e[MAP]), n = find(e[MAP], "Host"); - return n !== void 0 && (t[n] = t[n][0]), t; + const t = Object.assign({ __proto__: null }, e[MAP]), r = find(e[MAP], "Host"); + return r !== void 0 && (t[r] = t[r][0]), t; } function createHeadersLenient(e) { const t = new Headers(); - for (const n of Object.keys(e)) - if (!invalidTokenRegex.test(n)) - if (Array.isArray(e[n])) - for (const s of e[n]) - invalidHeaderCharRegex.test(s) || (t[MAP][n] === void 0 ? t[MAP][n] = [s] : t[MAP][n].push(s)); + for (const r of Object.keys(e)) + if (!invalidTokenRegex.test(r)) + if (Array.isArray(e[r])) + for (const n of e[r]) + invalidHeaderCharRegex.test(n) || (t[MAP][r] === void 0 ? t[MAP][r] = [n] : t[MAP][r].push(n)); else - invalidHeaderCharRegex.test(e[n]) || (t[MAP][n] = [e[n]]); + invalidHeaderCharRegex.test(e[r]) || (t[MAP][r] = [e[r]]); return t; } const INTERNALS$1 = Symbol("Response internals"), STATUS_CODES = http__default.default.STATUS_CODES; class Response { constructor() { - let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - Body.call(this, t, n); - const s = n.status || 200, o = new Headers(n.headers); - if (t != null && !o.has("Content-Type")) { - const i = extractContentType(t); - i && o.append("Content-Type", i); + let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + Body.call(this, t, r); + const n = r.status || 200, s = new Headers(r.headers); + if (t != null && !s.has("Content-Type")) { + const o = extractContentType(t); + o && s.append("Content-Type", o); } this[INTERNALS$1] = { - url: n.url, - status: s, - statusText: n.statusText || STATUS_CODES[s], - headers: o, - counter: n.counter + url: r.url, + status: n, + statusText: r.statusText || STATUS_CODES[n], + headers: s, + counter: r.counter }; } get url() { @@ -1460,31 +1460,31 @@ function isAbortSignal(e) { } class Request { constructor(t) { - let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s; - isRequest(t) ? s = parse_url(t.url) : (t && t.href ? s = parse_url(t.href) : s = parse_url(`${t}`), t = {}); - let o = n.method || t.method || "GET"; - if (o = o.toUpperCase(), (n.body != null || isRequest(t) && t.body !== null) && (o === "GET" || o === "HEAD")) + let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n; + isRequest(t) ? n = parse_url(t.url) : (t && t.href ? n = parse_url(t.href) : n = parse_url(`${t}`), t = {}); + let s = r.method || t.method || "GET"; + if (s = s.toUpperCase(), (r.body != null || isRequest(t) && t.body !== null) && (s === "GET" || s === "HEAD")) throw new TypeError("Request with GET/HEAD method cannot have body"); - let i = n.body != null ? n.body : isRequest(t) && t.body !== null ? clone(t) : null; - Body.call(this, i, { - timeout: n.timeout || t.timeout || 0, - size: n.size || t.size || 0 + let o = r.body != null ? r.body : isRequest(t) && t.body !== null ? clone(t) : null; + Body.call(this, o, { + timeout: r.timeout || t.timeout || 0, + size: r.size || t.size || 0 }); - const p = new Headers(n.headers || t.headers || {}); - if (i != null && !p.has("Content-Type")) { - const u = extractContentType(i); - u && p.append("Content-Type", u); + const a = new Headers(r.headers || t.headers || {}); + if (o != null && !a.has("Content-Type")) { + const u = extractContentType(o); + u && a.append("Content-Type", u); } - let a = isRequest(t) ? t.signal : null; - if ("signal" in n && (a = n.signal), a != null && !isAbortSignal(a)) + let i = isRequest(t) ? t.signal : null; + if ("signal" in r && (i = r.signal), i != null && !isAbortSignal(i)) throw new TypeError("Expected signal to be an instanceof AbortSignal"); this[INTERNALS$2] = { - method: o, - redirect: n.redirect || t.redirect || "follow", - headers: p, - parsedURL: s, - signal: a - }, this.follow = n.follow !== void 0 ? n.follow : t.follow !== void 0 ? t.follow : 20, this.compress = n.compress !== void 0 ? n.compress : t.compress !== void 0 ? t.compress : !0, this.counter = n.counter || t.counter || 0, this.agent = n.agent || t.agent; + method: s, + redirect: r.redirect || t.redirect || "follow", + headers: a, + parsedURL: n, + signal: i + }, this.follow = r.follow !== void 0 ? r.follow : t.follow !== void 0 ? t.follow : 20, this.compress = r.compress !== void 0 ? r.compress : t.compress !== void 0 ? t.compress : !0, this.counter = r.counter || t.counter || 0, this.agent = r.agent || t.agent; } get method() { return this[INTERNALS$2].method; @@ -1519,24 +1519,24 @@ Body.mixIn(Request.prototype), Object.defineProperty(Request.prototype, Symbol.t signal: { enumerable: !0 } }); function getNodeRequestOptions(e) { - const t = e[INTERNALS$2].parsedURL, n = new Headers(e[INTERNALS$2].headers); - if (n.has("Accept") || n.set("Accept", "*/*"), !t.protocol || !t.hostname) + const t = e[INTERNALS$2].parsedURL, r = new Headers(e[INTERNALS$2].headers); + if (r.has("Accept") || r.set("Accept", "*/*"), !t.protocol || !t.hostname) throw new TypeError("Only absolute URLs are supported"); if (!/^https?:$/.test(t.protocol)) throw new TypeError("Only HTTP(S) protocols are supported"); if (e.signal && e.body instanceof Stream__default.default.Readable && !streamDestructionSupported) throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8"); - let s = null; - if (e.body == null && /^(POST|PUT)$/i.test(e.method) && (s = "0"), e.body != null) { - const i = getTotalBytes(e); - typeof i == "number" && (s = String(i)); - } - s && n.set("Content-Length", s), n.has("User-Agent") || n.set("User-Agent", "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"), e.compress && !n.has("Accept-Encoding") && n.set("Accept-Encoding", "gzip,deflate"); - let o = e.agent; - return typeof o == "function" && (o = o(t)), !n.has("Connection") && !o && n.set("Connection", "close"), Object.assign({}, t, { + let n = null; + if (e.body == null && /^(POST|PUT)$/i.test(e.method) && (n = "0"), e.body != null) { + const o = getTotalBytes(e); + typeof o == "number" && (n = String(o)); + } + n && r.set("Content-Length", n), r.has("User-Agent") || r.set("User-Agent", "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"), e.compress && !r.has("Accept-Encoding") && r.set("Accept-Encoding", "gzip,deflate"); + let s = e.agent; + return typeof s == "function" && (s = s(t)), !r.has("Connection") && !s && r.set("Connection", "close"), Object.assign({}, t, { method: e.method, - headers: exportNodeCompatibleHeaders(n), - agent: o + headers: exportNodeCompatibleHeaders(r), + agent: s }); } function AbortError(e) { @@ -1547,112 +1547,112 @@ const PassThrough$1 = Stream__default.default.PassThrough, resolve_url = Url__de function fetch(e, t) { if (!fetch.Promise) throw new Error("native promise missing, set fetch.Promise to your favorite alternative"); - return Body.Promise = fetch.Promise, new fetch.Promise(function(n, s) { - const o = new Request(e, t), i = getNodeRequestOptions(o), p = (i.protocol === "https:" ? https__default.default : http__default.default).request, a = o.signal; + return Body.Promise = fetch.Promise, new fetch.Promise(function(r, n) { + const s = new Request(e, t), o = getNodeRequestOptions(s), a = (o.protocol === "https:" ? https__default.default : http__default.default).request, i = s.signal; let u = null; - const h = function() { - let G = new AbortError("The user aborted a request."); - s(G), o.body && o.body instanceof Stream__default.default.Readable && o.body.destroy(G), !(!u || !u.body) && u.body.emit("error", G); + const f = function() { + let P = new AbortError("The user aborted a request."); + n(P), s.body && s.body instanceof Stream__default.default.Readable && s.body.destroy(P), !(!u || !u.body) && u.body.emit("error", P); }; - if (a && a.aborted) { - h(); + if (i && i.aborted) { + f(); return; } - const b = function() { - h(), E(); - }, y = p(i); - let _; - a && a.addEventListener("abort", b); - function E() { - y.abort(), a && a.removeEventListener("abort", b), clearTimeout(_); + const w = function() { + f(), _(); + }, h = a(o); + let T; + i && i.addEventListener("abort", w); + function _() { + h.abort(), i && i.removeEventListener("abort", w), clearTimeout(T); } - o.timeout && y.once("socket", function(P) { - _ = setTimeout(function() { - s(new FetchError(`network timeout at: ${o.url}`, "request-timeout")), E(); - }, o.timeout); - }), y.on("error", function(P) { - s(new FetchError(`request to ${o.url} failed, reason: ${P.message}`, "system", P)), E(); - }), y.on("response", function(P) { - clearTimeout(_); - const G = createHeadersLenient(P.headers); - if (fetch.isRedirect(P.statusCode)) { - const g = G.get("Location"), T = g === null ? null : resolve_url(o.url, g); - switch (o.redirect) { + s.timeout && h.once("socket", function(E) { + T = setTimeout(function() { + n(new FetchError(`network timeout at: ${s.url}`, "request-timeout")), _(); + }, s.timeout); + }), h.on("error", function(E) { + n(new FetchError(`request to ${s.url} failed, reason: ${E.message}`, "system", E)), _(); + }), h.on("response", function(E) { + clearTimeout(T); + const P = createHeadersLenient(E.headers); + if (fetch.isRedirect(E.statusCode)) { + const d = P.get("Location"), b = d === null ? null : resolve_url(s.url, d); + switch (s.redirect) { case "error": - s(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${o.url}`, "no-redirect")), E(); + n(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${s.url}`, "no-redirect")), _(); return; case "manual": - if (T !== null) + if (b !== null) try { - G.set("Location", T); - } catch (O) { - s(O); + P.set("Location", b); + } catch (v) { + n(v); } break; case "follow": - if (T === null) + if (b === null) break; - if (o.counter >= o.follow) { - s(new FetchError(`maximum redirect reached at: ${o.url}`, "max-redirect")), E(); + if (s.counter >= s.follow) { + n(new FetchError(`maximum redirect reached at: ${s.url}`, "max-redirect")), _(); return; } - const v = { - headers: new Headers(o.headers), - follow: o.follow, - counter: o.counter + 1, - agent: o.agent, - compress: o.compress, - method: o.method, - body: o.body, - signal: o.signal, - timeout: o.timeout, - size: o.size + const y = { + headers: new Headers(s.headers), + follow: s.follow, + counter: s.counter + 1, + agent: s.agent, + compress: s.compress, + method: s.method, + body: s.body, + signal: s.signal, + timeout: s.timeout, + size: s.size }; - if (P.statusCode !== 303 && o.body && getTotalBytes(o) === null) { - s(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect")), E(); + if (E.statusCode !== 303 && s.body && getTotalBytes(s) === null) { + n(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect")), _(); return; } - (P.statusCode === 303 || (P.statusCode === 301 || P.statusCode === 302) && o.method === "POST") && (v.method = "GET", v.body = void 0, v.headers.delete("content-length")), n(fetch(new Request(T, v))), E(); + (E.statusCode === 303 || (E.statusCode === 301 || E.statusCode === 302) && s.method === "POST") && (y.method = "GET", y.body = void 0, y.headers.delete("content-length")), r(fetch(new Request(b, y))), _(); return; } } - P.once("end", function() { - a && a.removeEventListener("abort", b); + E.once("end", function() { + i && i.removeEventListener("abort", w); }); - let d = P.pipe(new PassThrough$1()); - const f = { - url: o.url, - status: P.statusCode, - statusText: P.statusMessage, - headers: G, - size: o.size, - timeout: o.timeout, - counter: o.counter - }, w = G.get("Content-Encoding"); - if (!o.compress || o.method === "HEAD" || w === null || P.statusCode === 204 || P.statusCode === 304) { - u = new Response(d, f), n(u); + let p = E.pipe(new PassThrough$1()); + const l = { + url: s.url, + status: E.statusCode, + statusText: E.statusMessage, + headers: P, + size: s.size, + timeout: s.timeout, + counter: s.counter + }, g = P.get("Content-Encoding"); + if (!s.compress || s.method === "HEAD" || g === null || E.statusCode === 204 || E.statusCode === 304) { + u = new Response(p, l), r(u); return; } const m = { flush: zlib__default.default.Z_SYNC_FLUSH, finishFlush: zlib__default.default.Z_SYNC_FLUSH }; - if (w == "gzip" || w == "x-gzip") { - d = d.pipe(zlib__default.default.createGunzip(m)), u = new Response(d, f), n(u); + if (g == "gzip" || g == "x-gzip") { + p = p.pipe(zlib__default.default.createGunzip(m)), u = new Response(p, l), r(u); return; } - if (w == "deflate" || w == "x-deflate") { - P.pipe(new PassThrough$1()).once("data", function(T) { - (T[0] & 15) == 8 ? d = d.pipe(zlib__default.default.createInflate()) : d = d.pipe(zlib__default.default.createInflateRaw()), u = new Response(d, f), n(u); + if (g == "deflate" || g == "x-deflate") { + E.pipe(new PassThrough$1()).once("data", function(b) { + (b[0] & 15) == 8 ? p = p.pipe(zlib__default.default.createInflate()) : p = p.pipe(zlib__default.default.createInflateRaw()), u = new Response(p, l), r(u); }); return; } - if (w == "br" && typeof zlib__default.default.createBrotliDecompress == "function") { - d = d.pipe(zlib__default.default.createBrotliDecompress()), u = new Response(d, f), n(u); + if (g == "br" && typeof zlib__default.default.createBrotliDecompress == "function") { + p = p.pipe(zlib__default.default.createBrotliDecompress()), u = new Response(p, l), r(u); return; } - u = new Response(d, f), n(u); - }), writeToStream(y, o); + u = new Response(p, l), r(u); + }), writeToStream(h, s); }); } fetch.isRedirect = function(e) { @@ -1670,16 +1670,16 @@ function wrappy(e, t) { return wrappy(e)(t); if (typeof e != "function") throw new TypeError("need wrapper function"); - return Object.keys(e).forEach(function(s) { - n[s] = e[s]; - }), n; - function n() { - for (var s = new Array(arguments.length), o = 0; o < s.length; o++) - s[o] = arguments[o]; - var i = e.apply(this, s), p = s[s.length - 1]; - return typeof i == "function" && i !== p && Object.keys(p).forEach(function(a) { - i[a] = p[a]; - }), i; + return Object.keys(e).forEach(function(n) { + r[n] = e[n]; + }), r; + function r() { + for (var n = new Array(arguments.length), s = 0; s < n.length; s++) + n[s] = arguments[s]; + var o = e.apply(this, n), a = n[n.length - 1]; + return typeof o == "function" && o !== a && Object.keys(a).forEach(function(i) { + o[i] = a[i]; + }), o; } } var once_1 = wrappy_1(once), strict = wrappy_1(onceStrict); @@ -1707,23 +1707,23 @@ function onceStrict(e) { if (t.called) throw new Error(t.onceError); return t.called = !0, t.value = e.apply(this, arguments); - }, n = e.name || "Function wrapped with `once`"; - return t.onceError = n + " shouldn't be called more than once", t.called = !1, t; + }, r = e.name || "Function wrapped with `once`"; + return t.onceError = r + " shouldn't be called more than once", t.called = !1, t; } once_1.strict = strict; const logOnce = once_1((e) => console.warn(e)); class RequestError extends Error { - constructor(t, n, s) { + constructor(t, r, n) { super(t); - Error.captureStackTrace && Error.captureStackTrace(this, this.constructor), this.name = "HttpError", this.status = n, Object.defineProperty(this, "code", { + Error.captureStackTrace && Error.captureStackTrace(this, this.constructor), this.name = "HttpError", this.status = r, Object.defineProperty(this, "code", { get() { - return logOnce(new Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")), n; + return logOnce(new Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")), r; } - }), this.headers = s.headers || {}; - const o = Object.assign({}, s.request); - s.request.headers.authorization && (o.headers = Object.assign({}, s.request.headers, { - authorization: s.request.headers.authorization.replace(/ .*$/, " [REDACTED]") - })), o.url = o.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"), this.request = o; + }), this.headers = n.headers || {}; + const s = Object.assign({}, n.request); + n.request.headers.authorization && (s.headers = Object.assign({}, n.request.headers, { + authorization: n.request.headers.authorization.replace(/ .*$/, " [REDACTED]") + })), s.url = s.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"), this.request = s; } } const VERSION$4 = "5.4.12"; @@ -1732,74 +1732,74 @@ function getBufferResponse(e) { } function fetchWrapper(e) { (isPlainObject(e.body) || Array.isArray(e.body)) && (e.body = JSON.stringify(e.body)); - let t = {}, n, s; + let t = {}, r, n; return (e.request && e.request.fetch || fetch)(e.url, Object.assign({ method: e.method, body: e.body, headers: e.headers, redirect: e.redirect - }, e.request)).then((i) => { - s = i.url, n = i.status; - for (const a of i.headers) - t[a[0]] = a[1]; - if (n === 204 || n === 205) + }, e.request)).then((o) => { + n = o.url, r = o.status; + for (const i of o.headers) + t[i[0]] = i[1]; + if (r === 204 || r === 205) return; if (e.method === "HEAD") { - if (n < 400) + if (r < 400) return; - throw new RequestError(i.statusText, n, { + throw new RequestError(o.statusText, r, { headers: t, request: e }); } - if (n === 304) - throw new RequestError("Not modified", n, { + if (r === 304) + throw new RequestError("Not modified", r, { headers: t, request: e }); - if (n >= 400) - return i.text().then((a) => { - const u = new RequestError(a, n, { + if (r >= 400) + return o.text().then((i) => { + const u = new RequestError(i, r, { headers: t, request: e }); try { - let h = JSON.parse(u.message); - Object.assign(u, h); - let b = h.errors; - u.message = u.message + ": " + b.map(JSON.stringify).join(", "); - } catch (h) { + let f = JSON.parse(u.message); + Object.assign(u, f); + let w = f.errors; + u.message = u.message + ": " + w.map(JSON.stringify).join(", "); + } catch (f) { } throw u; }); - const p = i.headers.get("content-type"); - return /application\/json/.test(p) ? i.json() : !p || /^text\/|charset=utf-8$/.test(p) ? i.text() : getBufferResponse(i); - }).then((i) => ({ - status: n, - url: s, + const a = o.headers.get("content-type"); + return /application\/json/.test(a) ? o.json() : !a || /^text\/|charset=utf-8$/.test(a) ? o.text() : getBufferResponse(o); + }).then((o) => ({ + status: r, + url: n, headers: t, - data: i - })).catch((i) => { - throw i instanceof RequestError ? i : new RequestError(i.message, 500, { + data: o + })).catch((o) => { + throw o instanceof RequestError ? o : new RequestError(o.message, 500, { headers: t, request: e }); }); } function withDefaults$1(e, t) { - const n = e.defaults(t); - return Object.assign(function(o, i) { - const p = n.merge(o, i); - if (!p.request || !p.request.hook) - return fetchWrapper(n.parse(p)); - const a = (u, h) => fetchWrapper(n.parse(n.merge(u, h))); - return Object.assign(a, { - endpoint: n, - defaults: withDefaults$1.bind(null, n) - }), p.request.hook(a, p); + const r = e.defaults(t); + return Object.assign(function(s, o) { + const a = r.merge(s, o); + if (!a.request || !a.request.hook) + return fetchWrapper(r.parse(a)); + const i = (u, f) => fetchWrapper(r.parse(r.merge(u, f))); + return Object.assign(i, { + endpoint: r, + defaults: withDefaults$1.bind(null, r) + }), a.request.hook(i, a); }, { - endpoint: n, - defaults: withDefaults$1.bind(null, n) + endpoint: r, + defaults: withDefaults$1.bind(null, r) }); } const request = withDefaults$1(endpoint, { @@ -1808,10 +1808,10 @@ const request = withDefaults$1(endpoint, { } }), VERSION$3 = "4.5.8"; class GraphqlError extends Error { - constructor(t, n) { - const s = n.data.errors[0].message; - super(s); - Object.assign(this, n.data), Object.assign(this, { headers: n.headers }), this.name = "GraphqlError", this.request = t, Error.captureStackTrace && Error.captureStackTrace(this, this.constructor); + constructor(t, r) { + const n = r.data.errors[0].message; + super(n); + Object.assign(this, r.data), Object.assign(this, { headers: r.headers }), this.name = "GraphqlError", this.request = t, Error.captureStackTrace && Error.captureStackTrace(this, this.constructor); } } const NON_VARIABLE_OPTIONS = [ @@ -1823,27 +1823,27 @@ const NON_VARIABLE_OPTIONS = [ "query", "mediaType" ], GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; -function graphql(e, t, n) { - if (typeof t == "string" && n && "query" in n) +function graphql(e, t, r) { + if (typeof t == "string" && r && "query" in r) return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name')); - const s = typeof t == "string" ? Object.assign({ query: t }, n) : t, o = Object.keys(s).reduce((p, a) => NON_VARIABLE_OPTIONS.includes(a) ? (p[a] = s[a], p) : (p.variables || (p.variables = {}), p.variables[a] = s[a], p), {}), i = s.baseUrl || e.endpoint.DEFAULTS.baseUrl; - return GHES_V3_SUFFIX_REGEX.test(i) && (o.url = i.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql")), e(o).then((p) => { - if (p.data.errors) { - const a = {}; - for (const u of Object.keys(p.headers)) - a[u] = p.headers[u]; - throw new GraphqlError(o, { - headers: a, - data: p.data + const n = typeof t == "string" ? Object.assign({ query: t }, r) : t, s = Object.keys(n).reduce((a, i) => NON_VARIABLE_OPTIONS.includes(i) ? (a[i] = n[i], a) : (a.variables || (a.variables = {}), a.variables[i] = n[i], a), {}), o = n.baseUrl || e.endpoint.DEFAULTS.baseUrl; + return GHES_V3_SUFFIX_REGEX.test(o) && (s.url = o.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql")), e(s).then((a) => { + if (a.data.errors) { + const i = {}; + for (const u of Object.keys(a.headers)) + i[u] = a.headers[u]; + throw new GraphqlError(s, { + headers: i, + data: a.data }); } - return p.data.data; + return a.data.data; }); } function withDefaults(e, t) { - const n = e.defaults(t); - return Object.assign((o, i) => graphql(n, o, i), { - defaults: withDefaults.bind(null, n), + const r = e.defaults(t); + return Object.assign((s, o) => graphql(r, s, o), { + defaults: withDefaults.bind(null, r), endpoint: request.endpoint }); } @@ -1871,9 +1871,9 @@ async function auth(e) { function withAuthorizationPrefix(e) { return e.split(/\./).length === 3 ? `bearer ${e}` : `token ${e}`; } -async function hook(e, t, n, s) { - const o = t.endpoint.merge(n, s); - return o.headers.authorization = withAuthorizationPrefix(e), t(o); +async function hook(e, t, r, n) { + const s = t.endpoint.merge(r, n); + return s.headers.authorization = withAuthorizationPrefix(e), t(s); } const createTokenAuth = function(t) { if (!t) @@ -1886,66 +1886,66 @@ const createTokenAuth = function(t) { }, VERSION$2 = "3.2.4"; class Octokit { constructor(t = {}) { - const n = new Collection(), s = { + const r = new Collection(), n = { baseUrl: request.endpoint.DEFAULTS.baseUrl, headers: {}, request: Object.assign({}, t.request, { - hook: n.bind(null, "request") + hook: r.bind(null, "request") }), mediaType: { previews: [], format: "" } }; - if (s.headers["user-agent"] = [ + if (n.headers["user-agent"] = [ t.userAgent, `octokit-core.js/${VERSION$2} ${getUserAgent()}` - ].filter(Boolean).join(" "), t.baseUrl && (s.baseUrl = t.baseUrl), t.previews && (s.mediaType.previews = t.previews), t.timeZone && (s.headers["time-zone"] = t.timeZone), this.request = request.defaults(s), this.graphql = withCustomRequest(this.request).defaults(s), this.log = Object.assign({ + ].filter(Boolean).join(" "), t.baseUrl && (n.baseUrl = t.baseUrl), t.previews && (n.mediaType.previews = t.previews), t.timeZone && (n.headers["time-zone"] = t.timeZone), this.request = request.defaults(n), this.graphql = withCustomRequest(this.request).defaults(n), this.log = Object.assign({ debug: () => { }, info: () => { }, warn: console.warn.bind(console), error: console.error.bind(console) - }, t.log), this.hook = n, t.authStrategy) { - const i = t, { authStrategy: p } = i, a = W(i, ["authStrategy"]), u = p(Object.assign({ + }, t.log), this.hook = r, t.authStrategy) { + const o = t, { authStrategy: a } = o, i = x(o, ["authStrategy"]), u = a(Object.assign({ request: this.request, log: this.log, octokit: this, - octokitOptions: a + octokitOptions: i }, t.auth)); - n.wrap("request", u.hook), this.auth = u; + r.wrap("request", u.hook), this.auth = u; } else if (!t.auth) this.auth = async () => ({ type: "unauthenticated" }); else { - const p = createTokenAuth(t.auth); - n.wrap("request", p.hook), this.auth = p; + const a = createTokenAuth(t.auth); + r.wrap("request", a.hook), this.auth = a; } - this.constructor.plugins.forEach((p) => { - Object.assign(this, p(this, t)); + this.constructor.plugins.forEach((a) => { + Object.assign(this, a(this, t)); }); } static defaults(t) { return class extends this { - constructor(...s) { - const o = s[0] || {}; + constructor(...n) { + const s = n[0] || {}; if (typeof t == "function") { - super(t(o)); + super(t(s)); return; } - super(Object.assign({}, t, o, o.userAgent && t.userAgent ? { - userAgent: `${o.userAgent} ${t.userAgent}` + super(Object.assign({}, t, s, s.userAgent && t.userAgent ? { + userAgent: `${s.userAgent} ${t.userAgent}` } : null)); } }; } static plugin(...t) { - var n; - const s = this.plugins; - return n = class extends this { - }, n.plugins = s.concat(t.filter((i) => !s.includes(i))), n; + var r; + const n = this.plugins; + return r = class extends this { + }, r.plugins = n.concat(t.filter((o) => !n.includes(o))), r; } } Octokit.VERSION = VERSION$2, Octokit.plugins = []; @@ -3226,42 +3226,42 @@ const Endpoints = { } }, VERSION$1 = "4.4.1"; function endpointsToMethods(e, t) { - const n = {}; - for (const [s, o] of Object.entries(t)) - for (const [i, p] of Object.entries(o)) { - const [a, u, h] = p, [b, y] = a.split(/ /), _ = Object.assign({ method: b, url: y }, u); - n[s] || (n[s] = {}); - const E = n[s]; - if (h) { - E[i] = decorate(e, s, i, _, h); + const r = {}; + for (const [n, s] of Object.entries(t)) + for (const [o, a] of Object.entries(s)) { + const [i, u, f] = a, [w, h] = i.split(/ /), T = Object.assign({ method: w, url: h }, u); + r[n] || (r[n] = {}); + const _ = r[n]; + if (f) { + _[o] = decorate(e, n, o, T, f); continue; } - E[i] = e.request.defaults(_); + _[o] = e.request.defaults(T); } - return n; + return r; } -function decorate(e, t, n, s, o) { - const i = e.request.defaults(s); - function p(...a) { - let u = i.endpoint.merge(...a); - if (o.mapToData) +function decorate(e, t, r, n, s) { + const o = e.request.defaults(n); + function a(...i) { + let u = o.endpoint.merge(...i); + if (s.mapToData) return u = Object.assign({}, u, { - data: u[o.mapToData], - [o.mapToData]: void 0 - }), i(u); - if (o.renamed) { - const [h, b] = o.renamed; - e.log.warn(`octokit.${t}.${n}() has been renamed to octokit.${h}.${b}()`); + data: u[s.mapToData], + [s.mapToData]: void 0 + }), o(u); + if (s.renamed) { + const [f, w] = s.renamed; + e.log.warn(`octokit.${t}.${r}() has been renamed to octokit.${f}.${w}()`); } - if (o.deprecated && e.log.warn(o.deprecated), o.renamedParameters) { - const h = i.endpoint.merge(...a); - for (const [b, y] of Object.entries(o.renamedParameters)) - b in h && (e.log.warn(`"${b}" parameter is deprecated for "octokit.${t}.${n}()". Use "${y}" instead`), y in h || (h[y] = h[b]), delete h[b]); - return i(h); + if (s.deprecated && e.log.warn(s.deprecated), s.renamedParameters) { + const f = o.endpoint.merge(...i); + for (const [w, h] of Object.entries(s.renamedParameters)) + w in f && (e.log.warn(`"${w}" parameter is deprecated for "octokit.${t}.${r}()". Use "${h}" instead`), h in f || (f[h] = f[w]), delete f[w]); + return o(f); } - return i(...a); + return o(...i); } - return Object.assign(p, i); + return Object.assign(a, o); } function restEndpointMethods(e) { return endpointsToMethods(e, Endpoints); @@ -3275,37 +3275,37 @@ const VERSION = "2.6.2"; function normalizePaginatedListResponse(e) { if (!("total_count" in e.data && !("url" in e.data))) return e; - const n = e.data.incomplete_results, s = e.data.repository_selection, o = e.data.total_count; + const r = e.data.incomplete_results, n = e.data.repository_selection, s = e.data.total_count; delete e.data.incomplete_results, delete e.data.repository_selection, delete e.data.total_count; - const i = Object.keys(e.data)[0], p = e.data[i]; - return e.data = p, typeof n != "undefined" && (e.data.incomplete_results = n), typeof s != "undefined" && (e.data.repository_selection = s), e.data.total_count = o, e; + const o = Object.keys(e.data)[0], a = e.data[o]; + return e.data = a, typeof r != "undefined" && (e.data.incomplete_results = r), typeof n != "undefined" && (e.data.repository_selection = n), e.data.total_count = s, e; } -function iterator(e, t, n) { - const s = typeof t == "function" ? t.endpoint(n) : e.request.endpoint(t, n), o = typeof t == "function" ? t : e.request, i = s.method, p = s.headers; - let a = s.url; +function iterator(e, t, r) { + const n = typeof t == "function" ? t.endpoint(r) : e.request.endpoint(t, r), s = typeof t == "function" ? t : e.request, o = n.method, a = n.headers; + let i = n.url; return { [Symbol.asyncIterator]: () => ({ async next() { - if (!a) + if (!i) return { done: !0 }; - const u = await o({ method: i, url: a, headers: p }), h = normalizePaginatedListResponse(u); - return a = ((h.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1], { value: h }; + const u = await s({ method: o, url: i, headers: a }), f = normalizePaginatedListResponse(u); + return i = ((f.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1], { value: f }; } }) }; } -function paginate(e, t, n, s) { - return typeof n == "function" && (s = n, n = void 0), gather(e, [], iterator(e, t, n)[Symbol.asyncIterator](), s); +function paginate(e, t, r, n) { + return typeof r == "function" && (n = r, r = void 0), gather(e, [], iterator(e, t, r)[Symbol.asyncIterator](), n); } -function gather(e, t, n, s) { - return n.next().then((o) => { - if (o.done) +function gather(e, t, r, n) { + return r.next().then((s) => { + if (s.done) return t; - let i = !1; - function p() { - i = !0; + let o = !1; + function a() { + o = !0; } - return t = t.concat(s ? s(o.value, p) : o.value.data), i ? t : gather(e, t, n, s); + return t = t.concat(n ? n(s.value, a) : s.value.data), o ? t : gather(e, t, r, n); }); } const composePaginateRest = Object.assign(paginate, { @@ -3324,113 +3324,116 @@ var distWeb = /* @__PURE__ */ Object.freeze({ composePaginateRest, paginateRest }), core_1 = /* @__PURE__ */ getAugmentedNamespace(distWeb$2), plugin_rest_endpoint_methods_1 = /* @__PURE__ */ getAugmentedNamespace(distWeb$1), plugin_paginate_rest_1 = /* @__PURE__ */ getAugmentedNamespace(distWeb), utils = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(b, y, _, E) { - E === void 0 && (E = _), Object.defineProperty(b, E, { enumerable: !0, get: function() { - return y[_]; + var r = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(w, h, T, _) { + _ === void 0 && (_ = T), Object.defineProperty(w, _, { enumerable: !0, get: function() { + return h[T]; } }); - } : function(b, y, _, E) { - E === void 0 && (E = _), b[E] = y[_]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(b, y) { - Object.defineProperty(b, "default", { enumerable: !0, value: y }); - } : function(b, y) { - b.default = y; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(b) { - if (b && b.__esModule) - return b; - var y = {}; - if (b != null) - for (var _ in b) - Object.hasOwnProperty.call(b, _) && n(y, b, _); - return s(y, b), y; + } : function(w, h, T, _) { + _ === void 0 && (_ = T), w[_] = h[T]; + }), n = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(w, h) { + Object.defineProperty(w, "default", { enumerable: !0, value: h }); + } : function(w, h) { + w.default = h; + }), s = commonjsGlobal && commonjsGlobal.__importStar || function(w) { + if (w && w.__esModule) + return w; + var h = {}; + if (w != null) + for (var T in w) + Object.hasOwnProperty.call(w, T) && r(h, w, T); + return n(h, w), h; }; Object.defineProperty(t, "__esModule", { value: !0 }), t.getOctokitOptions = t.GitHub = t.context = void 0; - const i = o(context), p = o(utils$1); - t.context = new i.Context(); - const a = p.getApiBaseUrl(), u = { - baseUrl: a, + const o = s(context), a = s(utils$1); + t.context = new o.Context(); + const i = a.getApiBaseUrl(), u = { + baseUrl: i, request: { - agent: p.getProxyAgent(a) + agent: a.getProxyAgent(i) } }; t.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(u); - function h(b, y) { - const _ = Object.assign({}, y || {}), E = p.getAuthString(b, _); - return E && (_.auth = E), _; + function f(w, h) { + const T = Object.assign({}, h || {}), _ = a.getAuthString(w, T); + return _ && (T.auth = _), T; } - t.getOctokitOptions = h; + t.getOctokitOptions = f; }), github = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(a, u, h, b) { - b === void 0 && (b = h), Object.defineProperty(a, b, { enumerable: !0, get: function() { - return u[h]; + var r = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(i, u, f, w) { + w === void 0 && (w = f), Object.defineProperty(i, w, { enumerable: !0, get: function() { + return u[f]; } }); - } : function(a, u, h, b) { - b === void 0 && (b = h), a[b] = u[h]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(a, u) { - Object.defineProperty(a, "default", { enumerable: !0, value: u }); - } : function(a, u) { - a.default = u; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(a) { - if (a && a.__esModule) - return a; + } : function(i, u, f, w) { + w === void 0 && (w = f), i[w] = u[f]; + }), n = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(i, u) { + Object.defineProperty(i, "default", { enumerable: !0, value: u }); + } : function(i, u) { + i.default = u; + }), s = commonjsGlobal && commonjsGlobal.__importStar || function(i) { + if (i && i.__esModule) + return i; var u = {}; - if (a != null) - for (var h in a) - Object.hasOwnProperty.call(a, h) && n(u, a, h); - return s(u, a), u; + if (i != null) + for (var f in i) + Object.hasOwnProperty.call(i, f) && r(u, i, f); + return n(u, i), u; }; Object.defineProperty(t, "__esModule", { value: !0 }), t.getOctokit = t.context = void 0; - const i = o(context); - t.context = new i.Context(); - function p(a, u) { - return new utils.GitHub(utils.getOctokitOptions(a, u)); + const o = s(context); + t.context = new o.Context(); + function a(i, u) { + return new utils.GitHub(utils.getOctokitOptions(i, u)); } - t.getOctokit = p; + t.getOctokit = a; }); -const c$1 = (e) => `\`${e}\``, link = (e, t) => `[${e}](${t})`, sub = (e) => `${e}`, sup = (e) => `${e}`, strong = (e) => `**${e}**`; -var __defProp$4 = Object.defineProperty, __defProps$4 = Object.defineProperties, __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors, __getOwnPropSymbols$4 = Object.getOwnPropertySymbols, __hasOwnProp$4 = Object.prototype.hasOwnProperty, __propIsEnum$4 = Object.prototype.propertyIsEnumerable, __defNormalProp$4 = (e, t, n) => t in e ? __defProp$4(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, __spreadValues$4 = (e, t) => { - for (var n in t || (t = {})) - __hasOwnProp$4.call(t, n) && __defNormalProp$4(e, n, t[n]); +const c = (e) => `\`${e}\``, link = (e, t) => `[${e}](${t})`, sub = (e) => `${e}`, sup = (e) => `${e}`, strong = (e) => `**${e}**`; +var __defProp$4 = Object.defineProperty, __defProps$4 = Object.defineProperties, __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors, __getOwnPropSymbols$4 = Object.getOwnPropertySymbols, __hasOwnProp$4 = Object.prototype.hasOwnProperty, __propIsEnum$4 = Object.prototype.propertyIsEnumerable, __defNormalProp$4 = (e, t, r) => t in e ? __defProp$4(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, __spreadValues$4 = (e, t) => { + for (var r in t || (t = {})) + __hasOwnProp$4.call(t, r) && __defNormalProp$4(e, r, t[r]); if (__getOwnPropSymbols$4) - for (var n of __getOwnPropSymbols$4(t)) - __propIsEnum$4.call(t, n) && __defNormalProp$4(e, n, t[n]); + for (var r of __getOwnPropSymbols$4(t)) + __propIsEnum$4.call(t, r) && __defNormalProp$4(e, r, t[r]); return e; }, __spreadProps$4 = (e, t) => __defProps$4(e, __getOwnPropDescs$4(t)); async function upsertComment({ token: e, commentSignature: t, - repo: n, - prNumber: s, - body: o + repo: r, + prNumber: n, + body: s }) { - core.startGroup("Comment on PR"), o += ` + core.startGroup("Comment on PR"), s += ` ${t}`; - const i = github.getOctokit(e); + const o = github.getOctokit(e); core.info("Getting list of comments"); - const { data: p } = await i.issues.listComments(__spreadProps$4(__spreadValues$4({}, n), { - issue_number: s - })), a = p.find((u) => u.body.endsWith(t)); - a ? (core.info(`Updating previous comment ID ${a.id}`), await i.issues.updateComment(__spreadProps$4(__spreadValues$4({}, n), { - comment_id: a.id, - body: o - }))) : (core.info("Posting new comment"), await i.issues.createComment(__spreadProps$4(__spreadValues$4({}, n), { - issue_number: s, - body: o + const { data: a } = await o.issues.listComments(__spreadProps$4(__spreadValues$4({}, r), { + issue_number: n + })), i = a.find((u) => { + var f; + return (f = u.body) == null ? void 0 : f.endsWith(t); + }); + i ? (core.info(`Updating previous comment ID ${i.id}`), await o.issues.updateComment(__spreadProps$4(__spreadValues$4({}, r), { + comment_id: i.id, + body: s + }))) : (core.info("Posting new comment"), await o.issues.createComment(__spreadProps$4(__spreadValues$4({}, r), { + issue_number: n, + body: s }))), core.endGroup(); } var dist = createCommonjsModule(function(e, t) { - (function(n, s) { - e.exports = s(); + (function(r, n) { + e.exports = n(); })(commonjsGlobal, function() { - let n = {}; - const s = new WeakMap(); - class o { - constructor(a, u) { + let r = {}; + const n = new WeakMap(); + class s { + constructor(i, u) { u = Object.assign({ units: "metric", precision: 1 - }, n, u), s.set(this, u); - const h = { + }, r, u), n.set(this, u); + const f = { metric: [ { from: 0, to: 1e3, unit: "B", long: "bytes" }, { from: 1e3, to: 1e6, unit: "kB", long: "kilobytes" }, @@ -3476,78 +3479,60 @@ var dist = createCommonjsModule(function(e, t) { { from: Math.pow(1024, 8), to: Math.pow(1024, 9), unit: "Yio", long: "yobioctets" } ] }; - Object.assign(h, u.customUnits); - const b = a < 0 ? "-" : ""; - a = Math.abs(a); - const y = h[u.units]; - if (y) { - const _ = y.find((E) => a >= E.from && a < E.to); - if (_) { - const E = _.from === 0 ? b + a : b + (a / _.from).toFixed(u.precision); - this.value = E, this.unit = _.unit, this.long = _.long; + Object.assign(f, u.customUnits); + const w = i < 0 ? "-" : ""; + i = Math.abs(i); + const h = f[u.units]; + if (h) { + const T = h.find((_) => i >= _.from && i < _.to); + if (T) { + const _ = T.from === 0 ? w + i : w + (i / T.from).toFixed(u.precision); + this.value = _, this.unit = T.unit, this.long = T.long; } else - this.value = b + a, this.unit = "", this.long = ""; + this.value = w + i, this.unit = "", this.long = ""; } else throw new Error(`Invalid units specified: ${u.units}`); } toString() { - const a = s.get(this); - return a.toStringFn ? a.toStringFn.bind(this)() : `${this.value} ${this.unit}`; + const i = n.get(this); + return i.toStringFn ? i.toStringFn.bind(this)() : `${this.value} ${this.unit}`; } } - function i(p, a) { - return new o(p, a); + function o(a, i) { + return new s(a, i); } - return i.defaultOptions = function(p) { - n = p; - }, i; + return o.defaultOptions = function(a) { + r = a; + }, o; }); }); -/*! - * repeat-string - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ -var res = "", cache, repeatString = repeat; -function repeat(e, t) { - if (typeof e != "string") - throw new TypeError("expected a string"); - if (t === 1) - return e; - if (t === 2) - return e + e; - var n = e.length * t; - if (cache !== e || typeof cache == "undefined") - cache = e, res = ""; - else if (res.length >= n) - return res.substr(0, n); - for (; n > res.length && t > 1; ) - t & 1 && (res += e), t >>= 1, e += e; - return res += e, res = res.substr(0, n), res; -} -var markdownTable_1 = markdownTable, trailingWhitespace = / +$/, space = " ", lineFeed = ` -`, dash = "-", colon = ":", verticalBar = "|", x = 0, C = 67, L = 76, R = 82, c = 99, l = 108, r = 114; function markdownTable(e, t) { - for (var n = t || {}, s = n.padding !== !1, o = n.delimiterStart !== !1, i = n.delimiterEnd !== !1, p = (n.align || []).concat(), a = n.alignDelimiters !== !1, u = [], h = n.stringLength || defaultStringLength, b = -1, y = e.length, _ = [], E = [], P = [], G = [], d = [], f = 0, w, m, g, T, v, O, $, A, k, D, S; ++b < y; ) { - for (w = e[b], m = -1, g = w.length, P = [], G = [], g > f && (f = g); ++m < g; ) - O = serialize(w[m]), a === !0 && (v = h(O), G[m] = v, T = d[m], (T === void 0 || v > T) && (d[m] = v)), P.push(O); - _[b] = P, E[b] = G; - } - if (m = -1, g = f, typeof p == "object" && "length" in p) - for (; ++m < g; ) - u[m] = toAlignment(p[m]); + const r = t || {}, n = (r.align || []).concat(), s = r.stringLength || defaultStringLength, o = []; + let a = -1; + const i = [], u = [], f = []; + let w = 0, h, T, _, E, P, p, l, g, m; + for (; ++a < e.length; ) { + for (h = -1, T = [], _ = [], e[a].length > w && (w = e[a].length); ++h < e[a].length; ) + P = serialize(e[a][h]), r.alignDelimiters !== !1 && (E = s(P), _[h] = E, (f[h] === void 0 || E > f[h]) && (f[h] = E)), T.push(P); + i[a] = T, u[a] = _; + } + if (h = -1, typeof n == "object" && "length" in n) + for (; ++h < w; ) + o[h] = toAlignment(n[h]); else - for (S = toAlignment(p); ++m < g; ) - u[m] = S; - for (m = -1, g = f, P = [], G = []; ++m < g; ) - S = u[m], k = "", D = "", S === l ? k = colon : S === r ? D = colon : S === c && (k = colon, D = colon), v = a ? Math.max(1, d[m] - k.length - D.length) : 1, O = k + repeatString(dash, v) + D, a === !0 && (v = k.length + v + D.length, v > d[m] && (d[m] = v), G[m] = v), P[m] = O; - for (_.splice(1, 0, P), E.splice(1, 0, G), b = -1, y = _.length, $ = []; ++b < y; ) { - for (P = _[b], G = E[b], m = -1, g = f, A = []; ++m < g; ) - O = P[m] || "", k = "", D = "", a === !0 && (v = d[m] - (G[m] || 0), S = u[m], S === r ? k = repeatString(space, v) : S === c ? v % 2 == 0 ? (k = repeatString(space, v / 2), D = k) : (k = repeatString(space, v / 2 + 0.5), D = repeatString(space, v / 2 - 0.5)) : D = repeatString(space, v)), o === !0 && m === 0 && A.push(verticalBar), s === !0 && !(a === !1 && O === "") && (o === !0 || m !== 0) && A.push(space), a === !0 && A.push(k), A.push(O), a === !0 && A.push(D), s === !0 && A.push(space), (i === !0 || m !== g - 1) && A.push(verticalBar); - A = A.join(""), i === !1 && (A = A.replace(trailingWhitespace, "")), $.push(A); - } - return $.join(lineFeed); + for (m = toAlignment(n); ++h < w; ) + o[h] = m; + for (h = -1, T = [], _ = []; ++h < w; ) + m = o[h], l = "", g = "", m === 99 ? (l = ":", g = ":") : m === 108 ? l = ":" : m === 114 && (g = ":"), E = r.alignDelimiters === !1 ? 1 : Math.max(1, f[h] - l.length - g.length), P = l + "-".repeat(E) + g, r.alignDelimiters !== !1 && (E = l.length + E + g.length, E > f[h] && (f[h] = E), _[h] = E), T[h] = P; + i.splice(1, 0, T), u.splice(1, 0, _), a = -1; + const d = []; + for (; ++a < i.length; ) { + for (T = i[a], _ = u[a], h = -1, p = []; ++h < w; ) + P = T[h] || "", l = "", g = "", r.alignDelimiters !== !1 && (E = f[h] - (_[h] || 0), m = o[h], m === 114 ? l = " ".repeat(E) : m === 99 ? E % 2 ? (l = " ".repeat(E / 2 + 0.5), g = " ".repeat(E / 2 - 0.5)) : (l = " ".repeat(E / 2), g = l) : g = " ".repeat(E)), r.delimiterStart !== !1 && !h && p.push("|"), r.padding !== !1 && !(r.alignDelimiters === !1 && P === "") && (r.delimiterStart !== !1 || h) && p.push(" "), r.alignDelimiters !== !1 && p.push(l), p.push(P), r.alignDelimiters !== !1 && p.push(g), r.padding !== !1 && p.push(" "), (r.delimiterEnd !== !1 || h !== w - 1) && p.push("|"); + d.push(r.delimiterEnd === !1 ? p.join("").replace(/ +$/, "") : p.join("")); + } + return d.join(` +`); } function serialize(e) { return e == null ? "" : String(e); @@ -3556,8 +3541,8 @@ function defaultStringLength(e) { return e.length; } function toAlignment(e) { - var t = typeof e == "string" ? e.charCodeAt(0) : x; - return t === L || t === l ? l : t === R || t === r ? r : t === C || t === c ? c : x; + const t = typeof e == "string" ? e.charCodeAt(0) : 0; + return t === 67 || t === 99 ? 99 : t === 76 || t === 108 ? 108 : t === 82 || t === 114 ? 114 : 0; } function noop() { for (var e = [], t = 0; t < arguments.length; t++) @@ -3581,51 +3566,51 @@ var hop = Object.prototype.hasOwnProperty, has = function(e, t) { return hop.call(e, t); }; function extend(e, t) { - for (var n in t) - has(t, n) && (e[n] = t[n]); + for (var r in t) + has(t, r) && (e[r] = t[r]); return e; } var reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/, reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/, reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/, reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/, reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/; -function _outdentArray(e, t, n) { - var s = 0, o = e[0].match(reDetectIndentation); - o && (s = o[1].length); - var i = "(\\r\\n|\\r|\\n).{0," + s + "}", p = new RegExp(i, "g"); +function _outdentArray(e, t, r) { + var n = 0, s = e[0].match(reDetectIndentation); + s && (n = s[1].length); + var o = "(\\r\\n|\\r|\\n).{0," + n + "}", a = new RegExp(o, "g"); t && (e = e.slice(1)); - var a = n.newline, u = n.trimLeadingNewline, h = n.trimTrailingNewline, b = typeof a == "string", y = e.length, _ = e.map(function(E, P) { - return E = E.replace(p, "$1"), P === 0 && u && (E = E.replace(reLeadingNewline, "")), P === y - 1 && h && (E = E.replace(reTrailingNewline, "")), b && (E = E.replace(/\r\n|\n|\r/g, function(G) { - return a; - })), E; + var i = r.newline, u = r.trimLeadingNewline, f = r.trimTrailingNewline, w = typeof i == "string", h = e.length, T = e.map(function(_, E) { + return _ = _.replace(a, "$1"), E === 0 && u && (_ = _.replace(reLeadingNewline, "")), E === h - 1 && f && (_ = _.replace(reTrailingNewline, "")), w && (_ = _.replace(/\r\n|\n|\r/g, function(P) { + return i; + })), _; }); - return _; + return T; } function concatStringsAndValues(e, t) { - for (var n = "", s = 0, o = e.length; s < o; s++) - n += e[s], s < o - 1 && (n += t[s]); - return n; + for (var r = "", n = 0, s = e.length; n < s; n++) + r += e[n], n < s - 1 && (r += t[n]); + return r; } function isTemplateStringsArray(e) { return has(e, "raw") && has(e, "length"); } function createInstance(e) { - var t = createWeakMap(), n = createWeakMap(); - function s(i) { - for (var p = [], a = 1; a < arguments.length; a++) - p[a - 1] = arguments[a]; - if (isTemplateStringsArray(i)) { - var u = i, h = (p[0] === s || p[0] === defaultOutdent) && reOnlyWhitespaceWithAtLeastOneNewline.test(u[0]) && reStartsWithNewlineOrIsEmpty.test(u[1]), b = h ? n : t, y = b.get(u); - if (y || (y = _outdentArray(u, h, e), b.set(u, y)), p.length === 0) - return y[0]; - var _ = concatStringsAndValues(y, h ? p.slice(1) : p); - return _; + var t = createWeakMap(), r = createWeakMap(); + function n(o) { + for (var a = [], i = 1; i < arguments.length; i++) + a[i - 1] = arguments[i]; + if (isTemplateStringsArray(o)) { + var u = o, f = (a[0] === n || a[0] === defaultOutdent) && reOnlyWhitespaceWithAtLeastOneNewline.test(u[0]) && reStartsWithNewlineOrIsEmpty.test(u[1]), w = f ? r : t, h = w.get(u); + if (h || (h = _outdentArray(u, f, e), w.set(u, h)), a.length === 0) + return h[0]; + var T = concatStringsAndValues(h, f ? a.slice(1) : a); + return T; } else - return createInstance(extend(extend({}, e), i || {})); + return createInstance(extend(extend({}, e), o || {})); } - var o = extend(s, { - string: function(i) { - return _outdentArray([i], !1, e)[0]; + var s = extend(n, { + string: function(o) { + return _outdentArray([o], !1, e)[0]; } }); - return o; + return s; } var defaultOutdent = createInstance({ trimLeadingNewline: !0, @@ -3638,14 +3623,14 @@ if (typeof module != "undefined") } var freeGlobal = typeof global == "object" && global && global.Object === Object && global, freeGlobal$1 = freeGlobal, freeSelf = typeof self == "object" && self && self.Object === Object && self, root = freeGlobal$1 || freeSelf || Function("return this")(), root$1 = root, Symbol$1 = root$1.Symbol, Symbol$2 = Symbol$1, objectProto$b = Object.prototype, hasOwnProperty$8 = objectProto$b.hasOwnProperty, nativeObjectToString$1 = objectProto$b.toString, symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0; function getRawTag(e) { - var t = hasOwnProperty$8.call(e, symToStringTag$1), n = e[symToStringTag$1]; + var t = hasOwnProperty$8.call(e, symToStringTag$1), r = e[symToStringTag$1]; try { e[symToStringTag$1] = void 0; - var s = !0; - } catch (i) { + var n = !0; + } catch (o) { } - var o = nativeObjectToString$1.call(e); - return s && (t ? e[symToStringTag$1] = n : delete e[symToStringTag$1]), o; + var s = nativeObjectToString$1.call(e); + return n && (t ? e[symToStringTag$1] = r : delete e[symToStringTag$1]), s; } var objectProto$a = Object.prototype, nativeObjectToString = objectProto$a.toString; function objectToString(e) { @@ -3663,9 +3648,9 @@ function isSymbol(e) { return typeof e == "symbol" || isObjectLike(e) && baseGetTag(e) == symbolTag$1; } function arrayMap(e, t) { - for (var n = -1, s = e == null ? 0 : e.length, o = Array(s); ++n < s; ) - o[n] = t(e[n], n, e); - return o; + for (var r = -1, n = e == null ? 0 : e.length, s = Array(n); ++r < n; ) + s[r] = t(e[r], r, e); + return s; } var isArray = Array.isArray, isArray$1 = isArray, INFINITY$2 = 1 / 0, symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto$1 ? symbolProto$1.toString : void 0; function baseToString(e) { @@ -3705,8 +3690,8 @@ function toNumber(e) { if (typeof e != "string") return e === 0 ? e : +e; e = baseTrim(e); - var n = reIsBinary.test(e); - return n || reIsOctal.test(e) ? freeParseInt(e.slice(2), n ? 2 : 8) : reIsBadHex.test(e) ? NAN : +e; + var r = reIsBinary.test(e); + return r || reIsOctal.test(e) ? freeParseInt(e.slice(2), r ? 2 : 8) : reIsBadHex.test(e) ? NAN : +e; } var INFINITY$1 = 1 / 0, MAX_INTEGER = 17976931348623157e292; function toFinite(e) { @@ -3719,8 +3704,8 @@ function toFinite(e) { return e === e ? e : 0; } function toInteger(e) { - var t = toFinite(e), n = t % 1; - return t === t ? n ? t - n : t : 0; + var t = toFinite(e), r = t % 1; + return t === t ? r ? t - r : t : 0; } function identity(e) { return e; @@ -3764,13 +3749,13 @@ function getValue(e, t) { return e == null ? void 0 : e[t]; } function getNative(e, t) { - var n = getValue(e, t); - return baseIsNative(n) ? n : void 0; + var r = getValue(e, t); + return baseIsNative(r) ? r : void 0; } var WeakMap$1 = getNative(root$1, "WeakMap"), WeakMap$2 = WeakMap$1, MAX_SAFE_INTEGER$1 = 9007199254740991, reIsUint = /^(?:0|[1-9]\d*)$/; function isIndex(e, t) { - var n = typeof e; - return t = t == null ? MAX_SAFE_INTEGER$1 : t, !!t && (n == "number" || n != "symbol" && reIsUint.test(e)) && e > -1 && e % 1 == 0 && e < t; + var r = typeof e; + return t = t == null ? MAX_SAFE_INTEGER$1 : t, !!t && (r == "number" || r != "symbol" && reIsUint.test(e)) && e > -1 && e % 1 == 0 && e < t; } function eq(e, t) { return e === t || e !== e && t !== t; @@ -3784,13 +3769,13 @@ function isArrayLike(e) { } var objectProto$8 = Object.prototype; function isPrototype(e) { - var t = e && e.constructor, n = typeof t == "function" && t.prototype || objectProto$8; - return e === n; + var t = e && e.constructor, r = typeof t == "function" && t.prototype || objectProto$8; + return e === r; } function baseTimes(e, t) { - for (var n = -1, s = Array(e); ++n < e; ) - s[n] = t(n); - return s; + for (var r = -1, n = Array(e); ++r < e; ) + n[r] = t(r); + return n; } var argsTag$2 = "[object Arguments]"; function baseIsArguments(e) { @@ -3822,14 +3807,14 @@ var freeExports = typeof exports == "object" && exports && !exports.nodeType && } }(), nodeUtil$1 = nodeUtil, nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray, isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray, isTypedArray$1 = isTypedArray, objectProto$6 = Object.prototype, hasOwnProperty$5 = objectProto$6.hasOwnProperty; function arrayLikeKeys(e, t) { - var n = isArray$1(e), s = !n && isArguments$1(e), o = !n && !s && isBuffer$1(e), i = !n && !s && !o && isTypedArray$1(e), p = n || s || o || i, a = p ? baseTimes(e.length, String) : [], u = a.length; - for (var h in e) - (t || hasOwnProperty$5.call(e, h)) && !(p && (h == "length" || o && (h == "offset" || h == "parent") || i && (h == "buffer" || h == "byteLength" || h == "byteOffset") || isIndex(h, u))) && a.push(h); - return a; + var r = isArray$1(e), n = !r && isArguments$1(e), s = !r && !n && isBuffer$1(e), o = !r && !n && !s && isTypedArray$1(e), a = r || n || s || o, i = a ? baseTimes(e.length, String) : [], u = i.length; + for (var f in e) + (t || hasOwnProperty$5.call(e, f)) && !(a && (f == "length" || s && (f == "offset" || f == "parent") || o && (f == "buffer" || f == "byteLength" || f == "byteOffset") || isIndex(f, u))) && i.push(f); + return i; } function overArg(e, t) { - return function(n) { - return e(t(n)); + return function(r) { + return e(t(r)); }; } var nativeKeys = overArg(Object.keys, Object), nativeKeys$1 = nativeKeys, objectProto$5 = Object.prototype, hasOwnProperty$4 = objectProto$5.hasOwnProperty; @@ -3837,8 +3822,8 @@ function baseKeys(e) { if (!isPrototype(e)) return nativeKeys$1(e); var t = []; - for (var n in Object(e)) - hasOwnProperty$4.call(e, n) && n != "constructor" && t.push(n); + for (var r in Object(e)) + hasOwnProperty$4.call(e, r) && r != "constructor" && t.push(r); return t; } function keys(e) { @@ -3848,8 +3833,8 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlain function isKey(e, t) { if (isArray$1(e)) return !1; - var n = typeof e; - return n == "number" || n == "symbol" || n == "boolean" || e == null || isSymbol(e) ? !0 : reIsPlainProp.test(e) || !reIsDeepProp.test(e) || t != null && e in Object(t); + var r = typeof e; + return r == "number" || r == "symbol" || r == "boolean" || e == null || isSymbol(e) ? !0 : reIsPlainProp.test(e) || !reIsDeepProp.test(e) || t != null && e in Object(t); } var nativeCreate = getNative(Object, "create"), nativeCreate$1 = nativeCreate; function hashClear() { @@ -3863,8 +3848,8 @@ var HASH_UNDEFINED$2 = "__lodash_hash_undefined__", objectProto$4 = Object.proto function hashGet(e) { var t = this.__data__; if (nativeCreate$1) { - var n = t[e]; - return n === HASH_UNDEFINED$2 ? void 0 : n; + var r = t[e]; + return r === HASH_UNDEFINED$2 ? void 0 : r; } return hasOwnProperty$3.call(t, e) ? t[e] : void 0; } @@ -3875,14 +3860,14 @@ function hashHas(e) { } var HASH_UNDEFINED$1 = "__lodash_hash_undefined__"; function hashSet(e, t) { - var n = this.__data__; - return this.size += this.has(e) ? 0 : 1, n[e] = nativeCreate$1 && t === void 0 ? HASH_UNDEFINED$1 : t, this; + var r = this.__data__; + return this.size += this.has(e) ? 0 : 1, r[e] = nativeCreate$1 && t === void 0 ? HASH_UNDEFINED$1 : t, this; } function Hash(e) { - var t = -1, n = e == null ? 0 : e.length; - for (this.clear(); ++t < n; ) { - var s = e[t]; - this.set(s[0], s[1]); + var t = -1, r = e == null ? 0 : e.length; + for (this.clear(); ++t < r; ) { + var n = e[t]; + this.set(n[0], n[1]); } } Hash.prototype.clear = hashClear, Hash.prototype.delete = hashDelete, Hash.prototype.get = hashGet, Hash.prototype.has = hashHas, Hash.prototype.set = hashSet; @@ -3890,35 +3875,35 @@ function listCacheClear() { this.__data__ = [], this.size = 0; } function assocIndexOf(e, t) { - for (var n = e.length; n--; ) - if (eq(e[n][0], t)) - return n; + for (var r = e.length; r--; ) + if (eq(e[r][0], t)) + return r; return -1; } var arrayProto = Array.prototype, splice = arrayProto.splice; function listCacheDelete(e) { - var t = this.__data__, n = assocIndexOf(t, e); - if (n < 0) + var t = this.__data__, r = assocIndexOf(t, e); + if (r < 0) return !1; - var s = t.length - 1; - return n == s ? t.pop() : splice.call(t, n, 1), --this.size, !0; + var n = t.length - 1; + return r == n ? t.pop() : splice.call(t, r, 1), --this.size, !0; } function listCacheGet(e) { - var t = this.__data__, n = assocIndexOf(t, e); - return n < 0 ? void 0 : t[n][1]; + var t = this.__data__, r = assocIndexOf(t, e); + return r < 0 ? void 0 : t[r][1]; } function listCacheHas(e) { return assocIndexOf(this.__data__, e) > -1; } function listCacheSet(e, t) { - var n = this.__data__, s = assocIndexOf(n, e); - return s < 0 ? (++this.size, n.push([e, t])) : n[s][1] = t, this; + var r = this.__data__, n = assocIndexOf(r, e); + return n < 0 ? (++this.size, r.push([e, t])) : r[n][1] = t, this; } function ListCache(e) { - var t = -1, n = e == null ? 0 : e.length; - for (this.clear(); ++t < n; ) { - var s = e[t]; - this.set(s[0], s[1]); + var t = -1, r = e == null ? 0 : e.length; + for (this.clear(); ++t < r; ) { + var n = e[t]; + this.set(n[0], n[1]); } } ListCache.prototype.clear = listCacheClear, ListCache.prototype.delete = listCacheDelete, ListCache.prototype.get = listCacheGet, ListCache.prototype.has = listCacheHas, ListCache.prototype.set = listCacheSet; @@ -3935,8 +3920,8 @@ function isKeyable(e) { return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null; } function getMapData(e, t) { - var n = e.__data__; - return isKeyable(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map; + var r = e.__data__; + return isKeyable(t) ? r[typeof t == "string" ? "string" : "hash"] : r.map; } function mapCacheDelete(e) { var t = getMapData(this, e).delete(e); @@ -3949,14 +3934,14 @@ function mapCacheHas(e) { return getMapData(this, e).has(e); } function mapCacheSet(e, t) { - var n = getMapData(this, e), s = n.size; - return n.set(e, t), this.size += n.size == s ? 0 : 1, this; + var r = getMapData(this, e), n = r.size; + return r.set(e, t), this.size += r.size == n ? 0 : 1, this; } function MapCache(e) { - var t = -1, n = e == null ? 0 : e.length; - for (this.clear(); ++t < n; ) { - var s = e[t]; - this.set(s[0], s[1]); + var t = -1, r = e == null ? 0 : e.length; + for (this.clear(); ++t < r; ) { + var n = e[t]; + this.set(n[0], n[1]); } } MapCache.prototype.clear = mapCacheClear, MapCache.prototype.delete = mapCacheDelete, MapCache.prototype.get = mapCacheGet, MapCache.prototype.has = mapCacheHas, MapCache.prototype.set = mapCacheSet; @@ -3964,27 +3949,27 @@ var FUNC_ERROR_TEXT = "Expected a function"; function memoize(e, t) { if (typeof e != "function" || t != null && typeof t != "function") throw new TypeError(FUNC_ERROR_TEXT); - var n = function() { - var s = arguments, o = t ? t.apply(this, s) : s[0], i = n.cache; - if (i.has(o)) - return i.get(o); - var p = e.apply(this, s); - return n.cache = i.set(o, p) || i, p; + var r = function() { + var n = arguments, s = t ? t.apply(this, n) : n[0], o = r.cache; + if (o.has(s)) + return o.get(s); + var a = e.apply(this, n); + return r.cache = o.set(s, a) || o, a; }; - return n.cache = new (memoize.Cache || MapCache)(), n; + return r.cache = new (memoize.Cache || MapCache)(), r; } memoize.Cache = MapCache; var MAX_MEMOIZE_SIZE = 500; function memoizeCapped(e) { - var t = memoize(e, function(s) { - return n.size === MAX_MEMOIZE_SIZE && n.clear(), s; - }), n = t.cache; + var t = memoize(e, function(n) { + return r.size === MAX_MEMOIZE_SIZE && r.clear(), n; + }), r = t.cache; return t; } var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, reEscapeChar = /\\(\\)?/g, stringToPath = memoizeCapped(function(e) { var t = []; - return e.charCodeAt(0) === 46 && t.push(""), e.replace(rePropName, function(n, s, o, i) { - t.push(o ? i.replace(reEscapeChar, "$1") : s || n); + return e.charCodeAt(0) === 46 && t.push(""), e.replace(rePropName, function(r, n, s, o) { + t.push(s ? o.replace(reEscapeChar, "$1") : n || r); }), t; }), stringToPath$1 = stringToPath; function toString(e) { @@ -4002,36 +3987,36 @@ function toKey(e) { } function baseGet(e, t) { t = castPath(t, e); - for (var n = 0, s = t.length; e != null && n < s; ) - e = e[toKey(t[n++])]; - return n && n == s ? e : void 0; + for (var r = 0, n = t.length; e != null && r < n; ) + e = e[toKey(t[r++])]; + return r && r == n ? e : void 0; } -function get(e, t, n) { - var s = e == null ? void 0 : baseGet(e, t); - return s === void 0 ? n : s; +function get(e, t, r) { + var n = e == null ? void 0 : baseGet(e, t); + return n === void 0 ? r : n; } function arrayPush(e, t) { - for (var n = -1, s = t.length, o = e.length; ++n < s; ) - e[o + n] = t[n]; + for (var r = -1, n = t.length, s = e.length; ++r < n; ) + e[s + r] = t[r]; return e; } var nativeIsFinite = root$1.isFinite, nativeMin = Math.min; function createRound(e) { var t = Math[e]; - return function(n, s) { - if (n = toNumber(n), s = s == null ? 0 : nativeMin(toInteger(s), 292), s && nativeIsFinite(n)) { - var o = (toString(n) + "e").split("e"), i = t(o[0] + "e" + (+o[1] + s)); - return o = (toString(i) + "e").split("e"), +(o[0] + "e" + (+o[1] - s)); + return function(r, n) { + if (r = toNumber(r), n = n == null ? 0 : nativeMin(toInteger(n), 292), n && nativeIsFinite(r)) { + var s = (toString(r) + "e").split("e"), o = t(s[0] + "e" + (+s[1] + n)); + return s = (toString(o) + "e").split("e"), +(s[0] + "e" + (+s[1] - n)); } - return t(n); + return t(r); }; } function stackClear() { this.__data__ = new ListCache(), this.size = 0; } function stackDelete(e) { - var t = this.__data__, n = t.delete(e); - return this.size = t.size, n; + var t = this.__data__, r = t.delete(e); + return this.size = t.size, r; } function stackGet(e) { return this.__data__.get(e); @@ -4041,14 +4026,14 @@ function stackHas(e) { } var LARGE_ARRAY_SIZE = 200; function stackSet(e, t) { - var n = this.__data__; - if (n instanceof ListCache) { - var s = n.__data__; - if (!Map$1 || s.length < LARGE_ARRAY_SIZE - 1) - return s.push([e, t]), this.size = ++n.size, this; - n = this.__data__ = new MapCache(s); + var r = this.__data__; + if (r instanceof ListCache) { + var n = r.__data__; + if (!Map$1 || n.length < LARGE_ARRAY_SIZE - 1) + return n.push([e, t]), this.size = ++r.size, this; + r = this.__data__ = new MapCache(n); } - return n.set(e, t), this.size = n.size, this; + return r.set(e, t), this.size = r.size, this; } function Stack(e) { var t = this.__data__ = new ListCache(e); @@ -4056,11 +4041,11 @@ function Stack(e) { } Stack.prototype.clear = stackClear, Stack.prototype.delete = stackDelete, Stack.prototype.get = stackGet, Stack.prototype.has = stackHas, Stack.prototype.set = stackSet; function arrayFilter(e, t) { - for (var n = -1, s = e == null ? 0 : e.length, o = 0, i = []; ++n < s; ) { - var p = e[n]; - t(p, n, e) && (i[o++] = p); + for (var r = -1, n = e == null ? 0 : e.length, s = 0, o = []; ++r < n; ) { + var a = e[r]; + t(a, r, e) && (o[s++] = a); } - return i; + return o; } function stubArray() { return []; @@ -4070,18 +4055,18 @@ var objectProto$2 = Object.prototype, propertyIsEnumerable = objectProto$2.prope return propertyIsEnumerable.call(e, t); })); } : stubArray, getSymbols$1 = getSymbols; -function baseGetAllKeys(e, t, n) { - var s = t(e); - return isArray$1(e) ? s : arrayPush(s, n(e)); +function baseGetAllKeys(e, t, r) { + var n = t(e); + return isArray$1(e) ? n : arrayPush(n, r(e)); } function getAllKeys(e) { return baseGetAllKeys(e, keys, getSymbols$1); } var DataView = getNative(root$1, "DataView"), DataView$1 = DataView, Promise$1 = getNative(root$1, "Promise"), Promise$2 = Promise$1, Set = getNative(root$1, "Set"), Set$1 = Set, mapTag$1 = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag$1 = "[object Set]", weakMapTag = "[object WeakMap]", dataViewTag$1 = "[object DataView]", dataViewCtorString = toSource(DataView$1), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$2), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$2), getTag = baseGetTag; (DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$1 || Map$1 && getTag(new Map$1()) != mapTag$1 || Promise$2 && getTag(Promise$2.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$1 || WeakMap$2 && getTag(new WeakMap$2()) != weakMapTag) && (getTag = function(e) { - var t = baseGetTag(e), n = t == objectTag$1 ? e.constructor : void 0, s = n ? toSource(n) : ""; - if (s) - switch (s) { + var t = baseGetTag(e), r = t == objectTag$1 ? e.constructor : void 0, n = r ? toSource(r) : ""; + if (n) + switch (n) { case dataViewCtorString: return dataViewTag$1; case mapCtorString: @@ -4103,14 +4088,14 @@ function setCacheHas(e) { return this.__data__.has(e); } function SetCache(e) { - var t = -1, n = e == null ? 0 : e.length; - for (this.__data__ = new MapCache(); ++t < n; ) + var t = -1, r = e == null ? 0 : e.length; + for (this.__data__ = new MapCache(); ++t < r; ) this.add(e[t]); } SetCache.prototype.add = SetCache.prototype.push = setCacheAdd, SetCache.prototype.has = setCacheHas; function arraySome(e, t) { - for (var n = -1, s = e == null ? 0 : e.length; ++n < s; ) - if (t(e[n], n, e)) + for (var r = -1, n = e == null ? 0 : e.length; ++r < n; ) + if (t(e[r], r, e)) return !0; return !1; } @@ -4118,60 +4103,60 @@ function cacheHas(e, t) { return e.has(t); } var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2; -function equalArrays(e, t, n, s, o, i) { - var p = n & COMPARE_PARTIAL_FLAG$5, a = e.length, u = t.length; - if (a != u && !(p && u > a)) +function equalArrays(e, t, r, n, s, o) { + var a = r & COMPARE_PARTIAL_FLAG$5, i = e.length, u = t.length; + if (i != u && !(a && u > i)) return !1; - var h = i.get(e), b = i.get(t); - if (h && b) - return h == t && b == e; - var y = -1, _ = !0, E = n & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0; - for (i.set(e, t), i.set(t, e); ++y < a; ) { - var P = e[y], G = t[y]; - if (s) - var d = p ? s(G, P, y, t, e, i) : s(P, G, y, e, t, i); - if (d !== void 0) { - if (d) + var f = o.get(e), w = o.get(t); + if (f && w) + return f == t && w == e; + var h = -1, T = !0, _ = r & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0; + for (o.set(e, t), o.set(t, e); ++h < i; ) { + var E = e[h], P = t[h]; + if (n) + var p = a ? n(P, E, h, t, e, o) : n(E, P, h, e, t, o); + if (p !== void 0) { + if (p) continue; - _ = !1; + T = !1; break; } - if (E) { - if (!arraySome(t, function(f, w) { - if (!cacheHas(E, w) && (P === f || o(P, f, n, s, i))) - return E.push(w); + if (_) { + if (!arraySome(t, function(l, g) { + if (!cacheHas(_, g) && (E === l || s(E, l, r, n, o))) + return _.push(g); })) { - _ = !1; + T = !1; break; } - } else if (!(P === G || o(P, G, n, s, i))) { - _ = !1; + } else if (!(E === P || s(E, P, r, n, o))) { + T = !1; break; } } - return i.delete(e), i.delete(t), _; + return o.delete(e), o.delete(t), T; } function mapToArray(e) { - var t = -1, n = Array(e.size); - return e.forEach(function(s, o) { - n[++t] = [o, s]; - }), n; + var t = -1, r = Array(e.size); + return e.forEach(function(n, s) { + r[++t] = [s, n]; + }), r; } function setToArray(e) { - var t = -1, n = Array(e.size); - return e.forEach(function(s) { - n[++t] = s; - }), n; + var t = -1, r = Array(e.size); + return e.forEach(function(n) { + r[++t] = n; + }), r; } var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2, boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0; -function equalByTag(e, t, n, s, o, i, p) { - switch (n) { +function equalByTag(e, t, r, n, s, o, a) { + switch (r) { case dataViewTag: if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) return !1; e = e.buffer, t = t.buffer; case arrayBufferTag: - return !(e.byteLength != t.byteLength || !i(new Uint8Array$1(e), new Uint8Array$1(t))); + return !(e.byteLength != t.byteLength || !o(new Uint8Array$1(e), new Uint8Array$1(t))); case boolTag: case dateTag: case numberTag: @@ -4182,17 +4167,17 @@ function equalByTag(e, t, n, s, o, i, p) { case stringTag: return e == t + ""; case mapTag: - var a = mapToArray; + var i = mapToArray; case setTag: - var u = s & COMPARE_PARTIAL_FLAG$4; - if (a || (a = setToArray), e.size != t.size && !u) + var u = n & COMPARE_PARTIAL_FLAG$4; + if (i || (i = setToArray), e.size != t.size && !u) return !1; - var h = p.get(e); - if (h) - return h == t; - s |= COMPARE_UNORDERED_FLAG$2, p.set(e, t); - var b = equalArrays(a(e), a(t), s, o, i, p); - return p.delete(e), b; + var f = a.get(e); + if (f) + return f == t; + n |= COMPARE_UNORDERED_FLAG$2, a.set(e, t); + var w = equalArrays(i(e), i(t), n, s, o, a); + return a.delete(e), w; case symbolTag: if (symbolValueOf) return symbolValueOf.call(e) == symbolValueOf.call(t); @@ -4200,82 +4185,82 @@ function equalByTag(e, t, n, s, o, i, p) { return !1; } var COMPARE_PARTIAL_FLAG$3 = 1, objectProto$1 = Object.prototype, hasOwnProperty$1 = objectProto$1.hasOwnProperty; -function equalObjects(e, t, n, s, o, i) { - var p = n & COMPARE_PARTIAL_FLAG$3, a = getAllKeys(e), u = a.length, h = getAllKeys(t), b = h.length; - if (u != b && !p) +function equalObjects(e, t, r, n, s, o) { + var a = r & COMPARE_PARTIAL_FLAG$3, i = getAllKeys(e), u = i.length, f = getAllKeys(t), w = f.length; + if (u != w && !a) return !1; - for (var y = u; y--; ) { - var _ = a[y]; - if (!(p ? _ in t : hasOwnProperty$1.call(t, _))) + for (var h = u; h--; ) { + var T = i[h]; + if (!(a ? T in t : hasOwnProperty$1.call(t, T))) return !1; } - var E = i.get(e), P = i.get(t); - if (E && P) - return E == t && P == e; - var G = !0; - i.set(e, t), i.set(t, e); - for (var d = p; ++y < u; ) { - _ = a[y]; - var f = e[_], w = t[_]; - if (s) - var m = p ? s(w, f, _, t, e, i) : s(f, w, _, e, t, i); - if (!(m === void 0 ? f === w || o(f, w, n, s, i) : m)) { - G = !1; + var _ = o.get(e), E = o.get(t); + if (_ && E) + return _ == t && E == e; + var P = !0; + o.set(e, t), o.set(t, e); + for (var p = a; ++h < u; ) { + T = i[h]; + var l = e[T], g = t[T]; + if (n) + var m = a ? n(g, l, T, t, e, o) : n(l, g, T, e, t, o); + if (!(m === void 0 ? l === g || s(l, g, r, n, o) : m)) { + P = !1; break; } - d || (d = _ == "constructor"); + p || (p = T == "constructor"); } - if (G && !d) { - var g = e.constructor, T = t.constructor; - g != T && "constructor" in e && "constructor" in t && !(typeof g == "function" && g instanceof g && typeof T == "function" && T instanceof T) && (G = !1); + if (P && !p) { + var d = e.constructor, b = t.constructor; + d != b && "constructor" in e && "constructor" in t && !(typeof d == "function" && d instanceof d && typeof b == "function" && b instanceof b) && (P = !1); } - return i.delete(e), i.delete(t), G; + return o.delete(e), o.delete(t), P; } var COMPARE_PARTIAL_FLAG$2 = 1, argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]", objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty; -function baseIsEqualDeep(e, t, n, s, o, i) { - var p = isArray$1(e), a = isArray$1(t), u = p ? arrayTag : getTag$1(e), h = a ? arrayTag : getTag$1(t); - u = u == argsTag ? objectTag : u, h = h == argsTag ? objectTag : h; - var b = u == objectTag, y = h == objectTag, _ = u == h; - if (_ && isBuffer$1(e)) { +function baseIsEqualDeep(e, t, r, n, s, o) { + var a = isArray$1(e), i = isArray$1(t), u = a ? arrayTag : getTag$1(e), f = i ? arrayTag : getTag$1(t); + u = u == argsTag ? objectTag : u, f = f == argsTag ? objectTag : f; + var w = u == objectTag, h = f == objectTag, T = u == f; + if (T && isBuffer$1(e)) { if (!isBuffer$1(t)) return !1; - p = !0, b = !1; - } - if (_ && !b) - return i || (i = new Stack()), p || isTypedArray$1(e) ? equalArrays(e, t, n, s, o, i) : equalByTag(e, t, u, n, s, o, i); - if (!(n & COMPARE_PARTIAL_FLAG$2)) { - var E = b && hasOwnProperty.call(e, "__wrapped__"), P = y && hasOwnProperty.call(t, "__wrapped__"); - if (E || P) { - var G = E ? e.value() : e, d = P ? t.value() : t; - return i || (i = new Stack()), o(G, d, n, s, i); + a = !0, w = !1; + } + if (T && !w) + return o || (o = new Stack()), a || isTypedArray$1(e) ? equalArrays(e, t, r, n, s, o) : equalByTag(e, t, u, r, n, s, o); + if (!(r & COMPARE_PARTIAL_FLAG$2)) { + var _ = w && hasOwnProperty.call(e, "__wrapped__"), E = h && hasOwnProperty.call(t, "__wrapped__"); + if (_ || E) { + var P = _ ? e.value() : e, p = E ? t.value() : t; + return o || (o = new Stack()), s(P, p, r, n, o); } } - return _ ? (i || (i = new Stack()), equalObjects(e, t, n, s, o, i)) : !1; + return T ? (o || (o = new Stack()), equalObjects(e, t, r, n, s, o)) : !1; } -function baseIsEqual(e, t, n, s, o) { - return e === t ? !0 : e == null || t == null || !isObjectLike(e) && !isObjectLike(t) ? e !== e && t !== t : baseIsEqualDeep(e, t, n, s, baseIsEqual, o); +function baseIsEqual(e, t, r, n, s) { + return e === t ? !0 : e == null || t == null || !isObjectLike(e) && !isObjectLike(t) ? e !== e && t !== t : baseIsEqualDeep(e, t, r, n, baseIsEqual, s); } var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2; -function baseIsMatch(e, t, n, s) { - var o = n.length, i = o, p = !s; +function baseIsMatch(e, t, r, n) { + var s = r.length, o = s, a = !n; if (e == null) - return !i; - for (e = Object(e); o--; ) { - var a = n[o]; - if (p && a[2] ? a[1] !== e[a[0]] : !(a[0] in e)) + return !o; + for (e = Object(e); s--; ) { + var i = r[s]; + if (a && i[2] ? i[1] !== e[i[0]] : !(i[0] in e)) return !1; } - for (; ++o < i; ) { - a = n[o]; - var u = a[0], h = e[u], b = a[1]; - if (p && a[2]) { - if (h === void 0 && !(u in e)) + for (; ++s < o; ) { + i = r[s]; + var u = i[0], f = e[u], w = i[1]; + if (a && i[2]) { + if (f === void 0 && !(u in e)) return !1; } else { - var y = new Stack(); - if (s) - var _ = s(h, b, u, e, t, y); - if (!(_ === void 0 ? baseIsEqual(b, h, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, s, y) : _)) + var h = new Stack(); + if (n) + var T = n(f, w, u, e, t, h); + if (!(T === void 0 ? baseIsEqual(w, f, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, n, h) : T)) return !1; } } @@ -4285,44 +4270,44 @@ function isStrictComparable(e) { return e === e && !isObject(e); } function getMatchData(e) { - for (var t = keys(e), n = t.length; n--; ) { - var s = t[n], o = e[s]; - t[n] = [s, o, isStrictComparable(o)]; + for (var t = keys(e), r = t.length; r--; ) { + var n = t[r], s = e[n]; + t[r] = [n, s, isStrictComparable(s)]; } return t; } function matchesStrictComparable(e, t) { - return function(n) { - return n == null ? !1 : n[e] === t && (t !== void 0 || e in Object(n)); + return function(r) { + return r == null ? !1 : r[e] === t && (t !== void 0 || e in Object(r)); }; } function baseMatches(e) { var t = getMatchData(e); - return t.length == 1 && t[0][2] ? matchesStrictComparable(t[0][0], t[0][1]) : function(n) { - return n === e || baseIsMatch(n, e, t); + return t.length == 1 && t[0][2] ? matchesStrictComparable(t[0][0], t[0][1]) : function(r) { + return r === e || baseIsMatch(r, e, t); }; } function baseHasIn(e, t) { return e != null && t in Object(e); } -function hasPath(e, t, n) { +function hasPath(e, t, r) { t = castPath(t, e); - for (var s = -1, o = t.length, i = !1; ++s < o; ) { - var p = toKey(t[s]); - if (!(i = e != null && n(e, p))) + for (var n = -1, s = t.length, o = !1; ++n < s; ) { + var a = toKey(t[n]); + if (!(o = e != null && r(e, a))) break; - e = e[p]; + e = e[a]; } - return i || ++s != o ? i : (o = e == null ? 0 : e.length, !!o && isLength(o) && isIndex(p, o) && (isArray$1(e) || isArguments$1(e))); + return o || ++n != s ? o : (s = e == null ? 0 : e.length, !!s && isLength(s) && isIndex(a, s) && (isArray$1(e) || isArguments$1(e))); } function hasIn(e, t) { return e != null && hasPath(e, t, baseHasIn); } var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; function baseMatchesProperty(e, t) { - return isKey(e) && isStrictComparable(t) ? matchesStrictComparable(toKey(e), t) : function(n) { - var s = get(n, e); - return s === void 0 && s === t ? hasIn(n, e) : baseIsEqual(t, s, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + return isKey(e) && isStrictComparable(t) ? matchesStrictComparable(toKey(e), t) : function(r) { + var n = get(r, e); + return n === void 0 && n === t ? hasIn(r, e) : baseIsEqual(t, n, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); }; } function baseProperty(e) { @@ -4341,18 +4326,18 @@ function property(e) { function baseIteratee(e) { return typeof e == "function" ? e : e == null ? identity : typeof e == "object" ? isArray$1(e) ? baseMatchesProperty(e[0], e[1]) : baseMatches(e) : property(e); } -function arrayAggregator(e, t, n, s) { - for (var o = -1, i = e == null ? 0 : e.length; ++o < i; ) { - var p = e[o]; - t(s, p, n(p), e); +function arrayAggregator(e, t, r, n) { + for (var s = -1, o = e == null ? 0 : e.length; ++s < o; ) { + var a = e[s]; + t(n, a, r(a), e); } - return s; + return n; } function createBaseFor(e) { - return function(t, n, s) { - for (var o = -1, i = Object(t), p = s(t), a = p.length; a--; ) { - var u = p[e ? a : ++o]; - if (n(i[u], u, i) === !1) + return function(t, r, n) { + for (var s = -1, o = Object(t), a = n(t), i = a.length; i--; ) { + var u = a[e ? i : ++s]; + if (r(o[u], u, o) === !1) break; } return t; @@ -4363,37 +4348,37 @@ function baseForOwn(e, t) { return e && baseFor$1(e, t, keys); } function createBaseEach(e, t) { - return function(n, s) { - if (n == null) - return n; - if (!isArrayLike(n)) - return e(n, s); - for (var o = n.length, i = t ? o : -1, p = Object(n); (t ? i-- : ++i < o) && s(p[i], i, p) !== !1; ) + return function(r, n) { + if (r == null) + return r; + if (!isArrayLike(r)) + return e(r, n); + for (var s = r.length, o = t ? s : -1, a = Object(r); (t ? o-- : ++o < s) && n(a[o], o, a) !== !1; ) ; - return n; + return r; }; } var baseEach = createBaseEach(baseForOwn), baseEach$1 = baseEach; -function baseAggregator(e, t, n, s) { - return baseEach$1(e, function(o, i, p) { - t(s, o, n(o), p); - }), s; +function baseAggregator(e, t, r, n) { + return baseEach$1(e, function(s, o, a) { + t(n, s, r(s), a); + }), n; } function createAggregator(e, t) { - return function(n, s) { - var o = isArray$1(n) ? arrayAggregator : baseAggregator, i = t ? t() : {}; - return o(n, e, baseIteratee(s), i); + return function(r, n) { + var s = isArray$1(r) ? arrayAggregator : baseAggregator, o = t ? t() : {}; + return s(r, e, baseIteratee(n), o); }; } -var partition = createAggregator(function(e, t, n) { - e[n ? 0 : 1].push(t); +var partition = createAggregator(function(e, t, r) { + e[r ? 0 : 1].push(t); }, function() { return [[], []]; }), partition$1 = partition, round = createRound("round"), round$1 = round, globToRegexp = function(e, t) { if (typeof e != "string") throw new TypeError("Expected a string"); - for (var n = String(e), s = "", o = t ? !!t.extended : !1, i = t ? !!t.globstar : !1, p = !1, a = t && typeof t.flags == "string" ? t.flags : "", u, h = 0, b = n.length; h < b; h++) - switch (u = n[h], u) { + for (var r = String(e), n = "", s = t ? !!t.extended : !1, o = t ? !!t.globstar : !1, a = !1, i = t && typeof t.flags == "string" ? t.flags : "", u, f = 0, w = r.length; f < w; f++) + switch (u = r[f], u) { case "/": case "$": case "^": @@ -4404,57 +4389,57 @@ var partition = createAggregator(function(e, t, n) { case "=": case "!": case "|": - s += "\\" + u; + n += "\\" + u; break; case "?": - if (o) { - s += "."; + if (s) { + n += "."; break; } case "[": case "]": - if (o) { - s += u; + if (s) { + n += u; break; } case "{": - if (o) { - p = !0, s += "("; + if (s) { + a = !0, n += "("; break; } case "}": - if (o) { - p = !1, s += ")"; + if (s) { + a = !1, n += ")"; break; } case ",": - if (p) { - s += "|"; + if (a) { + n += "|"; break; } - s += "\\" + u; + n += "\\" + u; break; case "*": - for (var y = n[h - 1], _ = 1; n[h + 1] === "*"; ) - _++, h++; - var E = n[h + 1]; - if (!i) - s += ".*"; + for (var h = r[f - 1], T = 1; r[f + 1] === "*"; ) + T++, f++; + var _ = r[f + 1]; + if (!o) + n += ".*"; else { - var P = _ > 1 && (y === "/" || y === void 0) && (E === "/" || E === void 0); - P ? (s += "((?:[^/]*(?:/|$))*)", h++) : s += "([^/]*)"; + var E = T > 1 && (h === "/" || h === void 0) && (_ === "/" || _ === void 0); + E ? (n += "((?:[^/]*(?:/|$))*)", f++) : n += "([^/]*)"; } break; default: - s += u; + n += u; } - return (!a || !~a.indexOf("g")) && (s = "^" + s + "$"), new RegExp(s, a); + return (!i || !~i.indexOf("g")) && (n = "^" + n + "$"), new RegExp(n, i); }; function partionHidden(e, t) { if (!e) return [[], t]; - const n = globToRegexp(e, { extended: !0 }); - return partition$1(t, (s) => n.test(s.path)); + const r = globToRegexp(e, { extended: !0 }); + return partition$1(t, (n) => r.test(n.path)); } function getSizeLabels(e) { return e.length === 1 && e[0].property === "size" ? "" : ` (${e.map((t) => t.label).join(" / ")})`; @@ -4476,27 +4461,27 @@ const supportedSizes = { function parseDisplaySize(e) { return e.split(",").map((t) => t.trim()).filter((t) => supportedSizes.hasOwnProperty(t)).map((t) => supportedSizes[t]); } -const listSizes = (e, t) => e.map(({ property: n }) => t(n)).join(" / "); -function sortFiles(e, t, n) { - e.sort((s, o) => o[t] - s[t] || s.path.localeCompare(o.path)), n === "asc" && e.reverse(); +const listSizes = (e, t) => e.map(({ property: r }) => t(r)).join(" / "); +function sortFiles(e, t, r) { + e.sort((n, s) => s[t] - n[t] || n.path.localeCompare(s.path)), r === "asc" && e.reverse(); } -var __defProp$3 = Object.defineProperty, __defProps$3 = Object.defineProperties, __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors, __getOwnPropSymbols$3 = Object.getOwnPropertySymbols, __hasOwnProp$3 = Object.prototype.hasOwnProperty, __propIsEnum$3 = Object.prototype.propertyIsEnumerable, __defNormalProp$3 = (e, t, n) => t in e ? __defProp$3(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, __spreadValues$3 = (e, t) => { - for (var n in t || (t = {})) - __hasOwnProp$3.call(t, n) && __defNormalProp$3(e, n, t[n]); +var __defProp$3 = Object.defineProperty, __defProps$3 = Object.defineProperties, __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors, __getOwnPropSymbols$3 = Object.getOwnPropertySymbols, __hasOwnProp$3 = Object.prototype.hasOwnProperty, __propIsEnum$3 = Object.prototype.propertyIsEnumerable, __defNormalProp$3 = (e, t, r) => t in e ? __defProp$3(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, __spreadValues$3 = (e, t) => { + for (var r in t || (t = {})) + __hasOwnProp$3.call(t, r) && __defNormalProp$3(e, r, t[r]); if (__getOwnPropSymbols$3) - for (var n of __getOwnPropSymbols$3(t)) - __propIsEnum$3.call(t, n) && __defNormalProp$3(e, n, t[n]); + for (var r of __getOwnPropSymbols$3(t)) + __propIsEnum$3.call(t, r) && __defNormalProp$3(e, r, t[r]); return e; }, __spreadProps$3 = (e, t) => __defProps$3(e, __getOwnPropDescs$3(t)); const percent = (e) => (e < 1e-3 ? e = round$1(e, 4) : e < 0.01 ? e = round$1(e, 3) : e = round$1(e, 2), e.toLocaleString(void 0, { style: "percent", maximumSignificantDigits: 3 })); -function calculateDiffBy(e, t, n) { - const s = e[n] - t[n]; +function calculateDiffBy(e, t, r) { + const n = e[r] - t[r]; return { - delta: s, - percent: percent(s / t[n]) + delta: n, + percent: percent(n / t[r]) }; } function calculateDiff(e, t) { @@ -4506,26 +4491,26 @@ function calculateDiff(e, t) { sizeBrotli: calculateDiffBy(e, t, "sizeBrotli") }; } -function processPkgFiles(e, t, n) { - for (const s of n.files) { - e[s.path] || (e[s.path] = { - path: s.path, - label: s.label +function processPkgFiles(e, t, r) { + for (const n of r.files) { + e[n.path] || (e[n.path] = { + path: n.path, + label: n.label }); - const o = e[s.path]; - o[t] = s, o.head && o.base && (o.diff = calculateDiff(o.head, o.base)); + const s = e[n.path]; + s[t] = n, s.head && s.base && (s.diff = calculateDiff(s.head, s.base)); } } function comparePackages(e, t, { - sortBy: n, - sortOrder: s, - hideFiles: o + sortBy: r, + sortOrder: n, + hideFiles: s } = {}) { - const i = {}; - processPkgFiles(i, "head", e), processPkgFiles(i, "base", t); - const p = Object.values(i); - sortFiles(p, n, s); - const [a, u] = partionHidden(o, p), [h, b] = partition$1(u, (y) => y.diff && y.diff.size.delta === 0); + const o = {}; + processPkgFiles(o, "head", e), processPkgFiles(o, "base", t); + const a = Object.values(o); + sortFiles(a, r, n); + const [i, u] = partionHidden(s, a), [f, w] = partition$1(u, (h) => h.diff && h.diff.size.delta === 0); return { head: e, base: t, @@ -4533,9 +4518,9 @@ function comparePackages(e, t, { tarballSize: calculateDiffBy(e, t, "tarballSize") }), files: { - changed: b, - unchanged: h, - hidden: a + changed: w, + unchanged: f, + hidden: i } }; } @@ -4543,570 +4528,570 @@ const directionSymbol = (e) => e < 0 ? "\u2193" : e > 0 ? "\u2191" : "", formatD function generateComment({ headPkgData: e, basePkgData: t, - sortBy: n, - sortOrder: s, - hideFiles: o, - unchangedFiles: i, - displaySize: p + sortBy: r, + sortOrder: n, + hideFiles: s, + unchangedFiles: o, + displaySize: a }) { - const a = comparePackages(e, t, { - sortBy: n, - sortOrder: s, - hideFiles: o + const i = comparePackages(e, t, { + sortBy: r, + sortOrder: n, + hideFiles: s }); - core.setOutput("regressionData", a); - const { changed: u, unchanged: h, hidden: b } = a.files, y = parseDisplaySize(p), _ = getSizeLabels(y), E = markdownTable_1([ - ["File", `Before${_}`, `After${_}`], + core.setOutput("regressionData", i); + const { changed: u, unchanged: f, hidden: w } = i.files, h = parseDisplaySize(a), T = getSizeLabels(h), _ = markdownTable([ + ["File", `Before${T}`, `After${T}`], ...[ ...u, - ...i === "show" ? h : [] - ].map((d) => [ - d.label, - d.base && d.base.size ? listSizes(y, (f) => c$1(dist(d.base[f]))) : "\u2014", - d.head && d.head.size ? listSizes(y, (f) => (d.base && d.base[f] ? sup(formatDelta(d.diff[f])) : "") + c$1(dist(d.head[f]))) : "\u2014" + ...o === "show" ? f : [] + ].map((p) => [ + p.label, + p.base && p.base.size ? listSizes(h, (l) => c(dist(p.base[l]))) : "\u2014", + p.head && p.head.size ? listSizes(h, (l) => (p.base && p.base[l] ? sup(formatDelta(p.diff[l])) : "") + c(dist(p.head[l]))) : "\u2014" ]), [ - `${strong("Total")} ${i === "show" ? "" : sub("_(Includes all files)_")}`, - listSizes(y, (d) => c$1(dist(a.base[d]))), - listSizes(y, (d) => sup(formatDelta(a.diff[d])) + c$1(dist(a.head[d]))) + `${strong("Total")} ${o === "show" ? "" : sub("_(Includes all files)_")}`, + listSizes(h, (p) => c(dist(i.base[p]))), + listSizes(h, (p) => sup(formatDelta(i.diff[p])) + c(dist(i.head[p]))) ], [ strong("Tarball size"), - c$1(dist(a.base.tarballSize)), - sup(formatDelta(a.diff.tarballSize)) + c$1(dist(a.head.tarballSize)) + c(dist(i.base.tarballSize)), + sup(formatDelta(i.diff.tarballSize)) + c(dist(i.head.tarballSize)) ] ], { align: ["", "r", "r"] }); - let P = ""; - i === "collapse" && h.length > 0 && (P = markdownTable_1([ - ["File", `Size${_}`], - ...h.map((d) => [ - d.label, - listSizes(y, (f) => c$1(dist(d.base[f]))) + let E = ""; + o === "collapse" && f.length > 0 && (E = markdownTable([ + ["File", `Size${T}`], + ...f.map((p) => [ + p.label, + listSizes(h, (l) => c(dist(p.base[l]))) ]) ], { align: ["", "r"] - }), P = `
Unchanged files + }), E = `
Unchanged files -${P} +${E}
`); - let G = ""; - return b.length > 0 && (G = markdownTable_1([ - ["File", `Before${_}`, `After${_}`], - ...b.map((d) => [ - d.label, - d.base && d.base.size ? listSizes(y, (f) => c$1(dist(d.base[f]))) : "\u2014", - d.head && d.head.size ? listSizes(y, (f) => (d.base && d.base[f] ? sup(formatDelta(d.diff[f])) : "") + c$1(dist(d.head[f]))) : "\u2014" + let P = ""; + return w.length > 0 && (P = markdownTable([ + ["File", `Before${T}`, `After${T}`], + ...w.map((p) => [ + p.label, + p.base && p.base.size ? listSizes(h, (l) => c(dist(p.base[l]))) : "\u2014", + p.head && p.head.size ? listSizes(h, (l) => (p.base && p.base[l] ? sup(formatDelta(p.diff[l])) : "") + c(dist(p.head[l]))) : "\u2014" ]) ], { align: ["", "r", "r"] - }), G = `
Hidden files + }), P = `
Hidden files -${G} +${P}
`), defaultOutdent` - ### 📊 Package size report   ${formatDelta(a.diff.size) || "No changes"} + ### 📊 Package size report   ${formatDelta(i.diff.size) || "No changes"} + + ${_} ${E} ${P} - - ${G} `; } function headOnly({ headPkgData: e, hideFiles: t, - displaySize: n, - sortBy: s, - sortOrder: o + displaySize: r, + sortBy: n, + sortOrder: s }) { - const i = parseDisplaySize(n), p = getSizeLabels(i); - sortFiles(e.files, s, o); - const [a, u] = partionHidden(t, e.files), h = markdownTable_1([ - ["File", `Size${p}`], - ...u.map((y) => [ - y.label, - listSizes(i, (_) => c$1(dist(y[_]))) + const o = parseDisplaySize(r), a = getSizeLabels(o); + sortFiles(e.files, n, s); + const [i, u] = partionHidden(t, e.files), f = markdownTable([ + ["File", `Size${a}`], + ...u.map((h) => [ + h.label, + listSizes(o, (T) => c(dist(h[T]))) ]), [ strong("Total"), - listSizes(i, (y) => c$1(dist(e[y]))) + listSizes(o, (h) => c(dist(e[h]))) ], [ strong("Tarball size"), - c$1(dist(e.tarballSize)) + c(dist(e.tarballSize)) ] ], { align: ["", "r"] }); - let b = ""; - return a.length > 0 && (b = markdownTable_1([ - ["File", `Size${p}`], - ...a.map((y) => [ - y.label, - listSizes(i, (_) => c$1(dist(y[_]))) + let w = ""; + return i.length > 0 && (w = markdownTable([ + ["File", `Size${a}`], + ...i.map((h) => [ + h.label, + listSizes(o, (T) => c(dist(h[T]))) ]) ], { align: ["", "r"] - }), b = `
Hidden files + }), w = `
Hidden files -${b} +${w}
`), defaultOutdent` ### 📊 Package size report - ${h} + ${f} - ${b} + ${w} `; } var ioUtil = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(d, f, w, m) { - m === void 0 && (m = w), Object.defineProperty(d, m, { enumerable: !0, get: function() { - return f[w]; + var r = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(p, l, g, m) { + m === void 0 && (m = g), Object.defineProperty(p, m, { enumerable: !0, get: function() { + return l[g]; } }); - } : function(d, f, w, m) { - m === void 0 && (m = w), d[m] = f[w]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(d, f) { - Object.defineProperty(d, "default", { enumerable: !0, value: f }); - } : function(d, f) { - d.default = f; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(d) { - if (d && d.__esModule) - return d; - var f = {}; - if (d != null) - for (var w in d) - w !== "default" && Object.hasOwnProperty.call(d, w) && n(f, d, w); - return s(f, d), f; - }, i = commonjsGlobal && commonjsGlobal.__awaiter || function(d, f, w, m) { - function g(T) { - return T instanceof w ? T : new w(function(v) { - v(T); + } : function(p, l, g, m) { + m === void 0 && (m = g), p[m] = l[g]; + }), n = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(p, l) { + Object.defineProperty(p, "default", { enumerable: !0, value: l }); + } : function(p, l) { + p.default = l; + }), s = commonjsGlobal && commonjsGlobal.__importStar || function(p) { + if (p && p.__esModule) + return p; + var l = {}; + if (p != null) + for (var g in p) + g !== "default" && Object.hasOwnProperty.call(p, g) && r(l, p, g); + return n(l, p), l; + }, o = commonjsGlobal && commonjsGlobal.__awaiter || function(p, l, g, m) { + function d(b) { + return b instanceof g ? b : new g(function(y) { + y(b); }); } - return new (w || (w = Promise))(function(T, v) { - function O(k) { + return new (g || (g = Promise))(function(b, y) { + function v(G) { try { - A(m.next(k)); - } catch (D) { - v(D); + S(m.next(G)); + } catch ($) { + y($); } } - function $(k) { + function A(G) { try { - A(m.throw(k)); - } catch (D) { - v(D); + S(m.throw(G)); + } catch ($) { + y($); } } - function A(k) { - k.done ? T(k.value) : g(k.value).then(O, $); + function S(G) { + G.done ? b(G.value) : d(G.value).then(v, A); } - A((m = m.apply(d, f || [])).next()); + S((m = m.apply(p, l || [])).next()); }); - }, p; + }, a; Object.defineProperty(t, "__esModule", { value: !0 }), t.getCmdPath = t.tryGetExecutablePath = t.isRooted = t.isDirectory = t.exists = t.IS_WINDOWS = t.unlink = t.symlink = t.stat = t.rmdir = t.rename = t.readlink = t.readdir = t.mkdir = t.lstat = t.copyFile = t.chmod = void 0; - const a = o(fs__default.default), u = o(require$$1__default.default); - p = a.promises, t.chmod = p.chmod, t.copyFile = p.copyFile, t.lstat = p.lstat, t.mkdir = p.mkdir, t.readdir = p.readdir, t.readlink = p.readlink, t.rename = p.rename, t.rmdir = p.rmdir, t.stat = p.stat, t.symlink = p.symlink, t.unlink = p.unlink, t.IS_WINDOWS = process.platform === "win32"; - function h(d) { - return i(this, void 0, void 0, function* () { + const i = s(fs__default.default), u = s(require$$1__default.default); + a = i.promises, t.chmod = a.chmod, t.copyFile = a.copyFile, t.lstat = a.lstat, t.mkdir = a.mkdir, t.readdir = a.readdir, t.readlink = a.readlink, t.rename = a.rename, t.rmdir = a.rmdir, t.stat = a.stat, t.symlink = a.symlink, t.unlink = a.unlink, t.IS_WINDOWS = process.platform === "win32"; + function f(p) { + return o(this, void 0, void 0, function* () { try { - yield t.stat(d); - } catch (f) { - if (f.code === "ENOENT") + yield t.stat(p); + } catch (l) { + if (l.code === "ENOENT") return !1; - throw f; + throw l; } return !0; }); } - t.exists = h; - function b(d, f = !1) { - return i(this, void 0, void 0, function* () { - return (f ? yield t.stat(d) : yield t.lstat(d)).isDirectory(); + t.exists = f; + function w(p, l = !1) { + return o(this, void 0, void 0, function* () { + return (l ? yield t.stat(p) : yield t.lstat(p)).isDirectory(); }); } - t.isDirectory = b; - function y(d) { - if (d = E(d), !d) + t.isDirectory = w; + function h(p) { + if (p = _(p), !p) throw new Error('isRooted() parameter "p" cannot be empty'); - return t.IS_WINDOWS ? d.startsWith("\\") || /^[A-Z]:/i.test(d) : d.startsWith("/"); + return t.IS_WINDOWS ? p.startsWith("\\") || /^[A-Z]:/i.test(p) : p.startsWith("/"); } - t.isRooted = y; - function _(d, f) { - return i(this, void 0, void 0, function* () { - let w; + t.isRooted = h; + function T(p, l) { + return o(this, void 0, void 0, function* () { + let g; try { - w = yield t.stat(d); - } catch (g) { - g.code !== "ENOENT" && console.log(`Unexpected error attempting to determine if executable file exists '${d}': ${g}`); + g = yield t.stat(p); + } catch (d) { + d.code !== "ENOENT" && console.log(`Unexpected error attempting to determine if executable file exists '${p}': ${d}`); } - if (w && w.isFile()) { + if (g && g.isFile()) { if (t.IS_WINDOWS) { - const g = u.extname(d).toUpperCase(); - if (f.some((T) => T.toUpperCase() === g)) - return d; - } else if (P(w)) - return d; + const d = u.extname(p).toUpperCase(); + if (l.some((b) => b.toUpperCase() === d)) + return p; + } else if (E(g)) + return p; } - const m = d; - for (const g of f) { - d = m + g, w = void 0; + const m = p; + for (const d of l) { + p = m + d, g = void 0; try { - w = yield t.stat(d); - } catch (T) { - T.code !== "ENOENT" && console.log(`Unexpected error attempting to determine if executable file exists '${d}': ${T}`); + g = yield t.stat(p); + } catch (b) { + b.code !== "ENOENT" && console.log(`Unexpected error attempting to determine if executable file exists '${p}': ${b}`); } - if (w && w.isFile()) { + if (g && g.isFile()) { if (t.IS_WINDOWS) { try { - const T = u.dirname(d), v = u.basename(d).toUpperCase(); - for (const O of yield t.readdir(T)) - if (v === O.toUpperCase()) { - d = u.join(T, O); + const b = u.dirname(p), y = u.basename(p).toUpperCase(); + for (const v of yield t.readdir(b)) + if (y === v.toUpperCase()) { + p = u.join(b, v); break; } - } catch (T) { - console.log(`Unexpected error attempting to determine the actual case of the file '${d}': ${T}`); + } catch (b) { + console.log(`Unexpected error attempting to determine the actual case of the file '${p}': ${b}`); } - return d; - } else if (P(w)) - return d; + return p; + } else if (E(g)) + return p; } } return ""; }); } - t.tryGetExecutablePath = _; - function E(d) { - return d = d || "", t.IS_WINDOWS ? (d = d.replace(/\//g, "\\"), d.replace(/\\\\+/g, "\\")) : d.replace(/\/\/+/g, "/"); + t.tryGetExecutablePath = T; + function _(p) { + return p = p || "", t.IS_WINDOWS ? (p = p.replace(/\//g, "\\"), p.replace(/\\\\+/g, "\\")) : p.replace(/\/\/+/g, "/"); } - function P(d) { - return (d.mode & 1) > 0 || (d.mode & 8) > 0 && d.gid === process.getgid() || (d.mode & 64) > 0 && d.uid === process.getuid(); + function E(p) { + return (p.mode & 1) > 0 || (p.mode & 8) > 0 && p.gid === process.getgid() || (p.mode & 64) > 0 && p.uid === process.getuid(); } - function G() { - var d; - return (d = process.env.COMSPEC) !== null && d !== void 0 ? d : "cmd.exe"; + function P() { + var p; + return (p = process.env.COMSPEC) !== null && p !== void 0 ? p : "cmd.exe"; } - t.getCmdPath = G; + t.getCmdPath = P; }), io = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(g, T, v, O) { - O === void 0 && (O = v), Object.defineProperty(g, O, { enumerable: !0, get: function() { - return T[v]; + var r = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(d, b, y, v) { + v === void 0 && (v = y), Object.defineProperty(d, v, { enumerable: !0, get: function() { + return b[y]; } }); - } : function(g, T, v, O) { - O === void 0 && (O = v), g[O] = T[v]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(g, T) { - Object.defineProperty(g, "default", { enumerable: !0, value: T }); - } : function(g, T) { - g.default = T; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(g) { - if (g && g.__esModule) - return g; - var T = {}; - if (g != null) - for (var v in g) - v !== "default" && Object.hasOwnProperty.call(g, v) && n(T, g, v); - return s(T, g), T; - }, i = commonjsGlobal && commonjsGlobal.__awaiter || function(g, T, v, O) { - function $(A) { - return A instanceof v ? A : new v(function(k) { - k(A); + } : function(d, b, y, v) { + v === void 0 && (v = y), d[v] = b[y]; + }), n = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(d, b) { + Object.defineProperty(d, "default", { enumerable: !0, value: b }); + } : function(d, b) { + d.default = b; + }), s = commonjsGlobal && commonjsGlobal.__importStar || function(d) { + if (d && d.__esModule) + return d; + var b = {}; + if (d != null) + for (var y in d) + y !== "default" && Object.hasOwnProperty.call(d, y) && r(b, d, y); + return n(b, d), b; + }, o = commonjsGlobal && commonjsGlobal.__awaiter || function(d, b, y, v) { + function A(S) { + return S instanceof y ? S : new y(function(G) { + G(S); }); } - return new (v || (v = Promise))(function(A, k) { - function D(U) { + return new (y || (y = Promise))(function(S, G) { + function $(C) { try { - j(O.next(U)); - } catch (F) { - k(F); + R(v.next(C)); + } catch (D) { + G(D); } } - function S(U) { + function O(C) { try { - j(O.throw(U)); - } catch (F) { - k(F); + R(v.throw(C)); + } catch (D) { + G(D); } } - function j(U) { - U.done ? A(U.value) : $(U.value).then(D, S); + function R(C) { + C.done ? S(C.value) : A(C.value).then($, O); } - j((O = O.apply(g, T || [])).next()); + R((v = v.apply(d, b || [])).next()); }); }; Object.defineProperty(t, "__esModule", { value: !0 }), t.findInPath = t.which = t.mkdirP = t.rmRF = t.mv = t.cp = void 0; - const p = o(require$$0__default$1.default), a = o(require$$1__default.default), u = o(ioUtil), h = util_1__default.default.promisify(p.exec), b = util_1__default.default.promisify(p.execFile); - function y(g, T, v = {}) { - return i(this, void 0, void 0, function* () { - const { force: O, recursive: $, copySourceDirectory: A } = f(v), k = (yield u.exists(T)) ? yield u.stat(T) : null; - if (k && k.isFile() && !O) + const a = s(require$$0__default$1.default), i = s(require$$1__default.default), u = s(ioUtil), f = util_1__default.default.promisify(a.exec), w = util_1__default.default.promisify(a.execFile); + function h(d, b, y = {}) { + return o(this, void 0, void 0, function* () { + const { force: v, recursive: A, copySourceDirectory: S } = l(y), G = (yield u.exists(b)) ? yield u.stat(b) : null; + if (G && G.isFile() && !v) return; - const D = k && k.isDirectory() && A ? a.join(T, a.basename(g)) : T; - if (!(yield u.exists(g))) - throw new Error(`no such file or directory: ${g}`); - if ((yield u.stat(g)).isDirectory()) - if ($) - yield w(g, D, 0, O); + const $ = G && G.isDirectory() && S ? i.join(b, i.basename(d)) : b; + if (!(yield u.exists(d))) + throw new Error(`no such file or directory: ${d}`); + if ((yield u.stat(d)).isDirectory()) + if (A) + yield g(d, $, 0, v); else - throw new Error(`Failed to copy. ${g} is a directory, but tried to copy without recursive flag.`); + throw new Error(`Failed to copy. ${d} is a directory, but tried to copy without recursive flag.`); else { - if (a.relative(g, D) === "") - throw new Error(`'${D}' and '${g}' are the same file`); - yield m(g, D, O); + if (i.relative(d, $) === "") + throw new Error(`'${$}' and '${d}' are the same file`); + yield m(d, $, v); } }); } - t.cp = y; - function _(g, T, v = {}) { - return i(this, void 0, void 0, function* () { - if (yield u.exists(T)) { - let O = !0; - if ((yield u.isDirectory(T)) && (T = a.join(T, a.basename(g)), O = yield u.exists(T)), O) - if (v.force == null || v.force) - yield E(T); + t.cp = h; + function T(d, b, y = {}) { + return o(this, void 0, void 0, function* () { + if (yield u.exists(b)) { + let v = !0; + if ((yield u.isDirectory(b)) && (b = i.join(b, i.basename(d)), v = yield u.exists(b)), v) + if (y.force == null || y.force) + yield _(b); else throw new Error("Destination already exists"); } - yield P(a.dirname(T)), yield u.rename(g, T); + yield E(i.dirname(b)), yield u.rename(d, b); }); } - t.mv = _; - function E(g) { - return i(this, void 0, void 0, function* () { + t.mv = T; + function _(d) { + return o(this, void 0, void 0, function* () { if (u.IS_WINDOWS) { - if (/[*"<>|]/.test(g)) + if (/[*"<>|]/.test(d)) throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); try { - const T = u.getCmdPath(); - (yield u.isDirectory(g, !0)) ? yield h(`${T} /s /c "rd /s /q "%inputPath%""`, { - env: { inputPath: g } - }) : yield h(`${T} /s /c "del /f /a "%inputPath%""`, { - env: { inputPath: g } + const b = u.getCmdPath(); + (yield u.isDirectory(d, !0)) ? yield f(`${b} /s /c "rd /s /q "%inputPath%""`, { + env: { inputPath: d } + }) : yield f(`${b} /s /c "del /f /a "%inputPath%""`, { + env: { inputPath: d } }); - } catch (T) { - if (T.code !== "ENOENT") - throw T; + } catch (b) { + if (b.code !== "ENOENT") + throw b; } try { - yield u.unlink(g); - } catch (T) { - if (T.code !== "ENOENT") - throw T; + yield u.unlink(d); + } catch (b) { + if (b.code !== "ENOENT") + throw b; } } else { - let T = !1; + let b = !1; try { - T = yield u.isDirectory(g); - } catch (v) { - if (v.code !== "ENOENT") - throw v; + b = yield u.isDirectory(d); + } catch (y) { + if (y.code !== "ENOENT") + throw y; return; } - T ? yield b("rm", ["-rf", `${g}`]) : yield u.unlink(g); + b ? yield w("rm", ["-rf", `${d}`]) : yield u.unlink(d); } }); } - t.rmRF = E; - function P(g) { - return i(this, void 0, void 0, function* () { - assert_1__default.default.ok(g, "a path argument must be provided"), yield u.mkdir(g, { recursive: !0 }); + t.rmRF = _; + function E(d) { + return o(this, void 0, void 0, function* () { + assert__default.default.ok(d, "a path argument must be provided"), yield u.mkdir(d, { recursive: !0 }); }); } - t.mkdirP = P; - function G(g, T) { - return i(this, void 0, void 0, function* () { - if (!g) + t.mkdirP = E; + function P(d, b) { + return o(this, void 0, void 0, function* () { + if (!d) throw new Error("parameter 'tool' is required"); - if (T) { - const O = yield G(g, !1); - if (!O) - throw u.IS_WINDOWS ? new Error(`Unable to locate executable file: ${g}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`) : new Error(`Unable to locate executable file: ${g}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); - return O; + if (b) { + const v = yield P(d, !1); + if (!v) + throw u.IS_WINDOWS ? new Error(`Unable to locate executable file: ${d}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`) : new Error(`Unable to locate executable file: ${d}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); + return v; } - const v = yield d(g); - return v && v.length > 0 ? v[0] : ""; + const y = yield p(d); + return y && y.length > 0 ? y[0] : ""; }); } - t.which = G; - function d(g) { - return i(this, void 0, void 0, function* () { - if (!g) + t.which = P; + function p(d) { + return o(this, void 0, void 0, function* () { + if (!d) throw new Error("parameter 'tool' is required"); - const T = []; + const b = []; if (u.IS_WINDOWS && process.env.PATHEXT) - for (const $ of process.env.PATHEXT.split(a.delimiter)) - $ && T.push($); - if (u.isRooted(g)) { - const $ = yield u.tryGetExecutablePath(g, T); - return $ ? [$] : []; + for (const A of process.env.PATHEXT.split(i.delimiter)) + A && b.push(A); + if (u.isRooted(d)) { + const A = yield u.tryGetExecutablePath(d, b); + return A ? [A] : []; } - if (g.includes(a.sep)) + if (d.includes(i.sep)) return []; - const v = []; + const y = []; if (process.env.PATH) - for (const $ of process.env.PATH.split(a.delimiter)) - $ && v.push($); - const O = []; - for (const $ of v) { - const A = yield u.tryGetExecutablePath(a.join($, g), T); - A && O.push(A); + for (const A of process.env.PATH.split(i.delimiter)) + A && y.push(A); + const v = []; + for (const A of y) { + const S = yield u.tryGetExecutablePath(i.join(A, d), b); + S && v.push(S); } - return O; + return v; }); } - t.findInPath = d; - function f(g) { - const T = g.force == null ? !0 : g.force, v = Boolean(g.recursive), O = g.copySourceDirectory == null ? !0 : Boolean(g.copySourceDirectory); - return { force: T, recursive: v, copySourceDirectory: O }; + t.findInPath = p; + function l(d) { + const b = d.force == null ? !0 : d.force, y = Boolean(d.recursive), v = d.copySourceDirectory == null ? !0 : Boolean(d.copySourceDirectory); + return { force: b, recursive: y, copySourceDirectory: v }; } - function w(g, T, v, O) { - return i(this, void 0, void 0, function* () { - if (v >= 255) + function g(d, b, y, v) { + return o(this, void 0, void 0, function* () { + if (y >= 255) return; - v++, yield P(T); - const $ = yield u.readdir(g); - for (const A of $) { - const k = `${g}/${A}`, D = `${T}/${A}`; - (yield u.lstat(k)).isDirectory() ? yield w(k, D, v, O) : yield m(k, D, O); + y++, yield E(b); + const A = yield u.readdir(d); + for (const S of A) { + const G = `${d}/${S}`, $ = `${b}/${S}`; + (yield u.lstat(G)).isDirectory() ? yield g(G, $, y, v) : yield m(G, $, v); } - yield u.chmod(T, (yield u.stat(g)).mode); + yield u.chmod(b, (yield u.stat(d)).mode); }); } - function m(g, T, v) { - return i(this, void 0, void 0, function* () { - if ((yield u.lstat(g)).isSymbolicLink()) { + function m(d, b, y) { + return o(this, void 0, void 0, function* () { + if ((yield u.lstat(d)).isSymbolicLink()) { try { - yield u.lstat(T), yield u.unlink(T); - } catch ($) { - $.code === "EPERM" && (yield u.chmod(T, "0666"), yield u.unlink(T)); + yield u.lstat(b), yield u.unlink(b); + } catch (A) { + A.code === "EPERM" && (yield u.chmod(b, "0666"), yield u.unlink(b)); } - const O = yield u.readlink(g); - yield u.symlink(O, T, u.IS_WINDOWS ? "junction" : null); + const v = yield u.readlink(d); + yield u.symlink(v, b, u.IS_WINDOWS ? "junction" : null); } else - (!(yield u.exists(T)) || v) && (yield u.copyFile(g, T)); + (!(yield u.exists(b)) || y) && (yield u.copyFile(d, b)); }); } }), toolrunner = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(d, f, w, m) { - m === void 0 && (m = w), Object.defineProperty(d, m, { enumerable: !0, get: function() { - return f[w]; + var r = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(p, l, g, m) { + m === void 0 && (m = g), Object.defineProperty(p, m, { enumerable: !0, get: function() { + return l[g]; } }); - } : function(d, f, w, m) { - m === void 0 && (m = w), d[m] = f[w]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(d, f) { - Object.defineProperty(d, "default", { enumerable: !0, value: f }); - } : function(d, f) { - d.default = f; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(d) { - if (d && d.__esModule) - return d; - var f = {}; - if (d != null) - for (var w in d) - w !== "default" && Object.hasOwnProperty.call(d, w) && n(f, d, w); - return s(f, d), f; - }, i = commonjsGlobal && commonjsGlobal.__awaiter || function(d, f, w, m) { - function g(T) { - return T instanceof w ? T : new w(function(v) { - v(T); + } : function(p, l, g, m) { + m === void 0 && (m = g), p[m] = l[g]; + }), n = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(p, l) { + Object.defineProperty(p, "default", { enumerable: !0, value: l }); + } : function(p, l) { + p.default = l; + }), s = commonjsGlobal && commonjsGlobal.__importStar || function(p) { + if (p && p.__esModule) + return p; + var l = {}; + if (p != null) + for (var g in p) + g !== "default" && Object.hasOwnProperty.call(p, g) && r(l, p, g); + return n(l, p), l; + }, o = commonjsGlobal && commonjsGlobal.__awaiter || function(p, l, g, m) { + function d(b) { + return b instanceof g ? b : new g(function(y) { + y(b); }); } - return new (w || (w = Promise))(function(T, v) { - function O(k) { + return new (g || (g = Promise))(function(b, y) { + function v(G) { try { - A(m.next(k)); - } catch (D) { - v(D); + S(m.next(G)); + } catch ($) { + y($); } } - function $(k) { + function A(G) { try { - A(m.throw(k)); - } catch (D) { - v(D); + S(m.throw(G)); + } catch ($) { + y($); } } - function A(k) { - k.done ? T(k.value) : g(k.value).then(O, $); + function S(G) { + G.done ? b(G.value) : d(G.value).then(v, A); } - A((m = m.apply(d, f || [])).next()); + S((m = m.apply(p, l || [])).next()); }); }; Object.defineProperty(t, "__esModule", { value: !0 }), t.argStringToArray = t.ToolRunner = void 0; - const p = o(require$$0__default.default), a = o(events__default.default), u = o(require$$0__default$1.default), h = o(require$$1__default.default), b = o(io), y = o(ioUtil), _ = process.platform === "win32"; - class E extends a.EventEmitter { - constructor(f, w, m) { + const a = s(require$$0__default.default), i = s(events__default.default), u = s(require$$0__default$1.default), f = s(require$$1__default.default), w = s(io), h = s(ioUtil), T = process.platform === "win32"; + class _ extends i.EventEmitter { + constructor(l, g, m) { super(); - if (!f) + if (!l) throw new Error("Parameter 'toolPath' cannot be null or empty."); - this.toolPath = f, this.args = w || [], this.options = m || {}; + this.toolPath = l, this.args = g || [], this.options = m || {}; } - _debug(f) { - this.options.listeners && this.options.listeners.debug && this.options.listeners.debug(f); + _debug(l) { + this.options.listeners && this.options.listeners.debug && this.options.listeners.debug(l); } - _getCommandString(f, w) { - const m = this._getSpawnFileName(), g = this._getSpawnArgs(f); - let T = w ? "" : "[command]"; - if (_) + _getCommandString(l, g) { + const m = this._getSpawnFileName(), d = this._getSpawnArgs(l); + let b = g ? "" : "[command]"; + if (T) if (this._isCmdFile()) { - T += m; - for (const v of g) - T += ` ${v}`; - } else if (f.windowsVerbatimArguments) { - T += `"${m}"`; - for (const v of g) - T += ` ${v}`; + b += m; + for (const y of d) + b += ` ${y}`; + } else if (l.windowsVerbatimArguments) { + b += `"${m}"`; + for (const y of d) + b += ` ${y}`; } else { - T += this._windowsQuoteCmdArg(m); - for (const v of g) - T += ` ${this._windowsQuoteCmdArg(v)}`; + b += this._windowsQuoteCmdArg(m); + for (const y of d) + b += ` ${this._windowsQuoteCmdArg(y)}`; } else { - T += m; - for (const v of g) - T += ` ${v}`; + b += m; + for (const y of d) + b += ` ${y}`; } - return T; + return b; } - _processLineBuffer(f, w, m) { + _processLineBuffer(l, g, m) { try { - let g = w + f.toString(), T = g.indexOf(p.EOL); - for (; T > -1; ) { - const v = g.substring(0, T); - m(v), g = g.substring(T + p.EOL.length), T = g.indexOf(p.EOL); + let d = g + l.toString(), b = d.indexOf(a.EOL); + for (; b > -1; ) { + const y = d.substring(0, b); + m(y), d = d.substring(b + a.EOL.length), b = d.indexOf(a.EOL); } - return g; - } catch (g) { - return this._debug(`error processing line. Failed with error ${g}`), ""; + return d; + } catch (d) { + return this._debug(`error processing line. Failed with error ${d}`), ""; } } _getSpawnFileName() { - return _ && this._isCmdFile() ? process.env.COMSPEC || "cmd.exe" : this.toolPath; + return T && this._isCmdFile() ? process.env.COMSPEC || "cmd.exe" : this.toolPath; } - _getSpawnArgs(f) { - if (_ && this._isCmdFile()) { - let w = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; + _getSpawnArgs(l) { + if (T && this._isCmdFile()) { + let g = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; for (const m of this.args) - w += " ", w += f.windowsVerbatimArguments ? m : this._windowsQuoteCmdArg(m); - return w += '"', [w]; + g += " ", g += l.windowsVerbatimArguments ? m : this._windowsQuoteCmdArg(m); + return g += '"', [g]; } return this.args; } - _endsWith(f, w) { - return f.endsWith(w); + _endsWith(l, g) { + return l.endsWith(g); } _isCmdFile() { - const f = this.toolPath.toUpperCase(); - return this._endsWith(f, ".CMD") || this._endsWith(f, ".BAT"); + const l = this.toolPath.toUpperCase(); + return this._endsWith(l, ".CMD") || this._endsWith(l, ".BAT"); } - _windowsQuoteCmdArg(f) { + _windowsQuoteCmdArg(l) { if (!this._isCmdFile()) - return this._uvQuoteCmdArg(f); - if (!f) + return this._uvQuoteCmdArg(l); + if (!l) return '""'; - const w = [ + const g = [ " ", " ", "&", @@ -5131,387 +5116,390 @@ var ioUtil = createCommonjsModule(function(e, t) { '"' ]; let m = !1; - for (const v of f) - if (w.some((O) => O === v)) { + for (const y of l) + if (g.some((v) => v === y)) { m = !0; break; } if (!m) - return f; - let g = '"', T = !0; - for (let v = f.length; v > 0; v--) - g += f[v - 1], T && f[v - 1] === "\\" ? g += "\\" : f[v - 1] === '"' ? (T = !0, g += '"') : T = !1; - return g += '"', g.split("").reverse().join(""); + return l; + let d = '"', b = !0; + for (let y = l.length; y > 0; y--) + d += l[y - 1], b && l[y - 1] === "\\" ? d += "\\" : l[y - 1] === '"' ? (b = !0, d += '"') : b = !1; + return d += '"', d.split("").reverse().join(""); } - _uvQuoteCmdArg(f) { - if (!f) + _uvQuoteCmdArg(l) { + if (!l) return '""'; - if (!f.includes(" ") && !f.includes(" ") && !f.includes('"')) - return f; - if (!f.includes('"') && !f.includes("\\")) - return `"${f}"`; - let w = '"', m = !0; - for (let g = f.length; g > 0; g--) - w += f[g - 1], m && f[g - 1] === "\\" ? w += "\\" : f[g - 1] === '"' ? (m = !0, w += "\\") : m = !1; - return w += '"', w.split("").reverse().join(""); + if (!l.includes(" ") && !l.includes(" ") && !l.includes('"')) + return l; + if (!l.includes('"') && !l.includes("\\")) + return `"${l}"`; + let g = '"', m = !0; + for (let d = l.length; d > 0; d--) + g += l[d - 1], m && l[d - 1] === "\\" ? g += "\\" : l[d - 1] === '"' ? (m = !0, g += "\\") : m = !1; + return g += '"', g.split("").reverse().join(""); } - _cloneExecOptions(f) { - f = f || {}; - const w = { - cwd: f.cwd || process.cwd(), - env: f.env || process.env, - silent: f.silent || !1, - windowsVerbatimArguments: f.windowsVerbatimArguments || !1, - failOnStdErr: f.failOnStdErr || !1, - ignoreReturnCode: f.ignoreReturnCode || !1, - delay: f.delay || 1e4 + _cloneExecOptions(l) { + l = l || {}; + const g = { + cwd: l.cwd || process.cwd(), + env: l.env || process.env, + silent: l.silent || !1, + windowsVerbatimArguments: l.windowsVerbatimArguments || !1, + failOnStdErr: l.failOnStdErr || !1, + ignoreReturnCode: l.ignoreReturnCode || !1, + delay: l.delay || 1e4 }; - return w.outStream = f.outStream || process.stdout, w.errStream = f.errStream || process.stderr, w; + return g.outStream = l.outStream || process.stdout, g.errStream = l.errStream || process.stderr, g; } - _getSpawnOptions(f, w) { - f = f || {}; + _getSpawnOptions(l, g) { + l = l || {}; const m = {}; - return m.cwd = f.cwd, m.env = f.env, m.windowsVerbatimArguments = f.windowsVerbatimArguments || this._isCmdFile(), f.windowsVerbatimArguments && (m.argv0 = `"${w}"`), m; + return m.cwd = l.cwd, m.env = l.env, m.windowsVerbatimArguments = l.windowsVerbatimArguments || this._isCmdFile(), l.windowsVerbatimArguments && (m.argv0 = `"${g}"`), m; } exec() { - return i(this, void 0, void 0, function* () { - return !y.isRooted(this.toolPath) && (this.toolPath.includes("/") || _ && this.toolPath.includes("\\")) && (this.toolPath = h.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath)), this.toolPath = yield b.which(this.toolPath, !0), new Promise((f, w) => i(this, void 0, void 0, function* () { + return o(this, void 0, void 0, function* () { + return !h.isRooted(this.toolPath) && (this.toolPath.includes("/") || T && this.toolPath.includes("\\")) && (this.toolPath = f.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath)), this.toolPath = yield w.which(this.toolPath, !0), new Promise((l, g) => o(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`), this._debug("arguments:"); - for (const A of this.args) - this._debug(` ${A}`); + for (const S of this.args) + this._debug(` ${S}`); const m = this._cloneExecOptions(this.options); - !m.silent && m.outStream && m.outStream.write(this._getCommandString(m) + p.EOL); - const g = new G(m, this.toolPath); - if (g.on("debug", (A) => { - this._debug(A); - }), this.options.cwd && !(yield y.exists(this.options.cwd))) - return w(new Error(`The cwd: ${this.options.cwd} does not exist!`)); - const T = this._getSpawnFileName(), v = u.spawn(T, this._getSpawnArgs(m), this._getSpawnOptions(this.options, T)); - let O = ""; - v.stdout && v.stdout.on("data", (A) => { - this.options.listeners && this.options.listeners.stdout && this.options.listeners.stdout(A), !m.silent && m.outStream && m.outStream.write(A), O = this._processLineBuffer(A, O, (k) => { - this.options.listeners && this.options.listeners.stdline && this.options.listeners.stdline(k); + !m.silent && m.outStream && m.outStream.write(this._getCommandString(m) + a.EOL); + const d = new P(m, this.toolPath); + if (d.on("debug", (S) => { + this._debug(S); + }), this.options.cwd && !(yield h.exists(this.options.cwd))) + return g(new Error(`The cwd: ${this.options.cwd} does not exist!`)); + const b = this._getSpawnFileName(), y = u.spawn(b, this._getSpawnArgs(m), this._getSpawnOptions(this.options, b)); + let v = ""; + y.stdout && y.stdout.on("data", (S) => { + this.options.listeners && this.options.listeners.stdout && this.options.listeners.stdout(S), !m.silent && m.outStream && m.outStream.write(S), v = this._processLineBuffer(S, v, (G) => { + this.options.listeners && this.options.listeners.stdline && this.options.listeners.stdline(G); }); }); - let $ = ""; - if (v.stderr && v.stderr.on("data", (A) => { - g.processStderr = !0, this.options.listeners && this.options.listeners.stderr && this.options.listeners.stderr(A), !m.silent && m.errStream && m.outStream && (m.failOnStdErr ? m.errStream : m.outStream).write(A), $ = this._processLineBuffer(A, $, (k) => { - this.options.listeners && this.options.listeners.errline && this.options.listeners.errline(k); + let A = ""; + if (y.stderr && y.stderr.on("data", (S) => { + d.processStderr = !0, this.options.listeners && this.options.listeners.stderr && this.options.listeners.stderr(S), !m.silent && m.errStream && m.outStream && (m.failOnStdErr ? m.errStream : m.outStream).write(S), A = this._processLineBuffer(S, A, (G) => { + this.options.listeners && this.options.listeners.errline && this.options.listeners.errline(G); }); - }), v.on("error", (A) => { - g.processError = A.message, g.processExited = !0, g.processClosed = !0, g.CheckComplete(); - }), v.on("exit", (A) => { - g.processExitCode = A, g.processExited = !0, this._debug(`Exit code ${A} received from tool '${this.toolPath}'`), g.CheckComplete(); - }), v.on("close", (A) => { - g.processExitCode = A, g.processExited = !0, g.processClosed = !0, this._debug(`STDIO streams have closed for tool '${this.toolPath}'`), g.CheckComplete(); - }), g.on("done", (A, k) => { - O.length > 0 && this.emit("stdline", O), $.length > 0 && this.emit("errline", $), v.removeAllListeners(), A ? w(A) : f(k); + }), y.on("error", (S) => { + d.processError = S.message, d.processExited = !0, d.processClosed = !0, d.CheckComplete(); + }), y.on("exit", (S) => { + d.processExitCode = S, d.processExited = !0, this._debug(`Exit code ${S} received from tool '${this.toolPath}'`), d.CheckComplete(); + }), y.on("close", (S) => { + d.processExitCode = S, d.processExited = !0, d.processClosed = !0, this._debug(`STDIO streams have closed for tool '${this.toolPath}'`), d.CheckComplete(); + }), d.on("done", (S, G) => { + v.length > 0 && this.emit("stdline", v), A.length > 0 && this.emit("errline", A), y.removeAllListeners(), S ? g(S) : l(G); }), this.options.input) { - if (!v.stdin) + if (!y.stdin) throw new Error("child process missing stdin"); - v.stdin.end(this.options.input); + y.stdin.end(this.options.input); } })); }); } } - t.ToolRunner = E; - function P(d) { - const f = []; - let w = !1, m = !1, g = ""; - function T(v) { - m && v !== '"' && (g += "\\"), g += v, m = !1; + t.ToolRunner = _; + function E(p) { + const l = []; + let g = !1, m = !1, d = ""; + function b(y) { + m && y !== '"' && (d += "\\"), d += y, m = !1; } - for (let v = 0; v < d.length; v++) { - const O = d.charAt(v); - if (O === '"') { - m ? T(O) : w = !w; + for (let y = 0; y < p.length; y++) { + const v = p.charAt(y); + if (v === '"') { + m ? b(v) : g = !g; continue; } - if (O === "\\" && m) { - T(O); + if (v === "\\" && m) { + b(v); continue; } - if (O === "\\" && w) { + if (v === "\\" && g) { m = !0; continue; } - if (O === " " && !w) { - g.length > 0 && (f.push(g), g = ""); + if (v === " " && !g) { + d.length > 0 && (l.push(d), d = ""); continue; } - T(O); + b(v); } - return g.length > 0 && f.push(g.trim()), f; + return d.length > 0 && l.push(d.trim()), l; } - t.argStringToArray = P; - class G extends a.EventEmitter { - constructor(f, w) { + t.argStringToArray = E; + class P extends i.EventEmitter { + constructor(l, g) { super(); - if (this.processClosed = !1, this.processError = "", this.processExitCode = 0, this.processExited = !1, this.processStderr = !1, this.delay = 1e4, this.done = !1, this.timeout = null, !w) + if (this.processClosed = !1, this.processError = "", this.processExitCode = 0, this.processExited = !1, this.processStderr = !1, this.delay = 1e4, this.done = !1, this.timeout = null, !g) throw new Error("toolPath must not be empty"); - this.options = f, this.toolPath = w, f.delay && (this.delay = f.delay); + this.options = l, this.toolPath = g, l.delay && (this.delay = l.delay); } CheckComplete() { - this.done || (this.processClosed ? this._setResult() : this.processExited && (this.timeout = timers_1__default.default.setTimeout(G.HandleTimeout, this.delay, this))); + this.done || (this.processClosed ? this._setResult() : this.processExited && (this.timeout = timers_1__default.default.setTimeout(P.HandleTimeout, this.delay, this))); } - _debug(f) { - this.emit("debug", f); + _debug(l) { + this.emit("debug", l); } _setResult() { - let f; - this.processExited && (this.processError ? f = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`) : this.processExitCode !== 0 && !this.options.ignoreReturnCode ? f = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`) : this.processStderr && this.options.failOnStdErr && (f = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`))), this.timeout && (clearTimeout(this.timeout), this.timeout = null), this.done = !0, this.emit("done", f, this.processExitCode); + let l; + this.processExited && (this.processError ? l = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`) : this.processExitCode !== 0 && !this.options.ignoreReturnCode ? l = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`) : this.processStderr && this.options.failOnStdErr && (l = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`))), this.timeout && (clearTimeout(this.timeout), this.timeout = null), this.done = !0, this.emit("done", l, this.processExitCode); } - static HandleTimeout(f) { - if (!f.done) { - if (!f.processClosed && f.processExited) { - const w = `The STDIO streams did not close within ${f.delay / 1e3} seconds of the exit event from process '${f.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; - f._debug(w); + static HandleTimeout(l) { + if (!l.done) { + if (!l.processClosed && l.processExited) { + const g = `The STDIO streams did not close within ${l.delay / 1e3} seconds of the exit event from process '${l.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; + l._debug(g); } - f._setResult(); + l._setResult(); } } } }), exec_1 = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(h, b, y, _) { - _ === void 0 && (_ = y), Object.defineProperty(h, _, { enumerable: !0, get: function() { - return b[y]; + var r = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(f, w, h, T) { + T === void 0 && (T = h), Object.defineProperty(f, T, { enumerable: !0, get: function() { + return w[h]; } }); - } : function(h, b, y, _) { - _ === void 0 && (_ = y), h[_] = b[y]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(h, b) { - Object.defineProperty(h, "default", { enumerable: !0, value: b }); - } : function(h, b) { - h.default = b; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(h) { - if (h && h.__esModule) - return h; - var b = {}; - if (h != null) - for (var y in h) - y !== "default" && Object.hasOwnProperty.call(h, y) && n(b, h, y); - return s(b, h), b; - }, i = commonjsGlobal && commonjsGlobal.__awaiter || function(h, b, y, _) { - function E(P) { - return P instanceof y ? P : new y(function(G) { - G(P); + } : function(f, w, h, T) { + T === void 0 && (T = h), f[T] = w[h]; + }), n = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(f, w) { + Object.defineProperty(f, "default", { enumerable: !0, value: w }); + } : function(f, w) { + f.default = w; + }), s = commonjsGlobal && commonjsGlobal.__importStar || function(f) { + if (f && f.__esModule) + return f; + var w = {}; + if (f != null) + for (var h in f) + h !== "default" && Object.hasOwnProperty.call(f, h) && r(w, f, h); + return n(w, f), w; + }, o = commonjsGlobal && commonjsGlobal.__awaiter || function(f, w, h, T) { + function _(E) { + return E instanceof h ? E : new h(function(P) { + P(E); }); } - return new (y || (y = Promise))(function(P, G) { - function d(m) { + return new (h || (h = Promise))(function(E, P) { + function p(m) { try { - w(_.next(m)); - } catch (g) { - G(g); + g(T.next(m)); + } catch (d) { + P(d); } } - function f(m) { + function l(m) { try { - w(_.throw(m)); - } catch (g) { - G(g); + g(T.throw(m)); + } catch (d) { + P(d); } } - function w(m) { - m.done ? P(m.value) : E(m.value).then(d, f); + function g(m) { + m.done ? E(m.value) : _(m.value).then(p, l); } - w((_ = _.apply(h, b || [])).next()); + g((T = T.apply(f, w || [])).next()); }); }; Object.defineProperty(t, "__esModule", { value: !0 }), t.getExecOutput = t.exec = void 0; - const p = o(toolrunner); - function a(h, b, y) { - return i(this, void 0, void 0, function* () { - const _ = p.argStringToArray(h); - if (_.length === 0) + const a = s(toolrunner); + function i(f, w, h) { + return o(this, void 0, void 0, function* () { + const T = a.argStringToArray(f); + if (T.length === 0) throw new Error("Parameter 'commandLine' cannot be null or empty."); - const E = _[0]; - return b = _.slice(1).concat(b || []), new p.ToolRunner(E, b, y).exec(); + const _ = T[0]; + return w = T.slice(1).concat(w || []), new a.ToolRunner(_, w, h).exec(); }); } - t.exec = a; - function u(h, b, y) { - var _, E; - return i(this, void 0, void 0, function* () { - let P = "", G = ""; - const d = new string_decoder_1__default.default.StringDecoder("utf8"), f = new string_decoder_1__default.default.StringDecoder("utf8"), w = (_ = y == null ? void 0 : y.listeners) === null || _ === void 0 ? void 0 : _.stdout, m = (E = y == null ? void 0 : y.listeners) === null || E === void 0 ? void 0 : E.stderr, g = ($) => { - G += f.write($), m && m($); - }, T = ($) => { - P += d.write($), w && w($); - }, v = Object.assign(Object.assign({}, y == null ? void 0 : y.listeners), { stdout: T, stderr: g }), O = yield a(h, b, Object.assign(Object.assign({}, y), { listeners: v })); - return P += d.end(), G += f.end(), { - exitCode: O, - stdout: P, - stderr: G + t.exec = i; + function u(f, w, h) { + var T, _; + return o(this, void 0, void 0, function* () { + let E = "", P = ""; + const p = new string_decoder_1__default.default.StringDecoder("utf8"), l = new string_decoder_1__default.default.StringDecoder("utf8"), g = (T = h == null ? void 0 : h.listeners) === null || T === void 0 ? void 0 : T.stdout, m = (_ = h == null ? void 0 : h.listeners) === null || _ === void 0 ? void 0 : _.stderr, d = (A) => { + P += l.write(A), m && m(A); + }, b = (A) => { + E += p.write(A), g && g(A); + }, y = Object.assign(Object.assign({}, h == null ? void 0 : h.listeners), { stdout: b, stderr: d }), v = yield i(f, w, Object.assign(Object.assign({}, h), { listeners: y })); + return E += p.end(), P += l.end(), { + exitCode: v, + stdout: E, + stderr: P }; }); } t.getExecOutput = u; -}), __defProp$2 = Object.defineProperty, __defProps$2 = Object.defineProperties, __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors, __getOwnPropSymbols$2 = Object.getOwnPropertySymbols, __hasOwnProp$2 = Object.prototype.hasOwnProperty, __propIsEnum$2 = Object.prototype.propertyIsEnumerable, __defNormalProp$2 = (e, t, n) => t in e ? __defProp$2(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, __spreadValues$2 = (e, t) => { - for (var n in t || (t = {})) - __hasOwnProp$2.call(t, n) && __defNormalProp$2(e, n, t[n]); +}), __defProp$2 = Object.defineProperty, __defProps$2 = Object.defineProperties, __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors, __getOwnPropSymbols$2 = Object.getOwnPropertySymbols, __hasOwnProp$2 = Object.prototype.hasOwnProperty, __propIsEnum$2 = Object.prototype.propertyIsEnumerable, __defNormalProp$2 = (e, t, r) => t in e ? __defProp$2(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, __spreadValues$2 = (e, t) => { + for (var r in t || (t = {})) + __hasOwnProp$2.call(t, r) && __defNormalProp$2(e, r, t[r]); if (__getOwnPropSymbols$2) - for (var n of __getOwnPropSymbols$2(t)) - __propIsEnum$2.call(t, n) && __defNormalProp$2(e, n, t[n]); + for (var r of __getOwnPropSymbols$2(t)) + __propIsEnum$2.call(t, r) && __defNormalProp$2(e, r, t[r]); return e; }, __spreadProps$2 = (e, t) => __defProps$2(e, __getOwnPropDescs$2(t)); async function exec(e, t) { - let n = "", s = ""; - const o = Date.now(), i = await exec_1.exec(e, null, __spreadProps$2(__spreadValues$2({}, t), { + let r = "", n = ""; + const s = Date.now(), o = await exec_1.exec(e, void 0, __spreadProps$2(__spreadValues$2({}, t), { silent: !0, listeners: { - stdout(a) { - n += a.toString(); + stdout(i) { + r += i.toString(); }, - stderr(a) { - s += a.toString(); + stderr(i) { + n += i.toString(); } } - })), p = Date.now() - o; + })), a = Date.now() - s; return { - exitCode: i, - duration: p, - stdout: n, - stderr: s + exitCode: o, + duration: a, + stdout: r, + stderr: n }; } async function isBaseDiffFromHead(e) { try { await exec(`git fetch origin ${e} --depth=1`); - } catch (n) { - throw new Error(`Failed to git fetch ${e} ${n.message}`); + } catch (r) { + throw new Error(`Failed to git fetch ${e} ${r.message}`); } const { exitCode: t } = await exec(`git diff --quiet origin/${e}`, { ignoreReturnCode: !0 }); return t !== 0; } -async function npmCi({ cwd: e } = {}) { +async function npmCi(e = process.cwd()) { fs__default.default.existsSync("node_modules") && (core.info("Cleaning node_modules"), await io.rmRF(require$$1__default.default.join(e, "node_modules"))); const t = { cwd: e, ignoreReturnCode: !0 }; - let n = ""; - fs__default.default.existsSync("package-lock.json") ? (core.info("Installing dependencies with npm"), n = "npm ci") : fs__default.default.existsSync("yarn.lock") ? (core.info("Installing dependencies with yarn"), n = "yarn install --frozen-lockfile") : fs__default.default.existsSync("pnpm-lock.yaml") ? (core.info("Installing dependencies with pnpm"), n = "npx pnpm i --frozen-lockfile") : (core.info("No lock file detected. Installing dependencies with npm"), n = "npm i"); - const { exitCode: s, stdout: o, stderr: i } = await exec(n, t); - if (s > 0) - throw new Error(`${i} -${o}`); + let r = ""; + fs__default.default.existsSync("package-lock.json") ? (core.info("Installing dependencies with npm"), r = "npm ci") : fs__default.default.existsSync("yarn.lock") ? (core.info("Installing dependencies with yarn"), r = "yarn install --frozen-lockfile") : fs__default.default.existsSync("pnpm-lock.yaml") ? (core.info("Installing dependencies with pnpm"), r = "npx pnpm i --frozen-lockfile") : (core.info("No lock file detected. Installing dependencies with npm"), r = "npm i"); + const { exitCode: n, stdout: s, stderr: o } = await exec(r, t); + if (n > 0) + throw new Error(`${o} +${s}`); } async function isFileTracked(e) { - const { exitCode: t } = await exec(`git ls-files --error-unmatch ${e}`, { ignoreReturnCode: !0 }); + const { exitCode: t } = await exec(`git ls-files --error-unmatch ${e}`, { + ignoreReturnCode: !0 + }); return t === 0; } -var __defProp$1 = Object.defineProperty, __defProps$1 = Object.defineProperties, __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors, __getOwnPropSymbols$1 = Object.getOwnPropertySymbols, __hasOwnProp$1 = Object.prototype.hasOwnProperty, __propIsEnum$1 = Object.prototype.propertyIsEnumerable, __defNormalProp$1 = (e, t, n) => t in e ? __defProp$1(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, __spreadValues$1 = (e, t) => { - for (var n in t || (t = {})) - __hasOwnProp$1.call(t, n) && __defNormalProp$1(e, n, t[n]); +var __defProp$1 = Object.defineProperty, __defProps$1 = Object.defineProperties, __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors, __getOwnPropSymbols$1 = Object.getOwnPropertySymbols, __hasOwnProp$1 = Object.prototype.hasOwnProperty, __propIsEnum$1 = Object.prototype.propertyIsEnumerable, __defNormalProp$1 = (e, t, r) => t in e ? __defProp$1(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, __spreadValues$1 = (e, t) => { + for (var r in t || (t = {})) + __hasOwnProp$1.call(t, r) && __defNormalProp$1(e, r, t[r]); if (__getOwnPropSymbols$1) - for (var n of __getOwnPropSymbols$1(t)) - __propIsEnum$1.call(t, n) && __defNormalProp$1(e, n, t[n]); + for (var r of __getOwnPropSymbols$1(t)) + __propIsEnum$1.call(t, r) && __defNormalProp$1(e, r, t[r]); return e; }, __spreadProps$1 = (e, t) => __defProps$1(e, __getOwnPropDescs$1(t)); let pkgSizeInstalled = !1; async function buildRef({ checkoutRef: e, refData: t, - buildCommand: n + buildCommand: r }) { - const s = process.cwd(); - if (core.info(`Current working directory: ${s}`), e && (core.info(`Checking out ref '${e}'`), await exec(`git checkout -f ${e}`)), n !== "false") { - if (!n) { - let a; + const n = process.cwd(); + if (core.info(`Current working directory: ${n}`), e && (core.info(`Checking out ref '${e}'`), await exec(`git checkout -f ${e}`)), r !== "false") { + if (!r) { + let i; try { - a = JSON.parse(fs__default.default.readFileSync("./package.json")); + i = JSON.parse(fs__default.default.readFileSync("./package.json").toString()); } catch (u) { core.warning("Error reading package.json", u); } - a && a.scripts && a.scripts.build && (core.info("Build script found in package.json"), n = "npm run build"); + i && i.scripts && i.scripts.build && (core.info("Build script found in package.json"), r = "npm run build"); } - if (n) { - await npmCi({ cwd: s }).catch((u) => { + if (r) { + await npmCi(n).catch((u) => { throw new Error(`Failed to install dependencies: ${u.message}`); - }), core.info(`Running build command: ${n}`); - const a = Date.now(); - await exec(n, { cwd: s }).catch((u) => { - throw new Error(`Failed to run build command: ${n} + }), core.info(`Running build command: ${r}`); + const i = Date.now(); + await exec(r, { cwd: n }).catch((u) => { + throw new Error(`Failed to run build command: ${r} ${u.message}`); - }), core.info(`Build completed in ${(Date.now() - a) / 1e3}s`); + }), core.info(`Build completed in ${(Date.now() - i) / 1e3}s`); } } pkgSizeInstalled || (core.info("Installing pkg-size globally"), await exec("npm i -g pkg-size"), pkgSizeInstalled = !0), core.info("Getting package size"); - const o = await exec("pkg-size --json", { cwd: s }).catch((a) => { - throw new Error(`Failed to determine package size: ${a.message}`); + const s = await exec("pkg-size --json", { cwd: n }).catch((i) => { + throw new Error(`Failed to determine package size: ${i.message}`); }); - core.debug(JSON.stringify(o, null, 4)); - const i = __spreadProps$1(__spreadValues$1({}, JSON.parse(o.stdout)), { + core.debug(JSON.stringify(s, null, 4)); + const o = __spreadProps$1(__spreadValues$1({}, JSON.parse(s.stdout)), { ref: t, size: 0, sizeGzip: 0, sizeBrotli: 0 }); - await Promise.all(i.files.map(async (a) => { - i.size += a.size, i.sizeGzip += a.sizeGzip, i.sizeBrotli += a.sizeBrotli; - const u = await isFileTracked(a.path); - a.isTracked = u, a.label = u ? link(c$1(a.path), `${t.repo.html_url}/blob/${t.ref}/${a.path}`) : c$1(a.path); + await Promise.all(o.files.map(async (i) => { + o.size += i.size, o.sizeGzip += i.sizeGzip, o.sizeBrotli += i.sizeBrotli; + const u = await isFileTracked(i.path); + i.isTracked = u, i.label = u ? link(c(i.path), `${t.repo.html_url}/blob/${t.ref}/${i.path}`) : c(i.path); })), core.info("Cleaning up"), await exec("git reset --hard"); - const { stdout: p } = await exec("git clean -dfx"); - return core.debug(p), i; + const { stdout: a } = await exec("git clean -dfx"); + return core.debug(a), o; } -var __defProp = Object.defineProperty, __defProps = Object.defineProperties, __getOwnPropDescs = Object.getOwnPropertyDescriptors, __getOwnPropSymbols = Object.getOwnPropertySymbols, __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable, __defNormalProp = (e, t, n) => t in e ? __defProp(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, __spreadValues = (e, t) => { - for (var n in t || (t = {})) - __hasOwnProp.call(t, n) && __defNormalProp(e, n, t[n]); +var __defProp = Object.defineProperty, __defProps = Object.defineProperties, __getOwnPropDescs = Object.getOwnPropertyDescriptors, __getOwnPropSymbols = Object.getOwnPropertySymbols, __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable, __defNormalProp = (e, t, r) => t in e ? __defProp(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, __spreadValues = (e, t) => { + for (var r in t || (t = {})) + __hasOwnProp.call(t, r) && __defNormalProp(e, r, t[r]); if (__getOwnPropSymbols) - for (var n of __getOwnPropSymbols(t)) - __propIsEnum.call(t, n) && __defNormalProp(e, n, t[n]); + for (var r of __getOwnPropSymbols(t)) + __propIsEnum.call(t, r) && __defNormalProp(e, r, t[r]); return e; }, __spreadProps = (e, t) => __defProps(e, __getOwnPropDescs(t)); async function generateSizeReport({ pr: e, buildCommand: t, - commentReport: n, - mode: s, - unchangedFiles: o, - hideFiles: i, - sortBy: p, - sortOrder: a, + commentReport: r, + mode: n, + unchangedFiles: s, + hideFiles: o, + sortBy: a, + sortOrder: i, displaySize: u }) { core.startGroup("Build HEAD"); - const h = await buildRef({ + const f = await buildRef({ refData: e.head, buildCommand: t }); - if (core.setOutput("headPkgData", h), core.endGroup(), s === "head-only") - return n !== "false" ? headOnly({ - headPkgData: h, + if (core.setOutput("headPkgData", f), core.endGroup(), n === "head-only") + return r !== "false" ? headOnly({ + headPkgData: f, displaySize: u, - sortBy: p, - sortOrder: a, - hideFiles: i + sortBy: a, + sortOrder: i, + hideFiles: o }) : !1; - const { ref: b } = e.base; - let y; - return await isBaseDiffFromHead(b) ? (core.info("HEAD is different from BASE. Triggering build."), core.startGroup("Build BASE"), y = await buildRef({ - checkoutRef: b, + const { ref: w } = e.base; + let h; + return await isBaseDiffFromHead(w) ? (core.info("HEAD is different from BASE. Triggering build."), core.startGroup("Build BASE"), h = await buildRef({ + checkoutRef: w, refData: e.base, buildCommand: t - }), core.endGroup()) : (core.info("HEAD is identical to BASE. Skipping base build."), y = __spreadProps(__spreadValues({}, h), { + }), core.endGroup()) : (core.info("HEAD is identical to BASE. Skipping base build."), h = __spreadProps(__spreadValues({}, f), { ref: e.base - })), core.setOutput("basePkgData", y), n !== "false" ? generateComment({ - headPkgData: h, - basePkgData: y, + })), core.setOutput("basePkgData", h), r !== "false" ? generateComment({ + headPkgData: f, + basePkgData: h, displaySize: u, - sortBy: p, - sortOrder: a, - hideFiles: i, - unchangedFiles: o + sortBy: a, + sortOrder: i, + hideFiles: o, + unchangedFiles: s }) : !1; } const COMMENT_SIGNATURE = sub("\u{1F916} This report was automatically generated by [pkg-size-action](https://github.com/pkg-size/action/)"); (async () => { + assert__default.default(github.context.eventName === "pull_request", "Current only pull requests are supported"); const { GITHUB_TOKEN: e } = process.env; - assert_1__default.default(e, 'Environment variable "GITHUB_TOKEN" not set. Required for accessing and reporting on the PR.'); - const { pull_request: t } = github.context.payload, n = await generateSizeReport({ + assert__default.default(e, 'Environment variable "GITHUB_TOKEN" not set. Required for accessing and reporting on the PR.'); + const t = github.context.payload.pull_request, r = await generateSizeReport({ pr: t, buildCommand: core.getInput("build-command"), commentReport: core.getInput("comment-report"), @@ -5522,12 +5510,12 @@ const COMMENT_SIGNATURE = sub("\u{1F916} This report was automatically generated sortOrder: core.getInput("sort-order") || "desc", displaySize: core.getInput("display-size") || "uncompressed" }); - await exec(`git checkout -f ${github.context.sha}`), n && await upsertComment({ + await exec(`git checkout -f ${github.context.sha}`), r && await upsertComment({ token: e, commentSignature: COMMENT_SIGNATURE, repo: github.context.repo, prNumber: t.number, - body: n + body: r }); })().catch((e) => { core.setFailed(e.message), core.warning(e.stack); diff --git a/package.json b/package.json index c660b08..bcbbc31 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ } }, "lint-staged": { - "src/**/*.js": [ + "src/**/*.{ts,js}": [ "eslint", "npm run build", "git add dist" @@ -43,9 +43,13 @@ "@actions/exec": "^1.1.0", "@actions/github": "^4.0.0", "@actions/io": "^1.1.1", - "@pvtnbr/eslint-config-base": "^0.1.19", + "@octokit/webhooks-types": "^4.3.0", + "@pvtnbr/eslint-config-typescript": "^0.1.22", "@rollup/plugin-commonjs": "^17.1.0", "@rollup/plugin-node-resolve": "^11.2.1", + "@types/glob-to-regexp": "^0.4.1", + "@types/lodash-es": "^4.17.4", + "@types/node": "^16.6.1", "builtin-modules": "^3.1.0", "byte-size": "^7.0.1", "conventional-changelog-conventionalcommits": "^4.6.0", @@ -55,14 +59,15 @@ "husky": "^4.3.8", "lint-staged": "^10.5.4", "lodash-es": "^4.17.21", - "markdown-table": "^2.0.0", + "markdown-table": "^3.0.1", "outdent": "^0.7.1", "rollup": "^2.55.1", "rollup-plugin-esbuild": "^4.5.0", - "rollup-plugin-terser": "^7.0.2" + "rollup-plugin-terser": "^7.0.2", + "typescript": "^4.3.5" }, "eslintConfig": { - "extends": "@pvtnbr/eslint-config-base", + "extends": "@pvtnbr/eslint-config-typescript", "rules": { "unicorn/prevent-abbreviations": [ "error", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b6fe08c..cfb3f52 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,9 +6,13 @@ specifiers: '@actions/exec': ^1.1.0 '@actions/github': ^4.0.0 '@actions/io': ^1.1.1 - '@pvtnbr/eslint-config-base': ^0.1.19 + '@octokit/webhooks-types': ^4.3.0 + '@pvtnbr/eslint-config-typescript': ^0.1.22 '@rollup/plugin-commonjs': ^17.1.0 '@rollup/plugin-node-resolve': ^11.2.1 + '@types/glob-to-regexp': ^0.4.1 + '@types/lodash-es': ^4.17.4 + '@types/node': ^16.6.1 builtin-modules: ^3.1.0 byte-size: ^7.0.1 conventional-changelog-conventionalcommits: ^4.6.0 @@ -18,11 +22,12 @@ specifiers: husky: ^4.3.8 lint-staged: ^10.5.4 lodash-es: ^4.17.21 - markdown-table: ^2.0.0 + markdown-table: ^3.0.1 outdent: ^0.7.1 rollup: ^2.55.1 rollup-plugin-esbuild: ^4.5.0 rollup-plugin-terser: ^7.0.2 + typescript: ^4.3.5 devDependencies: '@actions/cache': 1.0.7 @@ -30,9 +35,13 @@ devDependencies: '@actions/exec': 1.1.0 '@actions/github': 4.0.0 '@actions/io': 1.1.1 - '@pvtnbr/eslint-config-base': 0.1.19_eslint@7.32.0 + '@octokit/webhooks-types': 4.3.0 + '@pvtnbr/eslint-config-typescript': 0.1.22_eslint@7.32.0+typescript@4.3.5 '@rollup/plugin-commonjs': 17.1.0_rollup@2.55.1 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.55.1 + '@types/glob-to-regexp': 0.4.1 + '@types/lodash-es': 4.17.4 + '@types/node': 16.6.1 builtin-modules: 3.2.0 byte-size: 7.0.1 conventional-changelog-conventionalcommits: 4.6.0 @@ -42,11 +51,12 @@ devDependencies: husky: 4.3.8 lint-staged: 10.5.4 lodash-es: 4.17.21 - markdown-table: 2.0.0 + markdown-table: 3.0.1 outdent: 0.7.1 rollup: 2.55.1 rollup-plugin-esbuild: 4.5.0_esbuild@0.12.20+rollup@2.55.1 rollup-plugin-terser: 7.0.2_rollup@2.55.1 + typescript: 4.3.5 packages: @@ -222,24 +232,24 @@ packages: '@babel/highlight': 7.14.5 dev: true - /@babel/compat-data/7.14.9: - resolution: {integrity: sha512-p3QjZmMGHDGdpcwEYYWu7i7oJShJvtgMjJeb0W95PPhSm++3lm8YXYOh45Y6iCN9PkZLTZ7CIX5nFrp7pw7TXw==} + /@babel/compat-data/7.15.0: + resolution: {integrity: sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA==} engines: {node: '>=6.9.0'} dev: true - /@babel/core/7.14.8: - resolution: {integrity: sha512-/AtaeEhT6ErpDhInbXmjHcUQXH0L0TEgscfcxk1qbOvLuKCa5aZT0SOOtDKFY96/CLROwbLSKyFor6idgNaU4Q==} + /@babel/core/7.15.0: + resolution: {integrity: sha512-tXtmTminrze5HEUPn/a0JtOzzfp0nk+UEXQ/tqIJo3WDGypl/2OFQEMll/zSFU8f/lfmfLXvTaORHF3cfXIQMw==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.14.5 - '@babel/generator': 7.14.9 - '@babel/helper-compilation-targets': 7.14.5_@babel+core@7.14.8 - '@babel/helper-module-transforms': 7.14.8 - '@babel/helpers': 7.14.8 - '@babel/parser': 7.14.9 + '@babel/generator': 7.15.0 + '@babel/helper-compilation-targets': 7.15.0_@babel+core@7.15.0 + '@babel/helper-module-transforms': 7.15.0 + '@babel/helpers': 7.15.3 + '@babel/parser': 7.15.3 '@babel/template': 7.14.5 - '@babel/traverse': 7.14.9 - '@babel/types': 7.14.9 + '@babel/traverse': 7.15.0 + '@babel/types': 7.15.0 convert-source-map: 1.8.0 debug: 4.3.2 gensync: 1.0.0-beta.2 @@ -250,39 +260,39 @@ packages: - supports-color dev: true - /@babel/eslint-parser/7.14.9_@babel+core@7.14.8+eslint@7.32.0: - resolution: {integrity: sha512-W3En2CT6iOZJ+jEujLlwL2h/Jraj6S/IHrh63nV+TfX83DYe9pI4pcu0Luj6/hJ2kIr/3hOttxzaEsSQnUKx+w==} + /@babel/eslint-parser/7.15.0_@babel+core@7.15.0+eslint@7.32.0: + resolution: {integrity: sha512-+gSPtjSBxOZz4Uh8Ggqu7HbfpB8cT1LwW0DnVVLZEJvzXauiD0Di3zszcBkRmfGGrLdYeHUwcflG7i3tr9kQlw==} engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0} peerDependencies: '@babel/core': '>=7.11.0' eslint: '>=7.5.0' dependencies: - '@babel/core': 7.14.8 + '@babel/core': 7.15.0 eslint: 7.32.0 eslint-scope: 5.1.1 eslint-visitor-keys: 2.1.0 semver: 6.3.0 dev: true - /@babel/generator/7.14.9: - resolution: {integrity: sha512-4yoHbhDYzFa0GLfCzLp5GxH7vPPMAHdZjyE7M/OajM9037zhx0rf+iNsJwp4PT0MSFpwjG7BsHEbPkBQpZ6cYA==} + /@babel/generator/7.15.0: + resolution: {integrity: sha512-eKl4XdMrbpYvuB505KTta4AV9g+wWzmVBW69tX0H2NwKVKd2YJbKgyK6M8j/rgLbmHOYJn6rUklV677nOyJrEQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.14.9 + '@babel/types': 7.15.0 jsesc: 2.5.2 source-map: 0.5.7 dev: true - /@babel/helper-compilation-targets/7.14.5_@babel+core@7.14.8: - resolution: {integrity: sha512-v+QtZqXEiOnpO6EYvlImB6zCD2Lel06RzOPzmkz/D/XgQiUu3C/Jb1LOqSt/AIA34TYi/Q+KlT8vTQrgdxkbLw==} + /@babel/helper-compilation-targets/7.15.0_@babel+core@7.15.0: + resolution: {integrity: sha512-h+/9t0ncd4jfZ8wsdAsoIxSa61qhBYlycXiHWqJaQBCXAhDCMbPRSMTGnZIkkmt1u4ag+UQmuqcILwqKzZ4N2A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/compat-data': 7.14.9 - '@babel/core': 7.14.8 + '@babel/compat-data': 7.15.0 + '@babel/core': 7.15.0 '@babel/helper-validator-option': 7.14.5 - browserslist: 4.16.6 + browserslist: 4.16.7 semver: 6.3.0 dev: true @@ -292,49 +302,49 @@ packages: dependencies: '@babel/helper-get-function-arity': 7.14.5 '@babel/template': 7.14.5 - '@babel/types': 7.14.9 + '@babel/types': 7.15.0 dev: true /@babel/helper-get-function-arity/7.14.5: resolution: {integrity: sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.14.9 + '@babel/types': 7.15.0 dev: true /@babel/helper-hoist-variables/7.14.5: resolution: {integrity: sha512-R1PXiz31Uc0Vxy4OEOm07x0oSjKAdPPCh3tPivn/Eo8cvz6gveAeuyUUPB21Hoiif0uoPQSSdhIPS3352nvdyQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.14.9 + '@babel/types': 7.15.0 dev: true - /@babel/helper-member-expression-to-functions/7.14.7: - resolution: {integrity: sha512-TMUt4xKxJn6ccjcOW7c4hlwyJArizskAhoSTOCkA0uZ+KghIaci0Qg9R043kUMWI9mtQfgny+NQ5QATnZ+paaA==} + /@babel/helper-member-expression-to-functions/7.15.0: + resolution: {integrity: sha512-Jq8H8U2kYiafuj2xMTPQwkTBnEEdGKpT35lJEQsRRjnG0LW3neucsaMWLgKcwu3OHKNeYugfw+Z20BXBSEs2Lg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.14.9 + '@babel/types': 7.15.0 dev: true /@babel/helper-module-imports/7.14.5: resolution: {integrity: sha512-SwrNHu5QWS84XlHwGYPDtCxcA0hrSlL2yhWYLgeOc0w7ccOl2qv4s/nARI0aYZW+bSwAL5CukeXA47B/1NKcnQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.14.9 + '@babel/types': 7.15.0 dev: true - /@babel/helper-module-transforms/7.14.8: - resolution: {integrity: sha512-RyE+NFOjXn5A9YU1dkpeBaduagTlZ0+fccnIcAGbv1KGUlReBj7utF7oEth8IdIBQPcux0DDgW5MFBH2xu9KcA==} + /@babel/helper-module-transforms/7.15.0: + resolution: {integrity: sha512-RkGiW5Rer7fpXv9m1B3iHIFDZdItnO2/BLfWVW/9q7+KqQSDY5kUfQEbzdXM1MVhJGcugKV7kRrNVzNxmk7NBg==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-module-imports': 7.14.5 - '@babel/helper-replace-supers': 7.14.5 + '@babel/helper-replace-supers': 7.15.0 '@babel/helper-simple-access': 7.14.8 '@babel/helper-split-export-declaration': 7.14.5 '@babel/helper-validator-identifier': 7.14.9 '@babel/template': 7.14.5 - '@babel/traverse': 7.14.9 - '@babel/types': 7.14.9 + '@babel/traverse': 7.15.0 + '@babel/types': 7.15.0 transitivePeerDependencies: - supports-color dev: true @@ -343,17 +353,17 @@ packages: resolution: {integrity: sha512-IqiLIrODUOdnPU9/F8ib1Fx2ohlgDhxnIDU7OEVi+kAbEZcyiF7BLU8W6PfvPi9LzztjS7kcbzbmL7oG8kD6VA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.14.9 + '@babel/types': 7.15.0 dev: true - /@babel/helper-replace-supers/7.14.5: - resolution: {integrity: sha512-3i1Qe9/8x/hCHINujn+iuHy+mMRLoc77b2nI9TB0zjH1hvn9qGlXjWlggdwUcju36PkPCy/lpM7LLUdcTyH4Ow==} + /@babel/helper-replace-supers/7.15.0: + resolution: {integrity: sha512-6O+eWrhx+HEra/uJnifCwhwMd6Bp5+ZfZeJwbqUTuqkhIT6YcRhiZCOOFChRypOIe0cV46kFrRBlm+t5vHCEaA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-member-expression-to-functions': 7.14.7 + '@babel/helper-member-expression-to-functions': 7.15.0 '@babel/helper-optimise-call-expression': 7.14.5 - '@babel/traverse': 7.14.9 - '@babel/types': 7.14.9 + '@babel/traverse': 7.15.0 + '@babel/types': 7.15.0 transitivePeerDependencies: - supports-color dev: true @@ -362,14 +372,14 @@ packages: resolution: {integrity: sha512-TrFN4RHh9gnWEU+s7JloIho2T76GPwRHhdzOWLqTrMnlas8T9O7ec+oEDNsRXndOmru9ymH9DFrEOxpzPoSbdg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.14.9 + '@babel/types': 7.15.0 dev: true /@babel/helper-split-export-declaration/7.14.5: resolution: {integrity: sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.14.9 + '@babel/types': 7.15.0 dev: true /@babel/helper-validator-identifier/7.12.11: @@ -386,13 +396,13 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helpers/7.14.8: - resolution: {integrity: sha512-ZRDmI56pnV+p1dH6d+UN6GINGz7Krps3+270qqI9UJ4wxYThfAIcI5i7j5vXC4FJ3Wap+S9qcebxeYiqn87DZw==} + /@babel/helpers/7.15.3: + resolution: {integrity: sha512-HwJiz52XaS96lX+28Tnbu31VeFSQJGOeKHJeaEPQlTl7PnlhFElWPj8tUXtqFIzeN86XxXoBr+WFAyK2PPVz6g==} engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.14.5 - '@babel/traverse': 7.14.9 - '@babel/types': 7.14.9 + '@babel/traverse': 7.15.0 + '@babel/types': 7.15.0 transitivePeerDependencies: - supports-color dev: true @@ -414,8 +424,8 @@ packages: js-tokens: 4.0.0 dev: true - /@babel/parser/7.14.9: - resolution: {integrity: sha512-RdUTOseXJ8POjjOeEBEvNMIZU/nm4yu2rufRkcibzkkg7DmQvXU8v3M4Xk9G7uuI86CDGkKcuDWgioqZm+mScQ==} + /@babel/parser/7.15.3: + resolution: {integrity: sha512-O0L6v/HvqbdJawj0iBEfVQMc3/6WP+AeOsovsIgBFyJaG+W2w7eqvZB7puddATmWuARlm1SX7DwxJ/JJUnDpEA==} engines: {node: '>=6.0.0'} hasBin: true dev: true @@ -425,29 +435,29 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.14.5 - '@babel/parser': 7.14.9 - '@babel/types': 7.14.9 + '@babel/parser': 7.15.3 + '@babel/types': 7.15.0 dev: true - /@babel/traverse/7.14.9: - resolution: {integrity: sha512-bldh6dtB49L8q9bUyB7bC20UKgU+EFDwKJylwl234Kv+ySZeMD31Xeht6URyueQ6LrRRpF2tmkfcZooZR9/e8g==} + /@babel/traverse/7.15.0: + resolution: {integrity: sha512-392d8BN0C9eVxVWd8H6x9WfipgVH5IaIoLp23334Sc1vbKKWINnvwRpb4us0xtPaCumlwbTtIYNA0Dv/32sVFw==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.14.5 - '@babel/generator': 7.14.9 + '@babel/generator': 7.15.0 '@babel/helper-function-name': 7.14.5 '@babel/helper-hoist-variables': 7.14.5 '@babel/helper-split-export-declaration': 7.14.5 - '@babel/parser': 7.14.9 - '@babel/types': 7.14.9 + '@babel/parser': 7.15.3 + '@babel/types': 7.15.0 debug: 4.3.2 globals: 11.12.0 transitivePeerDependencies: - supports-color dev: true - /@babel/types/7.14.9: - resolution: {integrity: sha512-u0bLTnv3DFHeaQLYzb7oRJ1JHr1sv/SYDM7JSqHFFLwXG1wTZRughxFI5NCP8qBEo1rVVsn7Yg2Lvw49nne/Ow==} + /@babel/types/7.15.0: + resolution: {integrity: sha512-OBvfqnllOIdX4ojTHpwZbpvz4j3EWyjkZEdmjH0/cgsd6QOdSgU8rLSk6ard/pcW7rlmjdVSX/AWOaORR1uNOQ==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-validator-identifier': 7.14.9 @@ -486,6 +496,27 @@ packages: resolution: {integrity: sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==} dev: true + /@nodelib/fs.scandir/2.1.5: + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + dev: true + + /@nodelib/fs.stat/2.0.5: + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + dev: true + + /@nodelib/fs.walk/1.2.8: + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.11.1 + dev: true + /@octokit/auth-token/2.4.4: resolution: {integrity: sha512-LNfGu3Ro9uFAYh10MUZVaT7X2CnNm2C8IDQmabx+3DygYIQjs9FwzFAHN/0t6mu5HEPhxcb1XOuxdpY82vCg2Q==} dependencies: @@ -570,6 +601,10 @@ packages: '@types/node': 14.14.20 dev: true + /@octokit/webhooks-types/4.3.0: + resolution: {integrity: sha512-Hp2o49WSiLHLwp8a9aQD9qK+uoa45Q/gnJG7a+EEZ4rLk5oDVCzlMbtsezxUPXG7/eLj05GciCzdzgJWANugEA==} + dev: true + /@opencensus/web-types/0.0.7: resolution: {integrity: sha512-xB+w7ZDAu3YBzqH44rCmG9/RlrOmFuDPt/bpf17eJr8eZSrLt7nc7LnWdxM9Mmoj/YKMHpxRg28txu3TcpiL+g==} engines: {node: '>=6.0'} @@ -599,15 +634,15 @@ packages: engines: {node: '>=8.0.0'} dev: true - /@pvtnbr/eslint-config-base/0.1.19_eslint@7.32.0: - resolution: {integrity: sha512-7f413IrQXTq8ieC7NfcI9R6tR90RthbNu5dHl4u2yAz2MEAouHGs0/kPduOSBoMfttUYGJvkM6zjA89KHBW6ww==} + /@pvtnbr/eslint-config-base/0.1.22_eslint@7.32.0: + resolution: {integrity: sha512-PffUu+wfsVdP1xU0C/ahFdtU4xpTF8qYCR7tKkd8qbEYDjq2XAHBwquSVeS9FQjutGGYZeg7Vfq3xK5jw43EeA==} peerDependencies: eslint: ^7.15.0 dependencies: confusing-browser-globals: 1.0.10 eslint: 7.32.0 eslint-plugin-eslint-comments: 3.2.0_eslint@7.32.0 - eslint-plugin-import: 2.22.1_eslint@7.32.0 + eslint-plugin-import: 2.24.0_eslint@7.32.0 eslint-plugin-jsonc: 1.4.0_eslint@7.32.0 eslint-plugin-no-use-extend-native: 0.5.0 eslint-plugin-node: 11.1.0_eslint@7.32.0 @@ -618,6 +653,22 @@ packages: - supports-color dev: true + /@pvtnbr/eslint-config-typescript/0.1.22_eslint@7.32.0+typescript@4.3.5: + resolution: {integrity: sha512-Z7JlJVY2oAJVMN6etFIWvykCWSh29Eo7nd/Uui9hk0u1UzDzyzQWvQp574vTjbmEbU5UgjYec/9XqYfovUxm/g==} + peerDependencies: + eslint: ^7.15.0 + dependencies: + '@pvtnbr/eslint-config-base': 0.1.22_eslint@7.32.0 + '@typescript-eslint/eslint-plugin': 4.29.1_d4376362794b743c19f4cba25c7fc6f5 + '@typescript-eslint/parser': 4.29.1_eslint@7.32.0+typescript@4.3.5 + eslint: 7.32.0 + eslint-import-resolver-typescript: 2.4.0_eslint@7.32.0 + transitivePeerDependencies: + - eslint-plugin-import + - supports-color + - typescript + dev: true + /@rollup/plugin-commonjs/17.1.0_rollup@2.55.1: resolution: {integrity: sha512-PoMdXCw0ZyvjpCMT5aV4nkL0QywxP29sODQsSGeDpr/oI49Qq9tRtAsb/LbYbDzFlOydVEqHmmZWFtXJEAX9ew==} engines: {node: '>= 8.0.0'} @@ -677,8 +728,22 @@ packages: resolution: {integrity: sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g==} dev: true - /@types/json5/0.0.29: - resolution: {integrity: sha1-7ihweulOEdK4J7y+UnC86n8+ce4=} + /@types/glob-to-regexp/0.4.1: + resolution: {integrity: sha512-S0mIukll6fbF0tvrKic/jj+jI8SHoSvGU+Cs95b/jzZEnBYCbj+7aJtQ9yeABuK3xP1okwA3jEH9qIRayijnvQ==} + dev: true + + /@types/json-schema/7.0.9: + resolution: {integrity: sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==} + dev: true + + /@types/lodash-es/4.17.4: + resolution: {integrity: sha512-BBz79DCJbD2CVYZH67MBeHZRX++HF+5p8Mo5MzjZi64Wac39S3diedJYHZtScbRVf4DjZyN6LzA0SB0zy+HSSQ==} + dependencies: + '@types/lodash': 4.14.172 + dev: true + + /@types/lodash/4.14.172: + resolution: {integrity: sha512-/BHF5HAx3em7/KkzVKm3LrsD6HZAXuXO1AJZQ3cRRBZj4oHZDviWPYu0aEplAqDFNHZPW6d3G7KN+ONcCCC7pw==} dev: true /@types/node-fetch/2.5.7: @@ -692,6 +757,10 @@ packages: resolution: {integrity: sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A==} dev: true + /@types/node/16.6.1: + resolution: {integrity: sha512-Sr7BhXEAer9xyGuCN3Ek9eg9xPviCF2gfu9kTfuU2HkTVAMYSDeX40fvpmo72n5nansg3nsBjuQBrsS28r+NUw==} + dev: true + /@types/normalize-package-data/2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} dev: true @@ -712,6 +781,111 @@ packages: '@types/node': 14.14.20 dev: true + /@typescript-eslint/eslint-plugin/4.29.1_d4376362794b743c19f4cba25c7fc6f5: + resolution: {integrity: sha512-AHqIU+SqZZgBEiWOrtN94ldR3ZUABV5dUG94j8Nms9rQnHFc8fvDOue/58K4CFz6r8OtDDc35Pw9NQPWo0Ayrw==} + engines: {node: ^10.12.0 || >=12.0.0} + peerDependencies: + '@typescript-eslint/parser': ^4.0.0 + eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/experimental-utils': 4.29.1_eslint@7.32.0+typescript@4.3.5 + '@typescript-eslint/parser': 4.29.1_eslint@7.32.0+typescript@4.3.5 + '@typescript-eslint/scope-manager': 4.29.1 + debug: 4.3.2 + eslint: 7.32.0 + functional-red-black-tree: 1.0.1 + regexpp: 3.2.0 + semver: 7.3.5 + tsutils: 3.21.0_typescript@4.3.5 + typescript: 4.3.5 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/experimental-utils/4.29.1_eslint@7.32.0+typescript@4.3.5: + resolution: {integrity: sha512-kl6QG6qpzZthfd2bzPNSJB2YcZpNOrP6r9jueXupcZHnL74WiuSjaft7WSu17J9+ae9zTlk0KJMXPUj0daBxMw==} + engines: {node: ^10.12.0 || >=12.0.0} + peerDependencies: + eslint: '*' + dependencies: + '@types/json-schema': 7.0.9 + '@typescript-eslint/scope-manager': 4.29.1 + '@typescript-eslint/types': 4.29.1 + '@typescript-eslint/typescript-estree': 4.29.1_typescript@4.3.5 + eslint: 7.32.0 + eslint-scope: 5.1.1 + eslint-utils: 3.0.0_eslint@7.32.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@typescript-eslint/parser/4.29.1_eslint@7.32.0+typescript@4.3.5: + resolution: {integrity: sha512-3fL5iN20hzX3Q4OkG7QEPFjZV2qsVGiDhEwwh+EkmE/w7oteiOvUNzmpu5eSwGJX/anCryONltJ3WDmAzAoCMg==} + engines: {node: ^10.12.0 || >=12.0.0} + peerDependencies: + eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 4.29.1 + '@typescript-eslint/types': 4.29.1 + '@typescript-eslint/typescript-estree': 4.29.1_typescript@4.3.5 + debug: 4.3.2 + eslint: 7.32.0 + typescript: 4.3.5 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/scope-manager/4.29.1: + resolution: {integrity: sha512-Hzv/uZOa9zrD/W5mftZa54Jd5Fed3tL6b4HeaOpwVSabJK8CJ+2MkDasnX/XK4rqP5ZTWngK1ZDeCi6EnxPQ7A==} + engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} + dependencies: + '@typescript-eslint/types': 4.29.1 + '@typescript-eslint/visitor-keys': 4.29.1 + dev: true + + /@typescript-eslint/types/4.29.1: + resolution: {integrity: sha512-Jj2yu78IRfw4nlaLtKjVaGaxh/6FhofmQ/j8v3NXmAiKafbIqtAPnKYrf0sbGjKdj0hS316J8WhnGnErbJ4RCA==} + engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} + dev: true + + /@typescript-eslint/typescript-estree/4.29.1_typescript@4.3.5: + resolution: {integrity: sha512-lIkkrR9E4lwZkzPiRDNq0xdC3f2iVCUjw/7WPJ4S2Sl6C3nRWkeE1YXCQ0+KsiaQRbpY16jNaokdWnm9aUIsfw==} + engines: {node: ^10.12.0 || >=12.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 4.29.1 + '@typescript-eslint/visitor-keys': 4.29.1 + debug: 4.3.2 + globby: 11.0.4 + is-glob: 4.0.1 + semver: 7.3.5 + tsutils: 3.21.0_typescript@4.3.5 + typescript: 4.3.5 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/visitor-keys/4.29.1: + resolution: {integrity: sha512-zLqtjMoXvgdZY/PG6gqA73V8BjqPs4af1v2kiiETBObp+uC6gRYnJLmJHxC0QyUrrHDLJPIWNYxoBV3wbcRlag==} + engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} + dependencies: + '@typescript-eslint/types': 4.29.1 + eslint-visitor-keys: 2.1.0 + dev: true + /abort-controller/3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} @@ -800,24 +974,29 @@ packages: resolution: {integrity: sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=} dev: true - /array-includes/3.1.2: - resolution: {integrity: sha512-w2GspexNQpx+PutG3QpT437/BenZBj0M/MZGn5mzv/MofYqo0xmRHzn4lFsoDlWJ+THYsGJmFlW68WlDFx7VRw==} + /array-includes/3.1.3: + resolution: {integrity: sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.0 + call-bind: 1.0.2 define-properties: 1.1.3 - es-abstract: 1.18.0-next.1 - get-intrinsic: 1.0.2 - is-string: 1.0.5 + es-abstract: 1.18.5 + get-intrinsic: 1.1.1 + is-string: 1.0.7 + dev: true + + /array-union/2.1.0: + resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} + engines: {node: '>=8'} dev: true /array.prototype.flat/1.2.4: resolution: {integrity: sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.0 + call-bind: 1.0.2 define-properties: 1.1.3 - es-abstract: 1.18.0-next.1 + es-abstract: 1.18.5 dev: true /astral-regex/2.0.0: @@ -851,16 +1030,16 @@ packages: fill-range: 7.0.1 dev: true - /browserslist/4.16.6: - resolution: {integrity: sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==} + /browserslist/4.16.7: + resolution: {integrity: sha512-7I4qVwqZltJ7j37wObBe3SoTz+nS8APaNcrBOlgoirb6/HbEU2XxW/LpUDTCngM6iauwFqmRTuOMfyKnFGY5JA==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001248 - colorette: 1.2.2 - electron-to-chromium: 1.3.793 + caniuse-lite: 1.0.30001251 + colorette: 1.3.0 + electron-to-chromium: 1.3.806 escalade: 3.1.1 - node-releases: 1.1.73 + node-releases: 1.1.74 dev: true /buffer-from/1.1.1: @@ -877,11 +1056,11 @@ packages: engines: {node: '>=10'} dev: true - /call-bind/1.0.0: - resolution: {integrity: sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==} + /call-bind/1.0.2: + resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} dependencies: function-bind: 1.1.1 - get-intrinsic: 1.0.2 + get-intrinsic: 1.1.1 dev: true /callsites/3.1.0: @@ -889,8 +1068,8 @@ packages: engines: {node: '>=6'} dev: true - /caniuse-lite/1.0.30001248: - resolution: {integrity: sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==} + /caniuse-lite/1.0.30001251: + resolution: {integrity: sha512-HOe1r+9VkU4TFmnU70z+r7OLmtR+/chB1rdcJUeQlAinjEeb0cKL20tlAtOagNZhbrtLnCvV19B4FmF1rgzl6A==} dev: true /chalk/2.4.2: @@ -962,8 +1141,8 @@ packages: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: true - /colorette/1.2.2: - resolution: {integrity: sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==} + /colorette/1.3.0: + resolution: {integrity: sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w==} dev: true /combined-stream/1.0.8: @@ -1010,11 +1189,6 @@ packages: resolution: {integrity: sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA==} dev: true - /contains-path/0.1.0: - resolution: {integrity: sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=} - engines: {node: '>=0.10.0'} - dev: true - /conventional-changelog-conventionalcommits/4.6.0: resolution: {integrity: sha512-sj9tj3z5cnHaSJCYObA9nISf7eq/YjscLPoq6nmew4SiOjxqL2KRpK20fjnjVbpNDjJ2HR3MoVcWKXwbVvzS0A==} engines: {node: '>=10'} @@ -1056,6 +1230,12 @@ packages: ms: 2.0.0 dev: true + /debug/3.2.7: + resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + dependencies: + ms: 2.1.3 + dev: true + /debug/4.3.1: resolution: {integrity: sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==} engines: {node: '>=6.0'} @@ -1109,12 +1289,18 @@ packages: resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} dev: true - /doctrine/1.5.0: - resolution: {integrity: sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=} + /dir-glob/3.0.1: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} + engines: {node: '>=8'} + dependencies: + path-type: 4.0.0 + dev: true + + /doctrine/2.1.0: + resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} engines: {node: '>=0.10.0'} dependencies: esutils: 2.0.3 - isarray: 1.0.0 dev: true /doctrine/3.0.0: @@ -1131,8 +1317,8 @@ packages: is-obj: 2.0.0 dev: true - /electron-to-chromium/1.3.793: - resolution: {integrity: sha512-l9NrGV6Mr4ov5mayYPvIWcwklNw5ROmy6rllzz9dCACw9nKE5y+s5uQk+CBJMetxrWZ6QJFsvEfG6WDcH2IGUg==} + /electron-to-chromium/1.3.806: + resolution: {integrity: sha512-AH/otJLAAecgyrYp0XK1DPiGVWcOgwPeJBOLeuFQ5l//vhQhwC9u6d+GijClqJAmsHG4XDue81ndSQPohUu0xA==} dev: true /emoji-regex/8.0.0: @@ -1158,31 +1344,36 @@ packages: is-arrayish: 0.2.1 dev: true - /es-abstract/1.18.0-next.1: - resolution: {integrity: sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==} + /es-abstract/1.18.5: + resolution: {integrity: sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA==} engines: {node: '>= 0.4'} dependencies: + call-bind: 1.0.2 es-to-primitive: 1.2.1 function-bind: 1.1.1 + get-intrinsic: 1.1.1 has: 1.0.3 - has-symbols: 1.0.1 - is-callable: 1.2.2 + has-symbols: 1.0.2 + internal-slot: 1.0.3 + is-callable: 1.2.4 is-negative-zero: 2.0.1 - is-regex: 1.1.1 - object-inspect: 1.9.0 + is-regex: 1.1.4 + is-string: 1.0.7 + object-inspect: 1.11.0 object-keys: 1.1.1 object.assign: 4.1.2 - string.prototype.trimend: 1.0.3 - string.prototype.trimstart: 1.0.3 + string.prototype.trimend: 1.0.4 + string.prototype.trimstart: 1.0.4 + unbox-primitive: 1.0.1 dev: true /es-to-primitive/1.2.1: resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} engines: {node: '>= 0.4'} dependencies: - is-callable: 1.2.2 - is-date-object: 1.0.2 - is-symbol: 1.0.3 + is-callable: 1.2.4 + is-date-object: 1.0.5 + is-symbol: 1.0.4 dev: true /esbuild/0.12.20: @@ -1206,18 +1397,35 @@ packages: engines: {node: '>=10'} dev: true - /eslint-import-resolver-node/0.3.4: - resolution: {integrity: sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==} + /eslint-import-resolver-node/0.3.5: + resolution: {integrity: sha512-XMoPKjSpXbkeJ7ZZ9icLnJMTY5Mc1kZbCakHquaFsXPpyWOwK0TK6CODO+0ca54UoM9LKOxyUNnoVZRl8TeaAg==} dependencies: - debug: 2.6.9 - resolve: 1.19.0 + debug: 3.2.7 + resolve: 1.20.0 dev: true - /eslint-module-utils/2.6.0: - resolution: {integrity: sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==} + /eslint-import-resolver-typescript/2.4.0_eslint@7.32.0: + resolution: {integrity: sha512-useJKURidCcldRLCNKWemr1fFQL1SzB3G4a0li6lFGvlc5xGe1hY343bvG07cbpCzPuM/lK19FIJB3XGFSkplA==} engines: {node: '>=4'} + peerDependencies: + eslint: '*' + eslint-plugin-import: '*' dependencies: - debug: 2.6.9 + debug: 4.3.2 + eslint: 7.32.0 + glob: 7.1.7 + is-glob: 4.0.1 + resolve: 1.20.0 + tsconfig-paths: 3.10.1 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-module-utils/2.6.2: + resolution: {integrity: sha512-QG8pcgThYOuqxupd06oYTZoNOGaUdTY1PqK+oS6ElF6vs4pBdk/aYxFVQQXzcrAqp9m7cl7lb2ubazX+g16k2Q==} + engines: {node: '>=4'} + dependencies: + debug: 3.2.7 pkg-dir: 2.0.0 dev: true @@ -1229,7 +1437,7 @@ packages: dependencies: eslint: 7.32.0 eslint-utils: 2.1.0 - regexpp: 3.1.0 + regexpp: 3.2.0 dev: true /eslint-plugin-eslint-comments/3.2.0_eslint@7.32.0: @@ -1243,26 +1451,28 @@ packages: ignore: 5.1.8 dev: true - /eslint-plugin-import/2.22.1_eslint@7.32.0: - resolution: {integrity: sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==} + /eslint-plugin-import/2.24.0_eslint@7.32.0: + resolution: {integrity: sha512-Kc6xqT9hiYi2cgybOc0I2vC9OgAYga5o/rAFinam/yF/t5uBqxQbauNPMC6fgb640T/89P0gFoO27FOilJ/Cqg==} engines: {node: '>=4'} peerDependencies: eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 dependencies: - array-includes: 3.1.2 + array-includes: 3.1.3 array.prototype.flat: 1.2.4 - contains-path: 0.1.0 debug: 2.6.9 - doctrine: 1.5.0 + doctrine: 2.1.0 eslint: 7.32.0 - eslint-import-resolver-node: 0.3.4 - eslint-module-utils: 2.6.0 + eslint-import-resolver-node: 0.3.5 + eslint-module-utils: 2.6.2 + find-up: 2.1.0 has: 1.0.3 + is-core-module: 2.5.0 minimatch: 3.0.4 - object.values: 1.1.2 - read-pkg-up: 2.0.0 - resolve: 1.19.0 - tsconfig-paths: 3.9.0 + object.values: 1.1.4 + pkg-up: 2.0.0 + read-pkg-up: 3.0.0 + resolve: 1.20.0 + tsconfig-paths: 3.10.1 dev: true /eslint-plugin-jsonc/1.4.0_eslint@7.32.0: @@ -1297,7 +1507,7 @@ packages: eslint-utils: 2.1.0 ignore: 5.1.8 minimatch: 3.0.4 - resolve: 1.19.0 + resolve: 1.20.0 semver: 6.3.0 dev: true @@ -1355,8 +1565,8 @@ packages: peerDependencies: eslint: '>=7.0.0' dependencies: - '@babel/core': 7.14.8 - '@babel/eslint-parser': 7.14.9_@babel+core@7.14.8+eslint@7.32.0 + '@babel/core': 7.15.0 + '@babel/eslint-parser': 7.15.0_@babel+core@7.15.0+eslint@7.32.0 eslint: 7.32.0 eslint-visitor-keys: 2.1.0 esquery: 1.4.0 @@ -1532,6 +1742,17 @@ packages: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true + /fast-glob/3.2.7: + resolution: {integrity: sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==} + engines: {node: '>=8'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.4 + dev: true + /fast-json-stable-stringify/2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} dev: true @@ -1540,6 +1761,12 @@ packages: resolution: {integrity: sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=} dev: true + /fastq/1.11.1: + resolution: {integrity: sha512-HOnr8Mc60eNYl1gzwp6r5RoUyAn5/glBolUzP/Ez6IFVPMPirxn/9phgL6zhOtaTy7ISwPvQ+wT+hfcRZh/bzw==} + dependencies: + reusify: 1.0.4 + dev: true + /figures/3.2.0: resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} engines: {node: '>=8'} @@ -1645,12 +1872,12 @@ packages: engines: {node: '>=6.9.0'} dev: true - /get-intrinsic/1.0.2: - resolution: {integrity: sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==} + /get-intrinsic/1.1.1: + resolution: {integrity: sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==} dependencies: function-bind: 1.1.1 has: 1.0.3 - has-symbols: 1.0.1 + has-symbols: 1.0.2 dev: true /get-own-enumerable-property-symbols/3.0.2: @@ -1714,8 +1941,24 @@ packages: type-fest: 0.20.2 dev: true - /graceful-fs/4.2.4: - resolution: {integrity: sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==} + /globby/11.0.4: + resolution: {integrity: sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==} + engines: {node: '>=10'} + dependencies: + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.2.7 + ignore: 5.1.8 + merge2: 1.4.1 + slash: 3.0.0 + dev: true + + /graceful-fs/4.2.8: + resolution: {integrity: sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==} + dev: true + + /has-bigints/1.0.1: + resolution: {integrity: sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==} dev: true /has-flag/3.0.0: @@ -1728,9 +1971,16 @@ packages: engines: {node: '>=8'} dev: true - /has-symbols/1.0.1: - resolution: {integrity: sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==} + /has-symbols/1.0.2: + resolution: {integrity: sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==} + engines: {node: '>= 0.4'} + dev: true + + /has-tostringtag/1.0.0: + resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.2 dev: true /has/1.0.3: @@ -1811,6 +2061,15 @@ packages: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} dev: true + /internal-slot/1.0.3: + resolution: {integrity: sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.1.1 + has: 1.0.3 + side-channel: 1.0.4 + dev: true + /ip-regex/2.1.0: resolution: {integrity: sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=} engines: {node: '>=4'} @@ -1820,8 +2079,22 @@ packages: resolution: {integrity: sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=} dev: true - /is-callable/1.2.2: - resolution: {integrity: sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==} + /is-bigint/1.0.4: + resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} + dependencies: + has-bigints: 1.0.1 + dev: true + + /is-boolean-object/1.1.2: + resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: true + + /is-callable/1.2.4: + resolution: {integrity: sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==} engines: {node: '>= 0.4'} dev: true @@ -1837,9 +2110,11 @@ packages: has: 1.0.3 dev: true - /is-date-object/1.0.2: - resolution: {integrity: sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==} + /is-date-object/1.0.5: + resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 dev: true /is-extglob/2.1.1: @@ -1881,6 +2156,13 @@ packages: engines: {node: '>= 0.4'} dev: true + /is-number-object/1.0.6: + resolution: {integrity: sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: true + /is-number/7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -1921,11 +2203,12 @@ packages: '@types/estree': 0.0.45 dev: true - /is-regex/1.1.1: - resolution: {integrity: sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==} + /is-regex/1.1.4: + resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} engines: {node: '>= 0.4'} dependencies: - has-symbols: 1.0.1 + call-bind: 1.0.2 + has-tostringtag: 1.0.0 dev: true /is-regexp/1.0.0: @@ -1938,20 +2221,18 @@ packages: engines: {node: '>=8'} dev: true - /is-string/1.0.5: - resolution: {integrity: sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==} + /is-string/1.0.7: + resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 dev: true - /is-symbol/1.0.3: - resolution: {integrity: sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==} + /is-symbol/1.0.4: + resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} engines: {node: '>= 0.4'} dependencies: - has-symbols: 1.0.1 - dev: true - - /isarray/1.0.0: - resolution: {integrity: sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=} + has-symbols: 1.0.2 dev: true /isexe/2.0.0: @@ -2001,6 +2282,10 @@ packages: hasBin: true dev: true + /json-parse-better-errors/1.0.2: + resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} + dev: true + /json-parse-even-better-errors/2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} dev: true @@ -2017,13 +2302,6 @@ packages: resolution: {integrity: sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=} dev: true - /json5/1.0.1: - resolution: {integrity: sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==} - hasBin: true - dependencies: - minimist: 1.2.5 - dev: true - /json5/2.2.0: resolution: {integrity: sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==} engines: {node: '>=6'} @@ -2099,13 +2377,13 @@ packages: through: 2.3.8 dev: true - /load-json-file/2.0.0: - resolution: {integrity: sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=} + /load-json-file/4.0.0: + resolution: {integrity: sha1-L19Fq5HjMhYjT9U62rZo607AmTs=} engines: {node: '>=4'} dependencies: - graceful-fs: 4.2.4 - parse-json: 2.2.0 - pify: 2.3.0 + graceful-fs: 4.2.8 + parse-json: 4.0.0 + pify: 3.0.0 strip-bom: 3.0.0 dev: true @@ -2190,16 +2468,19 @@ packages: sourcemap-codec: 1.4.8 dev: true - /markdown-table/2.0.0: - resolution: {integrity: sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==} - dependencies: - repeat-string: 1.6.1 + /markdown-table/3.0.1: + resolution: {integrity: sha512-CBbaYXKSGnE1uLRpKA1SWgIRb2PQrpkllNWpZtZe6VojOJ4ysqiq7/2glYcmKsOYN09QgH/HEBX5hIshAeiK6A==} dev: true /merge-stream/2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} dev: true + /merge2/1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + dev: true + /micromatch/4.0.2: resolution: {integrity: sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==} engines: {node: '>=8'} @@ -2208,6 +2489,14 @@ packages: picomatch: 2.2.2 dev: true + /micromatch/4.0.4: + resolution: {integrity: sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.2 + picomatch: 2.3.0 + dev: true + /mime-db/1.45.0: resolution: {integrity: sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==} engines: {node: '>= 0.6'} @@ -2243,6 +2532,10 @@ packages: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true + /ms/2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + dev: true + /multimap/1.1.0: resolution: {integrity: sha512-0ZIR9PasPxGXmRsEF8jsDzndzHDj7tIav+JUmvIFB/WHswliFnquxECT/De7GR4yg99ky/NlRKJT82G1y271bw==} dev: true @@ -2256,8 +2549,8 @@ packages: engines: {node: 4.x || >=6.0.0} dev: true - /node-releases/1.1.73: - resolution: {integrity: sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg==} + /node-releases/1.1.74: + resolution: {integrity: sha512-caJBVempXZPepZoZAPCWRTNxYQ+xtG/KAi4ozTA5A+nJ7IU+kLQCbqaUjb5Rwy14M9upBWiQ4NutcmW04LJSRw==} dev: true /normalize-package-data/2.5.0: @@ -2286,8 +2579,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /object-inspect/1.9.0: - resolution: {integrity: sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==} + /object-inspect/1.11.0: + resolution: {integrity: sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==} dev: true /object-keys/1.1.1: @@ -2299,20 +2592,19 @@ packages: resolution: {integrity: sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.0 + call-bind: 1.0.2 define-properties: 1.1.3 - has-symbols: 1.0.1 + has-symbols: 1.0.2 object-keys: 1.1.1 dev: true - /object.values/1.1.2: - resolution: {integrity: sha512-MYC0jvJopr8EK6dPBiO8Nb9mvjdypOachO5REGk6MXzujbBrAisKo3HmdEI6kZDL6fC31Mwee/5YbtMebixeag==} + /object.values/1.1.4: + resolution: {integrity: sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.0 + call-bind: 1.0.2 define-properties: 1.1.3 - es-abstract: 1.18.0-next.1 - has: 1.0.3 + es-abstract: 1.18.5 dev: true /once/1.4.0: @@ -2415,11 +2707,12 @@ packages: callsites: 3.1.0 dev: true - /parse-json/2.2.0: - resolution: {integrity: sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=} - engines: {node: '>=0.10.0'} + /parse-json/4.0.0: + resolution: {integrity: sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=} + engines: {node: '>=4'} dependencies: error-ex: 1.3.2 + json-parse-better-errors: 1.0.2 dev: true /parse-json/5.1.0: @@ -2470,11 +2763,11 @@ packages: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true - /path-type/2.0.0: - resolution: {integrity: sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=} + /path-type/3.0.0: + resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==} engines: {node: '>=4'} dependencies: - pify: 2.3.0 + pify: 3.0.0 dev: true /path-type/4.0.0: @@ -2487,9 +2780,14 @@ packages: engines: {node: '>=8.6'} dev: true - /pify/2.3.0: - resolution: {integrity: sha1-7RQaasBDqEnqWISY59yosVMw6Qw=} - engines: {node: '>=0.10.0'} + /picomatch/2.3.0: + resolution: {integrity: sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==} + engines: {node: '>=8.6'} + dev: true + + /pify/3.0.0: + resolution: {integrity: sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=} + engines: {node: '>=4'} dev: true /pkg-dir/2.0.0: @@ -2506,6 +2804,13 @@ packages: find-up: 5.0.0 dev: true + /pkg-up/2.0.0: + resolution: {integrity: sha1-yBmscoBZpGHKscOImivjxJoATX8=} + engines: {node: '>=4'} + dependencies: + find-up: 2.1.0 + dev: true + /please-upgrade-node/3.2.0: resolution: {integrity: sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==} dependencies: @@ -2558,18 +2863,22 @@ packages: engines: {node: '>=0.6.0', teleport: '>=0.2.0'} dev: true + /queue-microtask/1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + dev: true + /randombytes/2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} dependencies: safe-buffer: 5.2.1 dev: true - /read-pkg-up/2.0.0: - resolution: {integrity: sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=} + /read-pkg-up/3.0.0: + resolution: {integrity: sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=} engines: {node: '>=4'} dependencies: find-up: 2.1.0 - read-pkg: 2.0.0 + read-pkg: 3.0.0 dev: true /read-pkg-up/7.0.1: @@ -2581,13 +2890,13 @@ packages: type-fest: 0.8.1 dev: true - /read-pkg/2.0.0: - resolution: {integrity: sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=} + /read-pkg/3.0.0: + resolution: {integrity: sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=} engines: {node: '>=4'} dependencies: - load-json-file: 2.0.0 + load-json-file: 4.0.0 normalize-package-data: 2.5.0 - path-type: 2.0.0 + path-type: 3.0.0 dev: true /read-pkg/5.2.0: @@ -2615,11 +2924,6 @@ packages: engines: {node: '>=8'} dev: true - /repeat-string/1.6.1: - resolution: {integrity: sha1-jcrkcOHIirwtYA//Sndihtp15jc=} - engines: {node: '>=0.10'} - dev: true - /require-from-string/2.0.2: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} @@ -2656,6 +2960,11 @@ packages: signal-exit: 3.0.3 dev: true + /reusify/1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + dev: true + /rimraf/3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} hasBin: true @@ -2697,6 +3006,12 @@ packages: fsevents: 2.3.2 dev: true + /run-parallel/1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + dependencies: + queue-microtask: 1.2.3 + dev: true + /rxjs/6.6.3: resolution: {integrity: sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==} engines: {npm: '>=2.0.0'} @@ -2775,6 +3090,14 @@ packages: engines: {node: '>=8'} dev: true + /side-channel/1.0.4: + resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.1 + object-inspect: 1.11.0 + dev: true + /signal-exit/3.0.3: resolution: {integrity: sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==} dev: true @@ -2832,7 +3155,7 @@ packages: resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==} dependencies: spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.9 + spdx-license-ids: 3.0.10 dev: true /spdx-exceptions/2.3.0: @@ -2843,11 +3166,11 @@ packages: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} dependencies: spdx-exceptions: 2.3.0 - spdx-license-ids: 3.0.9 + spdx-license-ids: 3.0.10 dev: true - /spdx-license-ids/3.0.9: - resolution: {integrity: sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==} + /spdx-license-ids/3.0.10: + resolution: {integrity: sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA==} dev: true /sprintf-js/1.0.3: @@ -2877,17 +3200,17 @@ packages: strip-ansi: 6.0.0 dev: true - /string.prototype.trimend/1.0.3: - resolution: {integrity: sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==} + /string.prototype.trimend/1.0.4: + resolution: {integrity: sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==} dependencies: - call-bind: 1.0.0 + call-bind: 1.0.2 define-properties: 1.1.3 dev: true - /string.prototype.trimstart/1.0.3: - resolution: {integrity: sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==} + /string.prototype.trimstart/1.0.4: + resolution: {integrity: sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==} dependencies: - call-bind: 1.0.0 + call-bind: 1.0.2 define-properties: 1.1.3 dev: true @@ -2996,11 +3319,10 @@ packages: universalify: 0.1.2 dev: true - /tsconfig-paths/3.9.0: - resolution: {integrity: sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==} + /tsconfig-paths/3.10.1: + resolution: {integrity: sha512-rETidPDgCpltxF7MjBZlAFPUHv5aHH2MymyPvh+vEyWAED4Eb/WeMbsnD/JDr4OKPOA1TssDHgIcpTN5Kh0p6Q==} dependencies: - '@types/json5': 0.0.29 - json5: 1.0.1 + json5: 2.2.0 minimist: 1.2.5 strip-bom: 3.0.0 dev: true @@ -3013,6 +3335,16 @@ packages: resolution: {integrity: sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==} dev: true + /tsutils/3.21.0_typescript@4.3.5: + resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} + engines: {node: '>= 6'} + peerDependencies: + typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + dependencies: + tslib: 1.14.1 + typescript: 4.3.5 + dev: true + /tunnel/0.0.6: resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'} @@ -3045,6 +3377,21 @@ packages: engines: {node: '>=8'} dev: true + /typescript/4.3.5: + resolution: {integrity: sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==} + engines: {node: '>=4.2.0'} + hasBin: true + dev: true + + /unbox-primitive/1.0.1: + resolution: {integrity: sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==} + dependencies: + function-bind: 1.1.1 + has-bigints: 1.0.1 + has-symbols: 1.0.2 + which-boxed-primitive: 1.0.2 + dev: true + /universal-user-agent/6.0.0: resolution: {integrity: sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==} dev: true @@ -3087,6 +3434,16 @@ packages: spdx-expression-parse: 3.0.1 dev: true + /which-boxed-primitive/1.0.2: + resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} + dependencies: + is-bigint: 1.0.4 + is-boolean-object: 1.1.2 + is-number-object: 1.0.6 + is-string: 1.0.7 + is-symbol: 1.0.4 + dev: true + /which-pm-runs/1.0.0: resolution: {integrity: sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=} dev: true diff --git a/rollup.config.js b/rollup.config.ts similarity index 76% rename from rollup.config.js rename to rollup.config.ts index 4fd1ed3..4747319 100644 --- a/rollup.config.js +++ b/rollup.config.ts @@ -1,10 +1,11 @@ +import { defineConfig } from 'rollup'; import commonjs from '@rollup/plugin-commonjs'; import { nodeResolve } from '@rollup/plugin-node-resolve'; import builtins from 'builtin-modules'; import esbuild from 'rollup-plugin-esbuild'; -const rollupConfig = { - input: 'src/index.js', +export default defineConfig({ + input: 'src/index.ts', plugins: [ commonjs(), nodeResolve({ @@ -16,11 +17,11 @@ const rollupConfig = { legalComments: 'none', }), ], - external: builtins, + external: [ + ...builtins, + ], output: { format: 'cjs', file: 'dist/index.js', }, -}; - -export default rollupConfig; +}); diff --git a/src/@types/byte-size.d.ts b/src/@types/byte-size.d.ts new file mode 100644 index 0000000..b5bdd61 --- /dev/null +++ b/src/@types/byte-size.d.ts @@ -0,0 +1,11 @@ +declare module 'byte-size' { + export type Unit = 'metric' | 'iec' | 'metric_octet' | 'iec_octet'; + + type Options = { + units?: Unit; + }; + + const byteSize: (size: number, options?: Options) => string; + + export default byteSize; +} diff --git a/src/index.js b/src/index.ts similarity index 73% rename from src/index.js rename to src/index.ts index 9385495..2b5fbf3 100644 --- a/src/index.js +++ b/src/index.ts @@ -1,19 +1,22 @@ import assert from 'assert'; import { getInput, setFailed } from '@actions/core'; import { context } from '@actions/github'; -import { sub } from './lib/markdown.js'; -import upsertComment from './lib/upsert-comment.js'; -import generateSizeReport from './lib/generate-size-report.js'; -import * as log from './lib/log.js'; -import exec from './lib/exec.js'; +import type { PullRequest } from '@octokit/webhooks-types'; +import { sub } from './lib/markdown'; +import upsertComment from './lib/upsert-comment'; +import generateSizeReport from './lib/generate-size-report'; +import * as log from './lib/log'; +import exec from './lib/exec'; const COMMENT_SIGNATURE = sub('🤖 This report was automatically generated by [pkg-size-action](https://github.com/pkg-size/action/)'); (async () => { + assert(context.eventName === 'pull_request', 'Current only pull requests are supported'); + const { GITHUB_TOKEN } = process.env; assert(GITHUB_TOKEN, 'Environment variable "GITHUB_TOKEN" not set. Required for accessing and reporting on the PR.'); - const { pull_request: pr } = context.payload; + const pr = context.payload.pull_request as PullRequest; const sizeReport = await generateSizeReport({ pr, diff --git a/src/lib/build-ref.js b/src/lib/build-ref.ts similarity index 85% rename from src/lib/build-ref.js rename to src/lib/build-ref.ts index 847ef0d..4292f77 100644 --- a/src/lib/build-ref.js +++ b/src/lib/build-ref.ts @@ -1,17 +1,24 @@ import fs from 'fs'; -import * as log from './log.js'; -import exec from './exec.js'; -import npmCi from './npm-ci.js'; -import isFileTracked from './is-file-tracked.js'; -import { c, link } from './markdown.js'; +import type { Ref } from '../types'; +import * as log from './log'; +import exec from './exec'; +import npmCi from './npm-ci'; +import isFileTracked from './is-file-tracked'; +import { c, link } from './markdown'; let pkgSizeInstalled = false; +type Options = { + checkoutRef?: string; + refData: Ref; + buildCommand?: string; +}; + async function buildRef({ checkoutRef, refData, buildCommand, -}) { +}: Options) { const cwd = process.cwd(); log.info(`Current working directory: ${cwd}`); @@ -34,7 +41,7 @@ async function buildRef({ if (!buildCommand) { let pkgJson; try { - pkgJson = JSON.parse(fs.readFileSync('./package.json')); + pkgJson = JSON.parse(fs.readFileSync('./package.json').toString()); } catch (error) { log.warning('Error reading package.json', error); } @@ -46,7 +53,7 @@ async function buildRef({ } if (buildCommand) { - await npmCi({ cwd }).catch((error) => { + await npmCi(cwd).catch((error) => { throw new Error(`Failed to install dependencies:\n${error.message}`); }); diff --git a/src/lib/exec.js b/src/lib/exec.ts similarity index 66% rename from src/lib/exec.js rename to src/lib/exec.ts index 58a0a7c..c49aa74 100644 --- a/src/lib/exec.js +++ b/src/lib/exec.ts @@ -1,11 +1,14 @@ -import { exec as _exec } from '@actions/exec'; +import { exec as _exec, ExecOptions } from '@actions/exec'; -async function exec(command, options) { +async function exec( + command: string, + options?: ExecOptions, +) { let stdout = ''; let stderr = ''; const startTime = Date.now(); - const exitCode = await _exec(command, null, { + const exitCode = await _exec(command, undefined, { ...options, silent: true, listeners: { diff --git a/src/lib/generate-size-report.js b/src/lib/generate-size-report.ts similarity index 75% rename from src/lib/generate-size-report.js rename to src/lib/generate-size-report.ts index f9cb7a5..5facf1c 100644 --- a/src/lib/generate-size-report.js +++ b/src/lib/generate-size-report.ts @@ -1,8 +1,21 @@ import { setOutput } from '@actions/core'; -import { regressionReportTemplate, headOnlyReportTemplate } from '../report-templates/index.js'; -import isBaseDiffFromHead from './is-base-diff-from-head.js'; -import buildRef from './build-ref.js'; -import * as log from './log.js'; +import type { PullRequest } from '@octokit/webhooks-types'; +import { regressionReportTemplate, headOnlyReportTemplate } from '../report-templates/index'; +import isBaseDiffFromHead from './is-base-diff-from-head'; +import buildRef from './build-ref'; +import * as log from './log'; + +type Options = { + pr: PullRequest; + buildCommand: string; + commentReport: string; + mode: string; + unchangedFiles: string; + hideFiles: string; + sortBy: string; + sortOrder: string; + displaySize: string; +}; async function generateSizeReport({ pr, @@ -14,7 +27,7 @@ async function generateSizeReport({ sortBy, sortOrder, displaySize, -}) { +}: Options) { log.startGroup('Build HEAD'); const headPkgData = await buildRef({ refData: pr.head, diff --git a/src/lib/is-base-diff-from-head.js b/src/lib/is-base-diff-from-head.ts similarity index 86% rename from src/lib/is-base-diff-from-head.js rename to src/lib/is-base-diff-from-head.ts index 084e982..60fa48c 100644 --- a/src/lib/is-base-diff-from-head.js +++ b/src/lib/is-base-diff-from-head.ts @@ -1,11 +1,11 @@ -import exec from './exec.js'; +import exec from './exec'; /* * Compares files between current ref and the base ref (not commits) * The clean up (git reset --hard) that happens is crucial as it * takes into consideration uncommitted files */ -async function isBaseDiffFromHead(baseRef) { +async function isBaseDiffFromHead(baseRef: string) { try { await exec(`git fetch origin ${baseRef} --depth=1`); } catch (error) { diff --git a/src/lib/is-file-tracked.js b/src/lib/is-file-tracked.ts similarity index 50% rename from src/lib/is-file-tracked.js rename to src/lib/is-file-tracked.ts index 5cb7596..88b341b 100644 --- a/src/lib/is-file-tracked.js +++ b/src/lib/is-file-tracked.ts @@ -1,7 +1,9 @@ -import exec from './exec.js'; +import exec from './exec'; -async function isFileTracked(filePath) { - const { exitCode } = await exec(`git ls-files --error-unmatch ${filePath}`, { ignoreReturnCode: true }); +async function isFileTracked(filePath: string) { + const { exitCode } = await exec(`git ls-files --error-unmatch ${filePath}`, { + ignoreReturnCode: true, + }); return exitCode === 0; } diff --git a/src/lib/log.js b/src/lib/log.ts similarity index 100% rename from src/lib/log.js rename to src/lib/log.ts diff --git a/src/lib/markdown.js b/src/lib/markdown.js deleted file mode 100644 index fca5907..0000000 --- a/src/lib/markdown.js +++ /dev/null @@ -1,13 +0,0 @@ -const c = string => `\`${string}\``; -const link = (text, href) => `[${text}](${href})`; -const sub = string => `${string}`; -const sup = string => `${string}`; -const strong = string => `**${string}**`; - -export { - c, - link, - sub, - sup, - strong, -}; diff --git a/src/lib/markdown.ts b/src/lib/markdown.ts new file mode 100644 index 0000000..7b8c686 --- /dev/null +++ b/src/lib/markdown.ts @@ -0,0 +1,5 @@ +export const c = (text: string) => `\`${text}\``; +export const link = (text: string, href: string) => `[${text}](${href})`; +export const sub = (text: string) => `${text}`; +export const sup = (text: string) => `${text}`; +export const strong = (text: string) => `**${text}**`; diff --git a/src/lib/npm-ci.js b/src/lib/npm-ci.ts similarity index 91% rename from src/lib/npm-ci.js rename to src/lib/npm-ci.ts index 705eb34..694dfbc 100644 --- a/src/lib/npm-ci.js +++ b/src/lib/npm-ci.ts @@ -1,10 +1,12 @@ import fs from 'fs'; import path from 'path'; import { rmRF } from '@actions/io'; -import * as log from './log.js'; -import exec from './exec.js'; +import * as log from './log'; +import exec from './exec'; -async function npmCi({ cwd } = {}) { +async function npmCi( + cwd = process.cwd(), +) { if (fs.existsSync('node_modules')) { log.info('Cleaning node_modules'); await rmRF(path.join(cwd, 'node_modules')); diff --git a/src/lib/upsert-comment.js b/src/lib/upsert-comment.ts similarity index 81% rename from src/lib/upsert-comment.js rename to src/lib/upsert-comment.ts index 4e8a322..f1ed34f 100644 --- a/src/lib/upsert-comment.js +++ b/src/lib/upsert-comment.ts @@ -1,5 +1,13 @@ import { getOctokit } from '@actions/github'; -import * as log from './log.js'; +import * as log from './log'; + +type Options = { + token: string; + commentSignature: string; + repo: any; + prNumber: number; + body: string; +}; async function upsertComment({ token, @@ -7,7 +15,7 @@ async function upsertComment({ repo, prNumber, body, -}) { +}: Options) { log.startGroup('Comment on PR'); body += `\n\n${commentSignature}`; @@ -20,7 +28,7 @@ async function upsertComment({ issue_number: prNumber, }); - const hasPreviousComment = comments.find(comment => comment.body.endsWith(commentSignature)); + const hasPreviousComment = comments.find(comment => comment.body?.endsWith(commentSignature)); if (hasPreviousComment) { log.info(`Updating previous comment ID ${hasPreviousComment.id}`); await octokit.issues.updateComment({ diff --git a/src/report-templates/head-only.js b/src/report-templates/head-only.ts similarity index 92% rename from src/report-templates/head-only.js rename to src/report-templates/head-only.ts index d3c61d4..502309c 100644 --- a/src/report-templates/head-only.js +++ b/src/report-templates/head-only.ts @@ -1,14 +1,14 @@ import byteSize from 'byte-size'; -import markdownTable from 'markdown-table'; +import { markdownTable } from 'markdown-table'; import outdent from 'outdent'; -import { c, strong } from '../lib/markdown.js'; +import { c, strong } from '../lib/markdown'; import { partionHidden, getSizeLabels, parseDisplaySize, listSizes, sortFiles, -} from './utils.js'; +} from './utils'; function headOnly({ headPkgData, diff --git a/src/report-templates/index.js b/src/report-templates/index.js deleted file mode 100644 index e5e54af..0000000 --- a/src/report-templates/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default as regressionReportTemplate } from './regression/index.js'; -export { default as headOnlyReportTemplate } from './head-only.js'; diff --git a/src/report-templates/index.ts b/src/report-templates/index.ts new file mode 100644 index 0000000..f402d9c --- /dev/null +++ b/src/report-templates/index.ts @@ -0,0 +1,2 @@ +export { default as regressionReportTemplate } from './regression/index'; +export { default as headOnlyReportTemplate } from './head-only'; diff --git a/src/report-templates/regression/compare-packages.js b/src/report-templates/regression/compare-packages.ts similarity index 98% rename from src/report-templates/regression/compare-packages.js rename to src/report-templates/regression/compare-packages.ts index 0cb1453..e6b9270 100644 --- a/src/report-templates/regression/compare-packages.js +++ b/src/report-templates/regression/compare-packages.ts @@ -2,7 +2,7 @@ import { partition, round } from 'lodash-es'; import { partionHidden, sortFiles, -} from '../utils.js'; +} from '../utils'; const percent = (fraction) => { if (fraction < 0.001) { // 0.09% and lower diff --git a/src/report-templates/regression/index.js b/src/report-templates/regression/index.ts similarity index 94% rename from src/report-templates/regression/index.js rename to src/report-templates/regression/index.ts index 7ace4a4..61ba62d 100644 --- a/src/report-templates/regression/index.js +++ b/src/report-templates/regression/index.ts @@ -1,18 +1,18 @@ import { setOutput } from '@actions/core'; import byteSize from 'byte-size'; -import markdownTable from 'markdown-table'; +import { markdownTable } from 'markdown-table'; import outdent from 'outdent'; import { c, sub, sup, strong, -} from '../../lib/markdown.js'; +} from '../../lib/markdown'; import { getSizeLabels, parseDisplaySize, listSizes, -} from '../utils.js'; -import comparePackages from './compare-packages.js'; +} from '../utils'; +import comparePackages from './compare-packages'; -const directionSymbol = (value) => { +const directionSymbol = (value: number) => { if (value < 0) { return '↓'; } diff --git a/src/report-templates/utils.js b/src/report-templates/utils.ts similarity index 70% rename from src/report-templates/utils.js rename to src/report-templates/utils.ts index b96d37a..7cdc180 100644 --- a/src/report-templates/utils.js +++ b/src/report-templates/utils.ts @@ -1,7 +1,10 @@ import { partition } from 'lodash-es'; import globToRegExp from 'glob-to-regexp'; -function partionHidden(hideFilesGlob, files) { +function partionHidden( + hideFilesGlob: string | undefined, + files: { path: string }[], +) { if (!hideFilesGlob) { return [[], files]; } @@ -9,7 +12,12 @@ function partionHidden(hideFilesGlob, files) { return partition(files, file => hideFilesPtrn.test(file.path)); } -function getSizeLabels(displaySizes) { +function getSizeLabels( + displaySizes: { + property: string; + label: string; + }[], +) { if (displaySizes.length === 1 && displaySizes[0].property === 'size') { return ''; } @@ -29,9 +37,9 @@ const supportedSizes = { label: 'Brotli', property: 'sizeBrotli', }, -}; +} as const; -function parseDisplaySize(displaySize) { +function parseDisplaySize(displaySize: string) { return displaySize .split(',') .map(s => s.trim()) @@ -39,11 +47,21 @@ function parseDisplaySize(displaySize) { .map(s => supportedSizes[s]); } -const listSizes = (displaySizes, callback) => displaySizes +const listSizes = ( + displaySizes: { property: any }[], + callback: (any) => any, +) => displaySizes .map(({ property }) => callback(property)) .join(' / '); -function sortFiles(files, sortBy, sortOrder) { +function sortFiles( + files: { + path: string; + [key: string]: any; + }[], + sortBy: string, + sortOrder: string, +) { files.sort((a, b) => (b[sortBy] - a[sortBy]) || (a.path.localeCompare(b.path))); if (sortOrder === 'asc') { files.reverse(); diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..f00abd3 --- /dev/null +++ b/src/types.ts @@ -0,0 +1,3 @@ +import type { PullRequest } from '@octokit/webhooks-types'; + +export type Ref = PullRequest['head']; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..472e352 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "moduleResolution": "node", + "isolatedModules": true, + "esModuleInterop": true, + "strict": true, + }, + "include": [ + "src", + "rollup.config.ts", + ], +}