MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / refsOfNode

Function refsOfNode

javascript/selenium-webdriver/project_bidi_schema.mjs:634–649  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

632// target refs. Composition is already resolved upstream, so this ref adjacency is
633// complete for a reachability walk.
634function 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.

Callers 1

reachableTypesFunction · 0.85

Calls 2

refsInTypeFunction · 0.85
mapMethod · 0.45

Tested by

no test coverage detected