Improved Sieve code and added rfc5435

This commit is contained in:
the-djmaze 2022-03-15 09:58:04 +01:00
parent f453abf149
commit b3c1723c5c
10 changed files with 165 additions and 65 deletions

View file

@ -41,7 +41,9 @@ export class DateTest extends GrammarTest
pushArguments(args)
{
let l = args.length - 1;
this.key_list = args.pop();
this.date_part = args.pop();
this.header_name = args.pop();
args.forEach((arg, i) => {
if (':originalzone' === arg) {
this.originalzone = true;
@ -51,12 +53,6 @@ export class DateTest extends GrammarTest
this.zone.value = arg.value;
} else if (':index' === args[i-1]) {
this.index.value = arg.value;
} else if (l-2 === i) {
this.header_name = arg;
} else if (l-1 === i) {
this.date_part = arg;
} else if (l === i) {
this.key_list = arg;
}
});
}
@ -86,14 +82,11 @@ export class CurrentDateTest extends GrammarTest
pushArguments(args)
{
let l = args.length - 1;
this.key_list = args.pop();
this.date_part = args.pop();
args.forEach((arg, i) => {
if (':zone' === args[i-1]) {
this.zone.value = arg.value;
} else if (l-1 === i) {
this.date_part = arg;
} else if (l === i) {
this.key_list = arg;
}
});
}