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

Method functionOf

ark/aot/graph.ts:6180–6195  ·  view source on GitHub ↗
(
		callee: Node,
		module: SourceModule
	)

Source from the content-addressed store, hash-verified

6178 }
6179
6180 functionOf(
6181 callee: Node,
6182 module: SourceModule
6183 ): [FunctionNode, SourceModule] | undefined {
6184 callee = unwrapChain(callee)
6185 if (isFunctionNode(callee)) return [callee, module]
6186 if (callee.type === "Identifier") {
6187 const binding = module.scopes.byId.get(callee)?.binding
6188 return binding && this.boundFunctionOf(binding, module)
6189 }
6190 if (callee.type !== "MemberExpression") return
6191 const target = this.namespaceMemberOf(callee, module)
6192 return target?.kind === "binding" ?
6193 this.boundFunctionOf(target.binding, target.module)
6194 : undefined
6195 }
6196
6197 private methodOf(
6198 callee: Node,

Callers 8

calledKindOfMethod · 0.95
literalOfMethod · 0.95
reachesMethod · 0.95
writeFromMethod · 0.95
calleeOfMethod · 0.95
checkHelperReadsMethod · 0.80
callsCreatorAtLoadMethod · 0.80
rootOfFunction · 0.80

Calls 5

boundFunctionOfMethod · 0.95
namespaceMemberOfMethod · 0.95
unwrapChainFunction · 0.90
isFunctionNodeFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected