mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-12 01:17:39 +01:00
fix typehints for while unnamed arg / command
This commit is contained in:
parent
963e525e07
commit
89de668241
@ -316,14 +316,21 @@ function listVariablesCallback() {
|
||||
sendSystemMessage(system_message_types.GENERIC, htmlMessage);
|
||||
}
|
||||
|
||||
async function whileCallback(args, command) {
|
||||
/**
|
||||
*
|
||||
* @param {import('./slash-commands/SlashCommand.js').NamedArguments} args
|
||||
* @param {(string|SlashCommandClosure)[]} value
|
||||
*/
|
||||
async function whileCallback(args, value) {
|
||||
const isGuardOff = isFalseBoolean(args.guard);
|
||||
const iterations = isGuardOff ? Number.MAX_SAFE_INTEGER : MAX_LOOPS;
|
||||
if (command) {
|
||||
if (command[0] instanceof SlashCommandClosure) {
|
||||
command = command[0];
|
||||
/**@type {string|SlashCommandClosure} */
|
||||
let command;
|
||||
if (value) {
|
||||
if (value[0] instanceof SlashCommandClosure) {
|
||||
command = value[0];
|
||||
} else {
|
||||
command = command.join(' ');
|
||||
command = value.join(' ');
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user