node_modules: update (#150)

Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
Dawid Dziurlaanddawidd6 authored and GitHub committed 2026-09-29 16:54:46 +02:00
1 parent e7732aaa6f
commit d4178273f4
15 files changed
+566 -292

No files matched your search

+26 -25
View File
@@ -64,46 +64,47 @@ function plainValue(source, onError) {
}
if (badChar)
onError(0, 'BAD_SCALAR_START', `Plain value cannot start with ${badChar}`);
return foldLines(source);
return unfoldLines(source);
}
function singleQuotedValue(source, onError) {
if (source[source.length - 1] !== "'" || source.length === 1)
onError(source.length, 'MISSING_CHAR', "Missing closing 'quote");
return foldLines(source.slice(1, -1)).replace(/''/g, "'");
return unfoldLines(source.slice(1, -1)).replace(/''/g, "'");
}
function foldLines(source) {
/**
* The negative lookbehind here and in the `re` RegExp is to
* prevent causing a polynomial search time in certain cases.
*
* The try-catch is for Safari, which doesn't support this yet:
* https://caniuse.com/js-regexp-lookbehind
*/
let first, line;
try {
first = new RegExp('(.*?)(?<![ \t])[ \t]*\r?\n', 'sy');
line = new RegExp('[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n', 'sy');
}
catch {
first = /(.*?)[ \t]*\r?\n/sy;
line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
}
let match = first.exec(source);
function unfoldLines(source) {
const line = /(.*?)\r?\n/sy;
let match = line.exec(source);
if (!match)
return source;
let res = match[1];
/**
* The negative lookbehinds in these RegExps are to
* prevent causing a polynomial search time in certain cases.
*
* The try-catch is for Safari < 16.4 and other old browsers:
* https://caniuse.com/js-regexp-lookbehind
*/
let trimEnd, trimBoth;
try {
trimEnd = new RegExp('(?<![ \t])[ \t]+$');
trimBoth = new RegExp('^[ \t]+|(?<![ \t])[ \t]+$', 'g');
}
catch {
trimEnd = /[ \t]+$/;
trimBoth = /^[ \t]+|[ \t]+$/g;
}
let res = match[1].replace(trimEnd, '');
let sep = ' ';
let pos = first.lastIndex;
line.lastIndex = pos;
let pos = line.lastIndex;
while ((match = line.exec(source))) {
if (match[1] === '') {
const lm = match[1].replace(trimBoth, '');
if (lm === '') {
if (sep === '\n')
res += sep;
else
sep = '\n';
}
else {
res += sep + match[1];
res += sep + lm;
sep = ' ';
}
pos = line.lastIndex;