Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. // Quick-and-dirty helper to convert strings into URL-friendly slugs.
  2. const slugify = str =>
  3. str
  4. .toLowerCase()
  5. .replace(/[^a-z0-9]+/g, '-')
  6. .replace(/(^-|-$)+/g, '');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement