admina
Version:
Detect root/admin/sudo and execute commands as it if available
1,257 lines (1,164 loc) • 112 kB
JavaScript
import $iIEVR$fs, {stat as $iIEVR$stat, statSync as $iIEVR$statSync, promises as $iIEVR$promises, openSync as $iIEVR$openSync, readSync as $iIEVR$readSync, closeSync as $iIEVR$closeSync} from "fs";
import {join as $iIEVR$join, delimiter as $iIEVR$delimiter, sep as $iIEVR$sep, posix as $iIEVR$posix, normalize as $iIEVR$normalize, resolve as $iIEVR$resolve} from "path";
import {Buffer as $iIEVR$Buffer} from "node:buffer";
import $iIEVR$nodepath from "node:path";
import $iIEVR$nodechild_process, {ChildProcess as $iIEVR$ChildProcess} from "node:child_process";
import $iIEVR$nodeprocess from "node:process";
import {spawn as $iIEVR$spawn, spawnSync as $iIEVR$spawnSync} from "child_process";
import $iIEVR$nodeurl from "node:url";
import $iIEVR$nodeos, {constants as $iIEVR$constants} from "node:os";
import * as $iIEVR$assert from "assert";
import * as $iIEVR$events from "events";
import {createWriteStream as $iIEVR$createWriteStream, readFileSync as $iIEVR$readFileSync, createReadStream as $iIEVR$createReadStream} from "node:fs";
import {constants as $iIEVR$constants1} from "buffer";
import {pipeline as $iIEVR$pipeline, PassThrough as $iIEVR$PassThrough} from "stream";
import {promisify as $iIEVR$promisify} from "util";
import {debuglog as $iIEVR$debuglog} from "node:util";
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
var $parcel$global =
typeof globalThis !== 'undefined'
? globalThis
: typeof self !== 'undefined'
? self
: typeof window !== 'undefined'
? window
: typeof global !== 'undefined'
? global
: {};
var $parcel$modules = {};
var $parcel$inits = {};
var parcelRequire = $parcel$global["parcelRequireb51e"];
if (parcelRequire == null) {
parcelRequire = function(id) {
if (id in $parcel$modules) {
return $parcel$modules[id].exports;
}
if (id in $parcel$inits) {
var init = $parcel$inits[id];
delete $parcel$inits[id];
var module = {id: id, exports: {}};
$parcel$modules[id] = module;
init.call(module.exports, module, module.exports);
return module.exports;
}
var err = new Error("Cannot find module '" + id + "'");
err.code = 'MODULE_NOT_FOUND';
throw err;
};
parcelRequire.register = function register(id, init) {
$parcel$inits[id] = init;
};
$parcel$global["parcelRequireb51e"] = parcelRequire;
}
var parcelRegister = parcelRequire.register;
parcelRegister("6ssbl", function(module, exports) {
module.exports = $4b3b37fa6d624c95$var$isexe;
$4b3b37fa6d624c95$var$isexe.sync = $4b3b37fa6d624c95$var$sync;
function $4b3b37fa6d624c95$var$checkPathExt(path, options) {
var pathext = options.pathExt !== undefined ? options.pathExt : process.env.PATHEXT;
if (!pathext) return true;
pathext = pathext.split(";");
if (pathext.indexOf("") !== -1) return true;
for(var i = 0; i < pathext.length; i++){
var p = pathext[i].toLowerCase();
if (p && path.substr(-p.length).toLowerCase() === p) return true;
}
return false;
}
function $4b3b37fa6d624c95$var$checkStat(stat, path, options) {
if (!stat.isSymbolicLink() && !stat.isFile()) return false;
return $4b3b37fa6d624c95$var$checkPathExt(path, options);
}
function $4b3b37fa6d624c95$var$isexe(path, options, cb) {
$iIEVR$stat(path, function(er, stat) {
cb(er, er ? false : $4b3b37fa6d624c95$var$checkStat(stat, path, options));
});
}
function $4b3b37fa6d624c95$var$sync(path, options) {
return $4b3b37fa6d624c95$var$checkStat($iIEVR$statSync(path), path, options);
}
});
parcelRegister("1vtqQ", function(module, exports) {
module.exports = $118f8443dee3f4fd$var$isexe;
$118f8443dee3f4fd$var$isexe.sync = $118f8443dee3f4fd$var$sync;
function $118f8443dee3f4fd$var$isexe(path, options, cb) {
$iIEVR$stat(path, function(er, stat) {
cb(er, er ? false : $118f8443dee3f4fd$var$checkStat(stat, options));
});
}
function $118f8443dee3f4fd$var$sync(path, options) {
return $118f8443dee3f4fd$var$checkStat($iIEVR$statSync(path), options);
}
function $118f8443dee3f4fd$var$checkStat(stat, options) {
return stat.isFile() && $118f8443dee3f4fd$var$checkMode(stat, options);
}
function $118f8443dee3f4fd$var$checkMode(stat, options) {
var mod = stat.mode;
var uid = stat.uid;
var gid = stat.gid;
var myUid = options.uid !== undefined ? options.uid : process.getuid && process.getuid();
var myGid = options.gid !== undefined ? options.gid : process.getgid && process.getgid();
var u = parseInt("100", 8);
var g = parseInt("010", 8);
var o = parseInt("001", 8);
var ug = u | g;
var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
return ret;
}
});
parcelRegister("6j8hI", function(module, exports) {
// This is not the set of all possible signals.
//
// It IS, however, the set of all signals that trigger
// an exit on either Linux or BSD systems. Linux is a
// superset of the signal names supported on BSD, and
// the unknown signals just fail to register, so we can
// catch that easily enough.
//
// Don't bother with SIGKILL. It's uncatchable, which
// means that we can't fire any callbacks anyway.
//
// If a user does happen to register a handler on a non-
// fatal signal like SIGWINCH or something, and then
// exit, it'll end up firing `process.emit('exit')`, so
// the handler will be fired anyway.
//
// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
// artificially, inherently leave the process in a
// state from which it is not safe to try and enter JS
// listeners.
module.exports = [
"SIGABRT",
"SIGALRM",
"SIGHUP",
"SIGINT",
"SIGTERM"
];
if (process.platform !== "win32") module.exports.push("SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
if (process.platform === "linux") module.exports.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT", "SIGUNUSED");
});
var $345f0b38609981b6$exports = {};
$parcel$export($345f0b38609981b6$exports, "hasSudo", () => $345f0b38609981b6$export$7683bf1311d8252);
$parcel$export($345f0b38609981b6$exports, "isRoot", () => $345f0b38609981b6$export$e3140dc7d0c35e48);
$parcel$export($345f0b38609981b6$exports, "isSudo", () => $345f0b38609981b6$export$316200228f28b8ce);
$parcel$export($345f0b38609981b6$exports, "prependSudo", () => $345f0b38609981b6$export$d976d47922ae9667);
$parcel$export($345f0b38609981b6$exports, "defaultExecOptions", () => $345f0b38609981b6$export$151aeb0ade3989e1);
$parcel$export($345f0b38609981b6$exports, "execRootSync", () => $345f0b38609981b6$export$58f152936f209932);
$parcel$export($345f0b38609981b6$exports, "execRoot", () => $345f0b38609981b6$export$351270479e2eef26);
var $2a4ec6ee800b4c3d$exports = {};
var $63e30615774bc4fb$exports = {};
$parcel$export($63e30615774bc4fb$exports, "isexe", () => $63e30615774bc4fb$export$35888d6059c232d4);
$parcel$export($63e30615774bc4fb$exports, "sync", () => $63e30615774bc4fb$export$92d6409d68f0739a);
/**
* This is the Posix implementation of isexe, which uses the file
* mode and uid/gid values.
*
* @module
*/
var $40bd671a45062c29$export$2e2bcd8739ae039 = (0, $iIEVR$promises);
const { access: $40bd671a45062c29$export$9bb0e144ba4929ca, appendFile: $40bd671a45062c29$export$31f54b44f813a103, chmod: $40bd671a45062c29$export$fe07cae62e774a05, chown: $40bd671a45062c29$export$86560bc0b866a003, copyFile: $40bd671a45062c29$export$c763efb2c06e223f, lchmod: $40bd671a45062c29$export$4d4374c7ea08c49f, lchown: $40bd671a45062c29$export$b34a65c440b523a2, link: $40bd671a45062c29$export$9c30223ca0a664fb, lstat: $40bd671a45062c29$export$c29f07eab13966a4, mkdir: $40bd671a45062c29$export$d9fa9670717a639d, mkdtemp: $40bd671a45062c29$export$bb440dc863a3b46a, open: $40bd671a45062c29$export$3ce6949f20cea765, readdir: $40bd671a45062c29$export$b1e07c405f785337, readFile: $40bd671a45062c29$export$72c04af63de9061a, readlink: $40bd671a45062c29$export$3d3ca76659ee9f39, realpath: $40bd671a45062c29$export$9f2c45015a422c45, rename: $40bd671a45062c29$export$7ac989ec0c9c279, rmdir: $40bd671a45062c29$export$3f660f6332b9a01d, stat: $40bd671a45062c29$export$f82f04a91eb6144a, symlink: $40bd671a45062c29$export$ed42c6f39f07f97, truncate: $40bd671a45062c29$export$6a506b36fdea397d, unlink: $40bd671a45062c29$export$5e0808041271ce04, utimes: $40bd671a45062c29$export$d85d919a687a608f, writeFile: $40bd671a45062c29$export$552bfb764b5cd2b4 } = (0, $iIEVR$promises); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvbWlzZXMubWpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic3JjL2NvbXBhdC9mcy9wcm9taXNlcy5tdHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLElBQUksQ0FBQTtBQUM3QixlQUFlLFFBQVEsQ0FBQTtBQUV2QixNQUFNLENBQUMsTUFBTSxFQUNYLE1BQU0sRUFDTixVQUFVLEVBQ1YsS0FBSyxFQUNMLEtBQUssRUFDTCxRQUFRLEVBQ1IsTUFBTSxFQUNOLE1BQU0sRUFDTixJQUFJLEVBQ0osS0FBSyxFQUNMLEtBQUssRUFDTCxPQUFPLEVBQ1AsSUFBSSxFQUNKLE9BQU8sRUFDUCxRQUFRLEVBQ1IsUUFBUSxFQUNSLFFBQVEsRUFDUixNQUFNLEVBQ04sS0FBSyxFQUNMLElBQUksRUFDSixPQUFPLEVBQ1AsUUFBUSxFQUNSLE1BQU0sRUFDTixNQUFNLEVBQ04sU0FBUyxHQUNWLEdBQUcsUUFBUSxDQUFBIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgcHJvbWlzZXMgfSBmcm9tIFwiZnNcIlxuZXhwb3J0IGRlZmF1bHQgcHJvbWlzZXNcblxuZXhwb3J0IGNvbnN0IHtcbiAgYWNjZXNzLFxuICBhcHBlbmRGaWxlLFxuICBjaG1vZCxcbiAgY2hvd24sXG4gIGNvcHlGaWxlLFxuICBsY2htb2QsXG4gIGxjaG93bixcbiAgbGluayxcbiAgbHN0YXQsXG4gIG1rZGlyLFxuICBta2R0ZW1wLFxuICBvcGVuLFxuICByZWFkZGlyLFxuICByZWFkRmlsZSxcbiAgcmVhZGxpbmssXG4gIHJlYWxwYXRoLFxuICByZW5hbWUsXG4gIHJtZGlyLFxuICBzdGF0LFxuICBzeW1saW5rLFxuICB0cnVuY2F0ZSxcbiAgdW5saW5rLFxuICB1dGltZXMsXG4gIHdyaXRlRmlsZSxcbn0gPSBwcm9taXNlc1xuIl19
const $63e30615774bc4fb$export$35888d6059c232d4 = async (path, options = {})=>{
const { ignoreErrors: ignoreErrors = false } = options;
try {
return $63e30615774bc4fb$var$checkStat(await (0, $40bd671a45062c29$export$f82f04a91eb6144a)(path), options);
} catch (e) {
const er = e;
if (ignoreErrors || er.code === "EACCES") return false;
throw er;
}
};
const $63e30615774bc4fb$export$92d6409d68f0739a = (path, options = {})=>{
const { ignoreErrors: ignoreErrors = false } = options;
try {
return $63e30615774bc4fb$var$checkStat((0, $iIEVR$statSync)(path), options);
} catch (e) {
const er = e;
if (ignoreErrors || er.code === "EACCES") return false;
throw er;
}
};
const $63e30615774bc4fb$var$checkStat = (stat, options)=>stat.isFile() && $63e30615774bc4fb$var$checkMode(stat, options);
const $63e30615774bc4fb$var$checkMode = (stat, options)=>{
const myUid = options.uid ?? process.getuid?.();
const myGroups = options.groups ?? process.getgroups?.() ?? [];
const myGid = options.gid ?? process.getgid?.() ?? myGroups[0];
if (myUid === undefined || myGid === undefined) throw new Error("cannot get uid or gid");
const groups = new Set([
myGid,
...myGroups
]);
const mod = stat.mode;
const uid = stat.uid;
const gid = stat.gid;
const u = parseInt("100", 8);
const g = parseInt("010", 8);
const o = parseInt("001", 8);
const ug = u | g;
return !!(mod & o || mod & g && groups.has(gid) || mod & u && uid === myUid || mod & ug && myUid === 0);
};
var $1564f123a8b59fab$exports = {};
$parcel$export($1564f123a8b59fab$exports, "isexe", () => $1564f123a8b59fab$export$35888d6059c232d4);
$parcel$export($1564f123a8b59fab$exports, "sync", () => $1564f123a8b59fab$export$92d6409d68f0739a);
/**
* This is the Windows implementation of isexe, which uses the file
* extension and PATHEXT setting.
*
* @module
*/
const $1564f123a8b59fab$export$35888d6059c232d4 = async (path, options = {})=>{
const { ignoreErrors: ignoreErrors = false } = options;
try {
return $1564f123a8b59fab$var$checkStat(await (0, $40bd671a45062c29$export$f82f04a91eb6144a)(path), path, options);
} catch (e) {
const er = e;
if (ignoreErrors || er.code === "EACCES") return false;
throw er;
}
};
const $1564f123a8b59fab$export$92d6409d68f0739a = (path, options = {})=>{
const { ignoreErrors: ignoreErrors = false } = options;
try {
return $1564f123a8b59fab$var$checkStat((0, $iIEVR$statSync)(path), path, options);
} catch (e) {
const er = e;
if (ignoreErrors || er.code === "EACCES") return false;
throw er;
}
};
const $1564f123a8b59fab$var$checkPathExt = (path, options)=>{
const { pathExt: pathExt = process.env.PATHEXT || "" } = options;
const peSplit = pathExt.split(";");
if (peSplit.indexOf("") !== -1) return true;
for(let i = 0; i < peSplit.length; i++){
const p = peSplit[i].toLowerCase();
const ext = path.substring(path.length - p.length).toLowerCase();
if (p && ext === p) return true;
}
return false;
};
const $1564f123a8b59fab$var$checkStat = (stat, path, options)=>stat.isFile() && $1564f123a8b59fab$var$checkPathExt(path, options);
const $68e5b1322bd22178$var$platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform;
const $68e5b1322bd22178$var$impl = $68e5b1322bd22178$var$platform === "win32" ? $1564f123a8b59fab$exports : $63e30615774bc4fb$exports;
const $68e5b1322bd22178$export$35888d6059c232d4 = $68e5b1322bd22178$var$impl.isexe;
const $68e5b1322bd22178$export$92d6409d68f0739a = $68e5b1322bd22178$var$impl.sync;
var $2a4ec6ee800b4c3d$require$isexe = $68e5b1322bd22178$export$35888d6059c232d4;
var $2a4ec6ee800b4c3d$require$isexeSync = $68e5b1322bd22178$export$92d6409d68f0739a;
var $2a4ec6ee800b4c3d$require$join = $iIEVR$join;
var $2a4ec6ee800b4c3d$require$delimiter = $iIEVR$delimiter;
var $2a4ec6ee800b4c3d$require$sep = $iIEVR$sep;
var $2a4ec6ee800b4c3d$require$posix = $iIEVR$posix;
const $2a4ec6ee800b4c3d$var$isWindows = process.platform === "win32";
// used to check for slashed in commands passed in. always checks for the posix
// seperator on all platforms, and checks for the current separator when not on
// a posix platform. don't use the isWindows check for this since that is mocked
// in tests but we still need the code to actually work when called. that is also
// why it is ignored from coverage.
/* istanbul ignore next */ const $2a4ec6ee800b4c3d$var$rSlash = new RegExp(`[${$2a4ec6ee800b4c3d$require$posix.sep}${$2a4ec6ee800b4c3d$require$sep === $2a4ec6ee800b4c3d$require$posix.sep ? "" : $2a4ec6ee800b4c3d$require$sep}]`.replace(/(\\)/g, "\\$1"));
const $2a4ec6ee800b4c3d$var$rRel = new RegExp(`^\\.${$2a4ec6ee800b4c3d$var$rSlash.source}`);
const $2a4ec6ee800b4c3d$var$getNotFoundError = (cmd)=>Object.assign(new Error(`not found: ${cmd}`), {
code: "ENOENT"
});
const $2a4ec6ee800b4c3d$var$getPathInfo = (cmd, { path: optPath = process.env.PATH, pathExt: optPathExt = process.env.PATHEXT, delimiter: optDelimiter = $2a4ec6ee800b4c3d$require$delimiter })=>{
// If it has a slash, then we don't bother searching the pathenv.
// just check the file itself, and that's it.
const pathEnv = cmd.match($2a4ec6ee800b4c3d$var$rSlash) ? [
""
] : [
// windows always checks the cwd first
...$2a4ec6ee800b4c3d$var$isWindows ? [
process.cwd()
] : [],
...(optPath || /* istanbul ignore next: very unusual */ "").split(optDelimiter)
];
if ($2a4ec6ee800b4c3d$var$isWindows) {
const pathExtExe = optPathExt || [
".EXE",
".CMD",
".BAT",
".COM"
].join(optDelimiter);
const pathExt = pathExtExe.split(optDelimiter).flatMap((item)=>[
item,
item.toLowerCase()
]);
if (cmd.includes(".") && pathExt[0] !== "") pathExt.unshift("");
return {
pathEnv: pathEnv,
pathExt: pathExt,
pathExtExe: pathExtExe
};
}
return {
pathEnv: pathEnv,
pathExt: [
""
]
};
};
const $2a4ec6ee800b4c3d$var$getPathPart = (raw, cmd)=>{
const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
const prefix = !pathPart && $2a4ec6ee800b4c3d$var$rRel.test(cmd) ? cmd.slice(0, 2) : "";
return prefix + $2a4ec6ee800b4c3d$require$join(pathPart, cmd);
};
const $2a4ec6ee800b4c3d$var$which = async (cmd, opt = {})=>{
const { pathEnv: pathEnv, pathExt: pathExt, pathExtExe: pathExtExe } = $2a4ec6ee800b4c3d$var$getPathInfo(cmd, opt);
const found = [];
for (const envPart of pathEnv){
const p = $2a4ec6ee800b4c3d$var$getPathPart(envPart, cmd);
for (const ext of pathExt){
const withExt = p + ext;
const is = await $2a4ec6ee800b4c3d$require$isexe(withExt, {
pathExt: pathExtExe,
ignoreErrors: true
});
if (is) {
if (!opt.all) return withExt;
found.push(withExt);
}
}
}
if (opt.all && found.length) return found;
if (opt.nothrow) return null;
throw $2a4ec6ee800b4c3d$var$getNotFoundError(cmd);
};
const $2a4ec6ee800b4c3d$var$whichSync = (cmd, opt = {})=>{
const { pathEnv: pathEnv, pathExt: pathExt, pathExtExe: pathExtExe } = $2a4ec6ee800b4c3d$var$getPathInfo(cmd, opt);
const found = [];
for (const pathEnvPart of pathEnv){
const p = $2a4ec6ee800b4c3d$var$getPathPart(pathEnvPart, cmd);
for (const ext of pathExt){
const withExt = p + ext;
const is = $2a4ec6ee800b4c3d$require$isexeSync(withExt, {
pathExt: pathExtExe,
ignoreErrors: true
});
if (is) {
if (!opt.all) return withExt;
found.push(withExt);
}
}
}
if (opt.all && found.length) return found;
if (opt.nothrow) return null;
throw $2a4ec6ee800b4c3d$var$getNotFoundError(cmd);
};
$2a4ec6ee800b4c3d$exports = $2a4ec6ee800b4c3d$var$which;
$2a4ec6ee800b4c3d$var$which.sync = $2a4ec6ee800b4c3d$var$whichSync;
var $daf72ea6e4bc8475$exports = {};
"use strict";
var $c130c6d10fe44d87$exports = {};
"use strict";
var $88d18c7637b76847$exports = {};
"use strict";
var $f96dd009f5f00222$exports = {};
const $f96dd009f5f00222$var$isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
const $f96dd009f5f00222$var$COLON = $f96dd009f5f00222$var$isWindows ? ";" : ":";
var $0d8d6eb9e3382bd4$exports = {};
var $0d8d6eb9e3382bd4$var$core;
if (process.platform === "win32" || $parcel$global.TESTING_WINDOWS) $0d8d6eb9e3382bd4$var$core = (parcelRequire("6ssbl"));
else $0d8d6eb9e3382bd4$var$core = (parcelRequire("1vtqQ"));
$0d8d6eb9e3382bd4$exports = $0d8d6eb9e3382bd4$var$isexe;
$0d8d6eb9e3382bd4$var$isexe.sync = $0d8d6eb9e3382bd4$var$sync;
function $0d8d6eb9e3382bd4$var$isexe(path, options, cb) {
if (typeof options === "function") {
cb = options;
options = {};
}
if (!cb) {
if (typeof Promise !== "function") throw new TypeError("callback not provided");
return new Promise(function(resolve, reject) {
$0d8d6eb9e3382bd4$var$isexe(path, options || {}, function(er, is) {
if (er) reject(er);
else resolve(is);
});
});
}
$0d8d6eb9e3382bd4$var$core(path, options || {}, function(er, is) {
// ignore EACCES because that just means we aren't allowed to run it
if (er) {
if (er.code === "EACCES" || options && options.ignoreErrors) {
er = null;
is = false;
}
}
cb(er, is);
});
}
function $0d8d6eb9e3382bd4$var$sync(path, options) {
// my kingdom for a filtered catch
try {
return $0d8d6eb9e3382bd4$var$core.sync(path, options || {});
} catch (er) {
if (options && options.ignoreErrors || er.code === "EACCES") return false;
else throw er;
}
}
const $f96dd009f5f00222$var$getNotFoundError = (cmd)=>Object.assign(new Error(`not found: ${cmd}`), {
code: "ENOENT"
});
const $f96dd009f5f00222$var$getPathInfo = (cmd, opt)=>{
const colon = opt.colon || $f96dd009f5f00222$var$COLON;
// If it has a slash, then we don't bother searching the pathenv.
// just check the file itself, and that's it.
const pathEnv = cmd.match(/\//) || $f96dd009f5f00222$var$isWindows && cmd.match(/\\/) ? [
""
] : [
// windows always checks the cwd first
...$f96dd009f5f00222$var$isWindows ? [
process.cwd()
] : [],
...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */ "").split(colon)
];
const pathExtExe = $f96dd009f5f00222$var$isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
const pathExt = $f96dd009f5f00222$var$isWindows ? pathExtExe.split(colon) : [
""
];
if ($f96dd009f5f00222$var$isWindows) {
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "") pathExt.unshift("");
}
return {
pathEnv: pathEnv,
pathExt: pathExt,
pathExtExe: pathExtExe
};
};
const $f96dd009f5f00222$var$which = (cmd, opt, cb)=>{
if (typeof opt === "function") {
cb = opt;
opt = {};
}
if (!opt) opt = {};
const { pathEnv: pathEnv, pathExt: pathExt, pathExtExe: pathExtExe } = $f96dd009f5f00222$var$getPathInfo(cmd, opt);
const found = [];
const step = (i)=>new Promise((resolve, reject)=>{
if (i === pathEnv.length) return opt.all && found.length ? resolve(found) : reject($f96dd009f5f00222$var$getNotFoundError(cmd));
const ppRaw = pathEnv[i];
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
const pCmd = $iIEVR$join(pathPart, cmd);
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
resolve(subStep(p, i, 0));
});
const subStep = (p, i, ii)=>new Promise((resolve, reject)=>{
if (ii === pathExt.length) return resolve(step(i + 1));
const ext = pathExt[ii];
$0d8d6eb9e3382bd4$exports(p + ext, {
pathExt: pathExtExe
}, (er, is)=>{
if (!er && is) {
if (opt.all) found.push(p + ext);
else return resolve(p + ext);
}
return resolve(subStep(p, i, ii + 1));
});
});
return cb ? step(0).then((res)=>cb(null, res), cb) : step(0);
};
const $f96dd009f5f00222$var$whichSync = (cmd, opt)=>{
opt = opt || {};
const { pathEnv: pathEnv, pathExt: pathExt, pathExtExe: pathExtExe } = $f96dd009f5f00222$var$getPathInfo(cmd, opt);
const found = [];
for(let i = 0; i < pathEnv.length; i++){
const ppRaw = pathEnv[i];
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
const pCmd = $iIEVR$join(pathPart, cmd);
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
for(let j = 0; j < pathExt.length; j++){
const cur = p + pathExt[j];
try {
const is = $0d8d6eb9e3382bd4$exports.sync(cur, {
pathExt: pathExtExe
});
if (is) {
if (opt.all) found.push(cur);
else return cur;
}
} catch (ex) {}
}
}
if (opt.all && found.length) return found;
if (opt.nothrow) return null;
throw $f96dd009f5f00222$var$getNotFoundError(cmd);
};
$f96dd009f5f00222$exports = $f96dd009f5f00222$var$which;
$f96dd009f5f00222$var$which.sync = $f96dd009f5f00222$var$whichSync;
var $33700fc17480ef92$exports = {};
"use strict";
const $33700fc17480ef92$var$pathKey = (options = {})=>{
const environment = options.env || process.env;
const platform = options.platform || process.platform;
if (platform !== "win32") return "PATH";
return Object.keys(environment).reverse().find((key)=>key.toUpperCase() === "PATH") || "Path";
};
$33700fc17480ef92$exports = $33700fc17480ef92$var$pathKey;
// TODO: Remove this for the next major release
$33700fc17480ef92$exports.default = $33700fc17480ef92$var$pathKey;
function $88d18c7637b76847$var$resolveCommandAttempt(parsed, withoutPathExt) {
const env = parsed.options.env || process.env;
const cwd = process.cwd();
const hasCustomCwd = parsed.options.cwd != null;
// Worker threads do not have process.chdir()
const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;
// If a custom `cwd` was specified, we need to change the process cwd
// because `which` will do stat calls but does not support a custom cwd
if (shouldSwitchCwd) try {
process.chdir(parsed.options.cwd);
} catch (err) {
/* Empty */ }
let resolved;
try {
resolved = $f96dd009f5f00222$exports.sync(parsed.command, {
path: env[$33700fc17480ef92$exports({
env: env
})],
pathExt: withoutPathExt ? $iIEVR$delimiter : undefined
});
} catch (e) {
/* Empty */ } finally{
if (shouldSwitchCwd) process.chdir(cwd);
}
// If we successfully resolved, ensure that an absolute path is returned
// Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
if (resolved) resolved = $iIEVR$resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
return resolved;
}
function $88d18c7637b76847$var$resolveCommand(parsed) {
return $88d18c7637b76847$var$resolveCommandAttempt(parsed) || $88d18c7637b76847$var$resolveCommandAttempt(parsed, true);
}
$88d18c7637b76847$exports = $88d18c7637b76847$var$resolveCommand;
var $280b98749b8ad9e8$export$ae50443ffc990749;
var $280b98749b8ad9e8$export$6ea29ee575e3f5ff;
"use strict";
// See http://www.robvanderwoude.com/escapechars.php
const $280b98749b8ad9e8$var$metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
function $280b98749b8ad9e8$var$escapeCommand(arg) {
// Escape meta chars
arg = arg.replace($280b98749b8ad9e8$var$metaCharsRegExp, "^$1");
return arg;
}
function $280b98749b8ad9e8$var$escapeArgument(arg, doubleEscapeMetaChars) {
// Convert to string
arg = `${arg}`;
// Algorithm below is based on https://qntm.org/cmd
// Sequence of backslashes followed by a double quote:
// double up all the backslashes and escape the double quote
arg = arg.replace(/(\\*)"/g, '$1$1\\"');
// Sequence of backslashes followed by the end of the string
// (which will become a double quote later):
// double up all the backslashes
arg = arg.replace(/(\\*)$/, "$1$1");
// All other backslashes occur literally
// Quote the whole thing:
arg = `"${arg}"`;
// Escape meta chars
arg = arg.replace($280b98749b8ad9e8$var$metaCharsRegExp, "^$1");
// Double escape meta chars if necessary
if (doubleEscapeMetaChars) arg = arg.replace($280b98749b8ad9e8$var$metaCharsRegExp, "^$1");
return arg;
}
$280b98749b8ad9e8$export$ae50443ffc990749 = $280b98749b8ad9e8$var$escapeCommand;
$280b98749b8ad9e8$export$6ea29ee575e3f5ff = $280b98749b8ad9e8$var$escapeArgument;
var $24099d3b62d0edeb$exports = {};
"use strict";
var $6b556c343e41eb9a$exports = {};
"use strict";
var $8fec7f122efb0741$exports = {};
"use strict";
$8fec7f122efb0741$exports = /^#!(.*)/;
$6b556c343e41eb9a$exports = (string = "")=>{
const match = string.match($8fec7f122efb0741$exports);
if (!match) return null;
const [path, argument] = match[0].replace(/#! ?/, "").split(" ");
const binary = path.split("/").pop();
if (binary === "env") return argument;
return argument ? `${binary} ${argument}` : binary;
};
function $24099d3b62d0edeb$var$readShebang(command) {
// Read the first 150 bytes from the file
const size = 150;
const buffer = Buffer.alloc(size);
let fd;
try {
fd = $iIEVR$openSync(command, "r");
$iIEVR$readSync(fd, buffer, 0, size, 0);
$iIEVR$closeSync(fd);
} catch (e) {}
// Attempt to extract shebang (null is returned if not a shebang)
return $6b556c343e41eb9a$exports(buffer.toString());
}
$24099d3b62d0edeb$exports = $24099d3b62d0edeb$var$readShebang;
const $c130c6d10fe44d87$var$isWin = process.platform === "win32";
const $c130c6d10fe44d87$var$isExecutableRegExp = /\.(?:com|exe)$/i;
const $c130c6d10fe44d87$var$isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
function $c130c6d10fe44d87$var$detectShebang(parsed) {
parsed.file = $88d18c7637b76847$exports(parsed);
const shebang = parsed.file && $24099d3b62d0edeb$exports(parsed.file);
if (shebang) {
parsed.args.unshift(parsed.file);
parsed.command = shebang;
return $88d18c7637b76847$exports(parsed);
}
return parsed.file;
}
function $c130c6d10fe44d87$var$parseNonShell(parsed) {
if (!$c130c6d10fe44d87$var$isWin) return parsed;
// Detect & add support for shebangs
const commandFile = $c130c6d10fe44d87$var$detectShebang(parsed);
// We don't need a shell if the command filename is an executable
const needsShell = !$c130c6d10fe44d87$var$isExecutableRegExp.test(commandFile);
// If a shell is required, use cmd.exe and take care of escaping everything correctly
// Note that `forceShell` is an hidden option used only in tests
if (parsed.options.forceShell || needsShell) {
// Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
// The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
// Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
// we need to double escape them
const needsDoubleEscapeMetaChars = $c130c6d10fe44d87$var$isCmdShimRegExp.test(commandFile);
// Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
// This is necessary otherwise it will always fail with ENOENT in those cases
parsed.command = $iIEVR$normalize(parsed.command);
// Escape command & arguments
parsed.command = $280b98749b8ad9e8$export$ae50443ffc990749(parsed.command);
parsed.args = parsed.args.map((arg)=>$280b98749b8ad9e8$export$6ea29ee575e3f5ff(arg, needsDoubleEscapeMetaChars));
const shellCommand = [
parsed.command
].concat(parsed.args).join(" ");
parsed.args = [
"/d",
"/s",
"/c",
`"${shellCommand}"`
];
parsed.command = process.env.comspec || "cmd.exe";
parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
}
return parsed;
}
function $c130c6d10fe44d87$var$parse(command, args, options) {
// Normalize arguments, similar to nodejs
if (args && !Array.isArray(args)) {
options = args;
args = null;
}
args = args ? args.slice(0) : []; // Clone array to avoid changing the original
options = Object.assign({}, options); // Clone object to avoid changing the original
// Build our parsed object
const parsed = {
command: command,
args: args,
options: options,
file: undefined,
original: {
command: command,
args: args
}
};
// Delegate further parsing to shell or non-shell
return options.shell ? parsed : $c130c6d10fe44d87$var$parseNonShell(parsed);
}
$c130c6d10fe44d87$exports = $c130c6d10fe44d87$var$parse;
var $948d4846584ad699$exports = {};
"use strict";
const $948d4846584ad699$var$isWin = process.platform === "win32";
function $948d4846584ad699$var$notFoundError(original, syscall) {
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
code: "ENOENT",
errno: "ENOENT",
syscall: `${syscall} ${original.command}`,
path: original.command,
spawnargs: original.args
});
}
function $948d4846584ad699$var$hookChildProcess(cp, parsed) {
if (!$948d4846584ad699$var$isWin) return;
const originalEmit = cp.emit;
cp.emit = function(name, arg1) {
// If emitting "exit" event and exit code is 1, we need to check if
// the command exists and emit an "error" instead
// See https://github.com/IndigoUnited/node-cross-spawn/issues/16
if (name === "exit") {
const err = $948d4846584ad699$var$verifyENOENT(arg1, parsed, "spawn");
if (err) return originalEmit.call(cp, "error", err);
}
return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
};
}
function $948d4846584ad699$var$verifyENOENT(status, parsed) {
if ($948d4846584ad699$var$isWin && status === 1 && !parsed.file) return $948d4846584ad699$var$notFoundError(parsed.original, "spawn");
return null;
}
function $948d4846584ad699$var$verifyENOENTSync(status, parsed) {
if ($948d4846584ad699$var$isWin && status === 1 && !parsed.file) return $948d4846584ad699$var$notFoundError(parsed.original, "spawnSync");
return null;
}
$948d4846584ad699$exports = {
hookChildProcess: $948d4846584ad699$var$hookChildProcess,
verifyENOENT: $948d4846584ad699$var$verifyENOENT,
verifyENOENTSync: $948d4846584ad699$var$verifyENOENTSync,
notFoundError: $948d4846584ad699$var$notFoundError
};
function $daf72ea6e4bc8475$var$spawn(command, args, options) {
// Parse the arguments
const parsed = $c130c6d10fe44d87$exports(command, args, options);
// Spawn the child process
const spawned = $iIEVR$spawn(parsed.command, parsed.args, parsed.options);
// Hook into child process "exit" event to emit an error if the command
// does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
$948d4846584ad699$exports.hookChildProcess(spawned, parsed);
return spawned;
}
function $daf72ea6e4bc8475$var$spawnSync(command, args, options) {
// Parse the arguments
const parsed = $c130c6d10fe44d87$exports(command, args, options);
// Spawn the child process
const result = $iIEVR$spawnSync(parsed.command, parsed.args, parsed.options);
// Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
result.error = result.error || $948d4846584ad699$exports.verifyENOENTSync(result.status, parsed);
return result;
}
$daf72ea6e4bc8475$exports = $daf72ea6e4bc8475$var$spawn;
$daf72ea6e4bc8475$exports.spawn = $daf72ea6e4bc8475$var$spawn;
$daf72ea6e4bc8475$exports.sync = $daf72ea6e4bc8475$var$spawnSync;
$daf72ea6e4bc8475$exports._parse = $c130c6d10fe44d87$exports;
$daf72ea6e4bc8475$exports._enoent = $948d4846584ad699$exports;
function $11f7c326e148db82$export$2e2bcd8739ae039(input) {
const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
if (input[input.length - 1] === LF) input = input.slice(0, -1);
if (input[input.length - 1] === CR) input = input.slice(0, -1);
return input;
}
function $063e839e189620b0$export$2e2bcd8739ae039(options = {}) {
const { env: env = process.env, platform: platform = process.platform } = options;
if (platform !== "win32") return "PATH";
return Object.keys(env).reverse().find((key)=>key.toUpperCase() === "PATH") || "Path";
}
function $68ba7b3258eed759$export$62a298cbef08d65c(options = {}) {
const { cwd: cwd = (0, $iIEVR$nodeprocess).cwd(), path: path_ = (0, $iIEVR$nodeprocess).env[(0, $063e839e189620b0$export$2e2bcd8739ae039)()], execPath: execPath = (0, $iIEVR$nodeprocess).execPath } = options;
let previous;
const execPathString = execPath instanceof URL ? (0, $iIEVR$nodeurl).fileURLToPath(execPath) : execPath;
const cwdString = cwd instanceof URL ? (0, $iIEVR$nodeurl).fileURLToPath(cwd) : cwd;
let cwdPath = (0, $iIEVR$nodepath).resolve(cwdString);
const result = [];
while(previous !== cwdPath){
result.push((0, $iIEVR$nodepath).join(cwdPath, "node_modules/.bin"));
previous = cwdPath;
cwdPath = (0, $iIEVR$nodepath).resolve(cwdPath, "..");
}
// Ensure the running `node` binary is used.
result.push((0, $iIEVR$nodepath).resolve(cwdString, execPathString, ".."));
return [
...result,
path_
].join((0, $iIEVR$nodepath).delimiter);
}
function $68ba7b3258eed759$export$340e1fbaac04248b({ env: env = (0, $iIEVR$nodeprocess).env, ...options } = {}) {
env = {
...env
};
const path = (0, $063e839e189620b0$export$2e2bcd8739ae039)({
env: env
});
options.path = env[path];
env[path] = $68ba7b3258eed759$export$62a298cbef08d65c(options);
return env;
}
const $57c034a0dbbfd310$var$copyProperty = (to, from, property, ignoreNonConfigurable)=>{
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === "length" || property === "prototype") return;
// `Function#arguments` and `Function#caller` should not be copied. They were reported to be present in `Reflect.ownKeys` for some devices in React Native (#41), so we explicitly ignore them here.
if (property === "arguments" || property === "caller") return;
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!$57c034a0dbbfd310$var$canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) return;
Object.defineProperty(to, property, fromDescriptor);
};
// `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const $57c034a0dbbfd310$var$canCopyProperty = function(toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const $57c034a0dbbfd310$var$changePrototype = (to, from)=>{
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) return;
Object.setPrototypeOf(to, fromPrototype);
};
const $57c034a0dbbfd310$var$wrappedToString = (withName, fromBody)=>`/* Wrapped ${withName}*/\n${fromBody}`;
const $57c034a0dbbfd310$var$toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
const $57c034a0dbbfd310$var$toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
// We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected.
// We use `bind()` instead of a closure for the same reason.
// Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times.
const $57c034a0dbbfd310$var$changeToString = (to, from, name)=>{
const withName = name === "" ? "" : `with ${name.trim()}() `;
const newToString = $57c034a0dbbfd310$var$wrappedToString.bind(null, withName, from.toString());
// Ensure `to.toString.toString` is non-enumerable and has the same `same`
Object.defineProperty(newToString, "name", $57c034a0dbbfd310$var$toStringName);
Object.defineProperty(to, "toString", {
...$57c034a0dbbfd310$var$toStringDescriptor,
value: newToString
});
};
function $57c034a0dbbfd310$export$2e2bcd8739ae039(to, from, { ignoreNonConfigurable: ignoreNonConfigurable = false } = {}) {
const { name: name } = to;
for (const property of Reflect.ownKeys(from))$57c034a0dbbfd310$var$copyProperty(to, from, property, ignoreNonConfigurable);
$57c034a0dbbfd310$var$changePrototype(to, from);
$57c034a0dbbfd310$var$changeToString(to, from, name);
return to;
}
const $8f2127b429579d4b$var$calledFunctions = new WeakMap();
const $8f2127b429579d4b$var$onetime = (function_, options = {})=>{
if (typeof function_ !== "function") throw new TypeError("Expected a function");
let returnValue;
let callCount = 0;
const functionName = function_.displayName || function_.name || "<anonymous>";
const onetime = function(...arguments_) {
$8f2127b429579d4b$var$calledFunctions.set(onetime, ++callCount);
if (callCount === 1) {
returnValue = function_.apply(this, arguments_);
function_ = null;
} else if (options.throw === true) throw new Error(`Function \`${functionName}\` can only be called once`);
return returnValue;
};
(0, $57c034a0dbbfd310$export$2e2bcd8739ae039)(onetime, function_);
$8f2127b429579d4b$var$calledFunctions.set(onetime, callCount);
return onetime;
};
$8f2127b429579d4b$var$onetime.callCount = (function_)=>{
if (!$8f2127b429579d4b$var$calledFunctions.has(function_)) throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
return $8f2127b429579d4b$var$calledFunctions.get(function_);
};
var $8f2127b429579d4b$export$2e2bcd8739ae039 = $8f2127b429579d4b$var$onetime;
const $80e7969f4cf1b9d6$export$e221a98f4fd84d36 = ()=>{
const length = $80e7969f4cf1b9d6$export$dc8812f2f8882ff4 - $80e7969f4cf1b9d6$var$SIGRTMIN + 1;
return Array.from({
length: length
}, $80e7969f4cf1b9d6$var$getRealtimeSignal);
};
const $80e7969f4cf1b9d6$var$getRealtimeSignal = (value, index)=>({
name: `SIGRT${index + 1}`,
number: $80e7969f4cf1b9d6$var$SIGRTMIN + index,
action: "terminate",
description: "Application-specific signal (realtime)",
standard: "posix"
});
const $80e7969f4cf1b9d6$var$SIGRTMIN = 34;
const $80e7969f4cf1b9d6$export$dc8812f2f8882ff4 = 64;
const $58ec265091710a29$export$a43bf6822cc694af = [
{
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"
}
];
const $07e9a8b7cfb3428a$export$c50078d4faa171f0 = ()=>{
const realtimeSignals = (0, $80e7969f4cf1b9d6$export$e221a98f4fd84d36)();
const signals = [
...(0, $58ec265091710a29$export$a43bf6822cc694af),
...realtimeSignals
].map($07e9a8b7cfb3428a$var$normalizeSignal);
return signals;
};
const $07e9a8b7cfb3428a$var$normalizeSignal = ({ name: name, number: defaultNumber, description: description, action: action, forced: forced = false, standard: standard })=>{
const { signals: { [name]: constantSignal } } = (0, $iIEVR$constants);
const supported = constantSignal !== undefined;
const number = supported ? constantSignal : defaultNumber;
return {
name: name,
number: number,
description: description,
supported: supported,
action: action,
forced: forced,
standard: standard
};
};
const $166426e5b830937c$var$getSignalsByName = ()=>{
const signals = (0, $07e9a8b7cfb3428a$export$c50078d4faa171f0)();
return Object.fromEntries(signals.map($166426e5b830937c$var$getSignalByName));
};
const $166426e5b830937c$var$getSignalByName = ({ name: name, number: number, description: description, supported: supported, action: action, forced: forced, standard: standard })=>[
name,
{
name: name,
number: number,
description: description,
supported: supported,
action: action,
forced: forced,
standard: standard
}
];
const $166426e5b830937c$export$c3fcb39d6848c78d = $166426e5b830937c$var$getSignalsByName();
const $166426e5b830937c$var$getSignalsByNumber = ()=>{
c