> For the complete documentation index, see [llms.txt](/llms.txt).
> The full corpus is at [llms-full.txt](/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

### snapshot

`TraversalSnapshot`

### path

`Path`

### options

#### edge

`"start"` \| `"end"`

## Returns

\{ `node`: `Node`; `path`: `Path`; \} \| `undefined`