libtmux Reference MCP Search
On this page

selection.Selection.oneOrUndefined

View as Markdown

Module
selection
Declared in
Selection
Package
@libtmux/libtmux
Source
packages/libtmux/src/selection.ts
oneOrUndefined ( criteria : : WhereOf<Model> ) Model | undefined
method [source]
method [source]
oneOrUndefined

The single member, or undefined when there is none.

one without the empty case: several still throws, because that says the criteria were wrong rather than that the answer is absent.

Examples

snapshot.sessions.oneOrUndefined({ name: "work" })?.id;

Discussed in Filtering and queries

0 declared, 0 inherited

Esc

Type to search.