@vpalmisano/throttler 0.0.14 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/src/app.js CHANGED
@@ -34,6 +34,7 @@ ${(0, word_wrap_1.default)(value.doc, { width: 72, indent: ' ' })}
34
34
  }
35
35
  async function main() {
36
36
  showHelpOrVersion();
37
+ (0, utils_1.handleExitSignals)();
37
38
  const config = (0, config_1.loadConfig)(process.argv[2]);
38
39
  const pids = new Set();
39
40
  await (0, throttle_1.startThrottle)(config.throttleConfig);
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/app.ts"],"names":[],"mappings":";;;;;AAAA,6CAAuC;AACvC,iDAAqC;AACrC,4CAAmB;AACnB,kDAAyB;AACzB,0DAA4B;AAE5B,qCAAoD;AACpD,yCAKmB;AACnB,mCAKgB;AAEhB,MAAM,GAAG,GAAG,IAAA,cAAM,EAAC,WAAW,CAAC,CAAA;AAE/B,SAAS,iBAAiB;IACxB,IAAI,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,GAAG,IAAA,sBAAa,GAAE,CAAA;QAC5B,IAAI,GAAG,GAAG,+DAA+D,CAAA;QACzE,8DAA8D;QAC9D,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAgB,EAAE,EAAE;YAC5D,GAAG,IAAI,OAAO,IAAA,uBAAS,EAAC,IAAI,CAAC;EACjC,IAAA,mBAAI,EAAC,KAAK,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;mBACjC,KAAK,CAAC,OAAO,IAAI,CAAA;QAChC,CAAC,CAAC,CA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MAAM,CAAC,WAAW,GAAG,CAAC,EAAE,CAAC;QAC3B,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAC7C,CAAC;IAED,0BAA0B;IAC1B,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAA;IAC9C,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;IAC9B,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,CAAA;IACtB,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,EAAC,IAAI,EAAC,EAAE;QACpC,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;QAC7B,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;YAClC,IAAI,CAAC;gBACH,MAAM,IAAI,EAAE,CAAA;YACd,CAAC;YAAC,OAAO,GAAY,EAAE,CAAC;gBACtB,GAAG,CAAC,KAAK,CAAC,eAAgB,GAAa,CAAC,KAAK,EAAE,CAAC,CAAA;gBAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACjB,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAA;QAChD,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QACjB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;IAClB,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { paramCase } from 'change-case'\nimport { spawn } from 'child_process'\nimport fs from 'fs'\nimport json5 from 'json5'\nimport wrap from 'word-wrap'\n\nimport { getConfigDocs, loadConfig } from './config'\nimport {\n getSessionThrottleIndex,\n startThrottle,\n stopThrottle,\n throttleLauncher,\n} from './throttle'\nimport {\n getProcessChildren,\n logger,\n registerExitHandler,\n resolvePackagePath,\n} from './utils'\n\nconst log = logger('throttler')\n\nfunction showHelpOrVersion(): void {\n if (process.argv.findIndex(a => a.localeCompare('--help') === 0) !== -1) {\n const docs = getConfigDocs()\n let out = `Params:\\n --version\\n It shows the package version.\\n`\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Object.entries(docs).forEach(([name, value]: [string, any]) => {\n out += ` --${paramCase(name)}\n${wrap(value.doc, { width: 72, indent: ' ' })}\n Default: ${value.default}\\n`\n })\n console.log(out)\n process.exit(0)\n } else if (\n process.argv.findIndex(a => a.localeCompare('--version') === 0) !== -1\n ) {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const version = json5.parse(\n fs.readFileSync(resolvePackagePath('package.json')).toString(),\n ).version\n console.log(version)\n process.exit(0)\n }\n}\n\ntype Command = {\n command: string\n session?: number\n}\n\nasync function main(): Promise<void> {\n showHelpOrVersion()\n\n const config = loadConfig(process.argv[2])\n const pids = new Set<number>()\n\n await startThrottle(config.throttleConfig)\n\n const stop = async (): Promise<void> => {\n log.info('Stopping...')\n for (const pid of pids) {\n const childPids = await getProcessChildren(pid)\n log.debug(`Killing process ${pid} and children: ${childPids}`)\n try {\n process.kill(pid, 'SIGKILL')\n } catch (err: unknown) {\n log.debug(`Error killing process ${pid}: ${(err as Error).stack}`)\n }\n for (const childPid of childPids) {\n try {\n process.kill(childPid, 'SIGKILL')\n } catch (err: unknown) {\n log.debug(\n `Error killing child process ${childPid}: ${(err as Error).stack}`,\n )\n }\n }\n }\n await stopThrottle()\n process.exit(0)\n }\n registerExitHandler(() => stop())\n\n const commands = config.commandConfig\n ? (json5.parse(config.commandConfig) as Command[])\n : []\n for (const c of commands) {\n const { session, command } = c\n const shortName = command.split(' ')[0]\n const index = getSessionThrottleIndex(session || 0)\n const launcher = await throttleLauncher(command, index)\n try {\n const proc = spawn(launcher, {\n shell: false,\n stdio: ['ignore', 'pipe', 'pipe'],\n detached: false,\n })\n if (proc.pid) pids.add(proc.pid)\n proc.stdout.on('data', data => {\n log.info(`[${shortName}][stdout]`, data.toString().trim())\n })\n proc.stderr.on('data', data => {\n log.info(`[${shortName}][stderr]`, data.toString().trim())\n })\n proc.on('error', err => {\n if (err.message.startsWith('The operation was aborted')) return\n log.error(`Error running command \"${command}\": ${(err as Error).stack}`)\n })\n proc.once('exit', code => {\n log.info(`Command \"${command}\" exited with code: ${code || 0}`)\n if (proc.pid) pids.delete(proc.pid)\n /* fs.promises.unlink(launcher).catch(err => {\n log.warn(`Error unlinking \"${launcher}\": ${(err as Error).stack}`)\n }) */\n })\n } catch (err: unknown) {\n log.error(`Error running command \"${command}\": ${(err as Error).stack}`)\n }\n }\n\n // Stop after a configured duration.\n if (config.runDuration > 0) {\n setTimeout(stop, config.runDuration * 1000)\n }\n\n // Command line interface.\n console.log('Press [q] to stop the throttler')\n process.stdin.setRawMode(true)\n process.stdin.resume()\n process.stdin.on('data', async data => {\n log.debug('[stdin]', data[0])\n if (data[0] === 'q'.charCodeAt(0)) {\n try {\n await stop()\n } catch (err: unknown) {\n log.error(`stop error: ${(err as Error).stack}`)\n process.exit(1)\n }\n } else {\n console.log('Press [q] to stop the throttler')\n }\n })\n}\n\nif (require.main === module) {\n main().catch(err => {\n console.error(err)\n process.exit(-1)\n })\n}\n"]}
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/app.ts"],"names":[],"mappings":";;;;;AAAA,6CAAuC;AACvC,iDAAqC;AACrC,4CAAmB;AACnB,kDAAyB;AACzB,0DAA4B;AAE5B,qCAAoD;AACpD,yCAKmB;AACnB,mCAMgB;AAEhB,MAAM,GAAG,GAAG,IAAA,cAAM,EAAC,WAAW,CAAC,CAAA;AAE/B,SAAS,iBAAiB;IACxB,IAAI,OAAO,CAAC,IAAI,CAA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AE,CAAC;gBACtB,GAAG,CAAC,KAAK,CAAC,eAAgB,GAAa,CAAC,KAAK,EAAE,CAAC,CAAA;gBAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACjB,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAA;QAChD,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QACjB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;IAClB,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { paramCase } from 'change-case'\nimport { spawn } from 'child_process'\nimport fs from 'fs'\nimport json5 from 'json5'\nimport wrap from 'word-wrap'\n\nimport { getConfigDocs, loadConfig } from './config'\nimport {\n getSessionThrottleIndex,\n startThrottle,\n stopThrottle,\n throttleLauncher,\n} from './throttle'\nimport {\n getProcessChildren,\n handleExitSignals,\n logger,\n registerExitHandler,\n resolvePackagePath,\n} from './utils'\n\nconst log = logger('throttler')\n\nfunction showHelpOrVersion(): void {\n if (process.argv.findIndex(a => a.localeCompare('--help') === 0) !== -1) {\n const docs = getConfigDocs()\n let out = `Params:\\n --version\\n It shows the package version.\\n`\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Object.entries(docs).forEach(([name, value]: [string, any]) => {\n out += ` --${paramCase(name)}\n${wrap(value.doc, { width: 72, indent: ' ' })}\n Default: ${value.default}\\n`\n })\n console.log(out)\n process.exit(0)\n } else if (\n process.argv.findIndex(a => a.localeCompare('--version') === 0) !== -1\n ) {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const version = json5.parse(\n fs.readFileSync(resolvePackagePath('package.json')).toString(),\n ).version\n console.log(version)\n process.exit(0)\n }\n}\n\ntype Command = {\n command: string\n session?: number\n}\n\nasync function main(): Promise<void> {\n showHelpOrVersion()\n handleExitSignals()\n\n const config = loadConfig(process.argv[2])\n const pids = new Set<number>()\n\n await startThrottle(config.throttleConfig)\n\n const stop = async (): Promise<void> => {\n log.info('Stopping...')\n for (const pid of pids) {\n const childPids = await getProcessChildren(pid)\n log.debug(`Killing process ${pid} and children: ${childPids}`)\n try {\n process.kill(pid, 'SIGKILL')\n } catch (err: unknown) {\n log.debug(`Error killing process ${pid}: ${(err as Error).stack}`)\n }\n for (const childPid of childPids) {\n try {\n process.kill(childPid, 'SIGKILL')\n } catch (err: unknown) {\n log.debug(\n `Error killing child process ${childPid}: ${(err as Error).stack}`,\n )\n }\n }\n }\n await stopThrottle()\n process.exit(0)\n }\n registerExitHandler(() => stop())\n\n const commands = config.commandConfig\n ? (json5.parse(config.commandConfig) as Command[])\n : []\n for (const c of commands) {\n const { session, command } = c\n const shortName = command.split(' ')[0]\n const index = getSessionThrottleIndex(session || 0)\n const launcher = await throttleLauncher(command, index)\n try {\n const proc = spawn(launcher, {\n shell: false,\n stdio: ['ignore', 'pipe', 'pipe'],\n detached: false,\n })\n if (proc.pid) pids.add(proc.pid)\n proc.stdout.on('data', data => {\n log.info(`[${shortName}][stdout]`, data.toString().trim())\n })\n proc.stderr.on('data', data => {\n log.info(`[${shortName}][stderr]`, data.toString().trim())\n })\n proc.on('error', err => {\n if (err.message.startsWith('The operation was aborted')) return\n log.error(`Error running command \"${command}\": ${(err as Error).stack}`)\n })\n proc.once('exit', code => {\n log.info(`Command \"${command}\" exited with code: ${code || 0}`)\n if (proc.pid) pids.delete(proc.pid)\n /* fs.promises.unlink(launcher).catch(err => {\n log.warn(`Error unlinking \"${launcher}\": ${(err as Error).stack}`)\n }) */\n })\n } catch (err: unknown) {\n log.error(`Error running command \"${command}\": ${(err as Error).stack}`)\n }\n }\n\n // Stop after a configured duration.\n if (config.runDuration > 0) {\n setTimeout(stop, config.runDuration * 1000)\n }\n\n // Command line interface.\n console.log('Press [q] to stop the throttler')\n process.stdin.setRawMode(true)\n process.stdin.resume()\n process.stdin.on('data', async data => {\n log.debug('[stdin]', data[0])\n if (data[0] === 'q'.charCodeAt(0)) {\n try {\n await stop()\n } catch (err: unknown) {\n log.error(`stop error: ${(err as Error).stack}`)\n process.exit(1)\n }\n } else {\n console.log('Press [q] to stop the throttler')\n }\n })\n}\n\nif (require.main === module) {\n main().catch(err => {\n console.error(err)\n process.exit(-1)\n })\n}\n"]}
@@ -53,5 +53,6 @@ export declare function unregisterExitHandler(exitHandler: ExitHandler): void;
53
53
  * @param signal The process exit signal.
54
54
  */
55
55
  export declare function runExitHandlersNow(signal?: string): Promise<void>;
56
+ export declare function handleExitSignals(): void;
56
57
  export declare function getProcessChildren(pid: number): Promise<number[]>;
57
58
  export {};
@@ -13,6 +13,7 @@ exports.runShellCommand = runShellCommand;
13
13
  exports.registerExitHandler = registerExitHandler;
14
14
  exports.unregisterExitHandler = unregisterExitHandler;
15
15
  exports.runExitHandlersNow = runExitHandlersNow;
16
+ exports.handleExitSignals = handleExitSignals;
16
17
  exports.getProcessChildren = getProcessChildren;
17
18
  const child_process_1 = require("child_process");
18
19
  const fs_1 = __importDefault(require("fs"));
@@ -189,17 +190,19 @@ const SIGNALS = [
189
190
  'SIGUSR2',
190
191
  'SIGTERM',
191
192
  ];
192
- process.setMaxListeners(process.getMaxListeners() + SIGNALS.length);
193
- SIGNALS.forEach(event => process.once(event, async (signal) => {
194
- if (signal instanceof Error) {
195
- log.error(`Exit on error: ${signal.stack || signal.message}`);
196
- }
197
- else {
198
- log.debug(`Exit on signal: ${signal}`);
199
- }
200
- await runExitHandlersNow(signal);
201
- process.exit(0);
202
- }));
193
+ function handleExitSignals() {
194
+ process.setMaxListeners(process.getMaxListeners() + SIGNALS.length);
195
+ SIGNALS.forEach(event => process.once(event, async (signal) => {
196
+ if (signal instanceof Error) {
197
+ log.error(`Exit on error: ${signal.stack || signal.message}`);
198
+ }
199
+ else {
200
+ log.debug(`Exit on signal: ${signal}`);
201
+ }
202
+ await runExitHandlersNow(signal);
203
+ process.exit(0);
204
+ }));
205
+ }
203
206
  async function getProcessChildren(pid) {
204
207
  log.debug(`getProcessChildren pid=${pid}`);
205
208
  const pids = [];
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;;;;AAgBA,wBAEC;AA4CD,gDAcC;AAOD,kCAIC;AAED,gEAMC;AAED,sDAGC;AAGD,0CAwCC;AAYD,kDAEC;AAMD,sDAEC;AAwBD,gDAKC;AAgCD,gDAwBC;AA1PD,iDAAqC;AACrC,4CAAmB;AACnB,4CAAmB;AACnB,gDAAuB;AAEvB,8DAA8D;AAC/C,WAAG,GAAK,OAAO,CAAC,aAAa,CAAC,KAAA;AAU7C,SAAgB,MAAM,CAAC,IAAY,EAAE,OAAO,GAAG,EAAE;IAC/C,OAAO,IAAI,WAAG,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;AACxD,CAAC;AAED,MAAa,eAAe;IAC1B,IAAI,CAAS;IAEL,OAAO,CAAC,IAAe;QAC7B,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,CAAA;QAChC,CAAC;IACH,CAAC;IAED,KAAK,CAAC,GAAG,IAAe;QACtB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAClB,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAA;IACpB,CAAC;IAED,IAAI,CAAC,GAAG,IAAe;QACrB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAClB,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAA;IACnB,CAAC;IAED,IAAI,CAAC,GAAG,IAAe;QACrB,IAAI,CAAC,OAAO,CAAC,IA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sourcesContent":["import { spawn } from 'child_process'\nimport fs from 'fs'\nimport os from 'os'\nimport path from 'path'\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nexport const { Log } = require('debug-level')\n\ntype Logger = {\n error: (...args: unknown[]) => void\n warn: (...args: unknown[]) => void\n info: (...args: unknown[]) => void\n debug: (...args: unknown[]) => void\n log: (...args: unknown[]) => void\n}\n\nexport function logger(name: string, options = {}): Logger {\n return new Log(name, { splitLine: false, ...options })\n}\n\nexport class LoggerInterface {\n name?: string\n\n private logInit(args: unknown[]): void {\n if (this.name) {\n args.unshift(`[${this.name}]`)\n }\n }\n\n debug(...args: unknown[]): void {\n this.logInit(args)\n log.debug(...args)\n }\n\n info(...args: unknown[]): void {\n this.logInit(args)\n log.info(...args)\n }\n\n warn(...args: unknown[]): void {\n this.logInit(args)\n log.warn(...args)\n }\n\n error(...args: unknown[]): void {\n this.logInit(args)\n log.error(...args)\n }\n\n log(...args: unknown[]): void {\n this.logInit(args)\n log.log(...args)\n }\n}\n\nconst log = logger('webrtcperf:utils')\n\n/**\n * Resolves the absolute path from the package installation directory.\n * @param relativePath The relative path.\n * @returns The absolute path.\n */\nexport function resolvePackagePath(relativePath: string): string {\n if ('__nexe' in process) {\n return relativePath\n }\n if (process.env.WEBPACK) {\n return path.join(path.dirname(__filename), relativePath)\n }\n for (const d of ['..', '../..']) {\n const p = path.join(__dirname, d, relativePath)\n if (fs.existsSync(p)) {\n return require.resolve(p)\n }\n }\n throw new Error(`resolvePackagePath: ${relativePath} not found`)\n}\n\n/**\n * Format number to the specified precision.\n * @param value value to format\n * @param precision precision\n */\nexport function toPrecision(value: number, precision = 3): string {\n return (Math.round(value * 10 ** precision) / 10 ** precision).toFixed(\n precision,\n )\n}\n\nexport async function getDefaultNetworkInterface(): Promise<string> {\n if (os.platform() !== 'linux') return 'lo'\n const { stdout } = await runShellCommand(\n `ip route | awk '/default/ {print $5; exit}' | tr -d ''`,\n )\n return stdout.trim()\n}\n\nexport async function checkNetworkInterface(device: string): Promise<void> {\n if (device === 'lo') return\n await runShellCommand(`ip route | grep -q \"dev ${device}\"`)\n}\n\n/** Runs the shell command asynchronously. */\nexport async function runShellCommand(\n cmd: string,\n verbose = false,\n): Promise<{ stdout: string; stderr: string }> {\n if (verbose) log.debug(`runShellCommand cmd: ${cmd}`)\n return new Promise((resolve, reject) => {\n const p = spawn(cmd, {\n shell: true,\n stdio: ['ignore', 'pipe', 'pipe'],\n detached: true,\n })\n let stdout = ''\n let stderr = ''\n p.stdout.on('data', data => {\n if (stdout.length > 512 * 1024) {\n stdout = stdout.slice(data.length)\n }\n stdout += data\n })\n p.stderr.on('data', data => {\n if (stderr.length > 512 * 1024) {\n stderr = stderr.slice(data.length)\n }\n stderr += data\n })\n p.once('error', err => reject(err))\n p.once('close', code => {\n if (code !== 0) {\n reject(\n new Error(\n `runShellCommand cmd: ${cmd} failed with code ${code}: ${stderr}`,\n ),\n )\n } else {\n if (verbose)\n log.debug(`runShellCommand cmd: ${cmd} done`, { stdout, stderr })\n resolve({ stdout, stderr })\n }\n })\n })\n}\n\n/** Exit handler callback. */\nexport type ExitHandler = (signal?: string) => Promise<void>\n\nconst exitHandlers = new Set<ExitHandler>()\n\n/**\n * Register an {@link ExitHandler} callback that will be executed at the\n * nodejs process exit.\n * @param exitHandler\n */\nexport function registerExitHandler(exitHandler: ExitHandler): void {\n exitHandlers.add(exitHandler)\n}\n\n/**\n * Un-registers the {@link ExitHandler} callback.\n * @param exitHandler\n */\nexport function unregisterExitHandler(exitHandler: ExitHandler): void {\n exitHandlers.delete(exitHandler)\n}\n\nconst runExitHandlers = async (signal?: string): Promise<void> => {\n let i = 0\n for (const exitHandler of exitHandlers.values()) {\n const id = `${i + 1}/${exitHandlers.size}`\n log.debug(`running exitHandler ${id}`)\n try {\n await exitHandler(signal)\n log.debug(` exitHandler ${id} done`)\n } catch (err) {\n log.error(`exitHandler ${id} error: ${err}`)\n }\n i++\n }\n exitHandlers.clear()\n}\n\nlet runExitHandlersPromise: Promise<void> | null = null\n\n/**\n * Runs the registered exit handlers immediately.\n * @param signal The process exit signal.\n */\nexport async function runExitHandlersNow(signal?: string): Promise<void> {\n if (!runExitHandlersPromise) {\n runExitHandlersPromise = runExitHandlers(signal)\n }\n await runExitHandlersPromise\n}\n\nconst SIGNALS = [\n 'beforeExit',\n 'uncaughtException',\n 'unhandledRejection',\n 'SIGHUP',\n 'SIGINT',\n 'SIGQUIT',\n 'SIGILL',\n 'SIGTRAP',\n 'SIGABRT',\n 'SIGBUS',\n 'SIGFPE',\n 'SIGUSR1',\n 'SIGSEGV',\n 'SIGUSR2',\n 'SIGTERM',\n]\nprocess.setMaxListeners(process.getMaxListeners() + SIGNALS.length)\nSIGNALS.forEach(event =>\n process.once(event, async signal => {\n if (signal instanceof Error) {\n log.error(`Exit on error: ${signal.stack || signal.message}`)\n } else {\n log.debug(`Exit on signal: ${signal}`)\n }\n await runExitHandlersNow(signal)\n process.exit(0)\n }),\n)\n\nexport async function getProcessChildren(pid: number): Promise<number[]> {\n log.debug(`getProcessChildren pid=${pid}`)\n const pids = []\n try {\n const p = await runShellCommand(`pgrep -P ${pid}`)\n for (const pid of p.stdout.trim().split('\\n').map(Number)) {\n pids.push(pid)\n try {\n const childPids = await getProcessChildren(pid)\n for (const p of childPids) {\n pids.push(p)\n }\n } catch (err) {\n log.debug(\n `Error getting process ${pid} children: ${(err as Error).message}`,\n )\n }\n }\n } catch (err) {\n log.debug(\n `Error getting process ${pid} children: ${(err as Error).message}`,\n )\n }\n return pids\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;;;;AAgBA,wBAEC;AA4CD,gDAcC;AAOD,kCAIC;AAED,gEAMC;AAED,sDAGC;AAGD,0CAwCC;AAYD,kDAEC;AAMD,sDAEC;AAwBD,gDAKC;AAoBD,8CAaC;AAED,gDAwBC;AA7PD,iDAAqC;AACrC,4CAAmB;AACnB,4CAAmB;AACnB,gDAAuB;AAEvB,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AAI,GAAG,EAAE,CAAA;IACf,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,MAAM,eAAe,CAAC,YAAY,GAAG,EAAE,CAAC,CAAA;QAClD,KAAK,MAAM,GAAG,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACd,IAAI,CAAC;gBACH,MAAM,SAAS,GAAG,MAAM,kBAAkB,CAAC,GAAG,CAAC,CAAA;gBAC/C,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE,CAAC;oBAC1B,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;gBACd,CAAC;YACH,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,GAAG,CAAC,KAAK,CACP,yBAAyB,GAAG,cAAe,GAAa,CAAC,OAAO,EAAE,CACnE,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,KAAK,CACP,yBAAyB,GAAG,cAAe,GAAa,CAAC,OAAO,EAAE,CACnE,CAAA;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { spawn } from 'child_process'\nimport fs from 'fs'\nimport os from 'os'\nimport path from 'path'\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nexport const { Log } = require('debug-level')\n\ntype Logger = {\n error: (...args: unknown[]) => void\n warn: (...args: unknown[]) => void\n info: (...args: unknown[]) => void\n debug: (...args: unknown[]) => void\n log: (...args: unknown[]) => void\n}\n\nexport function logger(name: string, options = {}): Logger {\n return new Log(name, { splitLine: false, ...options })\n}\n\nexport class LoggerInterface {\n name?: string\n\n private logInit(args: unknown[]): void {\n if (this.name) {\n args.unshift(`[${this.name}]`)\n }\n }\n\n debug(...args: unknown[]): void {\n this.logInit(args)\n log.debug(...args)\n }\n\n info(...args: unknown[]): void {\n this.logInit(args)\n log.info(...args)\n }\n\n warn(...args: unknown[]): void {\n this.logInit(args)\n log.warn(...args)\n }\n\n error(...args: unknown[]): void {\n this.logInit(args)\n log.error(...args)\n }\n\n log(...args: unknown[]): void {\n this.logInit(args)\n log.log(...args)\n }\n}\n\nconst log = logger('webrtcperf:utils')\n\n/**\n * Resolves the absolute path from the package installation directory.\n * @param relativePath The relative path.\n * @returns The absolute path.\n */\nexport function resolvePackagePath(relativePath: string): string {\n if ('__nexe' in process) {\n return relativePath\n }\n if (process.env.WEBPACK) {\n return path.join(path.dirname(__filename), relativePath)\n }\n for (const d of ['..', '../..']) {\n const p = path.join(__dirname, d, relativePath)\n if (fs.existsSync(p)) {\n return require.resolve(p)\n }\n }\n throw new Error(`resolvePackagePath: ${relativePath} not found`)\n}\n\n/**\n * Format number to the specified precision.\n * @param value value to format\n * @param precision precision\n */\nexport function toPrecision(value: number, precision = 3): string {\n return (Math.round(value * 10 ** precision) / 10 ** precision).toFixed(\n precision,\n )\n}\n\nexport async function getDefaultNetworkInterface(): Promise<string> {\n if (os.platform() !== 'linux') return 'lo'\n const { stdout } = await runShellCommand(\n `ip route | awk '/default/ {print $5; exit}' | tr -d ''`,\n )\n return stdout.trim()\n}\n\nexport async function checkNetworkInterface(device: string): Promise<void> {\n if (device === 'lo') return\n await runShellCommand(`ip route | grep -q \"dev ${device}\"`)\n}\n\n/** Runs the shell command asynchronously. */\nexport async function runShellCommand(\n cmd: string,\n verbose = false,\n): Promise<{ stdout: string; stderr: string }> {\n if (verbose) log.debug(`runShellCommand cmd: ${cmd}`)\n return new Promise((resolve, reject) => {\n const p = spawn(cmd, {\n shell: true,\n stdio: ['ignore', 'pipe', 'pipe'],\n detached: true,\n })\n let stdout = ''\n let stderr = ''\n p.stdout.on('data', data => {\n if (stdout.length > 512 * 1024) {\n stdout = stdout.slice(data.length)\n }\n stdout += data\n })\n p.stderr.on('data', data => {\n if (stderr.length > 512 * 1024) {\n stderr = stderr.slice(data.length)\n }\n stderr += data\n })\n p.once('error', err => reject(err))\n p.once('close', code => {\n if (code !== 0) {\n reject(\n new Error(\n `runShellCommand cmd: ${cmd} failed with code ${code}: ${stderr}`,\n ),\n )\n } else {\n if (verbose)\n log.debug(`runShellCommand cmd: ${cmd} done`, { stdout, stderr })\n resolve({ stdout, stderr })\n }\n })\n })\n}\n\n/** Exit handler callback. */\nexport type ExitHandler = (signal?: string) => Promise<void>\n\nconst exitHandlers = new Set<ExitHandler>()\n\n/**\n * Register an {@link ExitHandler} callback that will be executed at the\n * nodejs process exit.\n * @param exitHandler\n */\nexport function registerExitHandler(exitHandler: ExitHandler): void {\n exitHandlers.add(exitHandler)\n}\n\n/**\n * Un-registers the {@link ExitHandler} callback.\n * @param exitHandler\n */\nexport function unregisterExitHandler(exitHandler: ExitHandler): void {\n exitHandlers.delete(exitHandler)\n}\n\nconst runExitHandlers = async (signal?: string): Promise<void> => {\n let i = 0\n for (const exitHandler of exitHandlers.values()) {\n const id = `${i + 1}/${exitHandlers.size}`\n log.debug(`running exitHandler ${id}`)\n try {\n await exitHandler(signal)\n log.debug(` exitHandler ${id} done`)\n } catch (err) {\n log.error(`exitHandler ${id} error: ${err}`)\n }\n i++\n }\n exitHandlers.clear()\n}\n\nlet runExitHandlersPromise: Promise<void> | null = null\n\n/**\n * Runs the registered exit handlers immediately.\n * @param signal The process exit signal.\n */\nexport async function runExitHandlersNow(signal?: string): Promise<void> {\n if (!runExitHandlersPromise) {\n runExitHandlersPromise = runExitHandlers(signal)\n }\n await runExitHandlersPromise\n}\n\nconst SIGNALS = [\n 'beforeExit',\n 'uncaughtException',\n 'unhandledRejection',\n 'SIGHUP',\n 'SIGINT',\n 'SIGQUIT',\n 'SIGILL',\n 'SIGTRAP',\n 'SIGABRT',\n 'SIGBUS',\n 'SIGFPE',\n 'SIGUSR1',\n 'SIGSEGV',\n 'SIGUSR2',\n 'SIGTERM',\n]\n\nexport function handleExitSignals(): void {\n process.setMaxListeners(process.getMaxListeners() + SIGNALS.length)\n SIGNALS.forEach(event =>\n process.once(event, async signal => {\n if (signal instanceof Error) {\n log.error(`Exit on error: ${signal.stack || signal.message}`)\n } else {\n log.debug(`Exit on signal: ${signal}`)\n }\n await runExitHandlersNow(signal)\n process.exit(0)\n }),\n )\n}\n\nexport async function getProcessChildren(pid: number): Promise<number[]> {\n log.debug(`getProcessChildren pid=${pid}`)\n const pids = []\n try {\n const p = await runShellCommand(`pgrep -P ${pid}`)\n for (const pid of p.stdout.trim().split('\\n').map(Number)) {\n pids.push(pid)\n try {\n const childPids = await getProcessChildren(pid)\n for (const p of childPids) {\n pids.push(p)\n }\n } catch (err) {\n log.debug(\n `Error getting process ${pid} children: ${(err as Error).message}`,\n )\n }\n }\n } catch (err) {\n log.debug(\n `Error getting process ${pid} children: ${(err as Error).message}`,\n )\n }\n return pids\n}\n"]}
@@ -1 +1 @@
1
- {"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/typescript/lib/lib.es2022.full.d.ts","../node_modules/no-case/dist/index.d.ts","../node_modules/pascal-case/dist/index.d.ts","../node_modules/camel-case/dist/index.d.ts","../node_modules/capital-case/dist/index.d.ts","../node_modules/constant-case/dist/index.d.ts","../node_modules/dot-case/dist/index.d.ts","../node_modules/header-case/dist/index.d.ts","../node_modules/param-case/dist/index.d.ts","../node_modules/path-case/dist/index.d.ts","../node_modules/sentence-case/dist/index.d.ts","../node_modules/snake-case/dist/index.d.ts","../node_modules/change-case/dist/index.d.ts","../node_modules/json5/lib/parse.d.ts","../node_modules/json5/lib/stringify.d.ts","../node_modules/json5/lib/index.d.ts","../node_modules/word-wrap/index.d.ts","../node_modules/@types/node/compatibility/disposable.d.ts","../node_modules/@types/node/compatibility/indexable.d.ts","../node_modules/@types/node/compatibility/iterators.d.ts","../node_modules/@types/node/compatibility/index.d.ts","../node_modules/@types/node/globals.typedarray.d.ts","../node_modules/@types/node/buffer.buffer.d.ts","../node_modules/buffer/index.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/env-http-proxy-agent.d.ts","../node_modules/undici-types/retry-handler.d.ts","../node_modules/undici-types/retry-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/util.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/eventsource.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/sea.d.ts","../node_modules/@types/node/sqlite.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/convict/index.d.ts","../node_modules/@types/convict-format-with-validator/index.d.ts","../src/utils.ts","../src/config.ts","../src/throttle.ts","../src/app.ts","../src/generate-config-docs.ts","../src/index.ts","../node_modules/@types/estree/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/eslint/use-at-your-own-risk.d.ts","../node_modules/@types/eslint/index.d.ts","../node_modules/@types/eslint-scope/index.d.ts","../node_modules/@types/unist/index.d.ts","../node_modules/@types/hast/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/normalize-package-data/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts"],"fileIdsList":[[85,128,179],[85,128,178],[85,128,187,190],[85,128,187,188,189],[85,128,190],[85,128],[85,128,192],[85,125,128],[85,127,128],[128],[85,128,133,163],[85,128,129,134,140,141,148,160,171],[85,128,129,130,140,148],[80,81,82,85,128],[85,128,131,172],[85,128,132,133,141,149],[85,128,133,160,168],[85,128,134,136,140,148],[85,127,128,135],[85,128,136,137],[85,128,140],[85,128,138,140],[85,127,128,140],[85,128,140,141,142,160,171],[85,128,140,141,142,155,160,163],[85,123,128,176],[85,123,128,136,140,143,148,160,171],[85,128,140,141,143,144,148,160,168,171],[85,128,143,145,160,168,171],[83,84,85,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177],[85,128,140,146],[85,128,147,171],[85,128,136,140,148,160],[85,128,149],[85,128,150],[85,127,128,151],[85,125,126,127,128,129,130,131,132,133,134,135,136,137,138,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177],[85,128,153],[85,128,154],[85,128,140,155,156],[85,128,155,157,172,174],[85,128,140,160,161,162,163],[85,128,160,162],[85,128,160,161],[85,128,163],[85,128,164],[85,125,128,160],[85,128,140,166,167],[85,128,166,167],[85,128,133,148,160,168],[85,128,169],[85,128,148,170],[85,128,143,154,171],[85,128,133,172],[85,128,160,173],[85,128,147,174],[85,128,175],[85,128,133,140,142,151,160,171,174,176],[85,128,160,177],[85,128,196,235],[85,128,196,220,235],[85,128,235],[85,128,196],[85,128,196,221,235],[85,128,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234],[85,128,221,235],[65,85,128],[64,85,128],[64,65,66,67,68,69,70,71,72,73,74,85,128],[67,85,128],[76,77,85,128],[69,85,128],[85,95,99,128,171],[85,95,128,160,171],[85,90,128],[85,92,95,128,168,171],[85,128,148,168],[85,90,128,178],[85,92,95,128,148,171],[85,87,88,91,94,128,140,160,171],[85,95,102,128],[85,87,93,128],[85,95,116,117,128],[85,91,95,128,163,171,178],[85,116,128,178],[85,89,90,128,178],[85,95,128],[85,89,90,91,92,93,94,95,96,97,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,117,118,119,120,121,122,128],[85,95,110,128],[85,95,102,103,128],[85,93,95,103,104,128],[85,94,128],[85,87,90,95,128],[85,95,99,103,104,128],[85,99,128],[85,93,95,98,128,171],[85,87,92,95,102,128],[85,128,160],[85,90,95,116,128,176,178],[75,78,79,85,128,129,141,181,182,183],[85,128,141,179,180,181],[85,128,142,182],[85,128,181,182,183,184],[78,85,128,129,140,141,149,181],[85,128,129,141,149,150]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2e80ee7a49e8ac312cc11b77f1475804bee36b3b2bc896bead8b6e1266befb43","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7a3c8b952931daebdfc7a2897c53c0a1c73624593fa070e46bd537e64dcd20a","affectsGlobalScope":true,"impliedFormat":1},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true,"impliedFormat":1},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"3cbad9a1ba4453443026ed38e4b8be018abb26565fa7c944376463ad9df07c41","impliedFormat":1},{"version":"b4e123af1af6049685c93073a15868b50aebdad666d422edc72fa2b585fa8a37","impliedFormat":1},{"version":"f86c04a744ebcede96bac376f9a2c90f2bd3c422740d91dda4ca6233199d4977","impliedFormat":1},{"version":"6ae1bddee5c790439bd992abd063b9b46e0cadd676c2a8562268d1869213ff60","impliedFormat":1},{"version":"606244fc97a6a74b877f2e924ba7e55b233bc6acb57d7bf40ba84a5be2d9adb0","impliedFormat":1},{"version":"4a1cabac71036b8a14f5db1b753b579f0c901c7d7b9227e6872dadf6efb104e8","impliedFormat":1},{"version":"062959a1d825b96639d87be35fe497cbd3f89544bf06fdad577bbfb85fcf604c","impliedFormat":1},{"version":"4c3672dc8f4e4fdd3d18525b22b31f1b5481f5a415db96550d3ac5163a6c3dd3","impliedFormat":1},{"version":"f9a69ca445010b91fe08f08c06e0f86d79c0d776905f9bdb828477cb2a1eb7fc","impliedFormat":1},{"version":"ad7fd0e7ee457d4884b3aaecbcbd2a80b6803407c4ce2540c296170d4c7918ef","impliedFormat":1},{"version":"a50ef21605f41c6acad6c3ef0307e5311b94963c846ca093c764b80cdb5318d6","impliedFormat":1},{"version":"74b4035dd26d09a417c44ca23ab5ee69b173f8c2f6b2e47350ab0795cf2d4a17","impliedFormat":1},{"version":"918f86ee2b19cc38cb8b1a4cf8f223eb228aaa39df3604c42f700fac2f0b3ea1","impliedFormat":1},{"version":"88a3a6f8c2a1640d8d5fd30d8d86462f8babd86a1e52fab0e8b7f7c141fb348e","impliedFormat":1},{"version":"345f76c854da724803c96f727a3f9c75e26cf95c6e7b8c1064dbc4e7727b74e6","impliedFormat":1},{"version":"ab7b7a15a5d73eb0cfc2b973e580f357f07492bff6608669d7e899e2d49ac9a3","impliedFormat":1},{"version":"14e27c8804ce2fe36fe1cfdbea2c0625cb97f4c20394fa9973567fb09cc03406","impliedFormat":1},{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true,"impliedFormat":1},{"version":"030e350db2525514580ed054f712ffb22d273e6bc7eddc1bb7eda1e0ba5d395e","affectsGlobalScope":true,"impliedFormat":1},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"a79e62f1e20467e11a904399b8b18b18c0c6eea6b50c1168bf215356d5bebfaf","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fd06258805d26c72f5997e07a23155d322d5f05387adb3744a791fe6a0b042d","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"d2bc987ae352271d0d615a420dcf98cc886aa16b87fb2b569358c1fe0ca0773d","affectsGlobalScope":true,"impliedFormat":1},{"version":"f52e8dacc97d71dcc96af29e49584353f9c54cb916d132e3e768d8b8129c928d","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"76103716ba397bbb61f9fa9c9090dca59f39f9047cb1352b2179c5d8e7f4e8d0","impliedFormat":1},{"version":"53eac70430b30089a3a1959d8306b0f9cfaf0de75224b68ef25243e0b5ad1ca3","affectsGlobalScope":true,"impliedFormat":1},{"version":"4314c7a11517e221f7296b46547dbc4df047115b182f544d072bdccffa57fc72","impliedFormat":1},{"version":"115971d64632ea4742b5b115fb64ed04bcaae2c3c342f13d9ba7e3f9ee39c4e7","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","impliedFormat":1},{"version":"86956cc2eb9dd371d6fab493d326a574afedebf76eef3fa7833b8e0d9b52d6f1","affectsGlobalScope":true,"impliedFormat":1},{"version":"91c1a729db5b28b2fc32bafa7a53611d417bc3f03f649278d4fd948aa4dec898","impliedFormat":1},{"version":"e6f5a38687bebe43a4cef426b69d34373ef68be9a6b1538ec0a371e69f309354","impliedFormat":1},{"version":"a6bf63d17324010ca1fbf0389cab83f93389bb0b9a01dc8a346d092f65b3605f","impliedFormat":1},{"version":"e009777bef4b023a999b2e5b9a136ff2cde37dc3f77c744a02840f05b18be8ff","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true,"impliedFormat":1},{"version":"88bc59b32d0d5b4e5d9632ac38edea23454057e643684c3c0b94511296f2998c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ff5a53a58e756d2661b73ba60ffe274231a4432d21f7a2d0d9e4f6aa99f4283","impliedFormat":1},{"version":"eaf9ee1d90a35d56264f0bf39842282c58b9219e112ac7d0c1bce98c6c5da672","impliedFormat":1},{"version":"c15c4427ae7fd1dcd7f312a8a447ac93581b0d4664ddf151ecd07de4bf2bb9d7","impliedFormat":1},{"version":"5135bdd72cc05a8192bd2e92f0914d7fc43ee077d1293dc622a049b7035a0afb","impliedFormat":1},{"version":"4f80de3a11c0d2f1329a72e92c7416b2f7eab14f67e92cac63bb4e8d01c6edc8","impliedFormat":1},{"version":"6d386bc0d7f3afa1d401afc3e00ed6b09205a354a9795196caed937494a713e6","impliedFormat":1},{"version":"c72ccc191348ac1933226cab7a814cfda8b29a827d1df5dbebfe516a6fd734a8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8bea55446a296d289fbc762f61954a0e3e38ffbcacc06e47e0cba491030e3235","impliedFormat":1},{"version":"b1b6ee0d012aeebe11d776a155d8979730440082797695fc8e2a5c326285678f","impliedFormat":1},{"version":"45875bcae57270aeb3ebc73a5e3fb4c7b9d91d6b045f107c1d8513c28ece71c0","impliedFormat":1},{"version":"3eb62baae4df08c9173e6903d3ca45942ccec8c3659b0565684a75f3292cffbb","affectsGlobalScope":true,"impliedFormat":1},{"version":"42aaa94addeed66a04b61e433c14e829c43d1efd653cf2fda480c5fb3d722ed8","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"c6b4e0a02545304935ecbf7de7a8e056a31bb50939b5b321c9d50a405b5a0bba","impliedFormat":1},{"version":"fab29e6d649aa074a6b91e3bdf2bff484934a46067f6ee97a30fcd9762ae2213","impliedFormat":1},{"version":"8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","impliedFormat":1},{"version":"e1120271ebbc9952fdc7b2dd3e145560e52e06956345e6fdf91d70ca4886464f","impliedFormat":1},{"version":"15c5e91b5f08be34a78e3d976179bf5b7a9cc28dc0ef1ffebffeb3c7812a2dca","impliedFormat":1},{"version":"d63ff33a2fa221b36a4da0dd5a3dad3156f3dd0fe1baf43a186e607d4ba5af99","impliedFormat":1},{"version":"553870e516f8c772b89f3820576152ebc70181d7994d96917bb943e37da7f8a7","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","impliedFormat":1},{"version":"745c4240220559bd340c8aeb6e3c5270a709d3565e934dc22a69c304703956bc","affectsGlobalScope":true,"impliedFormat":1},{"version":"2754d8221d77c7b382096651925eb476f1066b3348da4b73fe71ced7801edada","impliedFormat":1},{"version":"9212c6e9d80cb45441a3614e95afd7235a55a18584c2ed32d6c1aca5a0c53d93","affectsGlobalScope":true,"impliedFormat":1},{"version":"bef91efa0baea5d0e0f0f27b574a8bc100ce62a6d7e70220a0d58af6acab5e89","affectsGlobalScope":true,"impliedFormat":1},{"version":"282fd2a1268a25345b830497b4b7bf5037a5e04f6a9c44c840cb605e19fea841","impliedFormat":1},{"version":"5360a27d3ebca11b224d7d3e38e3e2c63f8290cb1fcf6c3610401898f8e68bc3","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"7d6ff413e198d25639f9f01f16673e7df4e4bd2875a42455afd4ecc02ef156da","affectsGlobalScope":true,"impliedFormat":1},{"version":"1f58ebc40c84046ba4c25cf7e86e1ae92c3f064fb641af6c46a5acebf0b8b20b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f689c4237b70ae6be5f0e4180e8833f34ace40529d1acc0676ab8fb8f70457d7","impliedFormat":1},{"version":"ae25afbbf1ed5df63a177d67b9048bf7481067f1b8dc9c39212e59db94fc9fc6","impliedFormat":1},{"version":"ac5ed35e649cdd8143131964336ab9076937fa91802ec760b3ea63b59175c10a","impliedFormat":1},{"version":"52a8e7e8a1454b6d1b5ad428efae3870ffc56f2c02d923467f2940c454aa9aec","affectsGlobalScope":true,"impliedFormat":1},{"version":"78dc0513cc4f1642906b74dda42146bcbd9df7401717d6e89ea6d72d12ecb539","impliedFormat":1},{"version":"ad90122e1cb599b3bc06a11710eb5489101be678f2920f2322b0ac3e195af78d","impliedFormat":1},{"version":"03d0e8cd16f16b504879544f6323f0e0a9ca9a6e70277c15bf3db9eeedb435cc","impliedFormat":1},{"version":"92d4cd0e80a54da81b6dca627c6b7f3357f91227ee5a2f807fe170c5e1486c85","impliedFormat":1},{"version":"f9ee90b6077378c21926a5c4ad07f76516df15faa281e0c282fab0b628458a1f","signature":"9135f578c1159fbc1a37339a1187c3d44459ec16090e2b84ed6c761900cf8afe","impliedFormat":1},{"version":"8648346b485f088f1171680a4cea70dc100f3cf7e6311a27cf520ffc9fab8ea1","signature":"bd28c9f28c2b9008b46ac5a90e3f397f8285f23b4f7c05171971d30649ffaaa0","impliedFormat":1},{"version":"2a6ae4678c38b8b5b717a471390e6d2677d981c99a3d492b683f121b04208c1e","signature":"01f118ac01015be05dc2a0005706bf8fe8248aaaed36c50f23b2a64dde0517ac","impliedFormat":1},{"version":"c7b5914ff504aa3590ef5a98f6a41ead9ccd896aae5ef129cfca16945f9b1af2","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","impliedFormat":1},{"version":"f7368a5cb0c090073c3ed4426d884aaab84c861bfd5266cc01e52fa4911b8609","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","impliedFormat":1},{"version":"17c20b6076805a442682f4cb8fa35a6bbcaa6c0309fc3fd7ce2b82597a8882b3","signature":"99e19059c4bd18df586ee56283eb59b0aba861204fb89cde18e064d64f6dc0ec","impliedFormat":1},{"version":"785b9d575b49124ce01b46f5b9402157c7611e6532effa562ac6aebec0074dfc","impliedFormat":1},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"a4a39b5714adfcadd3bbea6698ca2e942606d833bde62ad5fb6ec55f5e438ff8","impliedFormat":1},{"version":"bbc1d029093135d7d9bfa4b38cbf8761db505026cc458b5e9c8b74f4000e5e75","impliedFormat":1},{"version":"1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe","impliedFormat":1},{"version":"89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","impliedFormat":1},{"version":"79b4369233a12c6fa4a07301ecb7085802c98f3a77cf9ab97eee27e1656f82e6","impliedFormat":1},{"version":"96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","impliedFormat":1},{"version":"22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","impliedFormat":1},{"version":"cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","impliedFormat":1},{"version":"9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","impliedFormat":1},{"version":"c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","impliedFormat":1},{"version":"8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","impliedFormat":1},{"version":"86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","impliedFormat":1},{"version":"42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","impliedFormat":1},{"version":"ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","impliedFormat":1},{"version":"83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","impliedFormat":1},{"version":"1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","impliedFormat":1},{"version":"0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","impliedFormat":1},{"version":"cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","impliedFormat":1},{"version":"c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","impliedFormat":1},{"version":"f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","impliedFormat":1},{"version":"0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","impliedFormat":1},{"version":"7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","impliedFormat":1},{"version":"bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","impliedFormat":1},{"version":"52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","impliedFormat":1},{"version":"770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","impliedFormat":1},{"version":"d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","impliedFormat":1},{"version":"799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","impliedFormat":1},{"version":"2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","impliedFormat":1},{"version":"9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","impliedFormat":1},{"version":"397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","impliedFormat":1},{"version":"a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","impliedFormat":1},{"version":"a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","impliedFormat":1},{"version":"c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","impliedFormat":1},{"version":"4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","impliedFormat":1},{"version":"f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","impliedFormat":1},{"version":"cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","impliedFormat":1},{"version":"b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","impliedFormat":1},{"version":"c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","impliedFormat":1},{"version":"14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","impliedFormat":1},{"version":"a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","impliedFormat":1},{"version":"f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","impliedFormat":1},{"version":"3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","impliedFormat":1},{"version":"662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","impliedFormat":1},{"version":"c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","impliedFormat":1},{"version":"2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","impliedFormat":1},{"version":"34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","impliedFormat":1},{"version":"7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4","impliedFormat":1}],"root":[[181,186]],"options":{"allowJs":false,"composite":true,"declaration":true,"esModuleInterop":true,"experimentalDecorators":true,"inlineSources":true,"module":100,"outDir":"./","rootDir":"..","skipLibCheck":true,"sourceMap":true,"strict":true,"target":9},"referencedMap":[[180,1],[179,2],[191,3],[190,4],[189,5],[187,6],[193,7],[188,6],[194,6],[125,8],[126,8],[127,9],[85,10],[128,11],[129,12],[130,13],[80,6],[83,14],[81,6],[82,6],[131,15],[132,16],[133,17],[134,18],[135,19],[136,20],[137,20],[139,21],[138,22],[140,23],[141,24],[142,25],[124,26],[84,6],[143,27],[144,28],[145,29],[178,30],[146,31],[147,32],[148,33],[149,34],[150,35],[151,36],[152,37],[153,38],[154,39],[155,40],[156,40],[157,41],[158,6],[159,6],[160,42],[162,43],[161,44],[163,45],[164,46],[165,47],[166,48],[167,49],[168,50],[169,51],[170,52],[171,53],[172,54],[173,55],[174,56],[175,57],[176,58],[177,59],[195,6],[220,60],[221,61],[196,62],[199,62],[218,60],[219,60],[209,60],[208,63],[206,60],[201,60],[214,60],[212,60],[216,60],[200,60],[213,60],[217,60],[202,60],[203,60],[215,60],[197,60],[204,60],[205,60],[207,60],[211,60],[222,64],[210,60],[198,60],[235,65],[234,6],[229,64],[231,66],[230,64],[223,64],[224,64],[226,64],[228,64],[232,66],[233,66],[225,66],[227,66],[192,6],[86,6],[66,67],[67,68],[75,69],[68,68],[69,68],[70,70],[78,71],[76,6],[77,6],[64,6],[71,72],[65,68],[72,72],[73,68],[74,72],[61,6],[62,6],[12,6],[10,6],[11,6],[16,6],[15,6],[2,6],[17,6],[18,6],[19,6],[20,6],[21,6],[22,6],[23,6],[24,6],[3,6],[25,6],[26,6],[4,6],[27,6],[31,6],[28,6],[29,6],[30,6],[32,6],[33,6],[34,6],[5,6],[35,6],[36,6],[37,6],[38,6],[6,6],[42,6],[39,6],[40,6],[41,6],[43,6],[7,6],[44,6],[49,6],[50,6],[45,6],[46,6],[47,6],[48,6],[8,6],[54,6],[51,6],[52,6],[53,6],[55,6],[9,6],[56,6],[63,6],[57,6],[58,6],[60,6],[59,6],[1,6],[14,6],[13,6],[102,73],[112,74],[101,73],[122,75],[93,76],[92,77],[121,2],[115,78],[120,79],[95,80],[109,81],[94,82],[118,83],[90,84],[89,2],[119,85],[91,86],[96,87],[97,6],[100,87],[87,6],[123,88],[113,89],[104,90],[105,91],[107,92],[103,93],[106,94],[116,2],[98,95],[99,96],[108,97],[88,98],[111,89],[110,87],[114,6],[117,99],[79,6],[184,100],[182,101],[185,102],[186,103],[183,104],[181,105]],"latestChangedDtsFile":"./src/index.d.ts","version":"5.9.2"}
1
+ {"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/typescript/lib/lib.es2022.full.d.ts","../node_modules/no-case/dist/index.d.ts","../node_modules/pascal-case/dist/index.d.ts","../node_modules/camel-case/dist/index.d.ts","../node_modules/capital-case/dist/index.d.ts","../node_modules/constant-case/dist/index.d.ts","../node_modules/dot-case/dist/index.d.ts","../node_modules/header-case/dist/index.d.ts","../node_modules/param-case/dist/index.d.ts","../node_modules/path-case/dist/index.d.ts","../node_modules/sentence-case/dist/index.d.ts","../node_modules/snake-case/dist/index.d.ts","../node_modules/change-case/dist/index.d.ts","../node_modules/json5/lib/parse.d.ts","../node_modules/json5/lib/stringify.d.ts","../node_modules/json5/lib/index.d.ts","../node_modules/word-wrap/index.d.ts","../node_modules/@types/node/compatibility/disposable.d.ts","../node_modules/@types/node/compatibility/indexable.d.ts","../node_modules/@types/node/compatibility/iterators.d.ts","../node_modules/@types/node/compatibility/index.d.ts","../node_modules/@types/node/globals.typedarray.d.ts","../node_modules/@types/node/buffer.buffer.d.ts","../node_modules/buffer/index.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/env-http-proxy-agent.d.ts","../node_modules/undici-types/retry-handler.d.ts","../node_modules/undici-types/retry-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/util.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/eventsource.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/sea.d.ts","../node_modules/@types/node/sqlite.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/convict/index.d.ts","../node_modules/@types/convict-format-with-validator/index.d.ts","../src/utils.ts","../src/config.ts","../src/throttle.ts","../src/app.ts","../src/generate-config-docs.ts","../src/index.ts","../node_modules/@types/estree/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/eslint/use-at-your-own-risk.d.ts","../node_modules/@types/eslint/index.d.ts","../node_modules/@types/eslint-scope/index.d.ts","../node_modules/@types/unist/index.d.ts","../node_modules/@types/hast/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/normalize-package-data/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts"],"fileIdsList":[[85,128,179],[85,128,178],[85,128,187,190],[85,128,187,188,189],[85,128,190],[85,128],[85,128,192],[85,125,128],[85,127,128],[128],[85,128,133,163],[85,128,129,134,140,141,148,160,171],[85,128,129,130,140,148],[80,81,82,85,128],[85,128,131,172],[85,128,132,133,141,149],[85,128,133,160,168],[85,128,134,136,140,148],[85,127,128,135],[85,128,136,137],[85,128,140],[85,128,138,140],[85,127,128,140],[85,128,140,141,142,160,171],[85,128,140,141,142,155,160,163],[85,123,128,176],[85,123,128,136,140,143,148,160,171],[85,128,140,141,143,144,148,160,168,171],[85,128,143,145,160,168,171],[83,84,85,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177],[85,128,140,146],[85,128,147,171],[85,128,136,140,148,160],[85,128,149],[85,128,150],[85,127,128,151],[85,125,126,127,128,129,130,131,132,133,134,135,136,137,138,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177],[85,128,153],[85,128,154],[85,128,140,155,156],[85,128,155,157,172,174],[85,128,140,160,161,162,163],[85,128,160,162],[85,128,160,161],[85,128,163],[85,128,164],[85,125,128,160],[85,128,140,166,167],[85,128,166,167],[85,128,133,148,160,168],[85,128,169],[85,128,148,170],[85,128,143,154,171],[85,128,133,172],[85,128,160,173],[85,128,147,174],[85,128,175],[85,128,133,140,142,151,160,171,174,176],[85,128,160,177],[85,128,196,235],[85,128,196,220,235],[85,128,235],[85,128,196],[85,128,196,221,235],[85,128,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234],[85,128,221,235],[65,85,128],[64,85,128],[64,65,66,67,68,69,70,71,72,73,74,85,128],[67,85,128],[76,77,85,128],[69,85,128],[85,95,99,128,171],[85,95,128,160,171],[85,90,128],[85,92,95,128,168,171],[85,128,148,168],[85,90,128,178],[85,92,95,128,148,171],[85,87,88,91,94,128,140,160,171],[85,95,102,128],[85,87,93,128],[85,95,116,117,128],[85,91,95,128,163,171,178],[85,116,128,178],[85,89,90,128,178],[85,95,128],[85,89,90,91,92,93,94,95,96,97,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,117,118,119,120,121,122,128],[85,95,110,128],[85,95,102,103,128],[85,93,95,103,104,128],[85,94,128],[85,87,90,95,128],[85,95,99,103,104,128],[85,99,128],[85,93,95,98,128,171],[85,87,92,95,102,128],[85,128,160],[85,90,95,116,128,176,178],[75,78,79,85,128,129,141,181,182,183],[85,128,141,179,180,181],[85,128,142,182],[85,128,181,182,183,184],[78,85,128,129,140,141,149,181],[85,128,129,141,149,150]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2e80ee7a49e8ac312cc11b77f1475804bee36b3b2bc896bead8b6e1266befb43","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7a3c8b952931daebdfc7a2897c53c0a1c73624593fa070e46bd537e64dcd20a","affectsGlobalScope":true,"impliedFormat":1},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true,"impliedFormat":1},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"3cbad9a1ba4453443026ed38e4b8be018abb26565fa7c944376463ad9df07c41","impliedFormat":1},{"version":"b4e123af1af6049685c93073a15868b50aebdad666d422edc72fa2b585fa8a37","impliedFormat":1},{"version":"f86c04a744ebcede96bac376f9a2c90f2bd3c422740d91dda4ca6233199d4977","impliedFormat":1},{"version":"6ae1bddee5c790439bd992abd063b9b46e0cadd676c2a8562268d1869213ff60","impliedFormat":1},{"version":"606244fc97a6a74b877f2e924ba7e55b233bc6acb57d7bf40ba84a5be2d9adb0","impliedFormat":1},{"version":"4a1cabac71036b8a14f5db1b753b579f0c901c7d7b9227e6872dadf6efb104e8","impliedFormat":1},{"version":"062959a1d825b96639d87be35fe497cbd3f89544bf06fdad577bbfb85fcf604c","impliedFormat":1},{"version":"4c3672dc8f4e4fdd3d18525b22b31f1b5481f5a415db96550d3ac5163a6c3dd3","impliedFormat":1},{"version":"f9a69ca445010b91fe08f08c06e0f86d79c0d776905f9bdb828477cb2a1eb7fc","impliedFormat":1},{"version":"ad7fd0e7ee457d4884b3aaecbcbd2a80b6803407c4ce2540c296170d4c7918ef","impliedFormat":1},{"version":"a50ef21605f41c6acad6c3ef0307e5311b94963c846ca093c764b80cdb5318d6","impliedFormat":1},{"version":"74b4035dd26d09a417c44ca23ab5ee69b173f8c2f6b2e47350ab0795cf2d4a17","impliedFormat":1},{"version":"918f86ee2b19cc38cb8b1a4cf8f223eb228aaa39df3604c42f700fac2f0b3ea1","impliedFormat":1},{"version":"88a3a6f8c2a1640d8d5fd30d8d86462f8babd86a1e52fab0e8b7f7c141fb348e","impliedFormat":1},{"version":"345f76c854da724803c96f727a3f9c75e26cf95c6e7b8c1064dbc4e7727b74e6","impliedFormat":1},{"version":"ab7b7a15a5d73eb0cfc2b973e580f357f07492bff6608669d7e899e2d49ac9a3","impliedFormat":1},{"version":"14e27c8804ce2fe36fe1cfdbea2c0625cb97f4c20394fa9973567fb09cc03406","impliedFormat":1},{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true,"impliedFormat":1},{"version":"030e350db2525514580ed054f712ffb22d273e6bc7eddc1bb7eda1e0ba5d395e","affectsGlobalScope":true,"impliedFormat":1},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"a79e62f1e20467e11a904399b8b18b18c0c6eea6b50c1168bf215356d5bebfaf","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fd06258805d26c72f5997e07a23155d322d5f05387adb3744a791fe6a0b042d","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"d2bc987ae352271d0d615a420dcf98cc886aa16b87fb2b569358c1fe0ca0773d","affectsGlobalScope":true,"impliedFormat":1},{"version":"f52e8dacc97d71dcc96af29e49584353f9c54cb916d132e3e768d8b8129c928d","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"76103716ba397bbb61f9fa9c9090dca59f39f9047cb1352b2179c5d8e7f4e8d0","impliedFormat":1},{"version":"53eac70430b30089a3a1959d8306b0f9cfaf0de75224b68ef25243e0b5ad1ca3","affectsGlobalScope":true,"impliedFormat":1},{"version":"4314c7a11517e221f7296b46547dbc4df047115b182f544d072bdccffa57fc72","impliedFormat":1},{"version":"115971d64632ea4742b5b115fb64ed04bcaae2c3c342f13d9ba7e3f9ee39c4e7","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","impliedFormat":1},{"version":"86956cc2eb9dd371d6fab493d326a574afedebf76eef3fa7833b8e0d9b52d6f1","affectsGlobalScope":true,"impliedFormat":1},{"version":"91c1a729db5b28b2fc32bafa7a53611d417bc3f03f649278d4fd948aa4dec898","impliedFormat":1},{"version":"e6f5a38687bebe43a4cef426b69d34373ef68be9a6b1538ec0a371e69f309354","impliedFormat":1},{"version":"a6bf63d17324010ca1fbf0389cab83f93389bb0b9a01dc8a346d092f65b3605f","impliedFormat":1},{"version":"e009777bef4b023a999b2e5b9a136ff2cde37dc3f77c744a02840f05b18be8ff","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true,"impliedFormat":1},{"version":"88bc59b32d0d5b4e5d9632ac38edea23454057e643684c3c0b94511296f2998c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ff5a53a58e756d2661b73ba60ffe274231a4432d21f7a2d0d9e4f6aa99f4283","impliedFormat":1},{"version":"eaf9ee1d90a35d56264f0bf39842282c58b9219e112ac7d0c1bce98c6c5da672","impliedFormat":1},{"version":"c15c4427ae7fd1dcd7f312a8a447ac93581b0d4664ddf151ecd07de4bf2bb9d7","impliedFormat":1},{"version":"5135bdd72cc05a8192bd2e92f0914d7fc43ee077d1293dc622a049b7035a0afb","impliedFormat":1},{"version":"4f80de3a11c0d2f1329a72e92c7416b2f7eab14f67e92cac63bb4e8d01c6edc8","impliedFormat":1},{"version":"6d386bc0d7f3afa1d401afc3e00ed6b09205a354a9795196caed937494a713e6","impliedFormat":1},{"version":"c72ccc191348ac1933226cab7a814cfda8b29a827d1df5dbebfe516a6fd734a8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8bea55446a296d289fbc762f61954a0e3e38ffbcacc06e47e0cba491030e3235","impliedFormat":1},{"version":"b1b6ee0d012aeebe11d776a155d8979730440082797695fc8e2a5c326285678f","impliedFormat":1},{"version":"45875bcae57270aeb3ebc73a5e3fb4c7b9d91d6b045f107c1d8513c28ece71c0","impliedFormat":1},{"version":"3eb62baae4df08c9173e6903d3ca45942ccec8c3659b0565684a75f3292cffbb","affectsGlobalScope":true,"impliedFormat":1},{"version":"42aaa94addeed66a04b61e433c14e829c43d1efd653cf2fda480c5fb3d722ed8","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"c6b4e0a02545304935ecbf7de7a8e056a31bb50939b5b321c9d50a405b5a0bba","impliedFormat":1},{"version":"fab29e6d649aa074a6b91e3bdf2bff484934a46067f6ee97a30fcd9762ae2213","impliedFormat":1},{"version":"8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","impliedFormat":1},{"version":"e1120271ebbc9952fdc7b2dd3e145560e52e06956345e6fdf91d70ca4886464f","impliedFormat":1},{"version":"15c5e91b5f08be34a78e3d976179bf5b7a9cc28dc0ef1ffebffeb3c7812a2dca","impliedFormat":1},{"version":"d63ff33a2fa221b36a4da0dd5a3dad3156f3dd0fe1baf43a186e607d4ba5af99","impliedFormat":1},{"version":"553870e516f8c772b89f3820576152ebc70181d7994d96917bb943e37da7f8a7","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","impliedFormat":1},{"version":"745c4240220559bd340c8aeb6e3c5270a709d3565e934dc22a69c304703956bc","affectsGlobalScope":true,"impliedFormat":1},{"version":"2754d8221d77c7b382096651925eb476f1066b3348da4b73fe71ced7801edada","impliedFormat":1},{"version":"9212c6e9d80cb45441a3614e95afd7235a55a18584c2ed32d6c1aca5a0c53d93","affectsGlobalScope":true,"impliedFormat":1},{"version":"bef91efa0baea5d0e0f0f27b574a8bc100ce62a6d7e70220a0d58af6acab5e89","affectsGlobalScope":true,"impliedFormat":1},{"version":"282fd2a1268a25345b830497b4b7bf5037a5e04f6a9c44c840cb605e19fea841","impliedFormat":1},{"version":"5360a27d3ebca11b224d7d3e38e3e2c63f8290cb1fcf6c3610401898f8e68bc3","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"7d6ff413e198d25639f9f01f16673e7df4e4bd2875a42455afd4ecc02ef156da","affectsGlobalScope":true,"impliedFormat":1},{"version":"1f58ebc40c84046ba4c25cf7e86e1ae92c3f064fb641af6c46a5acebf0b8b20b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f689c4237b70ae6be5f0e4180e8833f34ace40529d1acc0676ab8fb8f70457d7","impliedFormat":1},{"version":"ae25afbbf1ed5df63a177d67b9048bf7481067f1b8dc9c39212e59db94fc9fc6","impliedFormat":1},{"version":"ac5ed35e649cdd8143131964336ab9076937fa91802ec760b3ea63b59175c10a","impliedFormat":1},{"version":"52a8e7e8a1454b6d1b5ad428efae3870ffc56f2c02d923467f2940c454aa9aec","affectsGlobalScope":true,"impliedFormat":1},{"version":"78dc0513cc4f1642906b74dda42146bcbd9df7401717d6e89ea6d72d12ecb539","impliedFormat":1},{"version":"ad90122e1cb599b3bc06a11710eb5489101be678f2920f2322b0ac3e195af78d","impliedFormat":1},{"version":"03d0e8cd16f16b504879544f6323f0e0a9ca9a6e70277c15bf3db9eeedb435cc","impliedFormat":1},{"version":"92d4cd0e80a54da81b6dca627c6b7f3357f91227ee5a2f807fe170c5e1486c85","impliedFormat":1},{"version":"54e590450329aa4f7651a8d5a3ed34b253c1ec8481ae8a893024a81c2e493a04","signature":"78a95c48d4e40bfd2b4c9289480dadda328952c5ecd46d01fc829a79115d84c4","impliedFormat":1},{"version":"8648346b485f088f1171680a4cea70dc100f3cf7e6311a27cf520ffc9fab8ea1","signature":"bd28c9f28c2b9008b46ac5a90e3f397f8285f23b4f7c05171971d30649ffaaa0","impliedFormat":1},{"version":"2a6ae4678c38b8b5b717a471390e6d2677d981c99a3d492b683f121b04208c1e","signature":"01f118ac01015be05dc2a0005706bf8fe8248aaaed36c50f23b2a64dde0517ac","impliedFormat":1},{"version":"fbfbf033058761eaa260d5db7f525bcada03dab64f07211b6179114012f0464d","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","impliedFormat":1},{"version":"f7368a5cb0c090073c3ed4426d884aaab84c861bfd5266cc01e52fa4911b8609","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","impliedFormat":1},{"version":"17c20b6076805a442682f4cb8fa35a6bbcaa6c0309fc3fd7ce2b82597a8882b3","signature":"99e19059c4bd18df586ee56283eb59b0aba861204fb89cde18e064d64f6dc0ec","impliedFormat":1},{"version":"785b9d575b49124ce01b46f5b9402157c7611e6532effa562ac6aebec0074dfc","impliedFormat":1},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"a4a39b5714adfcadd3bbea6698ca2e942606d833bde62ad5fb6ec55f5e438ff8","impliedFormat":1},{"version":"bbc1d029093135d7d9bfa4b38cbf8761db505026cc458b5e9c8b74f4000e5e75","impliedFormat":1},{"version":"1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe","impliedFormat":1},{"version":"89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","impliedFormat":1},{"version":"79b4369233a12c6fa4a07301ecb7085802c98f3a77cf9ab97eee27e1656f82e6","impliedFormat":1},{"version":"96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","impliedFormat":1},{"version":"22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","impliedFormat":1},{"version":"cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","impliedFormat":1},{"version":"9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","impliedFormat":1},{"version":"c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","impliedFormat":1},{"version":"8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","impliedFormat":1},{"version":"86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","impliedFormat":1},{"version":"42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","impliedFormat":1},{"version":"ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","impliedFormat":1},{"version":"83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","impliedFormat":1},{"version":"1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","impliedFormat":1},{"version":"0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","impliedFormat":1},{"version":"cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","impliedFormat":1},{"version":"c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","impliedFormat":1},{"version":"f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","impliedFormat":1},{"version":"0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","impliedFormat":1},{"version":"7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","impliedFormat":1},{"version":"bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","impliedFormat":1},{"version":"52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","impliedFormat":1},{"version":"770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","impliedFormat":1},{"version":"d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","impliedFormat":1},{"version":"799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","impliedFormat":1},{"version":"2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","impliedFormat":1},{"version":"9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","impliedFormat":1},{"version":"397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","impliedFormat":1},{"version":"a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","impliedFormat":1},{"version":"a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","impliedFormat":1},{"version":"c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","impliedFormat":1},{"version":"4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","impliedFormat":1},{"version":"f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","impliedFormat":1},{"version":"cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","impliedFormat":1},{"version":"b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","impliedFormat":1},{"version":"c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","impliedFormat":1},{"version":"14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","impliedFormat":1},{"version":"a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","impliedFormat":1},{"version":"f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","impliedFormat":1},{"version":"3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","impliedFormat":1},{"version":"662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","impliedFormat":1},{"version":"c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","impliedFormat":1},{"version":"2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","impliedFormat":1},{"version":"34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","impliedFormat":1},{"version":"7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4","impliedFormat":1}],"root":[[181,186]],"options":{"allowJs":false,"composite":true,"declaration":true,"esModuleInterop":true,"experimentalDecorators":true,"inlineSources":true,"module":100,"outDir":"./","rootDir":"..","skipLibCheck":true,"sourceMap":true,"strict":true,"target":9},"referencedMap":[[180,1],[179,2],[191,3],[190,4],[189,5],[187,6],[193,7],[188,6],[194,6],[125,8],[126,8],[127,9],[85,10],[128,11],[129,12],[130,13],[80,6],[83,14],[81,6],[82,6],[131,15],[132,16],[133,17],[134,18],[135,19],[136,20],[137,20],[139,21],[138,22],[140,23],[141,24],[142,25],[124,26],[84,6],[143,27],[144,28],[145,29],[178,30],[146,31],[147,32],[148,33],[149,34],[150,35],[151,36],[152,37],[153,38],[154,39],[155,40],[156,40],[157,41],[158,6],[159,6],[160,42],[162,43],[161,44],[163,45],[164,46],[165,47],[166,48],[167,49],[168,50],[169,51],[170,52],[171,53],[172,54],[173,55],[174,56],[175,57],[176,58],[177,59],[195,6],[220,60],[221,61],[196,62],[199,62],[218,60],[219,60],[209,60],[208,63],[206,60],[201,60],[214,60],[212,60],[216,60],[200,60],[213,60],[217,60],[202,60],[203,60],[215,60],[197,60],[204,60],[205,60],[207,60],[211,60],[222,64],[210,60],[198,60],[235,65],[234,6],[229,64],[231,66],[230,64],[223,64],[224,64],[226,64],[228,64],[232,66],[233,66],[225,66],[227,66],[192,6],[86,6],[66,67],[67,68],[75,69],[68,68],[69,68],[70,70],[78,71],[76,6],[77,6],[64,6],[71,72],[65,68],[72,72],[73,68],[74,72],[61,6],[62,6],[12,6],[10,6],[11,6],[16,6],[15,6],[2,6],[17,6],[18,6],[19,6],[20,6],[21,6],[22,6],[23,6],[24,6],[3,6],[25,6],[26,6],[4,6],[27,6],[31,6],[28,6],[29,6],[30,6],[32,6],[33,6],[34,6],[5,6],[35,6],[36,6],[37,6],[38,6],[6,6],[42,6],[39,6],[40,6],[41,6],[43,6],[7,6],[44,6],[49,6],[50,6],[45,6],[46,6],[47,6],[48,6],[8,6],[54,6],[51,6],[52,6],[53,6],[55,6],[9,6],[56,6],[63,6],[57,6],[58,6],[60,6],[59,6],[1,6],[14,6],[13,6],[102,73],[112,74],[101,73],[122,75],[93,76],[92,77],[121,2],[115,78],[120,79],[95,80],[109,81],[94,82],[118,83],[90,84],[89,2],[119,85],[91,86],[96,87],[97,6],[100,87],[87,6],[123,88],[113,89],[104,90],[105,91],[107,92],[103,93],[106,94],[116,2],[98,95],[99,96],[108,97],[88,98],[111,89],[110,87],[114,6],[117,99],[79,6],[184,100],[182,101],[185,102],[186,103],[183,104],[181,105]],"latestChangedDtsFile":"./src/utils.d.ts","version":"5.9.2"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vpalmisano/throttler",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/vpalmisano/throttler.git"
package/src/app.ts CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  } from './throttle'
14
14
  import {
15
15
  getProcessChildren,
16
+ handleExitSignals,
16
17
  logger,
17
18
  registerExitHandler,
18
19
  resolvePackagePath,
@@ -51,6 +52,7 @@ type Command = {
51
52
 
52
53
  async function main(): Promise<void> {
53
54
  showHelpOrVersion()
55
+ handleExitSignals()
54
56
 
55
57
  const config = loadConfig(process.argv[2])
56
58
  const pids = new Set<number>()
package/src/utils.ts CHANGED
@@ -211,18 +211,21 @@ const SIGNALS = [
211
211
  'SIGUSR2',
212
212
  'SIGTERM',
213
213
  ]
214
- process.setMaxListeners(process.getMaxListeners() + SIGNALS.length)
215
- SIGNALS.forEach(event =>
216
- process.once(event, async signal => {
217
- if (signal instanceof Error) {
218
- log.error(`Exit on error: ${signal.stack || signal.message}`)
219
- } else {
220
- log.debug(`Exit on signal: ${signal}`)
221
- }
222
- await runExitHandlersNow(signal)
223
- process.exit(0)
224
- }),
225
- )
214
+
215
+ export function handleExitSignals(): void {
216
+ process.setMaxListeners(process.getMaxListeners() + SIGNALS.length)
217
+ SIGNALS.forEach(event =>
218
+ process.once(event, async signal => {
219
+ if (signal instanceof Error) {
220
+ log.error(`Exit on error: ${signal.stack || signal.message}`)
221
+ } else {
222
+ log.debug(`Exit on signal: ${signal}`)
223
+ }
224
+ await runExitHandlersNow(signal)
225
+ process.exit(0)
226
+ }),
227
+ )
228
+ }
226
229
 
227
230
  export async function getProcessChildren(pid: number): Promise<number[]> {
228
231
  log.debug(`getProcessChildren pid=${pid}`)
package/throttler.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- (()=>{"use strict";var e={28:function(e,t,r){var n,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&o(t,e,r[s]);return i(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.getConfigDocs=function(){return g({},null,f.getSchema())},t.loadConfig=function(e,t){e&&(0,c.existsSync)(e)?(d.debug(`Loading config from ${e}`),f.loadFile(e)):t?(d.debug("Loading config from values."),f.load(t)):(d.debug("Using default values."),f.load({}));f.validate({allowed:"strict"});const r=f.getProperties();return d.debug("Using config:",r),r};const a=s(r(950)),l=r(618),c=r(896),d=(0,r(185).logger)("throttler:config"),u={name:"float",coerce:e=>parseFloat(e),validate:e=>{if(!Number.isFinite(e))throw new Error(`Invalid float: ${e}`)}},p={name:"index",coerce:e=>e,validate:e=>{if("string"==typeof e){if("true"===e||"false"===e||""===e)return;if(-1!==e.indexOf("-"))return void e.split("-").forEach((e=>{if(isNaN(parseInt(e))||!isFinite(parseInt(e)))throw new Error(`Invalid index: ${e}`)}));if(-1!==e.indexOf(","))return void e.split(",").forEach((e=>{if(isNaN(parseInt(e))||!isFinite(parseInt(e)))throw new Error(`Invalid index: ${e}`)}));if(isNaN(parseInt(e))||!isFinite(parseInt(e)))throw new Error(`Invalid index: ${e}`)}else if("number"==typeof e||"boolean"==typeof e)return;throw new Error(`Invalid index: ${e}`)}};(0,a.addFormats)({ipaddress:l.ipaddress,url:l.url,float:u,index:p});const f=(0,a.default)({runDuration:{doc:"If greater than 0, the test will stop after the provided number of seconds.",format:"nat",default:0,env:"RUN_DURATION",arg:"run-duration"},throttleConfig:{doc:"A JSON5 string with a valid network throttling configuration. Example: \n ```javascript\n [{\n sessions: '0-1',\n device: 'eth0',\n protocol: 'udp',\n capture: 'capture.pcap',\n up: {\n rate: 1000,\n delay: 50,\n loss: 5,\n queue: 10,\n },\n down: [\n { rate: 2000, delay: 50, loss: 2, queue: 20 },\n { rate: 1000, delay: 50, loss: 2, queue: 20, at: 60 },\n ]\n }]\n ```\nThe sessions field represents the sessions IDs range that will be affected by the rule, e.g.: \"0-10\", \"2,4\" or simply \"2\". The device, protocol, up, down fields are optional. When device is not set, the default route device will be used. If protocol is specified ('udp' or 'tcp'), only the packets with the specified protocol will be affected by the shaping rules. ",format:String,nullable:!0,default:"",env:"THROTTLE_CONFIG",arg:"throttle-config"},commandConfig:{doc:'The commands configuration.Example: \n ```javascript\n [{\n session: 0,\n command: "firefox https://www.speedtest.net",\n }]\n ```\n',format:String,nullable:!0,default:"",env:"COMMAND_CONFIG",arg:"command-config"}});function g(e,t,r){return r._cvtProperties?(Object.entries(r._cvtProperties).forEach((([r,n])=>{g(e,`${t?`${t}.`:""}${r}`,n)})),e):(t&&(e[t]={doc:r.doc,format:JSON.stringify(r.format,null,2),default:JSON.stringify(r.default,null,2)}),e)}f.getProperties()},185:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LoggerInterface=t.Log=void 0,t.logger=a,t.resolvePackagePath=function(e){if("__nexe"in process)return e;return s.default.join(s.default.dirname(__filename),e)},t.toPrecision=function(e,t=3){return(Math.round(e*10**t)/10**t).toFixed(t)},t.getDefaultNetworkInterface=async function(){if("linux"!==i.default.platform())return"lo";const{stdout:e}=await c("ip route | awk '/default/ {print $5; exit}' | tr -d ''");return e.trim()},t.checkNetworkInterface=async function(e){if("lo"===e)return;await c(`ip route | grep -q "dev ${e}"`)},t.runShellCommand=c,t.registerExitHandler=function(e){d.add(e)},t.unregisterExitHandler=function(e){d.delete(e)},t.runExitHandlersNow=f,t.getProcessChildren=async function e(t){l.debug(`getProcessChildren pid=${t}`);const r=[];try{const n=await c(`pgrep -P ${t}`);for(const t of n.stdout.trim().split("\n").map(Number)){r.push(t);try{const n=await e(t);for(const e of n)r.push(e)}catch(e){l.debug(`Error getting process ${t} children: ${e.message}`)}}}catch(e){l.debug(`Error getting process ${t} children: ${e.message}`)}return r};const o=r(200),i=(n(r(896)),n(r(857))),s=n(r(928));function a(e,r={}){return new t.Log(e,{splitLine:!1,...r})}t.Log=r(940).Log;t.LoggerInterface=class{name;logInit(e){this.name&&e.unshift(`[${this.name}]`)}debug(...e){this.logInit(e),l.debug(...e)}info(...e){this.logInit(e),l.info(...e)}warn(...e){this.logInit(e),l.warn(...e)}error(...e){this.logInit(e),l.error(...e)}log(...e){this.logInit(e),l.log(...e)}};const l=a("webrtcperf:utils");async function c(e,t=!1){return t&&l.debug(`runShellCommand cmd: ${e}`),new Promise(((r,n)=>{const i=(0,o.spawn)(e,{shell:!0,stdio:["ignore","pipe","pipe"],detached:!0});let s="",a="";i.stdout.on("data",(e=>{s.length>524288&&(s=s.slice(e.length)),s+=e})),i.stderr.on("data",(e=>{a.length>524288&&(a=a.slice(e.length)),a+=e})),i.once("error",(e=>n(e))),i.once("close",(o=>{0!==o?n(new Error(`runShellCommand cmd: ${e} failed with code ${o}: ${a}`)):(t&&l.debug(`runShellCommand cmd: ${e} done`,{stdout:s,stderr:a}),r({stdout:s,stderr:a}))}))}))}const d=new Set;const u=async e=>{let t=0;for(const r of d.values()){const n=`${t+1}/${d.size}`;l.debug(`running exitHandler ${n}`);try{await r(e),l.debug(` exitHandler ${n} done`)}catch(e){l.error(`exitHandler ${n} error: ${e}`)}t++}d.clear()};let p=null;async function f(e){p||(p=u(e)),await p}const g=["beforeExit","uncaughtException","unhandledRejection","SIGHUP","SIGINT","SIGQUIT","SIGILL","SIGTRAP","SIGABRT","SIGBUS","SIGFPE","SIGUSR1","SIGSEGV","SIGUSR2","SIGTERM"];process.setMaxListeners(process.getMaxListeners()+g.length),g.forEach((e=>process.once(e,(async e=>{e instanceof Error?l.error(`Exit on error: ${e.stack||e.message}`):l.debug(`Exit on signal: ${e}`),await f(e),process.exit(0)}))))},200:e=>{e.exports=require("child_process")},251:e=>{e.exports=require("word-wrap")},261:e=>{e.exports=require("events")},423:e=>{e.exports=require("change-case")},618:e=>{e.exports=require("convict-format-with-validator")},670:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.throttleNotifier=void 0,t.startThrottle=async function(e){try{u=a.default.parse(e),d.debug("Starting throttle with config:",u),await $(),await async function(){if(!u||!u.length)return;let e=u[0].device;if(e)try{await(0,c.checkNetworkInterface)(e)}catch(t){d.warn(`Network interface ${e} not found, using default.`),e=""}e||(e=await(0,c.getDefaultNetworkInterface)());await h(`set -e;\n\nsudo -n modprobe ifb || true;\nsudo -n ip link add ifb0 type ifb || true;\nsudo -n ip link set dev ifb0 up;\n\nsudo -n tc qdisc add dev ${e} root handle 1: htb default 1;\nsudo -n tc class add dev ${e} parent 1: classid 1:1 htb rate 1Gbit ceil 1Gbit;\n\nsudo -n tc qdisc add dev ifb0 root handle 1: htb default 1;\nsudo -n tc class add dev ifb0 parent 1: classid 1:1 htb rate 1Gbit ceil 1Gbit;\n\nsudo -n tc qdisc add dev ${e} ingress handle ffff: || true;\nsudo -n tc filter add dev ${e} parent ffff: protocol ip u32 match u32 0 0 action connmark action mirred egress redirect dev ifb0 flowid 1:1;\n`,!0);let t=0;for(const r of u)r.up&&await w(r,"up",e,t,r.protocol,r.match),r.down&&await w(r,"down","ifb0",t,r.protocol,r.match),r.capture&&"linux"===l.default.platform()&&f.set(t,v(t,r.capture,r.protocol)),t++}()}catch(t){throw d.error(`startThrottle "${e}" error: ${t.stack}`),await b(),t}},t.stopThrottle=b,t.getSessionThrottleIndex=function(e){if(!u)return-1;for(const[t,r]of u.entries())if(void 0!==r.sessions&&""!==r.sessions)try{if(r.sessions.includes("-")){const[n,o]=r.sessions.split("-").map(Number);if(e>=n&&e<=o)return t}else if(r.sessions.includes(",")){if(r.sessions.split(",").map(Number).includes(e))return t}else if(e===Number(r.sessions))return t}catch(t){d.error(`getSessionThrottleId sessionId=${e} error: ${t.stack}`)}return-1},t.getSessionThrottleValues=function(e,t){if(e<0)return{};return g[t].get(e)||{}},t.throttleLauncher=async function(e,t){if(d.debug(`throttleLauncher executablePath=${e} index=${t}`),!u||t<0)return e;const r=u[t],n=t+1,o=`/tmp/throttler-launcher-${t}`,i=`throttler${t}`,a=`${r.protocol?`-p ${r.protocol}`:""}${r.skipSourcePorts?` -m multiport ! --sports ${r.skipSourcePorts}`:""}${r.skipDestinationPorts?` -m multiport ! --dports ${r.skipDestinationPorts}`:""}${r.filter?` ${r.filter}`:""}`;return await s.default.promises.writeFile(o,`#!/bin/bash\ngetent group ${i} >/dev/null || sudo -n addgroup --system ${i}\nsudo -n adduser $USER ${i} --quiet\n\nrule=$(sudo -n iptables -t mangle -L OUTPUT --line-numbers | grep "owner GID match ${i}" | awk '{print $1}')\nif [ -n "$rule" ]; then\n sudo -n iptables -t mangle -R OUTPUT \${rule} ${a} -m owner --gid-owner ${i} -j MARK --set-mark ${n} \nelse\n sudo -n iptables -t mangle -I OUTPUT 1 ${a} -m owner --gid-owner ${i} -j MARK --set-mark ${n}\nfi\n\nsudo -n iptables -t mangle -L PREROUTING | grep -q "CONNMARK restore" || sudo -n iptables -t mangle -I PREROUTING 1 -j CONNMARK --restore-mark\nsudo -n iptables -t mangle -L POSTROUTING | grep -q "CONNMARK save" || sudo -n iptables -t mangle -I POSTROUTING 1 -j CONNMARK --save-mark\n\nfunction stop() {\n echo "Stopping throttler"\n}\ntrap stop SIGINT SIGTERM\n\necho "running: ${e} $@"\nexec newgrp ${i} <<EOF\n${e} $@\nEOF`),await s.default.promises.chmod(o,493),o};const o=r(200),i=r(261),s=n(r(896)),a=n(r(865)),l=n(r(857)),c=r(185),d=(0,c.logger)("throttler:throttle");let u=null;const p=new Set,f=new Map,g={up:new Map,down:new Map};async function h(e,t=!1){"linux"===l.default.platform()&&await(0,c.runShellCommand)(e,t)}async function $(){await Promise.allSettled([...f.values()].map((e=>e()))),f.clear(),p.forEach((e=>clearTimeout(e))),p.clear(),g.up.clear(),g.down.clear(),t.throttleNotifier.emit("change");let e=u?.length?u[0].device:"";e||(e=await(0,c.getDefaultNetworkInterface)()),await h(`sudo -n tc qdisc del dev ${e} root || true;\nsudo -n tc class del dev ${e} || true;\nsudo -n tc filter del dev ${e} || true;\nsudo -n tc qdisc del dev ${e} ingress || true;\n\nsudo -n tc qdisc del dev ifb0 root || true;\nsudo -n tc class del dev ifb0 root || true;\nsudo -n tc filter del dev ifb0 root || true;\n`),await async function(){if(!u?.length)return;d.debug(`cleanupRules (${u.length})`);try{await h(`for i in $(seq 0 ${u.length}); do\n rule=$(sudo -n iptables -t mangle -L OUTPUT --line-numbers | grep "owner GID match throttler\${i}" | awk '{print $1}');\n if [ -n "$rule" ]; then\n sudo -n iptables -t mangle -D OUTPUT \${rule};\n fi;\ndone;`)}catch(e){d.error(`cleanupRules error: ${e.stack}`)}}()}function m(e,t,r=1500){return Math.ceil(1.5*e*1e3/8*(t/1e3)/r)}async function w(e,r,n,o,i,s){let a=e[r];if(a){d.debug(`applyRules device=${n} index=${o} protocol=${i} match=${s} ${JSON.stringify(a)}`),Array.isArray(a)||(a=[a]),a.sort(((e,t)=>(e.at||0)-(t.at||0)));for(const[e,l]of a.entries()){const{rate:a,delay:u,delayJitter:f,delayJitterCorrelation:$,delayDistribution:w,reorder:b,reorderCorrelation:v,reorderGap:I,loss:y,lossBurst:x,queue:k,at:S}=l,P=m(a||0,u||0),N=Math.max(k||0,P),T=o+1,O=o+2;if(0===e){const e=[`'meta(nf_mark eq ${T})'`];"udp"===i?e.push("'cmp(u8 at 9 layer network eq 0x11)'"):"tcp"===i&&e.push("'cmp(u8 at 9 layer network eq 0x6)'"),s&&e.push(s);const t=`set -e;\n\nsudo -n tc class add dev ${n} parent 1: classid 1:${O} htb rate 1Gbit ceil 1Gbit;\n\nsudo -n tc qdisc add dev ${n} parent 1:${O} handle ${O}: netem; \nsudo -n tc filter add dev ${n} parent 1: protocol ip basic match ${e.join(" and ")} flowid 1:${O};\n`;try{await h(t,!0)}catch(e){throw d.error(`error running "${t}": ${e.stack}`),e}}const E=setTimeout((async()=>{let e="";if(a&&a>0&&(e+=` rate ${a}kbit`),N&&N>0&&(e+=` limit ${N}`),u&&u>0&&(e+=` delay ${u}ms`,f&&f>0&&(e+=` ${f}ms`,$&&$>0&&(e+=` ${$}`)),w&&(e+=` distribution ${w}`)),y&&y>0)if(x&&x>0){const t=100*y/(x*(100-y)),r=100/x;e+=` loss gemodel ${(0,c.toPrecision)(t,2)} ${(0,c.toPrecision)(r,2)}`}else e+=` loss ${(0,c.toPrecision)(y,2)}%`;b&&b>0&&(e+=` reorder ${(0,c.toPrecision)(b,2)}%`,v&&v>0&&(e+=` ${(0,c.toPrecision)(v,2)}`),I&&I>0&&(e+=` gap ${I}`)),d.debug(`applying rules on ${n} (${T}): ${e.trim()}`);const i=`sudo -n tc qdisc change dev ${n} parent 1:${O} handle ${O}: netem ${e}`;try{p.delete(E),await h(i),g[r].set(o,{rate:a?1e3*a:void 0,delay:u||void 0,loss:y||void 0,queue:N||void 0}),t.throttleNotifier.emit("change")}catch(e){d.error(`error running "${i}": ${e.stack}`)}}),1e3*(S||0));p.add(E)}}}async function b(){try{d.debug("Stopping throttle"),await $(),d.debug("Stopping throttle done"),u=null}catch(e){d.error(`Stop throttle error: ${e.stack}`)}}function v(e,t,r){const n=e+1;d.debug(`Starting capture ${t}`);const i=`#!/bin/bash\nsudo -n iptables -L INPUT | grep -q "nflog-group ${n}" || sudo -n iptables -I INPUT 1 ${r?`-p ${r}`:""} -m connmark --mark ${n} -j NFLOG --nflog-group ${n}\nsudo -n iptables -L OUTPUT | grep -q "nflog-group ${n}" || sudo -n iptables -I OUTPUT 1 ${r?`-p ${r}`:""} -m connmark --mark ${n} -j NFLOG --nflog-group ${n}\nmkdir -p $(dirname ${t})\nexec dumpcap -q -i nflog:${n} -w ${t}\n`,s=(0,o.spawn)(i,{shell:!0,stdio:["ignore","ignore","pipe"],detached:!0});let a="";s.stderr.on("data",(e=>{a+=e})),s.on("error",(e=>{d.error(`Error running command capturePackets ${e}: ${a}`)})),s.once("exit",(e=>{e?d.error(`capturePackets exited with code ${e}: ${a}`):d.debug("capturePackets exited")}));return async()=>{d.debug(`Stopping capture ${t}`),s.kill("SIGINT"),await(0,c.runShellCommand)(`#!/bin/bash\nsudo -n iptables -D INPUT ${r?`-p ${r}`:""} -m connmark --mark ${n} -j NFLOG --nflog-group ${n}\nsudo -n iptables -D OUTPUT ${r?`-p ${r}`:""} -m connmark --mark ${n} -j NFLOG --nflog-group ${n}\n`)}}t.throttleNotifier=new i.EventEmitter},857:e=>{e.exports=require("os")},859:function(e,t,r){e=r.nmd(e);var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(423),i=r(200),s=n(r(896)),a=n(r(865)),l=n(r(251)),c=r(28),d=r(670),u=r(185),p=(0,u.logger)("throttler");r.c[r.s]===e&&async function(){!function(){if(-1!==process.argv.findIndex((e=>0===e.localeCompare("--help")))){const e=(0,c.getConfigDocs)();let t="Params:\n --version\n It shows the package version.\n";Object.entries(e).forEach((([e,r])=>{t+=` --${(0,o.paramCase)(e)}\n${(0,l.default)(r.doc,{width:72,indent:" "})}\n Default: ${r.default}\n`})),console.log(t),process.exit(0)}else if(-1!==process.argv.findIndex((e=>0===e.localeCompare("--version")))){const e=a.default.parse(s.default.readFileSync((0,u.resolvePackagePath)("package.json")).toString()).version;console.log(e),process.exit(0)}}();const e=(0,c.loadConfig)(process.argv[2]),t=new Set;await(0,d.startThrottle)(e.throttleConfig);const r=async()=>{p.info("Stopping...");for(const e of t){const t=await(0,u.getProcessChildren)(e);p.debug(`Killing process ${e} and children: ${t}`);try{process.kill(e,"SIGKILL")}catch(t){p.debug(`Error killing process ${e}: ${t.stack}`)}for(const e of t)try{process.kill(e,"SIGKILL")}catch(t){p.debug(`Error killing child process ${e}: ${t.stack}`)}}await(0,d.stopThrottle)(),process.exit(0)};(0,u.registerExitHandler)((()=>r()));const n=e.commandConfig?a.default.parse(e.commandConfig):[];for(const e of n){const{session:r,command:n}=e,o=n.split(" ")[0],s=(0,d.getSessionThrottleIndex)(r||0),a=await(0,d.throttleLauncher)(n,s);try{const e=(0,i.spawn)(a,{shell:!1,stdio:["ignore","pipe","pipe"],detached:!1});e.pid&&t.add(e.pid),e.stdout.on("data",(e=>{p.info(`[${o}][stdout]`,e.toString().trim())})),e.stderr.on("data",(e=>{p.info(`[${o}][stderr]`,e.toString().trim())})),e.on("error",(e=>{e.message.startsWith("The operation was aborted")||p.error(`Error running command "${n}": ${e.stack}`)})),e.once("exit",(r=>{p.info(`Command "${n}" exited with code: ${r||0}`),e.pid&&t.delete(e.pid)}))}catch(e){p.error(`Error running command "${n}": ${e.stack}`)}}e.runDuration>0&&setTimeout(r,1e3*e.runDuration),console.log("Press [q] to stop the throttler"),process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.on("data",(async e=>{if(p.debug("[stdin]",e[0]),e[0]==="q".charCodeAt(0))try{await r()}catch(e){p.error(`stop error: ${e.stack}`),process.exit(1)}else console.log("Press [q] to stop the throttler")}))}().catch((e=>{console.error(e),process.exit(-1)}))},865:e=>{e.exports=require("json5")},896:e=>{e.exports=require("fs")},928:e=>{e.exports=require("path")},940:e=>{e.exports=require("debug-level")},950:e=>{e.exports=require("convict")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.c=t,r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);r(r.s=859)})();
2
+ (()=>{"use strict";var e={28:function(e,t,r){var n,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&o(t,e,r[s]);return i(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.getConfigDocs=function(){return g({},null,f.getSchema())},t.loadConfig=function(e,t){e&&(0,c.existsSync)(e)?(d.debug(`Loading config from ${e}`),f.loadFile(e)):t?(d.debug("Loading config from values."),f.load(t)):(d.debug("Using default values."),f.load({}));f.validate({allowed:"strict"});const r=f.getProperties();return d.debug("Using config:",r),r};const a=s(r(950)),l=r(618),c=r(896),d=(0,r(185).logger)("throttler:config"),u={name:"float",coerce:e=>parseFloat(e),validate:e=>{if(!Number.isFinite(e))throw new Error(`Invalid float: ${e}`)}},p={name:"index",coerce:e=>e,validate:e=>{if("string"==typeof e){if("true"===e||"false"===e||""===e)return;if(-1!==e.indexOf("-"))return void e.split("-").forEach((e=>{if(isNaN(parseInt(e))||!isFinite(parseInt(e)))throw new Error(`Invalid index: ${e}`)}));if(-1!==e.indexOf(","))return void e.split(",").forEach((e=>{if(isNaN(parseInt(e))||!isFinite(parseInt(e)))throw new Error(`Invalid index: ${e}`)}));if(isNaN(parseInt(e))||!isFinite(parseInt(e)))throw new Error(`Invalid index: ${e}`)}else if("number"==typeof e||"boolean"==typeof e)return;throw new Error(`Invalid index: ${e}`)}};(0,a.addFormats)({ipaddress:l.ipaddress,url:l.url,float:u,index:p});const f=(0,a.default)({runDuration:{doc:"If greater than 0, the test will stop after the provided number of seconds.",format:"nat",default:0,env:"RUN_DURATION",arg:"run-duration"},throttleConfig:{doc:"A JSON5 string with a valid network throttling configuration. Example: \n ```javascript\n [{\n sessions: '0-1',\n device: 'eth0',\n protocol: 'udp',\n capture: 'capture.pcap',\n up: {\n rate: 1000,\n delay: 50,\n loss: 5,\n queue: 10,\n },\n down: [\n { rate: 2000, delay: 50, loss: 2, queue: 20 },\n { rate: 1000, delay: 50, loss: 2, queue: 20, at: 60 },\n ]\n }]\n ```\nThe sessions field represents the sessions IDs range that will be affected by the rule, e.g.: \"0-10\", \"2,4\" or simply \"2\". The device, protocol, up, down fields are optional. When device is not set, the default route device will be used. If protocol is specified ('udp' or 'tcp'), only the packets with the specified protocol will be affected by the shaping rules. ",format:String,nullable:!0,default:"",env:"THROTTLE_CONFIG",arg:"throttle-config"},commandConfig:{doc:'The commands configuration.Example: \n ```javascript\n [{\n session: 0,\n command: "firefox https://www.speedtest.net",\n }]\n ```\n',format:String,nullable:!0,default:"",env:"COMMAND_CONFIG",arg:"command-config"}});function g(e,t,r){return r._cvtProperties?(Object.entries(r._cvtProperties).forEach((([r,n])=>{g(e,`${t?`${t}.`:""}${r}`,n)})),e):(t&&(e[t]={doc:r.doc,format:JSON.stringify(r.format,null,2),default:JSON.stringify(r.default,null,2)}),e)}f.getProperties()},185:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LoggerInterface=t.Log=void 0,t.logger=a,t.resolvePackagePath=function(e){if("__nexe"in process)return e;return s.default.join(s.default.dirname(__filename),e)},t.toPrecision=function(e,t=3){return(Math.round(e*10**t)/10**t).toFixed(t)},t.getDefaultNetworkInterface=async function(){if("linux"!==i.default.platform())return"lo";const{stdout:e}=await c("ip route | awk '/default/ {print $5; exit}' | tr -d ''");return e.trim()},t.checkNetworkInterface=async function(e){if("lo"===e)return;await c(`ip route | grep -q "dev ${e}"`)},t.runShellCommand=c,t.registerExitHandler=function(e){d.add(e)},t.unregisterExitHandler=function(e){d.delete(e)},t.runExitHandlersNow=f,t.handleExitSignals=function(){process.setMaxListeners(process.getMaxListeners()+g.length),g.forEach((e=>process.once(e,(async e=>{e instanceof Error?l.error(`Exit on error: ${e.stack||e.message}`):l.debug(`Exit on signal: ${e}`),await f(e),process.exit(0)}))))},t.getProcessChildren=async function e(t){l.debug(`getProcessChildren pid=${t}`);const r=[];try{const n=await c(`pgrep -P ${t}`);for(const t of n.stdout.trim().split("\n").map(Number)){r.push(t);try{const n=await e(t);for(const e of n)r.push(e)}catch(e){l.debug(`Error getting process ${t} children: ${e.message}`)}}}catch(e){l.debug(`Error getting process ${t} children: ${e.message}`)}return r};const o=r(200),i=(n(r(896)),n(r(857))),s=n(r(928));function a(e,r={}){return new t.Log(e,{splitLine:!1,...r})}t.Log=r(940).Log;t.LoggerInterface=class{name;logInit(e){this.name&&e.unshift(`[${this.name}]`)}debug(...e){this.logInit(e),l.debug(...e)}info(...e){this.logInit(e),l.info(...e)}warn(...e){this.logInit(e),l.warn(...e)}error(...e){this.logInit(e),l.error(...e)}log(...e){this.logInit(e),l.log(...e)}};const l=a("webrtcperf:utils");async function c(e,t=!1){return t&&l.debug(`runShellCommand cmd: ${e}`),new Promise(((r,n)=>{const i=(0,o.spawn)(e,{shell:!0,stdio:["ignore","pipe","pipe"],detached:!0});let s="",a="";i.stdout.on("data",(e=>{s.length>524288&&(s=s.slice(e.length)),s+=e})),i.stderr.on("data",(e=>{a.length>524288&&(a=a.slice(e.length)),a+=e})),i.once("error",(e=>n(e))),i.once("close",(o=>{0!==o?n(new Error(`runShellCommand cmd: ${e} failed with code ${o}: ${a}`)):(t&&l.debug(`runShellCommand cmd: ${e} done`,{stdout:s,stderr:a}),r({stdout:s,stderr:a}))}))}))}const d=new Set;const u=async e=>{let t=0;for(const r of d.values()){const n=`${t+1}/${d.size}`;l.debug(`running exitHandler ${n}`);try{await r(e),l.debug(` exitHandler ${n} done`)}catch(e){l.error(`exitHandler ${n} error: ${e}`)}t++}d.clear()};let p=null;async function f(e){p||(p=u(e)),await p}const g=["beforeExit","uncaughtException","unhandledRejection","SIGHUP","SIGINT","SIGQUIT","SIGILL","SIGTRAP","SIGABRT","SIGBUS","SIGFPE","SIGUSR1","SIGSEGV","SIGUSR2","SIGTERM"]},200:e=>{e.exports=require("child_process")},251:e=>{e.exports=require("word-wrap")},261:e=>{e.exports=require("events")},423:e=>{e.exports=require("change-case")},618:e=>{e.exports=require("convict-format-with-validator")},670:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.throttleNotifier=void 0,t.startThrottle=async function(e){try{u=a.default.parse(e),d.debug("Starting throttle with config:",u),await $(),await async function(){if(!u||!u.length)return;let e=u[0].device;if(e)try{await(0,c.checkNetworkInterface)(e)}catch(t){d.warn(`Network interface ${e} not found, using default.`),e=""}e||(e=await(0,c.getDefaultNetworkInterface)());await h(`set -e;\n\nsudo -n modprobe ifb || true;\nsudo -n ip link add ifb0 type ifb || true;\nsudo -n ip link set dev ifb0 up;\n\nsudo -n tc qdisc add dev ${e} root handle 1: htb default 1;\nsudo -n tc class add dev ${e} parent 1: classid 1:1 htb rate 1Gbit ceil 1Gbit;\n\nsudo -n tc qdisc add dev ifb0 root handle 1: htb default 1;\nsudo -n tc class add dev ifb0 parent 1: classid 1:1 htb rate 1Gbit ceil 1Gbit;\n\nsudo -n tc qdisc add dev ${e} ingress handle ffff: || true;\nsudo -n tc filter add dev ${e} parent ffff: protocol ip u32 match u32 0 0 action connmark action mirred egress redirect dev ifb0 flowid 1:1;\n`,!0);let t=0;for(const r of u)r.up&&await w(r,"up",e,t,r.protocol,r.match),r.down&&await w(r,"down","ifb0",t,r.protocol,r.match),r.capture&&"linux"===l.default.platform()&&f.set(t,v(t,r.capture,r.protocol)),t++}()}catch(t){throw d.error(`startThrottle "${e}" error: ${t.stack}`),await b(),t}},t.stopThrottle=b,t.getSessionThrottleIndex=function(e){if(!u)return-1;for(const[t,r]of u.entries())if(void 0!==r.sessions&&""!==r.sessions)try{if(r.sessions.includes("-")){const[n,o]=r.sessions.split("-").map(Number);if(e>=n&&e<=o)return t}else if(r.sessions.includes(",")){if(r.sessions.split(",").map(Number).includes(e))return t}else if(e===Number(r.sessions))return t}catch(t){d.error(`getSessionThrottleId sessionId=${e} error: ${t.stack}`)}return-1},t.getSessionThrottleValues=function(e,t){if(e<0)return{};return g[t].get(e)||{}},t.throttleLauncher=async function(e,t){if(d.debug(`throttleLauncher executablePath=${e} index=${t}`),!u||t<0)return e;const r=u[t],n=t+1,o=`/tmp/throttler-launcher-${t}`,i=`throttler${t}`,a=`${r.protocol?`-p ${r.protocol}`:""}${r.skipSourcePorts?` -m multiport ! --sports ${r.skipSourcePorts}`:""}${r.skipDestinationPorts?` -m multiport ! --dports ${r.skipDestinationPorts}`:""}${r.filter?` ${r.filter}`:""}`;return await s.default.promises.writeFile(o,`#!/bin/bash\ngetent group ${i} >/dev/null || sudo -n addgroup --system ${i}\nsudo -n adduser $USER ${i} --quiet\n\nrule=$(sudo -n iptables -t mangle -L OUTPUT --line-numbers | grep "owner GID match ${i}" | awk '{print $1}')\nif [ -n "$rule" ]; then\n sudo -n iptables -t mangle -R OUTPUT \${rule} ${a} -m owner --gid-owner ${i} -j MARK --set-mark ${n} \nelse\n sudo -n iptables -t mangle -I OUTPUT 1 ${a} -m owner --gid-owner ${i} -j MARK --set-mark ${n}\nfi\n\nsudo -n iptables -t mangle -L PREROUTING | grep -q "CONNMARK restore" || sudo -n iptables -t mangle -I PREROUTING 1 -j CONNMARK --restore-mark\nsudo -n iptables -t mangle -L POSTROUTING | grep -q "CONNMARK save" || sudo -n iptables -t mangle -I POSTROUTING 1 -j CONNMARK --save-mark\n\nfunction stop() {\n echo "Stopping throttler"\n}\ntrap stop SIGINT SIGTERM\n\necho "running: ${e} $@"\nexec newgrp ${i} <<EOF\n${e} $@\nEOF`),await s.default.promises.chmod(o,493),o};const o=r(200),i=r(261),s=n(r(896)),a=n(r(865)),l=n(r(857)),c=r(185),d=(0,c.logger)("throttler:throttle");let u=null;const p=new Set,f=new Map,g={up:new Map,down:new Map};async function h(e,t=!1){"linux"===l.default.platform()&&await(0,c.runShellCommand)(e,t)}async function $(){await Promise.allSettled([...f.values()].map((e=>e()))),f.clear(),p.forEach((e=>clearTimeout(e))),p.clear(),g.up.clear(),g.down.clear(),t.throttleNotifier.emit("change");let e=u?.length?u[0].device:"";e||(e=await(0,c.getDefaultNetworkInterface)()),await h(`sudo -n tc qdisc del dev ${e} root || true;\nsudo -n tc class del dev ${e} || true;\nsudo -n tc filter del dev ${e} || true;\nsudo -n tc qdisc del dev ${e} ingress || true;\n\nsudo -n tc qdisc del dev ifb0 root || true;\nsudo -n tc class del dev ifb0 root || true;\nsudo -n tc filter del dev ifb0 root || true;\n`),await async function(){if(!u?.length)return;d.debug(`cleanupRules (${u.length})`);try{await h(`for i in $(seq 0 ${u.length}); do\n rule=$(sudo -n iptables -t mangle -L OUTPUT --line-numbers | grep "owner GID match throttler\${i}" | awk '{print $1}');\n if [ -n "$rule" ]; then\n sudo -n iptables -t mangle -D OUTPUT \${rule};\n fi;\ndone;`)}catch(e){d.error(`cleanupRules error: ${e.stack}`)}}()}function m(e,t,r=1500){return Math.ceil(1.5*e*1e3/8*(t/1e3)/r)}async function w(e,r,n,o,i,s){let a=e[r];if(a){d.debug(`applyRules device=${n} index=${o} protocol=${i} match=${s} ${JSON.stringify(a)}`),Array.isArray(a)||(a=[a]),a.sort(((e,t)=>(e.at||0)-(t.at||0)));for(const[e,l]of a.entries()){const{rate:a,delay:u,delayJitter:f,delayJitterCorrelation:$,delayDistribution:w,reorder:b,reorderCorrelation:v,reorderGap:I,loss:y,lossBurst:x,queue:S,at:k}=l,P=m(a||0,u||0),N=Math.max(S||0,P),T=o+1,O=o+2;if(0===e){const e=[`'meta(nf_mark eq ${T})'`];"udp"===i?e.push("'cmp(u8 at 9 layer network eq 0x11)'"):"tcp"===i&&e.push("'cmp(u8 at 9 layer network eq 0x6)'"),s&&e.push(s);const t=`set -e;\n\nsudo -n tc class add dev ${n} parent 1: classid 1:${O} htb rate 1Gbit ceil 1Gbit;\n\nsudo -n tc qdisc add dev ${n} parent 1:${O} handle ${O}: netem; \nsudo -n tc filter add dev ${n} parent 1: protocol ip basic match ${e.join(" and ")} flowid 1:${O};\n`;try{await h(t,!0)}catch(e){throw d.error(`error running "${t}": ${e.stack}`),e}}const E=setTimeout((async()=>{let e="";if(a&&a>0&&(e+=` rate ${a}kbit`),N&&N>0&&(e+=` limit ${N}`),u&&u>0&&(e+=` delay ${u}ms`,f&&f>0&&(e+=` ${f}ms`,$&&$>0&&(e+=` ${$}`)),w&&(e+=` distribution ${w}`)),y&&y>0)if(x&&x>0){const t=100*y/(x*(100-y)),r=100/x;e+=` loss gemodel ${(0,c.toPrecision)(t,2)} ${(0,c.toPrecision)(r,2)}`}else e+=` loss ${(0,c.toPrecision)(y,2)}%`;b&&b>0&&(e+=` reorder ${(0,c.toPrecision)(b,2)}%`,v&&v>0&&(e+=` ${(0,c.toPrecision)(v,2)}`),I&&I>0&&(e+=` gap ${I}`)),d.debug(`applying rules on ${n} (${T}): ${e.trim()}`);const i=`sudo -n tc qdisc change dev ${n} parent 1:${O} handle ${O}: netem ${e}`;try{p.delete(E),await h(i),g[r].set(o,{rate:a?1e3*a:void 0,delay:u||void 0,loss:y||void 0,queue:N||void 0}),t.throttleNotifier.emit("change")}catch(e){d.error(`error running "${i}": ${e.stack}`)}}),1e3*(k||0));p.add(E)}}}async function b(){try{d.debug("Stopping throttle"),await $(),d.debug("Stopping throttle done"),u=null}catch(e){d.error(`Stop throttle error: ${e.stack}`)}}function v(e,t,r){const n=e+1;d.debug(`Starting capture ${t}`);const i=`#!/bin/bash\nsudo -n iptables -L INPUT | grep -q "nflog-group ${n}" || sudo -n iptables -I INPUT 1 ${r?`-p ${r}`:""} -m connmark --mark ${n} -j NFLOG --nflog-group ${n}\nsudo -n iptables -L OUTPUT | grep -q "nflog-group ${n}" || sudo -n iptables -I OUTPUT 1 ${r?`-p ${r}`:""} -m connmark --mark ${n} -j NFLOG --nflog-group ${n}\nmkdir -p $(dirname ${t})\nexec dumpcap -q -i nflog:${n} -w ${t}\n`,s=(0,o.spawn)(i,{shell:!0,stdio:["ignore","ignore","pipe"],detached:!0});let a="";s.stderr.on("data",(e=>{a+=e})),s.on("error",(e=>{d.error(`Error running command capturePackets ${e}: ${a}`)})),s.once("exit",(e=>{e?d.error(`capturePackets exited with code ${e}: ${a}`):d.debug("capturePackets exited")}));return async()=>{d.debug(`Stopping capture ${t}`),s.kill("SIGINT"),await(0,c.runShellCommand)(`#!/bin/bash\nsudo -n iptables -D INPUT ${r?`-p ${r}`:""} -m connmark --mark ${n} -j NFLOG --nflog-group ${n}\nsudo -n iptables -D OUTPUT ${r?`-p ${r}`:""} -m connmark --mark ${n} -j NFLOG --nflog-group ${n}\n`)}}t.throttleNotifier=new i.EventEmitter},857:e=>{e.exports=require("os")},859:function(e,t,r){e=r.nmd(e);var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(423),i=r(200),s=n(r(896)),a=n(r(865)),l=n(r(251)),c=r(28),d=r(670),u=r(185),p=(0,u.logger)("throttler");r.c[r.s]===e&&async function(){!function(){if(-1!==process.argv.findIndex((e=>0===e.localeCompare("--help")))){const e=(0,c.getConfigDocs)();let t="Params:\n --version\n It shows the package version.\n";Object.entries(e).forEach((([e,r])=>{t+=` --${(0,o.paramCase)(e)}\n${(0,l.default)(r.doc,{width:72,indent:" "})}\n Default: ${r.default}\n`})),console.log(t),process.exit(0)}else if(-1!==process.argv.findIndex((e=>0===e.localeCompare("--version")))){const e=a.default.parse(s.default.readFileSync((0,u.resolvePackagePath)("package.json")).toString()).version;console.log(e),process.exit(0)}}(),(0,u.handleExitSignals)();const e=(0,c.loadConfig)(process.argv[2]),t=new Set;await(0,d.startThrottle)(e.throttleConfig);const r=async()=>{p.info("Stopping...");for(const e of t){const t=await(0,u.getProcessChildren)(e);p.debug(`Killing process ${e} and children: ${t}`);try{process.kill(e,"SIGKILL")}catch(t){p.debug(`Error killing process ${e}: ${t.stack}`)}for(const e of t)try{process.kill(e,"SIGKILL")}catch(t){p.debug(`Error killing child process ${e}: ${t.stack}`)}}await(0,d.stopThrottle)(),process.exit(0)};(0,u.registerExitHandler)((()=>r()));const n=e.commandConfig?a.default.parse(e.commandConfig):[];for(const e of n){const{session:r,command:n}=e,o=n.split(" ")[0],s=(0,d.getSessionThrottleIndex)(r||0),a=await(0,d.throttleLauncher)(n,s);try{const e=(0,i.spawn)(a,{shell:!1,stdio:["ignore","pipe","pipe"],detached:!1});e.pid&&t.add(e.pid),e.stdout.on("data",(e=>{p.info(`[${o}][stdout]`,e.toString().trim())})),e.stderr.on("data",(e=>{p.info(`[${o}][stderr]`,e.toString().trim())})),e.on("error",(e=>{e.message.startsWith("The operation was aborted")||p.error(`Error running command "${n}": ${e.stack}`)})),e.once("exit",(r=>{p.info(`Command "${n}" exited with code: ${r||0}`),e.pid&&t.delete(e.pid)}))}catch(e){p.error(`Error running command "${n}": ${e.stack}`)}}e.runDuration>0&&setTimeout(r,1e3*e.runDuration),console.log("Press [q] to stop the throttler"),process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.on("data",(async e=>{if(p.debug("[stdin]",e[0]),e[0]==="q".charCodeAt(0))try{await r()}catch(e){p.error(`stop error: ${e.stack}`),process.exit(1)}else console.log("Press [q] to stop the throttler")}))}().catch((e=>{console.error(e),process.exit(-1)}))},865:e=>{e.exports=require("json5")},896:e=>{e.exports=require("fs")},928:e=>{e.exports=require("path")},940:e=>{e.exports=require("debug-level")},950:e=>{e.exports=require("convict")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.c=t,r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);r(r.s=859)})();