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

Method writtenKindOf

ark/aot/graph.ts:1771–1791  ·  view source on GitHub ↗
(
		binding: Binding,
		module: SourceModule,
		kindOfKey: KindOfKey
	)

Source from the content-addressed store, hash-verified

1769 }
1770
1771 private writtenKindOf(
1772 binding: Binding,
1773 module: SourceModule,
1774 kindOfKey: KindOfKey
1775 ): KindBits {
1776 let result = 0
1777 for (const write of binding.writes) {
1778 const parent = write.parent
1779 result |=
1780 (
1781 parent?.type === "AssignmentExpression" &&
1782 parent.operator === "=" &&
1783 parent.left === write
1784 ) ?
1785 this.transfer(parent.right, module, kindOfKey)
1786 : parent?.type === "VariableDeclarator" && parent.init ?
1787 this.transfer(parent.init, module, kindOfKey)
1788 : this.destructuredWriteOf(write, module, kindOfKey)
1789 }
1790 return result
1791 }
1792
1793 // e.g. `N` given `namespace N { export const User = type(...) }`, merged across declarations
1794 private namespaceKindOf(

Callers 2

keyKindOfMethod · 0.95
resultMethod · 0.95

Calls 2

transferMethod · 0.95
destructuredWriteOfMethod · 0.95

Tested by

no test coverage detected