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 // left pad to fixed width
if (PORT_FORMAT.padLeftTo && p.length < PORT_FORMAT.padLeftTo) { //if (PORT_FORMAT.padLeftTo && p.length < PORT_FORMAT.padLeftTo) {
p = p.padStart(PORT_FORMAT.padLeftTo, PORT_FORMAT.padChar); // p = p.padStart(PORT_FORMAT.padLeftTo, PORT_FORMAT.padChar);
} //}
// map digits // map digits
let out = ""; //let out = "";
for (const ch of p) out += PORT_FORMAT.fancy[ch] ?? ch; //for (const ch of p) out += PORT_FORMAT.fancy[ch] ?? ch;
out = "✳️"
return out; return out;
} }