Function
normalisedValue
(multiple: boolean, values: T[] | undefined)
Source from the content-addressed store, hash-verified
| 37 | } |
| 38 | |
| 39 | function normalisedValue<T>(multiple: boolean, values: T[] | undefined): T | T[] | undefined { |
| 40 | if (!values) { |
| 41 | return undefined; |
| 42 | } |
| 43 | if (multiple) { |
| 44 | return values; |
| 45 | } |
| 46 | return values[0]; |
| 47 | } |
| 48 | |
| 49 | export interface AutocompleteOptions<T extends OptionLike> |
| 50 | extends PromptOptions<T['value'] | T['value'][], AutocompletePrompt<T>> { |
Tested by
no test coverage detected