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

Method scopeCallOf

ark/aot/graph.ts:4554–4575  ·  view source on GitHub ↗
(
		node: Node,
		module: SourceModule,
		kindOfKey: KindOfKey,
		seen = new Set<Node>()
	)

Source from the content-addressed store, hash-verified

4552 }
4553
4554 private scopeCallOf(
4555 node: Node,
4556 module: SourceModule,
4557 kindOfKey: KindOfKey,
4558 seen = new Set<Node>()
4559 ): Located | undefined {
4560 node = unwrapChain(node)
4561 if (seen.has(node)) return
4562 seen.add(node)
4563 if (node.type === "Identifier" || node.type === "MemberExpression") {
4564 const init = this.constInitOf(node, module, kindOfKey)
4565 return (
4566 init && this.scopeCallOf(init.node, init.module, init.kindOfKey, seen)
4567 )
4568 }
4569 return (
4570 node.type === "CallExpression" &&
4571 this.arkExportNameOf(node.callee, module) === "scope"
4572 ) ?
4573 { node, module, kindOfKey }
4574 : undefined
4575 }
4576
4577 // e.g. `shop` or `defs.shop`, imported from where it's declared
4578 private constInitOf(

Callers 4

calledKindOfMethod · 0.95
moduleDefinitionOfMethod · 0.95
isParserMethod · 0.95
isDeclarationMethod · 0.95

Calls 5

constInitOfMethod · 0.95
arkExportNameOfMethod · 0.95
unwrapChainFunction · 0.90
hasMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected