Skip to content

Instantly share code, notes, and snippets.

@w-jerome
Created May 13, 2025 13:10
Show Gist options
  • Save w-jerome/fe2f8feeaec32b32ce8d9b430e3be365 to your computer and use it in GitHub Desktop.
Save w-jerome/fe2f8feeaec32b32ce8d9b430e3be365 to your computer and use it in GitHub Desktop.
[Typescript] normalize string (lower case, remove accents)
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