(str: string)
| 416 | |
| 417 | // Normalize Unicode punctuation to ASCII equivalents (like Rust's normalize_unicode) |
| 418 | function normalizeUnicode(str: string): string { |
| 419 | return str |
| 420 | .replace(/[‘’‚‛]/g, "'") // single quotes |
| 421 | .replace(/[“”„‟]/g, '"') // double quotes |
| 422 | .replace(/[‐‑‒–—―]/g, "-") // dashes |
| 423 | .replace(/…/g, "...") // ellipsis |
| 424 | .replace(/ /g, " ") // non-breaking space |
| 425 | } |
| 426 | |
| 427 | type Comparator = (a: string, b: string) => boolean |
| 428 |