node_modules: upgrade

This commit is contained in:
Dawid Dziurla
2025-06-13 19:44:16 +02:00
parent 7d23b91650
commit 21abe22bd8
320 changed files with 34046 additions and 3537 deletions

View File

@ -7,7 +7,6 @@
* @return {Object} Address object
*/
function _handleAddress(tokens) {
let token;
let isGroup = false;
let state = 'text';
let address;
@ -23,7 +22,8 @@ function _handleAddress(tokens) {
// Filter out <addresses>, (comments) and regular text
for (i = 0, len = tokens.length; i < len; i++) {
token = tokens[i];
let token = tokens[i];
let prevToken = i ? tokens[i - 1] : null;
if (token.type === 'operator') {
switch (token.value) {
case '<':
@ -38,6 +38,7 @@ function _handleAddress(tokens) {
break;
default:
state = 'text';
break;
}
} else if (token.value) {
if (state === 'address') {
@ -46,7 +47,13 @@ function _handleAddress(tokens) {
// and so will we
token.value = token.value.replace(/^[^<]*<\s*/, '');
}
data[state].push(token.value);
if (prevToken && prevToken.noBreak && data[state].length) {
// join values
data[state][data[state].length - 1] += token.value;
} else {
data[state].push(token.value);
}
}
}
@ -172,11 +179,12 @@ class Tokenizer {
* @return {Array} An array of operator|text tokens
*/
tokenize() {
let chr,
list = [];
let list = [];
for (let i = 0, len = this.str.length; i < len; i++) {
chr = this.str.charAt(i);
this.checkChar(chr);
let chr = this.str.charAt(i);
let nextChr = i < len - 1 ? this.str.charAt(i + 1) : null;
this.checkChar(chr, nextChr);
}
this.list.forEach(node => {
@ -194,7 +202,7 @@ class Tokenizer {
*
* @param {String} chr Character from the address field
*/
checkChar(chr) {
checkChar(chr, nextChr) {
if (this.escaped) {
// ignore next condition blocks
} else if (chr === this.operatorExpecting) {
@ -202,10 +210,16 @@ class Tokenizer {
type: 'operator',
value: chr
};
if (nextChr && ![' ', '\t', '\r', '\n', ',', ';'].includes(nextChr)) {
this.node.noBreak = true;
}
this.list.push(this.node);
this.node = null;
this.operatorExpecting = '';
this.escaped = false;
return;
} else if (!this.operatorExpecting && chr in this.operators) {
this.node = {