fix(javascript): preserve Next filesystem route spelling

Apply Next-specific uppercase %5F normalization while retaining ordinary percent sequences, encoded separators, and literal percent characters as distinct source segments.

Fixes #6641
This commit is contained in:
morluto
2026-10-24 00:11:41 +08:00
parent f719dc46c5
commit ddd7ac7b84
4 changed files with 73 additions and 11 deletions
@@ -244,7 +244,12 @@ it.each([
["app/blog/_draft/page.js", undefined],
["app/(group)/_private/nested/page.tsx", undefined],
["app/%5Fcomponents/page.tsx", "/_components"],
["app/blog/%5fdraft/page.js", "/blog/_draft"],
["app/blog/%5fdraft/page.js", "/blog/%5fdraft"],
["app/%61/page.tsx", "/%61"],
["https://example.test/app/%61/page.tsx", "/%61"],
["app/a/page.tsx", "/a"],
["app/100%/page.tsx", "/100%"],
["app/team%2Fadmin/page.tsx", "/team%2Fadmin"],
["static/chunks/app/(account)/reports/[id]/page-deadbeef.js", "/reports/:id"],
["app/docs/[...slug]/page.js", "/docs/:slug+"],
["app/(account)/reports/[id]/page.tsx", "/reports/:id"],