Skip to content

filterBy beta ​

Function of @v12-engine/client/kit

ts
export declare function filterBy<T>(items: readonly T[], query: string, textOf: (item: T) => string, options?: {
    fuzzy?: boolean;
    threshold?: number;
}): T[];

The items every word typed is found in, by what each says of itself (textOf), in the order they came. Every item, with nothing typed. When no item has the words as typed, those that nearly have them (a typo), still in their order: a filter keeps the list's order, so what was nearly typed can be told from what was only when nothing else would show. fuzzy: false finds only what is typed