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
+11 -4
View File
@@ -30,19 +30,26 @@ function composeNode(ctx, token, props, onError) {
case 'block-map':
case 'block-seq':
case 'flow-collection':
node = composeCollection.composeCollection(CN, ctx, token, props, onError);
if (anchor)
node.anchor = anchor.source.substring(1);
try {
node = composeCollection.composeCollection(CN, ctx, token, props, onError);
if (anchor)
node.anchor = anchor.source.substring(1);
}
catch (error) {
// Almost certainly here due to a stack overflow
const message = error instanceof Error ? error.message : String(error);
onError(token, 'RESOURCE_EXHAUSTION', message);
}
break;
default: {
const message = token.type === 'error'
? token.message
: `Unsupported token (type: ${token.type})`;
onError(token, 'UNEXPECTED_TOKEN', message);
node = composeEmptyNode(ctx, token.offset, undefined, null, props, onError);
isSrcToken = false;
}
}
node ?? (node = composeEmptyNode(ctx, token.offset, undefined, null, props, onError));
if (anchor && node.anchor === '')
onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
if (atKey &&
+4 -2
View File
@@ -97,8 +97,10 @@ class Composer {
}
}
if (afterDoc) {
Array.prototype.push.apply(doc.errors, this.errors);
Array.prototype.push.apply(doc.warnings, this.warnings);
for (let i = 0; i < this.errors.length; ++i)
doc.errors.push(this.errors[i]);
for (let i = 0; i < this.warnings.length; ++i)
doc.warnings.push(this.warnings[i]);
}
else {
doc.errors = this.errors;
+5 -3
View File
@@ -144,7 +144,7 @@ function doubleQuotedValue(source, onError) {
next = source[++i + 1];
}
else if (next === 'x' || next === 'u' || next === 'U') {
const length = { x: 2, u: 4, U: 8 }[next];
const length = next === 'x' ? 2 : next === 'u' ? 4 : 8;
res += parseCharCode(source, i + 1, length, onError);
i += length;
}
@@ -214,12 +214,14 @@ function parseCharCode(source, offset, length, onError) {
const cc = source.substr(offset, length);
const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
const code = ok ? parseInt(cc, 16) : NaN;
if (isNaN(code)) {
try {
return String.fromCodePoint(code);
}
catch {
const raw = source.substr(offset - 2, length + 2);
onError(offset - 2, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`);
return raw;
}
return String.fromCodePoint(code);
}
exports.resolveFlowScalar = resolveFlowScalar;