We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1d58325 commit 5fc56f3Copy full SHA for 5fc56f3
packages/core/src/next/utils.ts
@@ -65,13 +65,10 @@ export function createNextRoutesUrlGroup(maxDepth: number) {
65
66
for (const {regex, page} of routes) {
67
if (regex.test(withoutBasePathUrl)) {
68
- return `/${page
69
- .split('/')
70
- .slice(1, maxDepth + 1)
71
- .join('/')}`
+ return page
72
}
73
74
75
- return withoutBasePathUrl
+ return typeof maxDepth === 'number' ? withoutBasePathUrl.split('/', maxDepth + 1).join('/') : withoutBasePathUrl
76
77
0 commit comments