# selection.parseLegacyWhere

- **Module:** selection
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-ts/blob/3fe1ca654b81b8cbf4a13b777a001a3298c87a6f/packages/libtmux/src/selection.ts#L566
- **Page:** https://libtmux.org/en/ts/latest/reference/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/selection";
const document = parseLegacyWhere("window", { name__contains: "log" });
snapshot.windows.where(document.where);
```
