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

@ -56,4 +56,13 @@ export const
setError = text => {
serverError(true);
serverErrorDesc(text);
},
getMatchTypes = (validOnly = 1) => {
let result = [':is',':contains',':matches'];
// https://datatracker.ietf.org/doc/html/rfc6134#section-2.3
if (capa.includes('extlists') || !validOnly) {
result.push(':list');
}
return result;
};