Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
matchesFilter: (datum: Datum) =>
!style.if ||
style.if.filter_query === undefined ||
(ast = ast || new QuerySyntaxTree(style.if.filter_query)).evaluate(datum),
style: convertStyle(style)
private readonly ast = memoizerCache<[ColumnId, number]>()((
query: string
) => new QuerySyntaxTree(query));
export function ifFilter(condition: IConditionalElement | undefined, datum: Datum) {
return !condition ||
condition.filter_query === undefined ||
ifAstFilter(new QuerySyntaxTree(condition.filter_query), datum);
}
const getter = (
columns: Columns,
data: Data,
filter_action: TableAction,
filter_query: string,
sort_action: TableAction,
sort_by: SortBy = []
): IDerivedData => {
const map = new Map();
R.addIndex(R.forEach)((datum, index) => {
map.set(datum, index);
}, data);
if (filter_action === TableAction.Native) {
const tree = new QuerySyntaxTree(filter_query);
data = tree.isValid ?
tree.filter(data) :
data;
}
const getNullyCases = (
columnId: ColumnId
): SortAsNull => {
const column = R.find(c => c.id === columnId, columns);
return (column && column.sort_as_null) || [];
};
const isNully = (
value: any,