(owner: Solid.Owner)
| 148 | * Finds the top-level root owner of a given owner. |
| 149 | */ |
| 150 | export 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. |
no test coverage detected
searching dependent graphs…