( node: PageTree.Node, currentPath: string, )
| 38 | : `${node.type}-${String(node.name ?? node.type)}`); |
| 39 | |
| 40 | const 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 | |
| 50 | const activeRootFolder = (tree: PageTree.Root, currentPath: string) => { |
| 51 | return tree.children.find( |
no outgoing calls
no test coverage detected