Function
askList
(
message: string,
choices: Choice[]
)
Source from the content-addressed store, hash-verified
| 124 | } |
| 125 | |
| 126 | async function askList<Choice extends string>( |
| 127 | message: string, |
| 128 | choices: Choice[] |
| 129 | ): Promise<Choice> { |
| 130 | const name = `List-${serialId()}`; |
| 131 | |
| 132 | return prompt([ |
| 133 | { |
| 134 | choices, |
| 135 | message, |
| 136 | name, |
| 137 | prefix, |
| 138 | type: "select", |
| 139 | onCancel: cancelFlow, |
| 140 | } as ArrayPromptOptions, |
| 141 | ]) |
| 142 | .then((responses: any) => responses[name]) |
| 143 | .catch((err: unknown) => { |
| 144 | error(err); |
| 145 | }); |
| 146 | } |
| 147 | |
| 148 | export { |
| 149 | askCheckboxPlus, |
Callers
nothing calls this directly
Tested by
no test coverage detected