MCPcopy Create free account
hub / github.com/arktypeio/arktype / getPageTree

Function getPageTree

ark/docs/lib/content/docs.ts:20–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 * and the tree is rebuilt on every call so edits show up.
19 */
20export const getPageTree = (): PageTree => {
21 if (cached) return cached
22 const tree = buildPageTree(contentDir)
23 const errors = [...tree.errors, ...checkRedirects(tree)]
24 if (process.env.NODE_ENV !== "production") {
25 report([...errors, ...tree.warnings])
26 return tree
27 }
28 if (errors.length)
29 throw new Error(`The docs have problems:\n- ${errors.join("\n- ")}`)
30 report(tree.warnings)
31 return (cached = tree)
32}

Callers 10

TopNavFunction · 0.90
SiteFooterFunction · 0.90
writeOgImagesFunction · 0.90
writeMarkdownFunction · 0.90
redirects.test.tsFile · 0.90
sitemap.tsFile · 0.90
GETFunction · 0.90
generateStaticParamsFunction · 0.90
generateMetadataFunction · 0.90
DocsPageFunction · 0.90

Calls 3

buildPageTreeFunction · 0.90
checkRedirectsFunction · 0.90
reportFunction · 0.70

Tested by

no test coverage detected