UNPKG

@modern-js/utils

Version:

A Progressive React Framework for modern web development.

1,355 lines (1,354 loc) • 64.5 kB
(()=>{ var e = { 328: (e, t, n)=>{ "use strict"; const r = n(81); const o = n(529); const s = n(170); function spawn(e, t, n) { const i = o(e, t, n); const a = r.spawn(i.command, i.args, i.options); s.hookChildProcess(a, i); return a; } function spawnSync(e, t, n) { const i = o(e, t, n); const a = r.spawnSync(i.command, i.args, i.options); a.error = a.error || s.verifyENOENTSync(a.status, i); return a; } e.exports = spawn; e.exports.spawn = spawn; e.exports.sync = spawnSync; e.exports._parse = o; e.exports._enoent = s; }, 170: (e)=>{ "use strict"; const t = "win32" === process.platform; function notFoundError(e, t) { return Object.assign(new Error(`${t} ${e.command} ENOENT`), { code: "ENOENT", errno: "ENOENT", syscall: `${t} ${e.command}`, path: e.command, spawnargs: e.args }); } function hookChildProcess(e, n) { if (!t) return; const r = e.emit; e.emit = function(t, o) { if ("exit" === t) { const t = verifyENOENT(o, n); if (t) return r.call(e, "error", t); } return r.apply(e, arguments); }; } function verifyENOENT(e, n) { if (t && 1 === e && !n.file) return notFoundError(n.original, "spawn"); return null; } function verifyENOENTSync(e, n) { if (t && 1 === e && !n.file) return notFoundError(n.original, "spawnSync"); return null; } e.exports = { hookChildProcess: hookChildProcess, verifyENOENT: verifyENOENT, verifyENOENTSync: verifyENOENTSync, notFoundError: notFoundError }; }, 529: (e, t, n)=>{ "use strict"; const r = n(17); const o = n(499); const s = n(24); const i = n(91); const a = "win32" === process.platform; const c = /\.(?:com|exe)$/i; const d = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; function detectShebang(e) { e.file = o(e); const t = e.file && i(e.file); if (t) { e.args.unshift(e.file); e.command = t; return o(e); } return e.file; } function parseNonShell(e) { if (!a) return e; const t = detectShebang(e); const n = !c.test(t); if (e.options.forceShell || n) { const n = d.test(t); e.command = r.normalize(e.command); e.command = s.command(e.command); e.args = e.args.map((e)=>s.argument(e, n)); const o = [ e.command ].concat(e.args).join(" "); e.args = [ "/d", "/s", "/c", `"${o}"` ]; e.command = process.env.comspec || "cmd.exe"; e.options.windowsVerbatimArguments = true; } return e; } function parse(e, t, n) { if (t && !Array.isArray(t)) { n = t; t = null; } t = t ? t.slice(0) : []; n = Object.assign({}, n); const r = { command: e, args: t, options: n, file: void 0, original: { command: e, args: t } }; return n.shell ? r : parseNonShell(r); } e.exports = parse; }, 24: (e)=>{ "use strict"; const t = /([()\][%!^"`<>&|;, *?])/g; function escapeCommand(e) { e = e.replace(t, "^$1"); return e; } function escapeArgument(e, n) { e = `${e}`; e = e.replace(/(\\*)"/g, '$1$1\\"'); e = e.replace(/(\\*)$/, "$1$1"); e = `"${e}"`; e = e.replace(t, "^$1"); if (n) e = e.replace(t, "^$1"); return e; } e.exports.command = escapeCommand; e.exports.argument = escapeArgument; }, 91: (e, t, n)=>{ "use strict"; const r = n(147); const o = n(256); function readShebang(e) { const t = 150; const n = Buffer.alloc(t); let s; try { s = r.openSync(e, "r"); r.readSync(s, n, 0, t, 0); r.closeSync(s); } catch (e) {} return o(n.toString()); } e.exports = readShebang; }, 499: (e, t, n)=>{ "use strict"; const r = n(17); const o = n(85); const s = n(460); function resolveCommandAttempt(e, t) { const n = e.options.env || process.env; const i = process.cwd(); const a = null != e.options.cwd; const c = a && void 0 !== process.chdir && !process.chdir.disabled; if (c) try { process.chdir(e.options.cwd); } catch (e) {} let d; try { d = o.sync(e.command, { path: n[s({ env: n })], pathExt: t ? r.delimiter : void 0 }); } catch (e) {} finally{ if (c) process.chdir(i); } if (d) d = r.resolve(a ? e.options.cwd : "", d); return d; } function resolveCommand(e) { return resolveCommandAttempt(e) || resolveCommandAttempt(e, true); } e.exports = resolveCommand; }, 632: (e, t, n)=>{ "use strict"; const r = n(17); const o = n(81); const s = n(328); const i = n(133); const a = n(136); const c = n(591); const d = n(324); const u = n(166); const { spawnedKill: l, spawnedCancel: f, setupTimeout: p, validateTimeout: m, setExitHandler: g } = n(878); const { handleInput: x, getSpawnedResult: h, makeAllStream: y, validateInputSync: b } = n(533); const { mergePromise: S, getSpawnedPromise: v } = n(210); const { joinCommand: w, parseCommand: E, getEscapedCommand: I } = n(192); const T = 100000000; const getEnv = ({ env: e, extendEnv: t, preferLocal: n, localDir: r, execPath: o })=>{ const s = t ? { ...process.env, ...e } : e; if (n) return a.env({ env: s, cwd: r, execPath: o }); return s; }; const handleArguments = (e, t, n = {})=>{ const o = s._parse(e, t, n); e = o.command; t = o.args; n = o.options; n = { maxBuffer: T, buffer: true, stripFinalNewline: true, extendEnv: true, preferLocal: false, localDir: n.cwd || process.cwd(), execPath: process.execPath, encoding: "utf8", reject: true, cleanup: true, all: false, windowsHide: true, ...n }; n.env = getEnv(n); n.stdio = u(n); if ("win32" === process.platform && "cmd" === r.basename(e, ".exe")) t.unshift("/q"); return { file: e, args: t, options: n, parsed: o }; }; const handleOutput = (e, t, n)=>{ if ("string" != typeof t && !Buffer.isBuffer(t)) return void 0 === n ? void 0 : ""; if (e.stripFinalNewline) return i(t); return t; }; const execa = (e, t, n)=>{ const r = handleArguments(e, t, n); const s = w(e, t); const i = I(e, t); m(r.options); let a; try { a = o.spawn(r.file, r.args, r.options); } catch (e) { const t = new o.ChildProcess; const n = Promise.reject(d({ error: e, stdout: "", stderr: "", all: "", command: s, escapedCommand: i, parsed: r, timedOut: false, isCanceled: false, killed: false })); return S(t, n); } const u = v(a); const b = p(a, r.options, u); const E = g(a, r.options, b); const T = { isCanceled: false }; a.kill = l.bind(null, a.kill.bind(a)); a.cancel = f.bind(null, a, T); const handlePromise = async ()=>{ const [{ error: e, exitCode: t, signal: n, timedOut: o }, c, u, l] = await h(a, r.options, E); const f = handleOutput(r.options, c); const p = handleOutput(r.options, u); const m = handleOutput(r.options, l); if (e || 0 !== t || null !== n) { const c = d({ error: e, exitCode: t, signal: n, stdout: f, stderr: p, all: m, command: s, escapedCommand: i, parsed: r, timedOut: o, isCanceled: T.isCanceled, killed: a.killed }); if (!r.options.reject) return c; throw c; } return { command: s, escapedCommand: i, exitCode: 0, stdout: f, stderr: p, all: m, failed: false, timedOut: false, isCanceled: false, killed: false }; }; const C = c(handlePromise); x(a, r.options.input); a.all = y(a, r.options); return S(a, C); }; e.exports = execa; e.exports.sync = (e, t, n)=>{ const r = handleArguments(e, t, n); const s = w(e, t); const i = I(e, t); b(r.options); let a; try { a = o.spawnSync(r.file, r.args, r.options); } catch (e) { throw d({ error: e, stdout: "", stderr: "", all: "", command: s, escapedCommand: i, parsed: r, timedOut: false, isCanceled: false, killed: false }); } const c = handleOutput(r.options, a.stdout, a.error); const u = handleOutput(r.options, a.stderr, a.error); if (a.error || 0 !== a.status || null !== a.signal) { const e = d({ stdout: c, stderr: u, error: a.error, signal: a.signal, exitCode: a.status, command: s, escapedCommand: i, parsed: r, timedOut: a.error && "ETIMEDOUT" === a.error.code, isCanceled: false, killed: null !== a.signal }); if (!r.options.reject) return e; throw e; } return { command: s, escapedCommand: i, exitCode: 0, stdout: c, stderr: u, failed: false, timedOut: false, isCanceled: false, killed: false }; }; e.exports.command = (e, t)=>{ const [n, ...r] = E(e); return execa(n, r, t); }; e.exports.commandSync = (e, t)=>{ const [n, ...r] = E(e); return execa.sync(n, r, t); }; e.exports.node = (e, t, n = {})=>{ if (t && !Array.isArray(t) && "object" == typeof t) { n = t; t = []; } const r = u.node(n); const o = process.execArgv.filter((e)=>!e.startsWith("--inspect")); const { nodePath: s = process.execPath, nodeOptions: i = o } = n; return execa(s, [ ...i, e, ...Array.isArray(t) ? t : [] ], { ...n, stdin: void 0, stdout: void 0, stderr: void 0, stdio: r, shell: false }); }; }, 192: (e)=>{ "use strict"; const normalizeArgs = (e, t = [])=>{ if (!Array.isArray(t)) return [ e ]; return [ e, ...t ]; }; const t = /^[\w.-]+$/; const n = /"/g; const escapeArg = (e)=>{ if ("string" != typeof e || t.test(e)) return e; return `"${e.replace(n, '\\"')}"`; }; const joinCommand = (e, t)=>normalizeArgs(e, t).join(" "); const getEscapedCommand = (e, t)=>normalizeArgs(e, t).map((e)=>escapeArg(e)).join(" "); const r = / +/g; const parseCommand = (e)=>{ const t = []; for (const n of e.trim().split(r)){ const e = t[t.length - 1]; if (e && e.endsWith("\\")) t[t.length - 1] = `${e.slice(0, -1)} ${n}`; else t.push(n); } return t; }; e.exports = { joinCommand: joinCommand, getEscapedCommand: getEscapedCommand, parseCommand: parseCommand }; }, 324: (e, t, n)=>{ "use strict"; const { signalsByName: r } = n(882); const getErrorPrefix = ({ timedOut: e, timeout: t, errorCode: n, signal: r, signalDescription: o, exitCode: s, isCanceled: i })=>{ if (e) return `timed out after ${t} milliseconds`; if (i) return "was canceled"; if (void 0 !== n) return `failed with ${n}`; if (void 0 !== r) return `was killed with ${r} (${o})`; if (void 0 !== s) return `failed with exit code ${s}`; return "failed"; }; const makeError = ({ stdout: e, stderr: t, all: n, error: o, signal: s, exitCode: i, command: a, escapedCommand: c, timedOut: d, isCanceled: u, killed: l, parsed: { options: { timeout: f } } })=>{ i = null === i ? void 0 : i; s = null === s ? void 0 : s; const p = void 0 === s ? void 0 : r[s].description; const m = o && o.code; const g = getErrorPrefix({ timedOut: d, timeout: f, errorCode: m, signal: s, signalDescription: p, exitCode: i, isCanceled: u }); const x = `Command ${g}: ${a}`; const h = "[object Error]" === Object.prototype.toString.call(o); const y = h ? `${x}\n${o.message}` : x; const b = [ y, t, e ].filter(Boolean).join("\n"); if (h) { o.originalMessage = o.message; o.message = b; } else o = new Error(b); o.shortMessage = y; o.command = a; o.escapedCommand = c; o.exitCode = i; o.signal = s; o.signalDescription = p; o.stdout = e; o.stderr = t; if (void 0 !== n) o.all = n; if ("bufferedData" in o) delete o.bufferedData; o.failed = true; o.timedOut = Boolean(d); o.isCanceled = u; o.killed = l && !d; return o; }; e.exports = makeError; }, 878: (e, t, n)=>{ "use strict"; const r = n(37); const o = n(580); const s = 5000; const spawnedKill = (e, t = "SIGTERM", n = {})=>{ const r = e(t); setKillTimeout(e, t, n, r); return r; }; const setKillTimeout = (e, t, n, r)=>{ if (!shouldForceKill(t, n, r)) return; const o = getForceKillAfterTimeout(n); const s = setTimeout(()=>{ e("SIGKILL"); }, o); if (s.unref) s.unref(); }; const shouldForceKill = (e, { forceKillAfterTimeout: t }, n)=>isSigterm(e) && false !== t && n; const isSigterm = (e)=>e === r.constants.signals.SIGTERM || "string" == typeof e && "SIGTERM" === e.toUpperCase(); const getForceKillAfterTimeout = ({ forceKillAfterTimeout: e = true })=>{ if (true === e) return s; if (!Number.isFinite(e) || e < 0) throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`); return e; }; const spawnedCancel = (e, t)=>{ const n = e.kill(); if (n) t.isCanceled = true; }; const timeoutKill = (e, t, n)=>{ e.kill(t); n(Object.assign(new Error("Timed out"), { timedOut: true, signal: t })); }; const setupTimeout = (e, { timeout: t, killSignal: n = "SIGTERM" }, r)=>{ if (0 === t || void 0 === t) return r; let o; const s = new Promise((r, s)=>{ o = setTimeout(()=>{ timeoutKill(e, n, s); }, t); }); const i = r.finally(()=>{ clearTimeout(o); }); return Promise.race([ s, i ]); }; const validateTimeout = ({ timeout: e })=>{ if (void 0 !== e && (!Number.isFinite(e) || e < 0)) throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`); }; const setExitHandler = async (e, { cleanup: t, detached: n }, r)=>{ if (!t || n) return r; const s = o(()=>{ e.kill(); }); return r.finally(()=>{ s(); }); }; e.exports = { spawnedKill: spawnedKill, spawnedCancel: spawnedCancel, setupTimeout: setupTimeout, validateTimeout: validateTimeout, setExitHandler: setExitHandler }; }, 210: (e)=>{ "use strict"; const t = (async ()=>{})().constructor.prototype; const n = [ "then", "catch", "finally" ].map((e)=>[ e, Reflect.getOwnPropertyDescriptor(t, e) ]); const mergePromise = (e, t)=>{ for (const [r, o] of n){ const n = "function" == typeof t ? (...e)=>Reflect.apply(o.value, t(), e) : o.value.bind(t); Reflect.defineProperty(e, r, { ...o, value: n }); } return e; }; const getSpawnedPromise = (e)=>new Promise((t, n)=>{ e.on("exit", (e, n)=>{ t({ exitCode: e, signal: n }); }); e.on("error", (e)=>{ n(e); }); if (e.stdin) e.stdin.on("error", (e)=>{ n(e); }); }); e.exports = { mergePromise: mergePromise, getSpawnedPromise: getSpawnedPromise }; }, 166: (e)=>{ "use strict"; const t = [ "stdin", "stdout", "stderr" ]; const hasAlias = (e)=>t.some((t)=>void 0 !== e[t]); const normalizeStdio = (e)=>{ if (!e) return; const { stdio: n } = e; if (void 0 === n) return t.map((t)=>e[t]); if (hasAlias(e)) throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${t.map((e)=>`\`${e}\``).join(", ")}`); if ("string" == typeof n) return n; if (!Array.isArray(n)) throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof n}\``); const r = Math.max(n.length, t.length); return Array.from({ length: r }, (e, t)=>n[t]); }; e.exports = normalizeStdio; e.exports.node = (e)=>{ const t = normalizeStdio(e); if ("ipc" === t) return "ipc"; if (void 0 === t || "string" == typeof t) return [ t, t, t, "ipc" ]; if (t.includes("ipc")) return t; return [ ...t, "ipc" ]; }; }, 533: (e, t, n)=>{ "use strict"; const r = n(434); const o = n(981); const s = n(853); const handleInput = (e, t)=>{ if (void 0 === t || void 0 === e.stdin) return; if (r(t)) t.pipe(e.stdin); else e.stdin.end(t); }; const makeAllStream = (e, { all: t })=>{ if (!t || !e.stdout && !e.stderr) return; const n = s(); if (e.stdout) n.add(e.stdout); if (e.stderr) n.add(e.stderr); return n; }; const getBufferedData = async (e, t)=>{ if (!e) return; e.destroy(); try { return await t; } catch (e) { return e.bufferedData; } }; const getStreamPromise = (e, { encoding: t, buffer: n, maxBuffer: r })=>{ if (!e || !n) return; if (t) return o(e, { encoding: t, maxBuffer: r }); return o.buffer(e, { maxBuffer: r }); }; const getSpawnedResult = async ({ stdout: e, stderr: t, all: n }, { encoding: r, buffer: o, maxBuffer: s }, i)=>{ const a = getStreamPromise(e, { encoding: r, buffer: o, maxBuffer: s }); const c = getStreamPromise(t, { encoding: r, buffer: o, maxBuffer: s }); const d = getStreamPromise(n, { encoding: r, buffer: o, maxBuffer: 2 * s }); try { return await Promise.all([ i, a, c, d ]); } catch (r) { return Promise.all([ { error: r, signal: r.signal, timedOut: r.timedOut }, getBufferedData(e, a), getBufferedData(t, c), getBufferedData(n, d) ]); } }; const validateInputSync = ({ input: e })=>{ if (r(e)) throw new TypeError("The `input` option cannot be a stream in sync mode"); }; e.exports = { handleInput: handleInput, makeAllStream: makeAllStream, getSpawnedResult: getSpawnedResult, validateInputSync: validateInputSync }; }, 782: (e, t, n)=>{ "use strict"; const { PassThrough: r } = n(781); e.exports = (e)=>{ e = { ...e }; const { array: t } = e; let { encoding: n } = e; const o = "buffer" === n; let s = false; if (t) s = !(n || o); else n = n || "utf8"; if (o) n = null; const i = new r({ objectMode: s }); if (n) i.setEncoding(n); let a = 0; const c = []; i.on("data", (e)=>{ c.push(e); if (s) a = c.length; else a += e.length; }); i.getBufferedValue = ()=>{ if (t) return c; return o ? Buffer.concat(c, a) : c.join(""); }; i.getBufferedLength = ()=>a; return i; }; }, 981: (e, t, n)=>{ "use strict"; const { constants: r } = n(300); const o = n(781); const { promisify: s } = n(837); const i = n(782); const a = s(o.pipeline); class MaxBufferError extends Error { constructor(){ super("maxBuffer exceeded"); this.name = "MaxBufferError"; } } async function getStream(e, t) { if (!e) throw new Error("Expected a stream"); t = { maxBuffer: 1 / 0, ...t }; const { maxBuffer: n } = t; const o = i(t); await new Promise((t, s)=>{ const rejectPromise = (e)=>{ if (e && o.getBufferedLength() <= r.MAX_LENGTH) e.bufferedData = o.getBufferedValue(); s(e); }; (async ()=>{ try { await a(e, o); t(); } catch (e) { rejectPromise(e); } })(); o.on("data", ()=>{ if (o.getBufferedLength() > n) rejectPromise(new MaxBufferError); }); }); return o.getBufferedValue(); } e.exports = getStream; e.exports.buffer = (e, t)=>getStream(e, { ...t, encoding: "buffer" }); e.exports.array = (e, t)=>getStream(e, { ...t, array: true }); e.exports.MaxBufferError = MaxBufferError; }, 221: (e, t)=>{ "use strict"; Object.defineProperty(t, "__esModule", { value: true }); t.SIGNALS = void 0; const n = [ { name: "SIGHUP", number: 1, action: "terminate", description: "Terminal closed", standard: "posix" }, { name: "SIGINT", number: 2, action: "terminate", description: "User interruption with CTRL-C", standard: "ansi" }, { name: "SIGQUIT", number: 3, action: "core", description: "User interruption with CTRL-\\", standard: "posix" }, { name: "SIGILL", number: 4, action: "core", description: "Invalid machine instruction", standard: "ansi" }, { name: "SIGTRAP", number: 5, action: "core", description: "Debugger breakpoint", standard: "posix" }, { name: "SIGABRT", number: 6, action: "core", description: "Aborted", standard: "ansi" }, { name: "SIGIOT", number: 6, action: "core", description: "Aborted", standard: "bsd" }, { name: "SIGBUS", number: 7, action: "core", description: "Bus error due to misaligned, non-existing address or paging error", standard: "bsd" }, { name: "SIGEMT", number: 7, action: "terminate", description: "Command should be emulated but is not implemented", standard: "other" }, { name: "SIGFPE", number: 8, action: "core", description: "Floating point arithmetic error", standard: "ansi" }, { name: "SIGKILL", number: 9, action: "terminate", description: "Forced termination", standard: "posix", forced: true }, { name: "SIGUSR1", number: 10, action: "terminate", description: "Application-specific signal", standard: "posix" }, { name: "SIGSEGV", number: 11, action: "core", description: "Segmentation fault", standard: "ansi" }, { name: "SIGUSR2", number: 12, action: "terminate", description: "Application-specific signal", standard: "posix" }, { name: "SIGPIPE", number: 13, action: "terminate", description: "Broken pipe or socket", standard: "posix" }, { name: "SIGALRM", number: 14, action: "terminate", description: "Timeout or timer", standard: "posix" }, { name: "SIGTERM", number: 15, action: "terminate", description: "Termination", standard: "ansi" }, { name: "SIGSTKFLT", number: 16, action: "terminate", description: "Stack is empty or overflowed", standard: "other" }, { name: "SIGCHLD", number: 17, action: "ignore", description: "Child process terminated, paused or unpaused", standard: "posix" }, { name: "SIGCLD", number: 17, action: "ignore", description: "Child process terminated, paused or unpaused", standard: "other" }, { name: "SIGCONT", number: 18, action: "unpause", description: "Unpaused", standard: "posix", forced: true }, { name: "SIGSTOP", number: 19, action: "pause", description: "Paused", standard: "posix", forced: true }, { name: "SIGTSTP", number: 20, action: "pause", description: 'Paused using CTRL-Z or "suspend"', standard: "posix" }, { name: "SIGTTIN", number: 21, action: "pause", description: "Background process cannot read terminal input", standard: "posix" }, { name: "SIGBREAK", number: 21, action: "terminate", description: "User interruption with CTRL-BREAK", standard: "other" }, { name: "SIGTTOU", number: 22, action: "pause", description: "Background process cannot write to terminal output", standard: "posix" }, { name: "SIGURG", number: 23, action: "ignore", description: "Socket received out-of-band data", standard: "bsd" }, { name: "SIGXCPU", number: 24, action: "core", description: "Process timed out", standard: "bsd" }, { name: "SIGXFSZ", number: 25, action: "core", description: "File too big", standard: "bsd" }, { name: "SIGVTALRM", number: 26, action: "terminate", description: "Timeout or timer", standard: "bsd" }, { name: "SIGPROF", number: 27, action: "terminate", description: "Timeout or timer", standard: "bsd" }, { name: "SIGWINCH", number: 28, action: "ignore", description: "Terminal window size changed", standard: "bsd" }, { name: "SIGIO", number: 29, action: "terminate", description: "I/O is available", standard: "other" }, { name: "SIGPOLL", number: 29, action: "terminate", description: "Watched event", standard: "other" }, { name: "SIGINFO", number: 29, action: "ignore", description: "Request for process information", standard: "other" }, { name: "SIGPWR", number: 30, action: "terminate", description: "Device running out of power", standard: "systemv" }, { name: "SIGSYS", number: 31, action: "core", description: "Invalid system call", standard: "other" }, { name: "SIGUNUSED", number: 31, action: "terminate", description: "Invalid system call", standard: "other" } ]; t.SIGNALS = n; }, 882: (e, t, n)=>{ "use strict"; Object.defineProperty(t, "__esModule", { value: true }); t.signalsByNumber = t.signalsByName = void 0; var r = n(37); var o = n(922); var s = n(840); const getSignalsByName = function() { const e = (0, o.getSignals)(); return e.reduce(getSignalByName, {}); }; const getSignalByName = function(e, { name: t, number: n, description: r, supported: o, action: s, forced: i, standard: a }) { return { ...e, [t]: { name: t, number: n, description: r, supported: o, action: s, forced: i, standard: a } }; }; const i = getSignalsByName(); t.signalsByName = i; const getSignalsByNumber = function() { const e = (0, o.getSignals)(); const t = s.SIGRTMAX + 1; const n = Array.from({ length: t }, (t, n)=>getSignalByNumber(n, e)); return Object.assign({}, ...n); }; const getSignalByNumber = function(e, t) { const n = findSignalByNumber(e, t); if (void 0 === n) return {}; const { name: r, description: o, supported: s, action: i, forced: a, standard: c } = n; return { [e]: { name: r, number: e, description: o, supported: s, action: i, forced: a, standard: c } }; }; const findSignalByNumber = function(e, t) { const n = t.find(({ name: t })=>r.constants.signals[t] === e); if (void 0 !== n) return n; return t.find((t)=>t.number === e); }; const a = getSignalsByNumber(); t.signalsByNumber = a; }, 840: (e, t)=>{ "use strict"; Object.defineProperty(t, "__esModule", { value: true }); t.SIGRTMAX = t.getRealtimeSignals = void 0; const getRealtimeSignals = function() { const e = r - n + 1; return Array.from({ length: e }, getRealtimeSignal); }; t.getRealtimeSignals = getRealtimeSignals; const getRealtimeSignal = function(e, t) { return { name: `SIGRT${t + 1}`, number: n + t, action: "terminate", description: "Application-specific signal (realtime)", standard: "posix" }; }; const n = 34; const r = 64; t.SIGRTMAX = r; }, 922: (e, t, n)=>{ "use strict"; Object.defineProperty(t, "__esModule", { value: true }); t.getSignals = void 0; var r = n(37); var o = n(221); var s = n(840); const getSignals = function() { const e = (0, s.getRealtimeSignals)(); const t = [ ...o.SIGNALS, ...e ].map(normalizeSignal); return t; }; t.getSignals = getSignals; const normalizeSignal = function({ name: e, number: t, description: n, action: o, forced: s = false, standard: i }) { const { signals: { [e]: a } } = r.constants; const c = void 0 !== a; const d = c ? a : t; return { name: e, number: d, description: n, supported: c, action: o, forced: s, standard: i }; }; }, 434: (e)=>{ "use strict"; const isStream = (e)=>null !== e && "object" == typeof e && "function" == typeof e.pipe; isStream.writable = (e)=>isStream(e) && false !== e.writable && "function" == typeof e._write && "object" == typeof e._writableState; isStream.readable = (e)=>isStream(e) && false !== e.readable && "function" == typeof e._read && "object" == typeof e._readableState; isStream.duplex = (e)=>isStream.writable(e) && isStream.readable(e); isStream.transform = (e)=>isStream.duplex(e) && "function" == typeof e._transform; e.exports = isStream; }, 212: (e, t, n)=>{ n(147); var o; o = "win32" === process.platform || global.TESTING_WINDOWS ? n(476) : n(836); e.exports = isexe; isexe.sync = sync; function isexe(e, t, n) { if ("function" == typeof t) { n = t; t = {}; } if (!n) { if ("function" != typeof Promise) throw new TypeError("callback not provided"); return new Promise(function(n, r) { isexe(e, t || {}, function(e, t) { if (e) r(e); else n(t); }); }); } o(e, t || {}, function(e, r) { if (e) { if ("EACCES" === e.code || t && t.ignoreErrors) { e = null; r = false; } } n(e, r); }); } function sync(e, t) { try { return o.sync(e, t || {}); } catch (e) { if (t && t.ignoreErrors || "EACCES" === e.code) return false; throw e; } } }, 836: (e, t, n)=>{ e.exports = isexe; isexe.sync = sync; var r = n(147); function isexe(e, t, n) { r.stat(e, function(e, r) { n(e, e ? false : checkStat(r, t)); }); } function sync(e, t) { return checkStat(r.statSync(e), t); } function checkStat(e, t) { return e.isFile() && checkMode(e, t); } function checkMode(e, t) { var n = e.mode; var r = e.uid; var o = e.gid; var s = void 0 !== t.uid ? t.uid : process.getuid && process.getuid(); var i = void 0 !== t.gid ? t.gid : process.getgid && process.getgid(); var a = parseInt("100", 8); var c = parseInt("010", 8); var d = parseInt("001", 8); var u = a | c; var l = n & d || n & c && o === i || n & a && r === s || n & u && 0 === s; return l; } }, 476: (e, t, n)=>{ e.exports = isexe; isexe.sync = sync; var r = n(147); function checkPathExt(e, t) { var n = void 0 !== t.pathExt ? t.pathExt : process.env.PATHEXT; if (!n) return true; n = n.split(";"); if (-1 !== n.indexOf("")) return true; for(var r = 0; r < n.length; r++){ var o = n[r].toLowerCase(); if (o && e.substr(-o.length).toLowerCase() === o) return true; } return false; } function checkStat(e, t, n) { if (!e.isSymbolicLink() && !e.isFile()) return false; return checkPathExt(t, n); } function isexe(e, t, n) { r.stat(e, function(r, o) { n(r, r ? false : checkStat(o, e, t)); }); } function sync(e, t) { return checkStat(r.statSync(e), e, t); } }, 853: (e, t, n)=>{ "use strict"; const { PassThrough: r } = n(781); e.exports = function() { var e = []; var t = new r({ objectMode: true }); t.setMaxListeners(0); t.add = add; t.isEmpty = isEmpty; t.on("unpipe", remove); Array.prototype.slice.call(arguments).forEach(add); return t; function add(n) { if (Array.isArray(n)) { n.forEach(add); return this; } e.push(n); n.once("end", remove.bind(null, n)); n.once("error", t.emit.bind(t, "error")); n.pipe(t, { end: false }); return this; } function isEmpty() { return 0 == e.length; } function remove(n) { e = e.filter(function(e) {