Files
Gabriel Kaszewski 4d0cbb7fb2
All checks were successful
Build and Deploy Gabriel Kaszewski Portfolio / build-and-deploy-local (push) Successful in 1m46s
Refactor project slug handling and improve project retrieval logic
2026-08-21 15:46:33 +02:00

11 lines
256 B
TypeScript

export function slugify(value: string): string {
return value
.normalize("NFD")
.replace(/\p{Diacritic}/gu, "")
.replace(/ł/g, "l")
.replace(/Ł/g, "L")
.toLowerCase()
.replace(/[^a-z0-9]+/g, "-")
.replace(/^-+|-+$/g, "");
}