We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c9995c commit 7ec4c57Copy full SHA for 7ec4c57
1 file changed
packages/playground/lib/url.ts
@@ -2,7 +2,8 @@ const BASE_URL = import.meta.env.BASE_URL;
2
3
export function normalizeHref(href: string, addBase: boolean = true) {
4
const url = addBase === true && href.startsWith(BASE_URL) === false ? `${ BASE_URL }/${ href }` : href;
5
- return `/${ url.split('/').filter((t) => t.length > 0).join('/') }/`;
+ const split = url.split('/').filter((t) => t.length > 0);
6
+ return `/${ split.join('/') }${ split.at(-1)?.includes('.') ? '' : '/' }`;
7
}
8
9
export function matchHref(href: string, urlPathname: string) {
0 commit comments