node_modules: update (#146)

Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
Dawid Dziurla
2026-08-07 08:08:41 +02:00
committed by GitHub
co-authored by dawidd6
parent 6b3dfab4e0
commit 3d5a3a75cc
44 changed files with 660 additions and 284 deletions
+12 -4
View File
@@ -70,6 +70,14 @@ function getFirstKeyStartProps(prev) {
}
return prev.splice(i, prev.length);
}
function arrayPushArray(target, source) {
// May exhaust call stack with large `source` array
if (source.length < 1e5)
Array.prototype.push.apply(target, source);
else
for (let i = 0; i < source.length; ++i)
target.push(source[i]);
}
function fixFlowSeqItems(fc) {
if (fc.start.type === 'flow-seq-start') {
for (const it of fc.items) {
@@ -82,12 +90,12 @@ function fixFlowSeqItems(fc) {
delete it.key;
if (isFlowToken(it.value)) {
if (it.value.end)
Array.prototype.push.apply(it.value.end, it.sep);
arrayPushArray(it.value.end, it.sep);
else
it.value.end = it.sep;
}
else
Array.prototype.push.apply(it.start, it.sep);
arrayPushArray(it.start, it.sep);
delete it.sep;
}
}
@@ -507,7 +515,7 @@ class Parser {
const prev = map.items[map.items.length - 2];
const end = prev?.value?.end;
if (Array.isArray(end)) {
Array.prototype.push.apply(end, it.start);
arrayPushArray(end, it.start);
end.push(this.sourceToken);
map.items.pop();
return;
@@ -722,7 +730,7 @@ class Parser {
const prev = seq.items[seq.items.length - 2];
const end = prev?.value?.end;
if (Array.isArray(end)) {
Array.prototype.push.apply(end, it.start);
arrayPushArray(end, it.start);
end.push(this.sourceToken);
seq.items.pop();
return;