( answers: Record<string, PluginAnswer>, key: string, defaultValue: string, )
| 26 | |
| 27 | /** Extracts a non-empty string array from a plugin answer, using a default if empty. */ |
| 28 | export function answerNonEmptyArray( |
| 29 | answers: Record<string, PluginAnswer>, |
| 30 | key: string, |
| 31 | defaultValue: string, |
| 32 | ): [string, ...string[]] { |
| 33 | const [first = defaultValue, ...rest] = answerArray(answers, key); |
| 34 | return [first, ...rest]; |
| 35 | } |
| 36 | |
| 37 | /** Extracts a boolean from a plugin answer, defaulting to `true`. */ |
| 38 | export function answerBoolean( |
no test coverage detected