slug
Stentor API Reference / stentor-utils/src / slug
Function: slug()
slug(
value,options?):string
Defined in: packages/stentor-utils/src/string/slug.ts:93
Converts a value into a URL safe slug.
This is the single place the slug implementation lives. It used to wrap the slugify
package and keeps its rules: symbols are spelled out ("&" -> "and"), accents are dropped,
the characters it allowed through are allowed through, and spaces become the replacement.
It throws on a non string value, which is what the call sites rely on to surface bad input.
Parameters​
value​
string
The value to convert.
options?​
The slug options. If it is a string, it is used as the replacement.
Returns​
string