fix: resolved trailing slash issue with additional privileges

This commit is contained in:
Sheen Capadngan
2024-05-28 12:38:57 +08:00
parent 1e63604f1e
commit 3e9ce79398
2 changed files with 10 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
export const removeTrailingSlash = (str: string) => {
if (str === "/") return str;
return str.endsWith("/") ? str.slice(0, -1) : str;
};