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

Function getTopRoot

packages/debugger/src/main/roots.ts:150–158  ·  view source on GitHub ↗
(owner: Solid.Owner)

Source from the content-addressed store, hash-verified

148 * Finds the top-level root owner of a given owner.
149 */
150export function getTopRoot(owner: Solid.Owner): Solid.Root | null {
151 let root: Solid.Root | null = null
152 do {
153 if (isSolidRoot(owner) && !owner.isDisposed) root = owner
154 owner = owner.owner!
155 // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
156 } while (owner)
157 return root
158}
159
160/**
161 * Searches for the closest alive parent of the given owner.

Callers 1

changeRootAttachmentFunction · 0.85

Calls 1

isSolidRootFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…