Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
break;
case 'NOT':
if (opExpected)
fstr.push(" && ");
fstr.push("!");
opExpected = false;
break;
default:
let x = p.trim();
if (x) {
if (opExpected)
fstr.push(" && ");
fstr.push(`check('${x}', q)`);
checks[x] = getSearchQueryPredicate(x);
opExpected = true;
}
break;
}
}
if (fstr.length == 1)
return () => true;
function check(word, query) {
return checks[word](query)
}
try {
let fbody = fstr.join('');
//console.log(fbody);
}
if (fstr.length == 1)
return () => true;
function check(word, query) {
return checks[word](query)
}
try {
let fbody = fstr.join('');
//console.log(fbody);
return new Function('check', 'q', fbody).bind(null, check);
}
catch (err) {
return getSearchQueryPredicate(query);
}
}
onCreateFilter={filter => {
let predicate = getSearchQueryPredicate(filter);
return record => predicate(record.description);
}}
>