feat: ajout d'une fonction pour créer les URL

This commit is contained in:
Kazhnuz 2023-10-17 19:27:16 +02:00
parent b91cf7d758
commit 2cffd0476a

8
src/utils/urls.ts Normal file
View file

@ -0,0 +1,8 @@
export function toURI(str: string): string {
return str
.toLowerCase()
.trim()
.replace(/\s+/g, "-")
.normalize("NFD")
.replace(/[\u0300-\u036f]/g, "");
}