is-valid-slug
v1.0.0
Published
Validate URL slug
Downloads
867
Maintainers
Readme
is-valid-slug
Tests whether an string is considered to be valid URL slug or not. While there is no "official" specification on what is considered to be an URL slug, this package uses commonly used regular expression for the validation.
Usage
import { isValidSlug } from 'is-valid-slug';
isValidSlug('this-is-valid'); // => true
isValidSlug('@this;is invalid'); // => false