Turn a string into a slug
export function handleize (str) { | |
return str | |
.toLowerCase() | |
.replace(/[^\w\u00C0-\u024f]+/g, '-') | |
.replace(/^-+|-+$/g, '') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment