MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / getRootNode

Function getRootNode

packages/frontend/src/structure.tsx:44–53  ·  view source on GitHub ↗
(node: Node)

Source from the content-addressed store, hash-verified

42 * Finds the top-root node
43 */
44export 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
55export function getClosestComponentNode(node: Node): Node | undefined {
56 let current: Node | null = node

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…