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

Function isGlobalHost

ark/aot/usage.ts:1159–1169  ·  view source on GitHub ↗
(node: Node, module: SourceModule)

Source from the content-addressed store, hash-verified

1157}
1158
1159const isGlobalHost = (node: Node, module: SourceModule): boolean => {
1160 const target = unwrapExpression(node)
1161 if (isUnboundGlobal(target, module, globalHostNames)) return true
1162 if (target.type !== "MemberExpression") return false
1163 const name = memberNameOf(target)
1164 return (
1165 typeof name === "string" &&
1166 globalHostNames.has(name) &&
1167 isGlobalHost(target.object, module)
1168 )
1169}
1170
1171// e.g. `Array`, `Object`, `globalThis.Array`, `window.Object`
1172const isBuiltinCtor = (node: Node, module: SourceModule): boolean => {

Callers 3

isBuiltinCtorFunction · 0.85
isGetPrototypeOfCalleeFunction · 0.85
isPrototypeMutatorCallFunction · 0.85

Calls 4

unwrapExpressionFunction · 0.90
memberNameOfFunction · 0.90
isUnboundGlobalFunction · 0.85
hasMethod · 0.45

Tested by

no test coverage detected