Strip control characters and truncate to MAX_LABEL_LENGTH.
(raw: string)
| 72 | |
| 73 | /** Strip control characters and truncate to MAX_LABEL_LENGTH. */ |
| 74 | function cleanLabel(raw: string): string { |
| 75 | const stripped = raw.replace(/[\n\r\t]+/g, ' ').trim(); |
| 76 | return stripped.length > LABEL_MAX_LENGTH |
| 77 | ? stripped.slice(0, LABEL_MAX_LENGTH) + '…' |
| 78 | : stripped; |
| 79 | } |
| 80 | |
| 81 | // ─── Types ────────────────────────────────────────────────────────────── |
| 82 |
no outgoing calls
no test coverage detected