Fix type errors in variables.js

c094e5d8efaa3d4595e80a1c9bb360e6b6f6f80c

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +2 -2Showing whitespace changes
public/scripts/variables.js+2 -2
@@ -321,7 +321,7 @@ async function listVariablesCallback(args) {
321 */321 */
322async function whileCallback(args, value) {322async function whileCallback(args, value) {
323 if (args.guard instanceof SlashCommandClosure) throw new Error('argument \'guard\' cannot be a closure for command /while');323 if (args.guard instanceof SlashCommandClosure) throw new Error('argument \'guard\' cannot be a closure for command /while');
324 const isGuardOff = isFalseBoolean(args.guard);324 const isGuardOff = isFalseBoolean(args.guard?.toString());
325 const iterations = isGuardOff ? Number.MAX_SAFE_INTEGER : MAX_LOOPS;325 const iterations = isGuardOff ? Number.MAX_SAFE_INTEGER : MAX_LOOPS;
326 /**@type {string|SlashCommandClosure} */326 /**@type {string|SlashCommandClosure} */
327 let command;327 let command;
@@ -380,7 +380,7 @@ async function timesCallback(args, value) {
380 [repeats, ...command] = /**@type {string}*/(value).split(' ');380 [repeats, ...command] = /**@type {string}*/(value).split(' ');
381 command = command.join(' ');381 command = command.join(' ');
382 }382 }
383 const isGuardOff = isFalseBoolean(args.guard);383 const isGuardOff = isFalseBoolean(args.guard?.toString());
384 const iterations = Math.min(Number(repeats), isGuardOff ? Number.MAX_SAFE_INTEGER : MAX_LOOPS);384 const iterations = Math.min(Number(repeats), isGuardOff ? Number.MAX_SAFE_INTEGER : MAX_LOOPS);
385 let result;385 let result;
386 for (let i = 0; i < iterations; i++) {386 for (let i = 0; i < iterations; i++) {