Skip to content

Instantly share code, notes, and snippets.

@tcelestino
Created May 14, 2019 14:41
Show Gist options
  • Save tcelestino/d01330151a123bb923c5410756e51146 to your computer and use it in GitHub Desktop.
Save tcelestino/d01330151a123bb923c5410756e51146 to your computer and use it in GitHub Desktop.
remove accents, switch white-space from hifen and transform string in lowercase
const sanitize = str => str.normalize('NFD').replace(/[\u0300-\u036f]/g, '').replace(' ', '-').toLowerCase();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment