export function filterItems({ filterFns, filterVals, items, }: { filterFns: Record boolean>; filterVals: Record; items: I[]; }) { return items.filter(item => { for (const key in filterFns) { const filter = filterFns[key]; const val = filterVals[key]; if (!filter(item, val)) { return false; } } return true; }); }