mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 14:44:40 +02:00
Fix issue parsing args in sgr() introduced recently
This commit is contained in:
parent
dc8a06331b
commit
a3b4568a76
1 changed files with 3 additions and 2 deletions
|
@ -354,13 +354,14 @@ function sgr() {
|
|||
let result = [];
|
||||
const args = Array.isArray(arguments[0]) ? arguments[0] : arguments;
|
||||
|
||||
args.forEach(arg => {
|
||||
for(let i = 0; i < args.length; ++i) {
|
||||
const arg = args[i];
|
||||
if(_.isString(arg) && arg in SGRValues) {
|
||||
result.push(SGRValues[arg]);
|
||||
} else if(_.isNumber(arg)) {
|
||||
result.push(arg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return `${ESC_CSI}${result.join(';')}m`;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue