This page is available as Markdown at /api/traversal/functions/getleaf.md. For the full documentation index, see /llms.txt, or the complete corpus at /llms-full.txt.
getLeaf
getLeaf(
snapshot,path,options): {node:Node;path:Path; } |undefined
Defined in: get-leaf.ts:14
Get the deepest leaf node starting from a path, walking toward either the start or end edge. A leaf is any node that has no children according to the traversal context.
Parameters
Section titled “Parameters”snapshot
Section titled “snapshot”TraversalSnapshot
Path
options
Section titled “options”"start" | "end"
Returns
Section titled “Returns”{ node: Node; path: Path; } | undefined