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

Function leaves

ark/aot/usage.ts:878–884  ·  view source on GitHub ↗
(statement: Node)

Source from the content-addressed store, hash-verified

876
877// no statement after it in its block runs
878const leaves = (statement: Node): boolean =>
879 statement.type === "BlockStatement" ?
880 !!statement.body.length && leaves(statement.body[statement.body.length - 1])
881 : statement.type === "ReturnStatement" ||
882 statement.type === "ThrowStatement" ||
883 statement.type === "BreakStatement" ||
884 statement.type === "ContinueStatement"
885
886const literalOf = (node: Node | undefined): string | undefined =>
887 node?.type === "Literal" && typeof node.value === "string" ? node.value

Callers 1

isPastErrorsTestMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected