Filter tag enhancements.

This commit is contained in:
Mike Cao committed 2024-04-01 10:10:56 -07:00
1 parent a4d8afe516
commit ef11124672
12 files changed
+160 -64

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import { OPERATOR_PREFIXES, OPERATORS } from 'lib/constants';
export function parseParameterValue(param: string) {
const [, prefix, value] = param.match(/^(!~|!|~)?(.*)$/);
const operator =
Object.keys(OPERATOR_PREFIXES).find(key => OPERATOR_PREFIXES[key] === prefix) ||
OPERATORS.equals;
return { operator, value };
}
export function operatorEquals(operator: any) {
return [OPERATORS.equals, OPERATORS.notEquals].includes(operator);
}