Files
scriptc/tests/corpus/unicode-case-paths.ts
Chris Tate 3608a88602 Streamline regular expression and text transformations
- Share regex input preparation and bound capture storage to each result.
- Batch replacement output and avoid rebuilding unchanged strings.
- Accelerate case conversion and normalization while preserving Unicode and ownership behavior.
2026-10-06 02:17:01 -05:00

13 lines
628 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
for (const text of [
"", "unchanged 123", "CHANGED 123", "mixed Case\0tail", "\u007f",
"a".repeat(257), "Z".repeat(257), "prefix Straße SUFFIX", "ASCII Σ", "ASCII ΣX",
"Ο\u0301Σ", "Ο\u0301Σ\u0301Α", "İ café ffi 😀", "\u0065\u0301", "ABC", "가",
]) {
console.log(text.toLowerCase(), text.toUpperCase());
console.log(text.normalize("NFC"), text.normalize("NFD"), text.normalize("NFKC"), text.normalize("NFKD"));
}
for (const text of ["", "ascii", "é"]) {
try { console.log(text.normalize("invalid")); }
catch (error) { if (error instanceof RangeError) console.log(error.name, error.message); }
}