# selection.parseLegacyWhere

- **Module:** selection
- **Package:** @libtmux/libtmux
- **Language:** TypeScript
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-ts/blob/2cb93308200da38a26b59876618116850f110607/packages/libtmux/src/selection.ts#L560
- **Page:** https://libtmux.org/reference/ts/selection-parselegacywhere/

```
selection.parseLegacyWhere(model: : Model, input: : unknown) -> Extract<WhereDocumentV1, { readonly model: Model }>
```

Convert the Python port's `name__contains` spelling to canonical criteria.

Accepts one own data property on a plain object and never invokes accessors
or conversion hooks. The returned document and its criteria are frozen.

## Raises

- `QueryValidationError` — when the model is not `session` or `window`, or the input is not exactly one string-valued `name__contains` property.

## Example

```ts
import { parseLegacyWhere } from "libtmux";
const document = parseLegacyWhere("window", { name__contains: "log" });
snapshot.windows.where(document.where);
```
