On this page
selection.StringFilterFields
- Module
- selection
- Package
- @libtmux/libtmux
- Source
- packages/libtmux/src/selection.ts
-
A field's criteria accept its decoded shape as well as the text tmux sends:
where({ active: true })andwhere({ active: "1" })are the same query, and serialize identically. Anullcriterion matches any wire value that the field decoder treats as absent or invalid, rather than one particular wire spelling.The text side exists because the wire does.
encodeFormatValuelowers every criterion to tmux's text before a query is serialized, andWhereDocumentV1types both what a caller writes and whatdecodeWhereDocumentgives back — so a type that refused text would be lying about the documents this library's own encoder produces. That is the difference from an ORM, whose query AST never round-trips through a type the caller also authors.Rawis therefore not a taste."0" | "1"is the exact wire domain for a flag, while an integer uses${bigint}intersected with a decimal prefix. That rules out fractions, exponents, radix prefixes, leading zeroes,-0,NaN, and prose. TypeScript cannot bound an integer's magnitude, so the query validator also requires safe range at runtime.format_values.test.tsholds the layers in step.The substring operations stay
stringdeliberately:containsasks about the characters tmux sent, and a numeric field's text has characters like any other.
0 declared, 0 inherited