Files
outline/shared/utils/slugify.ts
2023-09-10 12:46:12 -07:00

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,
});
}