/**
* String utility functions
*/
/**
* Convert a title string to a URL-friendly slug
* @param title - The title to slugify
* @returns A slugified version of the title
*/
export function slugifyTitle(title: string): string {
if (!title) {
return "";
}
return title
.toLowerCase()
.replace(/[^a-z0-9]+/g, "-")
.replace(/^-+|-+$/g, "")
.slice(0, 60); // limit length
}