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

Method classOf

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

Source from the content-addressed store, hash-verified

4121 }
4122
4123 private classOf(
4124 node: Node,
4125 module: SourceModule,
4126 kindOfKey: KindOfKey
4127 ): Located | undefined {
4128 node = unwrapChain(node)
4129 if (node.type === "ThisExpression") {
4130 const owner = ownerOf(node)
4131 return owner && owner.type !== "ObjectExpression" ?
4132 { node: owner, module, kindOfKey }
4133 : undefined
4134 }
4135 const literal = this.literalOf(
4136 node.type === "NewExpression" ? node.callee : node,
4137 module,
4138 kindOfKey
4139 )
4140 return (
4141 literal?.node.type === "ClassDeclaration" ||
4142 literal?.node.type === "ClassExpression"
4143 ) ?
4144 literal
4145 : undefined
4146 }
4147
4148 private fieldKindIn(
4149 cls: Node,

Callers 4

thisKindOfMethod · 0.95
memberKindInMethod · 0.95
fieldKindInMethod · 0.95
mayDeclareMethod · 0.95

Calls 3

literalOfMethod · 0.95
unwrapChainFunction · 0.90
ownerOfFunction · 0.70

Tested by

no test coverage detected