Merge pull request #2923 from SillyTavern/fix-piping-split-unnamed-args

Fix piping not actually using/inputting an array for empty unnamed args
This commit is contained in:
Cohee 2024-09-30 23:25:20 +03:00 committed by GitHub
commit bc05c8de15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -508,6 +508,14 @@ export class SlashCommandClosure {
return v;
});
}
value ??= '';
// Make sure that if unnamed args are split, it should always return an array
if (executor.command.splitUnnamedArgument && !Array.isArray(value)) {
value = [value];
}
return value;
}