is-valid-slug
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i is-valid-slug

Weekly Downloads

42

Version

1.0.0

License

MIT

Unpacked Size

3.01 kB

Total Files

9

Last publish

Collaborators

  • rauli