Skip to content

Commit

Permalink
minimize changes
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jan 3, 2024
1 parent 45a3df2 commit e6095c3
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ const buildAggregatedFilterItemsApplier = (
};
}

// We generate a new function with `eval()` to avoid expensive patterns for JS engines
// We generate a new function with `new Function()` to avoid expensive patterns for JS engines
// such as a dynamic object assignment, e.g. `{ [dynamicKey]: value }`.
const filterItemCore = new Function(
'appliers',
Expand Down Expand Up @@ -288,7 +288,10 @@ return result$$;`.replaceAll('$$', String(filterItemsApplierId)),
);
filterItemsApplierId += 1;

return (row, shouldApplyItem) => filterItemCore(appliers, row, shouldApplyItem);
// Assign to the arrow function a name to help debugging
const filterItem: GridFilterItemApplierNotAggregated = (row, shouldApplyItem) =>
filterItemCore(appliers, row, shouldApplyItem);
return filterItem;
};

export const shouldQuickFilterExcludeHiddenColumns = (filterModel: GridFilterModel) => {
Expand Down

0 comments on commit e6095c3

Please sign in to comment.