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

Method componentFunctionOfBinding

ark/aot/graph.ts:3231–3253  ·  view source on GitHub ↗
(
		binding: Binding,
		module: SourceModule
	)

Source from the content-addressed store, hash-verified

3229 }
3230
3231 private componentFunctionOfBinding(
3232 binding: Binding,
3233 module: SourceModule
3234 ): [FunctionNode, SourceModule] | undefined {
3235 const direct = this.boundFunctionOf(binding, module)
3236 if (direct) return direct
3237 if (binding.kind === "import") {
3238 const target = this.importOf(binding, module)
3239 return (
3240 target.kind === "binding" ?
3241 this.componentFunctionOfBinding(target.binding, target.module)
3242 : target.kind === "expression" ?
3243 this.componentFunctionOfNode(target.node, target.module)
3244 : undefined
3245 )
3246 }
3247 if (
3248 !binding.writes.length &&
3249 binding.declaration.type === "VariableDeclarator" &&
3250 binding.declaration.init
3251 )
3252 return this.componentFunctionOfNode(binding.declaration.init, module)
3253 }
3254
3255 private componentFunctionOfNode(
3256 node: Node,

Callers 2

jsxComponentOfMethod · 0.95

Calls 3

boundFunctionOfMethod · 0.95
importOfMethod · 0.95

Tested by

no test coverage detected