Initial commit
This commit is contained in:
commit
78f8d225ee
21173 changed files with 2907774 additions and 0 deletions
22
node_modules/next/dist/esm/server/lib/router-utils/build-prefetch-segment-data-route.js
generated
vendored
Normal file
22
node_modules/next/dist/esm/server/lib/router-utils/build-prefetch-segment-data-route.js
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import path from '../../../shared/lib/isomorphic/path';
|
||||
import { normalizePagePath } from '../../../shared/lib/page-path/normalize-page-path';
|
||||
import { getNamedRouteRegex } from '../../../shared/lib/router/utils/route-regex';
|
||||
import { RSC_SEGMENT_SUFFIX, RSC_SEGMENTS_DIR_SUFFIX } from '../../../lib/constants';
|
||||
export const SEGMENT_PATH_KEY = 'nextSegmentPath';
|
||||
export function buildPrefetchSegmentDataRoute(page, segmentPath) {
|
||||
const pagePath = normalizePagePath(page);
|
||||
const destination = path.posix.join(`${pagePath}${RSC_SEGMENTS_DIR_SUFFIX}`, `${segmentPath}${RSC_SEGMENT_SUFFIX}`);
|
||||
const { namedRegex } = getNamedRouteRegex(destination, {
|
||||
prefixRouteKeys: true,
|
||||
includePrefix: true,
|
||||
includeSuffix: true,
|
||||
excludeOptionalTrailingSlash: true,
|
||||
backreferenceDuplicateKeys: true
|
||||
});
|
||||
return {
|
||||
destination,
|
||||
source: namedRegex
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=build-prefetch-segment-data-route.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue