(states: KnowledgeState[])
| 263 | * could answer is not a `known` section, and saying so would launder the gap. |
| 264 | */ |
| 265 | export function worstState(states: KnowledgeState[]): KnowledgeState { |
| 266 | return states.reduce<KnowledgeState>( |
| 267 | (worst, state) => (STATE_RANK[state] > STATE_RANK[worst] ? state : worst), |
| 268 | 'known' |
| 269 | ); |
| 270 | } |
| 271 | |
| 272 | /** Last path segment of a URI, for `file:line` captions. */ |
| 273 | export function displayFile(uri: string | undefined): string | undefined { |
no test coverage detected