/
opt
/
canhelp
/
node_modules
/
next
/
dist
/
esm
/
shared
/
lib
/
router
/
utils
/
/opt/canhelp/node_modules/next/dist/esm/shared/lib/router/utils
mkdir
upload
Name
Size
Mode
Actions
add-locale.js
1020
0644
edit
dl
rm
add-locale.js.map
1720
0644
edit
dl
rm
add-path-prefix.js
432
0644
edit
dl
rm
add-path-prefix.js.map
888
0644
edit
dl
rm
add-path-suffix.js
490
0644
edit
dl
rm
add-path-suffix.js.map
948
0644
edit
dl
rm
app-paths.js
1768
0644
edit
dl
rm
app-paths.js.map
2722
0644
edit
dl
rm
as-path-to-search-params.js
262
0644
edit
dl
rm
as-path-to-search-params.js.map
549
0644
edit
dl
rm
cache-busting-search-param.js
580
0644
edit
dl
rm
cache-busting-search-param.js.map
1307
0644
edit
dl
rm
compare-states.js
850
0644
edit
dl
rm
compare-states.js.map
1914
0644
edit
dl
rm
disable-smooth-scroll.js
2376
0644
edit
dl
rm
disable-smooth-scroll.js.map
3626
0644
edit
dl
rm
escape-path-delimiters.js
307
0644
edit
dl
rm
escape-path-delimiters.js.map
737
0644
edit
dl
rm
format-next-pathname-info.js
908
0644
edit
dl
rm
format-next-pathname-info.js.map
2079
0644
edit
dl
rm
format-url.js
3269
0644
edit
dl
rm
format-url.js.map
5697
0644
edit
dl
rm
get-asset-path-from-route.js
437
0644
edit
dl
rm
get-asset-path-from-route.js.map
830
0644
edit
dl
rm
get-dynamic-param.js
5308
0644
edit
dl
rm
get-dynamic-param.js.map
7436
0644
edit
dl
rm
get-next-pathname-info.js
2158
0644
edit
dl
rm
get-next-pathname-info.js.map
5177
0644
edit
dl
rm
get-route-from-asset-path.js
716
0644
edit
dl
rm
get-route-from-asset-path.js.map
1316
0644
edit
dl
rm
html-bots.js
909
0644
edit
dl
rm
html-bots.js.map
1136
0644
edit
dl
rm
index.js
155
0644
edit
dl
rm
index.js.map
389
0644
edit
dl
rm
interception-routes.js
3708
0644
edit
dl
rm
interception-routes.js.map
5016
0644
edit
dl
rm
interpolate-as.js
2000
0644
edit
dl
rm
interpolate-as.js.map
3805
0644
edit
dl
rm
is-bot.js
1100
0644
edit
dl
rm
is-bot.js.map
1947
0644
edit
dl
rm
is-dynamic.js
884
0644
edit
dl
rm
is-dynamic.js.map
1504
0644
edit
dl
rm
is-local-url.js
722
0644
edit
dl
rm
is-local-url.js.map
1282
0644
edit
dl
rm
middleware-route-matcher.js
678
0644
edit
dl
rm
middleware-route-matcher.js.map
1755
0644
edit
dl
rm
omit.js
250
0644
edit
dl
rm
omit.js.map
761
0644
edit
dl
rm
parse-path.js
841
0644
edit
dl
rm
parse-path.js.map
1495
0644
edit
dl
rm
parse-relative-url.js
1251
0644
edit
dl
rm
parse-relative-url.js.map
3015
0644
edit
dl
rm
parse-url.js
722
0644
edit
dl
rm
parse-url.js.map
1850
0644
edit
dl
rm
path-has-prefix.js
595
0644
edit
dl
rm
path-has-prefix.js.map
1002
0644
edit
dl
rm
path-match.js
1970
0644
edit
dl
rm
path-match.js.map
3791
0644
edit
dl
rm
prepare-destination.js
9828
0644
edit
dl
rm
prepare-destination.js.map
17143
0644
edit
dl
rm
querystring.js
1703
0644
edit
dl
rm
querystring.js.map
3224
0644
edit
dl
rm
relativize-url.js
851
0644
edit
dl
rm
relativize-url.js.map
1839
0644
edit
dl
rm
remove-path-prefix.js
1334
0644
edit
dl
rm
remove-path-prefix.js.map
2009
0644
edit
dl
rm
remove-trailing-slash.js
332
0644
edit
dl
rm
remove-trailing-slash.js.map
583
0644
edit
dl
rm
resolve-rewrites.js
4240
0644
edit
dl
rm
resolve-rewrites.js.map
7805
0644
edit
dl
rm
route-match-utils.js
3361
0644
edit
dl
rm
route-match-utils.js.map
5660
0644
edit
dl
rm
route-matcher.js
1271
0644
edit
dl
rm
route-matcher.js.map
2567
0644
edit
dl
rm
route-regex.js
9315
0644
edit
dl
rm
route-regex.js.map
17526
0644
edit
dl
rm
sortable-routes.js
8502
0644
edit
dl
rm
sortable-routes.js.map
12536
0644
edit
dl
rm
sorted-routes.js
11332
0644
edit
dl
rm
sorted-routes.js.map
14757
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/next/dist/esm/shared/lib/router/utils/interception-routes.js
(3708B)
import { normalizeAppPath } from './app-paths'; // order matters here, the first match will be used export const INTERCEPTION_ROUTE_MARKERS = [ '(..)(..)', '(.)', '(..)', '(...)' ]; export function isInterceptionRouteAppPath(path) { // TODO-APP: add more serious validation return path.split('/').find((segment)=>INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m))) !== undefined; } export function extractInterceptionRouteInformation(path) { let interceptingRoute, marker, interceptedRoute; for (const segment of path.split('/')){ marker = INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m)); if (marker) { ; [interceptingRoute, interceptedRoute] = path.split(marker, 2); break; } } if (!interceptingRoute || !marker || !interceptedRoute) { throw Object.defineProperty(new Error("Invalid interception route: " + path + ". Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>"), "__NEXT_ERROR_CODE", { value: "E269", enumerable: false, configurable: true }); } interceptingRoute = normalizeAppPath(interceptingRoute) // normalize the path, e.g. /(blog)/feed -> /feed ; switch(marker){ case '(.)': // (.) indicates that we should match with sibling routes, so we just need to append the intercepted route to the intercepting route if (interceptingRoute === '/') { interceptedRoute = "/" + interceptedRoute; } else { interceptedRoute = interceptingRoute + '/' + interceptedRoute; } break; case '(..)': // (..) indicates that we should match at one level up, so we need to remove the last segment of the intercepting route if (interceptingRoute === '/') { throw Object.defineProperty(new Error("Invalid interception route: " + path + ". Cannot use (..) marker at the root level, use (.) instead."), "__NEXT_ERROR_CODE", { value: "E207", enumerable: false, configurable: true }); } interceptedRoute = interceptingRoute.split('/').slice(0, -1).concat(interceptedRoute).join('/'); break; case '(...)': // (...) will match the route segment in the root directory, so we need to use the root directory to prepend the intercepted route interceptedRoute = '/' + interceptedRoute; break; case '(..)(..)': // (..)(..) indicates that we should match at two levels up, so we need to remove the last two segments of the intercepting route const splitInterceptingRoute = interceptingRoute.split('/'); if (splitInterceptingRoute.length <= 2) { throw Object.defineProperty(new Error("Invalid interception route: " + path + ". Cannot use (..)(..) marker at the root level or one level up."), "__NEXT_ERROR_CODE", { value: "E486", enumerable: false, configurable: true }); } interceptedRoute = splitInterceptingRoute.slice(0, -2).concat(interceptedRoute).join('/'); break; default: throw Object.defineProperty(new Error('Invariant: unexpected marker'), "__NEXT_ERROR_CODE", { value: "E112", enumerable: false, configurable: true }); } return { interceptingRoute, interceptedRoute }; } //# sourceMappingURL=interception-routes.js.map
Save
cmd:
run