Created
June 8, 2019 02:39
-
-
Save jlengstorf/29c43cfff2111e5dfb9451beb87ac65f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Quick-and-dirty helper to convert strings into URL-friendly slugs. | |
const slugify = str => | |
str | |
.toLowerCase() | |
.replace(/[^a-z0-9]+/g, '-') | |
.replace(/(^-|-$)+/g, ''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment