Refactor port formatting logic to simplify output generation

This commit is contained in:
2026-02-18 23:58:32 +03:00
parent 99b914fae5
commit a88790ade9

View File

@@ -247,13 +247,14 @@ function portToFancy(port, type) {
}
// left pad to fixed width
if (PORT_FORMAT.padLeftTo && p.length < PORT_FORMAT.padLeftTo) {
p = p.padStart(PORT_FORMAT.padLeftTo, PORT_FORMAT.padChar);
}
//if (PORT_FORMAT.padLeftTo && p.length < PORT_FORMAT.padLeftTo) {
// p = p.padStart(PORT_FORMAT.padLeftTo, PORT_FORMAT.padChar);
//}
// map digits
let out = "";
for (const ch of p) out += PORT_FORMAT.fancy[ch] ?? ch;
//let out = "";
//for (const ch of p) out += PORT_FORMAT.fancy[ch] ?? ch;
out = "✳️"
return out;
}