From 5fa10ef0fc3e7c4ddc3202a824097ba5451df5e2 Mon Sep 17 00:00:00 2001 From: phvm Date: Mon, 28 Oct 2024 08:59:11 -0300 Subject: [PATCH] fix: slugify function --- src/utils/string-utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/string-utils.ts b/src/utils/string-utils.ts index e5e1d4df..4eea4d41 100644 --- a/src/utils/string-utils.ts +++ b/src/utils/string-utils.ts @@ -12,9 +12,10 @@ export const toCamelCase = (str: string) => { export const slugify = (str: string) => { return str .toLowerCase() + .normalize('NFD') + .replace(/[\u0300-\u036f]/g, '') .replace(/\s+/g, '-') .replace(/\-+/g, '-') - .replace(/[^a-z0-9\-]/g, '') } type Child = string | { props: { children: Child[] } }