decord/stable/source/utils/ProcessArgs.tsx

81 lines
2.1 KiB
TypeScript
Raw Permalink Normal View History

2026-10-06 22:12:49 +00:00
// Module ID: 5454
// Function ID: 5455
// Name: ProcessArgs
2026-10-06 22:12:49 +00:00
// Dependencies: [4453, 2]
2026-10-06 22:12:49 +00:00
// Module 5454 (ProcessArgs)
import DiscordNativeDefault from "DiscordNative" /* 4453 */;
import size from "module_2" /* 2 */;
2026-10-06 22:12:49 +00:00
class ProcessArgs {
static get() {
if (null == ProcessArgs.cached) {
const tmp4 = DiscordNativeDefault;
let mainArgvSync;
if (tmp4 != null) {
const processUtils = tmp4.processUtils;
if (processUtils != null) {
const getMainArgvSync = processUtils.getMainArgvSync;
if (getMainArgvSync != null) {
mainArgvSync = getMainArgvSync();
}
}
}
2026-10-06 22:12:49 +00:00
const tmp5 = null != mainArgvSync && mainArgvSync.length > 1;
if (tmp5) {
mainArgvSync.shift();
}
if (mainArgvSync == null) {
mainArgvSync = [];
}
ProcessArgs.cached = mainArgvSync;
}
2026-10-06 22:12:49 +00:00
return ProcessArgs.cached;
}
2026-10-06 22:12:49 +00:00
static contains(arg0) {
const value = ProcessArgs.get();
return value.includes(arg0);
}
static isEnvVariableTrue(DISCORD_DISALLOW_POPUPS) {
if (undefined === DiscordNativeDefault) {
return false;
} else {
const tmpResult = DiscordNativeDefault;
let tmp5;
if (tmpResult != null) {
const _process = tmpResult.process;
if (_process != null) {
const env = _process.env;
if (env != null) {
tmp5 = env[DISCORD_DISALLOW_POPUPS];
}
}
}
2026-10-06 22:12:49 +00:00
if ("1" !== tmp5) {
if ("true" !== tmp5) {
return false;
}
}
2026-10-06 22:12:49 +00:00
return true;
}
}
static isDisallowPopupsSet() {
const hasItem = ProcessArgs.contains("--disallow-popups");
let tmp2 = !hasItem;
const obj = ProcessArgs;
if (tmp2) {
tmp2 = !obj.isEnvVariableTrue("DISCORD_DISALLOW_POPUPS");
}
2026-10-06 22:12:49 +00:00
return !tmp2;
}
static isDiscordTestSet() {
return ProcessArgs.isEnvVariableTrue("DISCORD_TEST");
}
2026-10-06 22:12:49 +00:00
static isDiscordGatewayPlaintextSet() {
return false;
}
2026-10-06 22:12:49 +00:00
}
const result = size.fileFinishedImporting("utils/ProcessArgs.tsx");
2026-10-06 22:12:49 +00:00
export { ProcessArgs };