Skip to content

Instantly share code, notes, and snippets.

@jsscclr
Created February 1, 2018 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsscclr/f050e30741e4f6eea209dd225ce75404 to your computer and use it in GitHub Desktop.
Save jsscclr/f050e30741e4f6eea209dd225ce75404 to your computer and use it in GitHub Desktop.
export const getSlug = string =>
string
.match(/(?:['\w])+/g)
.join("-")
.replace(/'/g, "")
.toLowerCase()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment