npm.io
1.0.0 • Published 5 years ago

is-valid-slug

Licence
MIT
Version
1.0.0
Deps
0
Size
3 kB
Vulns
0
Weekly
0
Stars
3

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

Keywords