diff --git a/src/utils/urls.ts b/src/utils/urls.ts new file mode 100644 index 0000000..563a082 --- /dev/null +++ b/src/utils/urls.ts @@ -0,0 +1,8 @@ +export function toURI(str: string): string { + return str + .toLowerCase() + .trim() + .replace(/\s+/g, "-") + .normalize("NFD") + .replace(/[\u0300-\u036f]/g, ""); +}