Skip to content

Commit 5fc56f3

Browse files
committed
[#10] Fix: Only apply to default case
1 parent 1d58325 commit 5fc56f3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/core/src/next/utils.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,10 @@ export function createNextRoutesUrlGroup(maxDepth: number) {
6565

6666
for (const {regex, page} of routes) {
6767
if (regex.test(withoutBasePathUrl)) {
68-
return `/${page
69-
.split('/')
70-
.slice(1, maxDepth + 1)
71-
.join('/')}`
68+
return page
7269
}
7370
}
7471

75-
return withoutBasePathUrl
72+
return typeof maxDepth === 'number' ? withoutBasePathUrl.split('/', maxDepth + 1).join('/') : withoutBasePathUrl
7673
}
7774
}

0 commit comments

Comments
 (0)