()
| 64 | itemIdOrIndexFromArg?: string, |
| 65 | options?: Partial<ChooseOptions<T>>, |
| 66 | ): Promise<string> => { |
| 67 | const opts = chooseOptionsWithDefaults(options) |
| 68 | |
| 69 | // Listing items usually makes an API call which we only want to happen once so we do it |
| 70 | // now and just use stub functions that return these items later as needed. |
| 71 | let filteredItems: T[] | undefined = undefined |
| 72 | const listItemsWrapper = async (): Promise<T[]> => { |
| 73 | if (!filteredItems) { |
| 74 | const items = await (opts.listItems ?? listItems)(command) |
| 75 | filteredItems = opts.listFilter ? items.filter(opts.listFilter) : items |
nothing calls this directly
no outgoing calls
no test coverage detected