remove empty first string and last string from unsplit list-parsed unnamed argument

This commit is contained in:
LenAnderson 2024-06-25 21:06:27 -04:00
parent adc54e7f22
commit 1fc34bd387
1 changed files with 6 additions and 0 deletions

View File

@ -946,10 +946,16 @@ export class SlashCommandParser {
const firstVal = listValues[0];
if (typeof firstVal.value == 'string') {
firstVal.value = firstVal.value.trimStart();
if (firstVal.value.length == 0) {
listValues.shift();
}
}
const lastVal = listValues.slice(-1)[0];
if (typeof lastVal.value == 'string') {
lastVal.value = lastVal.value.trimEnd();
if (lastVal.value.length == 0) {
listValues.pop();
}
}
return listValues;
}