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

Function isNonCallingFunctionRead

ark/aot/usage.ts:2420–2439  ·  view source on GitHub ↗
(
	operand: Node,
	parent: Node | undefined,
	module: SourceModule
)

Source from the content-addressed store, hash-verified

2418])
2419
2420const isNonCallingFunctionRead = (
2421 operand: Node,
2422 parent: Node | undefined,
2423 module: SourceModule
2424): boolean => {
2425 if (!parent) return false
2426 if (parent.type === "ExpressionStatement") return true
2427 if (
2428 parent.type === "UnaryExpression" &&
2429 (parent.operator === "typeof" ||
2430 parent.operator === "!" ||
2431 parent.operator === "void")
2432 )
2433 return true
2434 if (parent.type === "CallExpression" && parent.callee !== operand) {
2435 const name = globalNameOf(unwrapExpression(parent.callee), module)
2436 return !!name && nonCallingGlobals.has(name)
2437 }
2438 return false
2439}
2440
2441const collectBindingCalls = (
2442 binding: Binding,

Callers 3

classBindingExposesFunction · 0.85
collectBindingCallsFunction · 0.85
collectExportCallsFunction · 0.85

Calls 3

unwrapExpressionFunction · 0.90
globalNameOfFunction · 0.85
hasMethod · 0.45

Tested by

no test coverage detected