silverwolf-x/project / packages /next /src /shared /lib /router /utils /parse-loader-tree.ts
silverwolf-x's picture
download
raw
746 Bytes
import { DEFAULT_SEGMENT_KEY } from '../../segment'
import type { LoaderTree } from '../../../../server/lib/app-dir-module'
export function parseLoaderTree(tree: LoaderTree) {
const [segment, parallelRoutes, modules, staticSiblings] = tree
const { layout, template } = modules
let { page } = modules
// a __DEFAULT__ segment means that this route didn't match any of the
// segments in the route, so we should use the default page
page = segment === DEFAULT_SEGMENT_KEY ? modules.defaultPage : page
const conventionPath = layout?.[1] || template?.[1] || page?.[1]
return {
page,
segment,
modules,
/* it can be either layout / template / page */
conventionPath,
parallelRoutes,
staticSiblings,
}
}

Xet Storage Details

Size:
746 Bytes
·
Xet hash:
5325fc5bd6f1df3d5c81bf5f869ef119d3ad217c955c4f171006e9d545b77242

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.