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

Method globalMemberOf

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

Source from the content-addressed store, hash-verified

5626
5627 // e.g. "Object.values" for `Object.values`
5628 private globalMemberOf(node: Node, module: SourceModule): string | undefined {
5629 node = unwrapChain(node)
5630 if (node.type !== "MemberExpression") return
5631 const object = unwrapChain(node.object)
5632 const name = memberNameOf(node)
5633 return (
5634 object.type === "Identifier" &&
5635 typeof name === "string" &&
5636 !module.scopes.byId.get(object)?.binding
5637 ) ?
5638 `${object.name}.${name}`
5639 : undefined
5640 }
5641
5642 // a global reading what it's passed, holding none of it after
5643 private readsOnly(callee: Node, module: SourceModule): boolean {

Callers 2

calledKindOfMethod · 0.95
mayWriteFromMethod · 0.95

Calls 3

unwrapChainFunction · 0.90
memberNameOfFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected