(choices: ReadonlyArray<SelectChoice<A>>, query: string)
| 3060 | interface AutoCompleteOptionsReq<A> extends Required<AutoCompleteOptions<A>> {} |
| 3061 | |
| 3062 | const filterAutoCompleteChoices = <A>(choices: ReadonlyArray<SelectChoice<A>>, query: string) => { |
| 3063 | const normalizedQuery = query.toLowerCase() |
| 3064 | const indices: Array<number> = [] |
| 3065 | for (let i = 0; i < choices.length; i++) { |
| 3066 | if (choices[i].title.toLowerCase().includes(normalizedQuery)) { |
| 3067 | indices.push(i) |
| 3068 | } |
| 3069 | } |
| 3070 | return indices |
| 3071 | } |
| 3072 | |
| 3073 | const updateAutoCompleteState = <A>( |
| 3074 | state: AutoCompleteState, |
no test coverage detected