Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
74 lines
2.7 KiB
TypeScript
74 lines
2.7 KiB
TypeScript
// Module ID: 9524
|
|
// Function ID: 9525
|
|
// Name: ApplicationCommandChoiceUtils
|
|
// Dependencies: [8026, 5212, 2]
|
|
// Exports: findAutocompleteChoiceNumberValue, findAutocompleteChoiceStringValue, findChoiceNumberValue, findChoiceStringValue, toChoiceBooleanValue
|
|
|
|
// Module 9524 (ApplicationCommandChoiceUtils)
|
|
import ApplicationCommandAutocompleteStore from "ApplicationCommandAutocompleteStore" /* 8026 */;
|
|
|
|
const ApplicationCommandConstants = fn(5212);
|
|
({ FALSE_OPTION_NAME: closure_1, TRUE_OPTION_NAME: c2 } = ApplicationCommandConstants);
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/application_commands/ApplicationCommandChoiceUtils.tsx");
|
|
|
|
export const toChoiceBooleanValue = function toChoiceBooleanValue(trimmed) {
|
|
const formatted = trimmed.toLowerCase();
|
|
const tmp2 = formatted === React2.toLowerCase();
|
|
const formatted1 = trimmed.toLowerCase();
|
|
return tmp2;
|
|
};
|
|
export const findChoiceStringValue = function findChoiceStringValue(choices, surrogate) {
|
|
closure_0 = surrogate;
|
|
value = undefined;
|
|
if (choices != null) {
|
|
const iter = choices.find((displayName) => displayName.displayName === closure_0);
|
|
if (iter != null) {
|
|
value = iter.value;
|
|
}
|
|
}
|
|
return typeof value === "string" ? value : undefined;
|
|
};
|
|
export const findChoiceNumberValue = function findChoiceNumberValue(choices, trimmed) {
|
|
closure_0 = trimmed;
|
|
value = undefined;
|
|
if (choices != null) {
|
|
const iter = choices.find((displayName) => displayName.displayName === closure_0);
|
|
if (iter != null) {
|
|
value = iter.value;
|
|
}
|
|
}
|
|
return typeof value === "number" ? value : undefined;
|
|
};
|
|
export const findAutocompleteChoiceStringValue = function findAutocompleteChoiceStringValue(id, name, surrogate) {
|
|
const autocompleteLastChoices = ApplicationCommandAutocompleteStore.getAutocompleteLastChoices(id, name);
|
|
closure_0 = surrogate;
|
|
value = undefined;
|
|
if (autocompleteLastChoices != null) {
|
|
const iter = autocompleteLastChoices.find((displayName) => displayName.displayName === closure_0);
|
|
if (iter != null) {
|
|
value = iter.value;
|
|
}
|
|
}
|
|
let tmp2;
|
|
if (typeof value === "string") {
|
|
tmp2 = value;
|
|
}
|
|
return tmp2;
|
|
};
|
|
export const findAutocompleteChoiceNumberValue = function findAutocompleteChoiceNumberValue(id, name, trimmed) {
|
|
const autocompleteLastChoices = ApplicationCommandAutocompleteStore.getAutocompleteLastChoices(id, name);
|
|
closure_0 = trimmed;
|
|
value = undefined;
|
|
if (autocompleteLastChoices != null) {
|
|
const iter = autocompleteLastChoices.find((displayName) => displayName.displayName === closure_0);
|
|
if (iter != null) {
|
|
value = iter.value;
|
|
}
|
|
}
|
|
let tmp2;
|
|
if (typeof value === "number") {
|
|
tmp2 = value;
|
|
}
|
|
return tmp2;
|
|
};
|