MCPcopy
hub / github.com/colinhacks/zod / GET

Function GET

packages/docs/app/llms-full.txt/route.ts:8–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6export const revalidate = false;
7
8export async function GET() {
9 const pages = source.getPages();
10
11 // Read meta.json to get the page order
12 const metaPath = join(process.cwd(), "content", "meta.json");
13 const meta = JSON.parse(await fs.readFile(metaPath, "utf-8"));
14
15 // Create a map of page URLs to their order in meta.json
16 const pageOrder = new Map<string, number>();
17 meta.pages.forEach((page: string, index: number) => {
18 pageOrder.set(page, index);
19 });
20
21 // Sort pages according to meta.json order
22 const sortedPages = pages.sort((a, b) => {
23 const aOrder = pageOrder.get(a.url) ?? Number.MAX_SAFE_INTEGER;
24 const bOrder = pageOrder.get(b.url) ?? Number.MAX_SAFE_INTEGER;
25 return aOrder - bOrder;
26 });
27
28 // Generate content
29 let txt = `# Zod
30
31Zod is a TypeScript-first schema validation library with static type inference. This documentation provides comprehensive coverage of Zod 4's features, API, and usage patterns.
32
33`;
34
35 // Process each page
36 for (const page of sortedPages) {
37 txt += await getLLMText(page);
38 txt += "\n\n";
39 }
40
41 return new Response(txt, {
42 headers: { "Content-Type": "text/plain; charset=utf-8" },
43 });
44}

Callers

nothing calls this directly

Calls 3

getLLMTextFunction · 0.90
getMethod · 0.80
parseMethod · 0.65

Tested by

no test coverage detected