(choices: ReadonlyArray<SelectChoice<A>>, query: string)
| 3290 | interface AutoCompleteOptionsReq<A> extends OptionsReq<AutoCompleteOptions<A>> {} |
| 3291 | |
| 3292 | const filterAutoCompleteChoices = <A>(choices: ReadonlyArray<SelectChoice<A>>, query: string) => { |
| 3293 | const normalizedQuery = query.toLowerCase() |
| 3294 | const indices: Array<number> = [] |
| 3295 | for (let i = 0; i < choices.length; i++) { |
| 3296 | if (choices[i].title.toLowerCase().includes(normalizedQuery)) { |
| 3297 | indices.push(i) |
| 3298 | } |
| 3299 | } |
| 3300 | return indices |
| 3301 | } |
| 3302 | |
| 3303 | const updateAutoCompleteState = <A>( |
| 3304 | state: AutoCompleteState, |
no test coverage detected