(node)
| 632 | // target refs. Composition is already resolved upstream, so this ref adjacency is |
| 633 | // complete for a reachability walk. |
| 634 | function refsOfNode(node) { |
| 635 | if (!node) return [] |
| 636 | if (node.kind === 'record') { |
| 637 | const refs = node.fields.flatMap((f) => refsInType(f.type)) |
| 638 | if (node.map) refs.push(...refsInType(node.map)) |
| 639 | return refs |
| 640 | } |
| 641 | if (node.kind === 'union') { |
| 642 | const refs = [...node.variants] |
| 643 | if (node.selector?.variants) refs.push(...node.selector.variants.map((v) => v.ref)) |
| 644 | if (node.selector?.default) refs.push(node.selector.default) |
| 645 | return refs |
| 646 | } |
| 647 | if (node.kind === 'alias') return refsInType(node.type) |
| 648 | return [] |
| 649 | } |
| 650 | |
| 651 | // The transitive closure of a set of root type names over refsOfNode. An unknown name |
| 652 | // (a ref with no type entry) terminates that branch. |
no test coverage detected