export function removeMultipleSlashes(str: string) { return str.replaceAll(/\/\/+/g, "/") } export function removeTrailingSlash(pathname: string) { if (pathname.endsWith("/")) { // Remove the trailing slash return pathname.slice(0, -1) } return pathname }