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

Method isDeclaration

ark/aot/graph.ts:4538–4552  ·  view source on GitHub ↗
(
		node: Node,
		module: SourceModule,
		kindOfKey: KindOfKey
	)

Source from the content-addressed store, hash-verified

4536 // would be any arktype value, so the Type its `type` defines would be one a
4537 // call returning it loses track of
4538 private isDeclaration(
4539 node: Node,
4540 module: SourceModule,
4541 kindOfKey: KindOfKey
4542 ): boolean {
4543 node = unwrapChain(node)
4544 if (node.type !== "CallExpression") return false
4545 const callee = unwrapChain(node.callee)
4546 return (
4547 callee.type === "MemberExpression" &&
4548 memberNameOf(callee) === "declare" &&
4549 (this.arkExportNameOf(callee.object, module) === "type" ||
4550 !!this.scopeCallOf(callee.object, module, kindOfKey))
4551 )
4552 }
4553
4554 private scopeCallOf(
4555 node: Node,

Callers 1

calledKindOfMethod · 0.95

Calls 4

arkExportNameOfMethod · 0.95
scopeCallOfMethod · 0.95
unwrapChainFunction · 0.90
memberNameOfFunction · 0.70

Tested by

no test coverage detected