import { rankItem } from "@tanstack/match-sorter-utils"; import { FilterFn } from "@tanstack/table-core"; // eslint-disable-next-line @typescript-eslint/no-explicit-any export const fuzzyFilter: FilterFn = (row, columnId, value, addMeta) => { // Rank the item const itemRank = rankItem(row.getValue(columnId), value); // Store the ranking info addMeta(itemRank); // Return if the item should be filtered in/out return itemRank.passed; };