(str: string)
| 49 | /[\p{Script_Extensions=Han}\p{Script_Extensions=Hiragana}\p{Script_Extensions=Katakana}\p{Script_Extensions=Hangul}\p{Script_Extensions=Bopomofo}]/u; |
| 50 | |
| 51 | function isPrintableAscii(str: string): boolean { |
| 52 | for (let i = 0; i < str.length; i++) { |
| 53 | const code = str.charCodeAt(i); |
| 54 | if (code < 0x20 || code > 0x7e) { |
| 55 | return false; |
| 56 | } |
| 57 | } |
| 58 | return true; |
| 59 | } |
| 60 | |
| 61 | function truncateFragmentToWidth(text: string, maxWidth: number): { text: string; width: number } { |
| 62 | if (maxWidth <= 0 || text.length === 0) { |
no outgoing calls
no test coverage detected