feat: add slugify utility

This commit is contained in:
2026-03-26 11:54:42 -05:00
parent 86c1389d67
commit af2e48347f
2 changed files with 28 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
export function slugify(text: string): string {
return text
.toLowerCase()
.replace(/[^a-z0-9\s-]/g, '')
.replace(/[\s]+/g, '-')
.replace(/-+/g, '-')
.replace(/^-|-$/g, '');
}