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

Function isLoopVariable

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

Source from the content-addressed store, hash-verified

3613 node.type === "DoWhileStatement"
3614
3615const isLoopVariable = (binding: Binding) => {
3616 const declaration = binding.declaration.parent
3617 const loop = declaration?.parent
3618 return (
3619 (loop?.type === "ForInStatement" || loop?.type === "ForOfStatement") &&
3620 loop.left === declaration
3621 )
3622}
3623
3624// e.g. not `V` in `if (flag) { var V = type("string") }`
3625const isDeclaredInBody = (binding: Binding): boolean => {

Callers 1

staticProblemOfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected