(
root: Solid.Owner,
predicate: (owner: Solid.Owner) => boolean,
)
| 200 | * helper to getting to an owner that you want — walking downwards |
| 201 | */ |
| 202 | export function findOwner( |
| 203 | root: Solid.Owner, |
| 204 | predicate: (owner: Solid.Owner) => boolean, |
| 205 | ): Solid.Owner | null { |
| 206 | const queue: Solid.Owner[] = [root] |
| 207 | for (const owner of queue) { |
| 208 | if (predicate(owner)) return owner |
| 209 | if (Array.isArray(owner.owned)) queue.push(...owner.owned) |
| 210 | } |
| 211 | return null |
| 212 | } |
| 213 | |
| 214 | export function lookupOwner( |
| 215 | owner: Solid.Owner, |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…