(text: string | undefined)
| 70 | } |
| 71 | |
| 72 | function title(text: string | undefined): string { |
| 73 | if (!text) { |
| 74 | return SPLASH_TITLE_FALLBACK |
| 75 | } |
| 76 | |
| 77 | let value = "" |
| 78 | let gap = false |
| 79 | for (const char of text.trim()) { |
| 80 | if (char === " " || char === "\n" || char === "\r" || char === "\t") { |
| 81 | gap = true |
| 82 | continue |
| 83 | } |
| 84 | |
| 85 | if (gap && value.length > 0) { |
| 86 | value += " " |
| 87 | } |
| 88 | |
| 89 | value += char |
| 90 | gap = false |
| 91 | } |
| 92 | |
| 93 | if (!value) { |
| 94 | return SPLASH_TITLE_FALLBACK |
| 95 | } |
| 96 | |
| 97 | return Locale.truncate(value, SPLASH_TITLE_LIMIT) |
| 98 | } |
| 99 | |
| 100 | function write( |
| 101 | root: BoxRenderable, |
no outgoing calls
no test coverage detected