(arr: T[])
| 328 | |
| 329 | // Helper function for fuzzy search on prompt input |
| 330 | function filterInput<T>(arr: T[]) { |
| 331 | return (input: string | undefined): Promise<ReadonlyArray<{value: T}>> => { |
| 332 | input ??= ''; |
| 333 | return Promise.resolve(fuzzy.filter(input, arr).map((r) => ({value: r.original}))); |
| 334 | }; |
| 335 | } |
| 336 | |
| 337 | export function makeCLIPrompt(): Prompt { |
| 338 | return async ({defaultValue, message, multiple, options, required, type}) => { |