# selection.decodeWhereDocument

- **Module:** selection
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-ts/blob/3fe1ca654b81b8cbf4a13b777a001a3298c87a6f/packages/libtmux/src/selection.ts#L547
- **Page:** https://libtmux.org/en/ts/latest/reference/selection-decodewheredocument/

```
selection.decodeWhereDocument(input: : unknown) -> WhereDocumentV1
```

Validate a WHERE document and restore camelCase criteria names.

The returned document is canonical and deeply frozen.

## Raises

- `QueryValidationError`: when the document or its criteria are invalid.

## Example

```ts
import { decodeWhereDocument } from "libtmux/selection";
const document = decodeWhereDocument(
  JSON.parse('{"model":"pane","version":1,"where":{"pane_title":"logs"}}'),
);
if (document.model === "pane") snapshot.panes.where(document.where);
```
