(root: MindMapTreeNode)
| 312 | }; |
| 313 | |
| 314 | export const buildMindMapMarkdown = (root: MindMapTreeNode): string => { |
| 315 | const lines: string[] = [`# ${root.label}`]; |
| 316 | if (root.summary) { |
| 317 | lines.push('', root.summary); |
| 318 | } |
| 319 | if (root.children.length > 0) { |
| 320 | lines.push('', '## Branches'); |
| 321 | root.children.forEach((child) => markdownLines(child, 0, lines)); |
| 322 | } |
| 323 | return lines.join('\n'); |
| 324 | }; |
| 325 | |
| 326 | export const countTreeNodes = (node: MindMapTreeNode): number => |
| 327 | 1 + node.children.reduce((sum, child) => sum + countTreeNodes(child), 0); |
no test coverage detected