mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-11 15:14:36 +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 = [];
|
let result = [];
|
||||||
const args = Array.isArray(arguments[0]) ? arguments[0] : arguments;
|
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) {
|
if(_.isString(arg) && arg in SGRValues) {
|
||||||
result.push(SGRValues[arg]);
|
result.push(SGRValues[arg]);
|
||||||
} else if(_.isNumber(arg)) {
|
} else if(_.isNumber(arg)) {
|
||||||
result.push(arg);
|
result.push(arg);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
return `${ESC_CSI}${result.join(';')}m`;
|
return `${ESC_CSI}${result.join(';')}m`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue