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

Method genericCallOf

ark/aot/graph.ts:5029–5040  ·  view source on GitHub ↗
(node: Node, module: SourceModule)

Source from the content-addressed store, hash-verified

5027 // may be a Generic outside a site, which no member read refuses; a callee
5028 // that may be a Type or any arktype value is a validation or judged as a site
5029 genericCallOf(node: Node, module: SourceModule): boolean {
5030 if (node.type !== "CallExpression") return false
5031 const callee = unwrapChain(node.callee)
5032 if (callee.type === "MemberExpression") return false
5033 const kind = this.kindOf(callee, module)
5034 return (
5035 mayBeOtherArk(kind) &&
5036 (kind & kinds.returnsType) !== 0 &&
5037 (kind & (kinds.type | kinds.returnsArk)) === 0 &&
5038 !this.isArktypeImport(callee, module)
5039 )
5040 }
5041
5042 private isArktypeImport(node: Node, module: SourceModule): boolean {
5043 if (this.arkExportNameOf(node, module)) return true

Callers 1

scopeReadsOfFunction · 0.80

Calls 4

kindOfMethod · 0.95
isArktypeImportMethod · 0.95
unwrapChainFunction · 0.90
mayBeOtherArkFunction · 0.85

Tested by

no test coverage detected