Skip to content

Instantly share code, notes, and snippets.

@gilbarbara
Created March 31, 2021 18:11
Show Gist options
  • Save gilbarbara/695cc8994e0bc4c0d723293c648562fc to your computer and use it in GitHub Desktop.
Save gilbarbara/695cc8994e0bc4c0d723293c648562fc to your computer and use it in GitHub Desktop.
export function slugify(input = '') {
return removeAccents(input)
.replace(/[\u0300-\u036f]/g, '')
.replace(/[()]/g, '')
.replace(/ /g, '-')
.replace(/[|^{}%"<>\\`]/g, '')
.toLowerCase();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment