Created
May 13, 2025 13:10
-
-
Save w-jerome/fe2f8feeaec32b32ce8d9b430e3be365 to your computer and use it in GitHub Desktop.
[Typescript] normalize string (lower case, remove accents)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function normalizeString(text: string): string { | |
return text.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, ''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment