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

Function staticOwnerOf

ark/aot/graph.ts:6420–6430  ·  view source on GitHub ↗
(node: Node)

Source from the content-addressed store, hash-verified

6418 )
6419
6420const staticOwnerOf = (node: Node): Node | undefined => {
6421 const owner = ownerOf(node)
6422 if (!owner || owner.type === "ObjectExpression") return
6423 let element = node
6424 while (element.parent!.type !== "ClassBody") element = element.parent!
6425 return (
6426 element.type === "StaticBlock" || ("static" in element && element.static)
6427 ) ?
6428 owner
6429 : undefined
6430}
6431
6432const ownerOf = (node: Node): Node | undefined => {
6433 for (let owner = node.parent; owner; owner = owner.parent) {

Callers 3

thisKindOfMethod · 0.85
literalOfMethod · 0.85
writesThroughMethod · 0.85

Calls 1

ownerOfFunction · 0.70

Tested by

no test coverage detected