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

Function containsCurrentPage

website/app/components/docs/LeftSidebar.tsx:40–48  ·  view source on GitHub ↗
(
	node: PageTree.Node,
	currentPath: string,
)

Source from the content-addressed store, hash-verified

38 : `${node.type}-${String(node.name ?? node.type)}`);
39
40const containsCurrentPage = (
41 node: PageTree.Node,
42 currentPath: string,
43): boolean => {
44 if (node.type === 'page') return currentPath === node.url;
45 if (node.type !== 'folder') return false;
46
47 return node.children.some((child) => containsCurrentPage(child, currentPath));
48};
49
50const activeRootFolder = (tree: PageTree.Root, currentPath: string) => {
51 return tree.children.find(

Callers 2

activeRootFolderFunction · 0.85
RootSectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected