/** An explicit missing selection must never fall back to another peer. */ export function selectWgExportPeer(peers: readonly T[], peerId?: string | null): T | undefined { return peerId == null ? peers[0] : peers.find(peer => peer.id === peerId || peer.rosId === peerId) }