MCPcopy Create free account
hub / github.com/arktypeio/arktype / destructuredValueOf

Method destructuredValueOf

ark/aot/graph.ts:3688–3706  ·  view source on GitHub ↗
(
		node: Node,
		pattern: Node,
		source: Located,
		seen = new Set<Node>()
	)

Source from the content-addressed store, hash-verified

3686 }
3687
3688 private destructuredValueOf(
3689 node: Node,
3690 pattern: Node,
3691 source: Located,
3692 seen = new Set<Node>()
3693 ): Located | null | undefined {
3694 if (node === pattern) return source
3695 const owner = node.parent!
3696 if (owner.type !== "Property" && owner.type !== "ArrayPattern") return
3697 const held = this.destructuredValueOf(
3698 owner.type === "Property" ? owner.parent! : owner,
3699 pattern,
3700 source,
3701 seen
3702 )
3703 const literal =
3704 held && this.literalOf(held.node, held.module, held.kindOfKey, seen)
3705 return literal && this.valueIn(literal, keyIn(owner, node), seen)
3706 }
3707
3708 private returnKindIn(
3709 fn: FunctionNode,

Callers 2

patternKindOfMethod · 0.95
bindingLiteralOfMethod · 0.95

Calls 3

literalOfMethod · 0.95
valueInMethod · 0.95
keyInFunction · 0.85

Tested by

no test coverage detected