(str: string)
| 25 | * ---------------------------------------------------------------------- */ |
| 26 | |
| 27 | export function toCodePoints(str: string): string[] { |
| 28 | // [...str] or Array.from both iterate by UTF‑32 code point, handling |
| 29 | // surrogate pairs correctly. |
| 30 | return Array.from(str); |
| 31 | } |
| 32 | |
| 33 | export function cpLen(str: string): number { |
| 34 | return toCodePoints(str).length; |
no outgoing calls
no test coverage detected