mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-07 15:19:31 +00:00
prevent custom defaultHeaderFilter breaking tristate built-in filter
This commit is contained in:
@@ -3,6 +3,11 @@ function parseFilterExpression(expression){
|
||||
const excludeTerms = [];
|
||||
const comparisons = [];
|
||||
|
||||
if( typeof expression !== 'string' ) {
|
||||
comparisons.push({ operator: '=', number: expression });
|
||||
return { includeGroups, excludeTerms, comparisons };
|
||||
}
|
||||
|
||||
const andParts = expression.split('&&').map(part => part.trim());
|
||||
|
||||
andParts.forEach(part => {
|
||||
@@ -54,7 +59,7 @@ export function defaultHeaderFilter(headerValue, rowValue)
|
||||
const comparisonCheck = comparisons.every(({ operator, number }) => {
|
||||
let value = rowValue;
|
||||
|
||||
if (!isNaN(number))
|
||||
if (!isNaN(number) && typeof number !== 'boolean')
|
||||
{
|
||||
value = parseFloat(rowValue);
|
||||
if (isNaN(value)) return false;
|
||||
|
||||
Reference in New Issue
Block a user