refactor(lib): remove keys and just get a slug from the label

This commit is contained in:
Lewis Wynne 2026-03-23 17:02:46 +00:00
parent 7dc4bd8a11
commit 456e7e8feb
5 changed files with 26 additions and 30 deletions

3
src/lib/utils/slugify.ts Normal file
View file

@ -0,0 +1,3 @@
export function slugify(label: string): string {
return label.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)/g, '');
}