MCPcopy Create free account
hub / github.com/anomalyco/opencode / hasUnbound

Function hasUnbound

packages/core/src/effect/layer-node.ts:321–327  ·  view source on GitHub ↗
(root: Node<unknown, unknown, any>, source: AnyNode)

Source from the content-addressed store, hash-verified

319}
320
321export function hasUnbound(root: Node<unknown, unknown, any>, source: AnyNode): boolean {
322 if (source.kind !== "unbound") throw new Error(`Cannot check non-unbound layer node: ${source.name}`)
323 return walk<boolean>(root, (node, context) => {
324 if (node === source) return true
325 return node.dependencies.some(context.visit)
326 })
327}
328
329function flatten(node: AnyNode): readonly AnyNode[] {
330 return node.kind === "group" ? node.dependencies.flatMap(flatten) : [node]

Callers

nothing calls this directly

Calls 1

walkFunction · 0.70

Tested by

no test coverage detected