(codepoint: number)
| 87 | * it is from, or null if it is not part of a known block |
| 88 | */ |
| 89 | export function scriptFromCodepoint(codepoint: number): string | null | undefined { |
| 90 | for (let i = 0; i < scriptData.length; i++) { |
| 91 | const script = scriptData[i]; |
| 92 | for (let i = 0; i < script.blocks.length; i++) { |
| 93 | const block = script.blocks[i]; |
| 94 | if (codepoint >= block[0] && codepoint <= block[1]) { |
| 95 | return script.name; |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | return null; |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * A flattened version of all the supported blocks in a single array. |
no outgoing calls
no test coverage detected