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

Function isBuiltinCtor

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

Source from the content-addressed store, hash-verified

1170
1171// e.g. `Array`, `Object`, `globalThis.Array`, `window.Object`
1172const isBuiltinCtor = (node: Node, module: SourceModule): boolean => {
1173 const target = unwrapExpression(node)
1174 if (isUnboundGlobal(target, module, builtinPrototypeCtors)) return true
1175 if (target.type !== "MemberExpression") return false
1176 const name = memberNameOf(target)
1177 return (
1178 typeof name === "string" &&
1179 builtinPrototypeCtors.has(name) &&
1180 isGlobalHost(target.object, module)
1181 )
1182}
1183
1184// e.g. `Object.getPrototypeOf`, `Reflect.getPrototypeOf`, `globalThis.Object.getPrototypeOf`
1185const isGetPrototypeOfCallee = (node: Node, module: SourceModule): boolean => {

Callers 1

isBuiltinPrototypePatchFunction · 0.85

Calls 5

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

Tested by

no test coverage detected