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

Method bindingInitOf

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

Source from the content-addressed store, hash-verified

4589 }
4590
4591 private bindingInitOf(
4592 binding: Binding,
4593 module: SourceModule,
4594 kindOfKey: KindOfKey
4595 ): Located | undefined {
4596 if (binding.writes.length || this.writesThrough(binding, module).length)
4597 return
4598 if (binding.kind === "import")
4599 return this.targetInitOf(this.importOf(binding, module), kindOfKey)
4600 const declaration = binding.declaration
4601 return (
4602 binding.kind === "const" &&
4603 declaration.type === "VariableDeclarator" &&
4604 declaration.id === binding.id &&
4605 declaration.init
4606 ) ?
4607 { node: declaration.init, module, kindOfKey }
4608 : undefined
4609 }
4610
4611 private targetInitOf(
4612 target: ImportTarget,

Callers 2

constInitOfMethod · 0.95
targetInitOfMethod · 0.95

Calls 3

writesThroughMethod · 0.95
targetInitOfMethod · 0.95
importOfMethod · 0.95

Tested by

no test coverage detected