> For the complete documentation index, see [llms.txt](/llms.txt).
> The full corpus is at [llms-full.txt](/llms-full.txt).

# getParent

## Call Signature

> **getParent**\<`TMatch`\>(`snapshot`, `path`, `options`): \{ `node`: `TMatch`; `path`: `Path`; \} \| `undefined`

Defined in: get-parent.ts:18

Get the parent of a node at a given path.

A parent has children, so it is always a `PortableTextBlock` (text block
or object node).

When `match` is provided and the parent does not satisfy it, returns
`undefined`.

### Type Parameters

#### TMatch

`TMatch` *extends* `PortableTextBlock`

### Parameters

#### snapshot

`TraversalSnapshot`

#### path

`Path`

#### options

##### match

(`node`, `path`) => `node is TMatch`

### Returns

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

## Call Signature

> **getParent**(`snapshot`, `path`, `options?`): \{ `node`: `PortableTextBlock`; `path`: `Path`; \} \| `undefined`

Defined in: get-parent.ts:28

### Parameters

#### snapshot

`TraversalSnapshot`

#### path

`Path`

#### options?

##### match?

(`node`, `path`) => `boolean`

### Returns

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