1export function slugify(text: string): string { 2 return text 3 .toLowerCase() 4 .trim() 5 .replace(/[^\w\s-]/g, "") 6 .replace(/[\s_]+/g, "-") 7 .replace(/-+/g, "-") 8 .replace(/^-|-$/g, ""); 9}