node_modules: update (#307)

Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
Dawid Dziurla
2026-08-07 08:08:22 +02:00
committed by GitHub
parent 5cdad7c44d
commit 8de3c31270
35 changed files with 1023 additions and 339 deletions
+17 -1
View File
@@ -181,6 +181,7 @@ class Tokenizer {
this.operatorExpecting = '';
this.node = null;
this.escaped = false;
this.inDomainLiteral = false;
this.list = [];
/**
@@ -232,6 +233,21 @@ class Tokenizer {
* @param {String} chr Character from the address field
*/
checkChar(chr, nextChr) {
// Track RFC 5322 domain-literals ("[" *dtext "]"). Operator characters such
// as the ":" of an IPv6 address-literal (user@[IPv6:2001:db8::1]) are dtext
// and must not be treated as the group delimiter while inside the brackets.
// Quoted strings and comments are handled separately via operatorExpecting,
// so only enter this state when no operator is open. The list separators ","
// and ";" are the exception: they always end the literal (and split the
// address list) so that an unclosed "[" cannot swallow later recipients.
if (!this.escaped && !this.operatorExpecting) {
if (!this.inDomainLiteral && chr === '[') {
this.inDomainLiteral = true;
} else if (this.inDomainLiteral && (chr === ']' || chr === ',' || chr === ';')) {
this.inDomainLiteral = false;
}
}
if (this.escaped) {
// ignore next condition blocks
} else if (chr === this.operatorExpecting) {
@@ -250,7 +266,7 @@ class Tokenizer {
this.escaped = false;
return;
} else if (!this.operatorExpecting && chr in this.operators) {
} else if (!this.operatorExpecting && !this.inDomainLiteral && chr in this.operators) {
this.node = {
type: 'operator',
value: chr