mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
fix typehints for while unnamed arg / command
This commit is contained in:
@ -316,14 +316,21 @@ function listVariablesCallback() {
|
|||||||
sendSystemMessage(system_message_types.GENERIC, htmlMessage);
|
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 isGuardOff = isFalseBoolean(args.guard);
|
||||||
const iterations = isGuardOff ? Number.MAX_SAFE_INTEGER : MAX_LOOPS;
|
const iterations = isGuardOff ? Number.MAX_SAFE_INTEGER : MAX_LOOPS;
|
||||||
if (command) {
|
/**@type {string|SlashCommandClosure} */
|
||||||
if (command[0] instanceof SlashCommandClosure) {
|
let command;
|
||||||
command = command[0];
|
if (value) {
|
||||||
|
if (value[0] instanceof SlashCommandClosure) {
|
||||||
|
command = value[0];
|
||||||
} else {
|
} else {
|
||||||
command = command.join(' ');
|
command = value.join(' ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user