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

Method boundFunctionOf

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

Source from the content-addressed store, hash-verified

6207 }
6208
6209 private boundFunctionOf(
6210 binding: Binding,
6211 module: SourceModule
6212 ): [FunctionNode, SourceModule] | undefined {
6213 if (binding.kind === "import") {
6214 const target = this.importOf(binding, module)
6215 if (target.kind === "binding")
6216 return this.boundFunctionOf(target.binding, target.module)
6217 // e.g. `export default () => A`
6218 const fn =
6219 target.kind === "expression" &&
6220 namedFunctionOf(unwrapChain(target.node), target.module)
6221 return fn && isFunctionNode(fn) ? [fn, target.module] : undefined
6222 }
6223 const fn = functionOfBinding(binding, module)
6224 return fn && [fn, module]
6225 }
6226
6227 // e.g. a Type, a literal holding one, or a function returning one
6228 definesArk(

Callers 3

functionOfMethod · 0.95
definesArkMethod · 0.95

Calls 5

importOfMethod · 0.95
unwrapChainFunction · 0.90
namedFunctionOfFunction · 0.85
isFunctionNodeFunction · 0.85
functionOfBindingFunction · 0.85

Tested by

no test coverage detected