(node: Node)
| 42 | * Finds the top-root node |
| 43 | */ |
| 44 | export function getRootNode(node: Node): Node { |
| 45 | let current: Node | null = node |
| 46 | let lastRoot: Node | undefined |
| 47 | while (current) { |
| 48 | if (current.type === debug.NodeType.Root) lastRoot = current |
| 49 | current = current.parent |
| 50 | } |
| 51 | if (lastRoot) return lastRoot |
| 52 | throw new Error('Parent root not found') |
| 53 | } |
| 54 | |
| 55 | export function getClosestComponentNode(node: Node): Node | undefined { |
| 56 | let current: Node | null = node |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…