Fix issue parsing args in sgr() introduced recently
This commit is contained in:
parent
dc8a06331b
commit
a3b4568a76
|
@ -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…
Reference in New Issue