Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux-ts latest

Selection.oneOrUndefined

The single member, or undefined when there is none.

Source and package
Qualified name
Selection.oneOrUndefined
Module
selection
Declared in
Selection
Package
libtmux
Source
packages/libtmux/src/selection.ts
oneOrUndefined( criteria?: WhereOf<Model>, ): Model | undefined

Description#

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;
Type parameters
Parameters

Guides#

Pages that discuss oneOrUndefined.

Esc

Type to search.

Reference previewOpen reference