Filter tag enhancements.
This commit is contained in:
1 parent
a4d8afe516
commit
ef11124672
12 files changed
+160
-64
No files matched your search
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user