MCPcopy Create free account
hub / github.com/fontsource/fontsource / visit

Function visit

website/app/utils/docs/navigation.ts:43–65  ·  view source on GitHub ↗
(nodes: PageTree.Node[])

Source from the content-addressed store, hash-verified

41 const pages: PageLink[] = [];
42
43 const visit = (nodes: PageTree.Node[]) => {
44 for (const node of nodes) {
45 if (isPage(node)) {
46 pages.push({
47 name: nodeName(node),
48 url: node.url,
49 external: node.external,
50 });
51 continue;
52 }
53
54 if (isFolder(node)) {
55 if (node.index) {
56 pages.push({
57 name: nodeName(node.index),
58 url: node.index.url,
59 external: node.index.external,
60 });
61 }
62 visit(node.children);
63 }
64 }
65 };
66
67 visit(tree.children);
68 return pages;

Callers 2

flattenPagesFunction · 0.85
getBreadcrumbsFunction · 0.85

Calls 4

isPageFunction · 0.85
nodeNameFunction · 0.85
isFolderFunction · 0.85
firstInternalPageUrlFunction · 0.70

Tested by

no test coverage detected