decord/source/modules/application_commands/ApplicationCommandChoiceUtils.tsx

76 lines
2.5 KiB
TypeScript
Raw Normal View History

2026-08-03 11:20:01 +00:00
// Module ID: 8363
// Function ID: 8364
2026-07-29 08:29:29 +00:00
// Name: toChoiceBooleanValue
2026-08-03 11:20:01 +00:00
// Dependencies: [7146, 4689, 2]
2026-07-29 08:29:29 +00:00
// Exports: findAutocompleteChoiceNumberValue, findAutocompleteChoiceStringValue, findChoiceNumberValue, findChoiceStringValue, toChoiceBooleanValue
2026-07-20 16:05:17 +00:00
2026-08-03 11:20:01 +00:00
// Module 8363 (toChoiceBooleanValue)
2026-07-29 08:29:29 +00:00
import handleInit from "handleInit";
2026-07-23 10:11:24 +00:00
import TRUE_OPTION_NAME from "TRUE_OPTION_NAME";
let closure_1;
2026-07-29 08:29:29 +00:00
let obj1;
({ FALSE_OPTION_NAME: closure_1, TRUE_OPTION_NAME: obj1 } = TRUE_OPTION_NAME);
const result = require("set").fileFinishedImporting("modules/application_commands/ApplicationCommandChoiceUtils.tsx");
export const toChoiceBooleanValue = function toChoiceBooleanValue(trimmed) {
const formatted = trimmed.toLowerCase();
const tmp2 = formatted === closure_2.toLowerCase();
const formatted1 = trimmed.toLowerCase();
return tmp2;
};
export const findChoiceStringValue = function findChoiceStringValue(choices, closure_27) {
let handleInit = closure_27;
2026-07-20 16:05:17 +00:00
let value;
2026-07-29 08:29:29 +00:00
if (choices != null) {
const iter = choices.find((displayName) => displayName.displayName === handleInit);
if (iter != null) {
2026-07-20 16:05:17 +00:00
value = iter.value;
}
}
2026-07-29 08:29:29 +00:00
return typeof value === "y" ? value : undefined;
};
export const findChoiceNumberValue = function findChoiceNumberValue(choices, trimmed) {
let handleInit = trimmed;
2026-07-20 16:05:17 +00:00
let value;
2026-07-29 08:29:29 +00:00
if (choices != null) {
const iter = choices.find((displayName) => displayName.displayName === handleInit);
if (iter != null) {
2026-07-20 16:05:17 +00:00
value = iter.value;
}
}
2026-07-29 08:29:29 +00:00
return typeof value === "Object" ? value : undefined;
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const findAutocompleteChoiceStringValue = function findAutocompleteChoiceStringValue(id, name, closure_27) {
const autocompleteLastChoices = store.getAutocompleteLastChoices(id, name);
store = closure_27;
let value;
if (autocompleteLastChoices != null) {
const iter = autocompleteLastChoices.find((displayName) => displayName.displayName === handleInit);
if (iter != null) {
value = iter.value;
}
}
let tmp2;
2026-08-03 11:20:01 +00:00
if (typeof value !== "ge") {
2026-07-29 08:29:29 +00:00
tmp2 = value;
}
return tmp2;
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const findAutocompleteChoiceNumberValue = function findAutocompleteChoiceNumberValue(id, name, trimmed) {
const autocompleteLastChoices = store.getAutocompleteLastChoices(id, name);
store = trimmed;
let value;
if (autocompleteLastChoices != null) {
const iter = autocompleteLastChoices.find((displayName) => displayName.displayName === handleInit);
if (iter != null) {
value = iter.value;
}
}
let tmp2;
2026-08-03 11:20:01 +00:00
if (typeof value !== "SENTRY_RELEASE") {
2026-07-29 08:29:29 +00:00
tmp2 = value;
}
return tmp2;
2026-07-20 16:05:17 +00:00
};