1.0.0 • Published 3 years ago

is-valid-slug v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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