Skip to content

Instantly share code, notes, and snippets.

@colantuomo
Created February 14, 2023 20:56
Show Gist options
  • Save colantuomo/4904c12b2f48d4549e67c8c400a096fc to your computer and use it in GitHub Desktop.
Save colantuomo/4904c12b2f48d4549e67c8c400a096fc to your computer and use it in GitHub Desktop.
Useful JS/TS Codes

Remove accents and normalize words

export const removeAccents = (word: string) =>
  word
    .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