mirror of
https://github.com/outline/outline.git
synced 2025-12-20 18:19:43 -06:00
17 lines
343 B
TypeScript
17 lines
343 B
TypeScript
import slug from "slug";
|
|
|
|
slug.defaults.mode = "rfc3986";
|
|
|
|
/**
|
|
* Convert a string to a slug that can be used in a URL in kebab-case format,
|
|
* and remove periods.
|
|
*
|
|
* @param text The text to convert
|
|
* @returns The slugified text
|
|
*/
|
|
export default function slugify(text: string): string {
|
|
return slug(text, {
|
|
remove: /[.]/g,
|
|
});
|
|
}
|