added Sieve getMatchTypes() for easy valid match-types

This commit is contained in:
the-djmaze 2022-03-16 14:33:43 +01:00
parent e4bd24b4e8
commit 37bb9a9a97
3 changed files with 13 additions and 12 deletions

View file

@ -9,9 +9,7 @@ import {
MULTILINE_DOTSTART
} from 'Sieve/RegEx';
import {
arrayToString
} from 'Sieve/Utils';
import { arrayToString, getMatchTypes } from 'Sieve/Utils';
/**
* abstract
@ -240,12 +238,10 @@ export class GrammarTest
toString()
{
/*
// https://datatracker.ietf.org/doc/html/rfc6134#section-2.3
if (':list' == this.match_type && !capa.includes('extlists')) {
if (!getMatchTypes().includes(this.match_type)) {
throw 'Unsupported match-type ' + this.match_type;
}
*/
return (this.identifier
+ (this.comparator ? ' :comparator ' + this.comparator : '')
+ (this.match_type ? ' ' + this.match_type : '')