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

Function isCallableBeforeBody

ark/aot/graph.ts:7490–7496  ·  view source on GitHub ↗
(fn: Node, module: SourceModule)

Source from the content-addressed store, hash-verified

7488
7489// e.g. `export function f() {}`, which is set before the module's body runs
7490export const isCallableBeforeBody = (fn: Node, module: SourceModule): boolean =>
7491 fn.type === "FunctionDeclaration" &&
7492 (fn.parent?.type === "ExportNamedDeclaration" ||
7493 fn.parent?.type === "ExportDefaultDeclaration" ||
7494 (fn.parent?.type === "Program" &&
7495 !!bindingOfFunction(fn, module)?.exportNames.length)) &&
7496 importsValues(module)
7497
7498export const bindingOfFunction = (
7499 node: Node,

Callers 1

runPointOfFunction · 0.90

Calls 2

bindingOfFunctionFunction · 0.85
importsValuesFunction · 0.85

Tested by

no test coverage detected