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

Function isDeclaredInBody

ark/aot/interpreter.ts:3625–3630  ·  view source on GitHub ↗
(binding: Binding)

Source from the content-addressed store, hash-verified

3623
3624// e.g. not `V` in `if (flag) { var V = type("string") }`
3625const isDeclaredInBody = (binding: Binding): boolean => {
3626 let container = binding.declaration.parent?.parent
3627 if (container?.type === "ExportNamedDeclaration") container = container.parent
3628 const scope = binding.scope.node
3629 return container === scope || ("body" in scope && container === scope.body)
3630}
3631
3632const parameterCount = (fn: FunctionNode): number => {
3633 let count = 0

Callers 1

staticProblemOfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected