Skip to content

matchWords

matchWords(label, query): boolean

Defined in: components/autocomplete.ts:147

The default type-ahead test: every whitespace-separated term of the query has to match the label from a word start on, and no two terms may claim the same word. Order doesn’t matter, so “se pal” finds “Palette search” just as “pal se” does — but “ette” finds nothing, as you type the beginnings of words. A term may run past its word’s end (“typescript” finds “TypeScript”, “c++” finds “C++”), so typing a label out in full always finds it.

Pass it to AutocompleteOptions.match to compose with it.

string

string

boolean