Merge pull request #3989 from github/dependabot/npm_and_yarn/js-yaml-5.1.0

Bump js-yaml from 5.0.0 to 5.1.0
This commit is contained in:
Michael B. Gale
2026-07-01 21:08:54 +00:00
committed by GitHub
4 changed files with 56 additions and 25 deletions

69
lib/entry-points.js generated
View File

@@ -141380,6 +141380,7 @@ function defineScalarTag(tagName, options) {
};
}
function defineSequenceTag(tagName, options) {
const carrierIsResult = options.finalize === void 0;
return {
tagName,
nodeKind: "sequence",
@@ -141387,12 +141388,15 @@ function defineSequenceTag(tagName, options) {
matchByTagPrefix: options.matchByTagPrefix ?? false,
create: options.create,
addItem: options.addItem,
finalize: options.finalize ?? ((carrier) => carrier),
carrierIsResult,
identify: options.identify ?? null,
represent: options.represent ?? ((data) => data),
representTagName: options.representTagName ?? null
};
}
function defineMappingTag(tagName, options) {
const carrierIsResult = options.finalize === void 0;
return {
tagName,
nodeKind: "mapping",
@@ -141403,6 +141407,8 @@ function defineMappingTag(tagName, options) {
has: options.has,
keys: options.keys,
get: options.get,
finalize: options.finalize ?? ((carrier) => carrier),
carrierIsResult,
identify: options.identify ?? null,
represent: options.represent ?? ((data) => data),
representTagName: options.representTagName ?? null
@@ -142458,6 +142464,14 @@ function eventPosition$1(event) {
function throwError$1(state, message) {
throwErrorAt(state.source, state.position, message, state.filename);
}
function finalizeCollection(state, position, tag, carrier) {
try {
return tag.finalize(carrier);
} catch (error3) {
if (error3 instanceof YAMLException) throw error3;
throwErrorAt(state.source, position, error3 instanceof Error ? error3.message : String(error3), state.filename);
}
}
function lookupTag(exact, prefix, tagName) {
const exactTag = exact[tagName];
if (exactTag) return exactTag;
@@ -142490,8 +142504,9 @@ function constructScalar(state, event) {
const collectionTagDef = lookupTag(state.schema.exact.mapping, state.schema.prefix.mapping, tagName) ?? lookupTag(state.schema.exact.sequence, state.schema.prefix.sequence, tagName);
if (collectionTagDef) {
if (source !== "") throwError$1(state, `cannot resolve a node with !<${tagName}> explicit tag`);
const carrier = collectionTagDef.create(tagName);
return {
value: collectionTagDef.create(tagName),
value: collectionTagDef.carrierIsResult ? carrier : finalizeCollection(state, state.position, collectionTagDef, carrier),
tag: collectionTagDef
};
}
@@ -142577,11 +142592,17 @@ function addValue(state, value, tag) {
frame.hasKey = true;
}
}
function storeAnchor(state, event, value, tag) {
if (event.anchorStart !== NO_RANGE$2) state.anchors.set(state.source.slice(event.anchorStart, event.anchorEnd), {
value,
tag
});
function storeAnchor(state, event, value, tag, isValueFinal) {
if (event.anchorStart !== NO_RANGE$2) {
const anchor = {
value,
tag,
isValueFinal
};
state.anchors.set(state.source.slice(event.anchorStart, event.anchorEnd), anchor);
return anchor;
}
return null;
}
function constructFromEvents(events, options) {
const state = {
@@ -142612,14 +142633,14 @@ function constructFromEvents(events, options) {
break;
case 4: {
const { value, tag } = constructScalar(state, event);
storeAnchor(state, event, value, tag);
storeAnchor(state, event, value, tag, true);
addValue(state, value, tag);
break;
}
case 2: {
const definition = collectionTag(state, event, state.schema.exact.sequence, state.schema.prefix.sequence, "tag:yaml.org,2002:seq", "sequence");
const value = definition.tag.create(definition.tagName);
storeAnchor(state, event, value, definition.tag);
const anchor = storeAnchor(state, event, value, definition.tag, definition.tag.carrierIsResult);
const parent = state.frames[state.frames.length - 1];
const merge2 = parent !== void 0 && parent.kind === "mapping" && parent.hasKey && parent.key === MERGE_KEY;
state.frames.push({
@@ -142627,6 +142648,7 @@ function constructFromEvents(events, options) {
position: state.position,
value,
tag: definition.tag,
anchor,
index: 0,
merge: merge2
});
@@ -142635,12 +142657,13 @@ function constructFromEvents(events, options) {
case 3: {
const definition = collectionTag(state, event, state.schema.exact.mapping, state.schema.prefix.mapping, "tag:yaml.org,2002:map", "mapping");
const value = definition.tag.create(definition.tagName);
storeAnchor(state, event, value, definition.tag);
const anchor = storeAnchor(state, event, value, definition.tag, definition.tag.carrierIsResult);
state.frames.push({
kind: "mapping",
position: state.position,
value,
tag: definition.tag,
anchor,
key: void 0,
keyPosition: state.position,
hasKey: false,
@@ -142652,13 +142675,21 @@ function constructFromEvents(events, options) {
const name = state.source.slice(event.anchorStart, event.anchorEnd);
const anchor = state.anchors.get(name);
if (!anchor) throwError$1(state, `unidentified alias "${name}"`);
if (!anchor.isValueFinal) throwError$1(state, `recursive alias "${name}" is not supported for tag ${anchor.tag.tagName} because it uses finalize()`);
addValue(state, anchor.value, anchor.tag);
break;
}
case 6: {
const frame = state.frames.pop();
if (frame.kind === "document") state.documents.push(frame.value);
else addValue(state, frame.value, frame.tag);
else {
const value = frame.tag.carrierIsResult ? frame.value : finalizeCollection(state, frame.position, frame.tag, frame.value);
if (frame.anchor) {
frame.anchor.value = value;
frame.anchor.isValueFinal = true;
}
addValue(state, value, frame.tag);
}
break;
}
}
@@ -143728,7 +143759,8 @@ var DEFAULT_PRESENTER_OPTIONS = {
flowSkipCommaSpace: false,
flowSkipColonSpace: false,
quoteFlowKeys: false,
quoteStyle: "auto",
quoteStyle: "single",
forceQuotes: false,
tagBeforeAnchor: false
};
function nodeTagShort(node) {
@@ -143843,9 +143875,8 @@ var STYLE_SINGLE = 2;
var STYLE_LITERAL = 3;
var STYLE_FOLDED = 4;
var STYLE_DOUBLE = 5;
function chooseScalarStyle(state, string2, layout, singleLineOnly, inblock) {
function chooseScalarStyle(state, string2, layout, singleLineOnly, forceQuote, inblock) {
const { blockIndent, lineWidth } = layout;
const forceQuote = state.quoteStyle !== "auto";
let i;
let char = 0;
let prevChar = -1;
@@ -143907,11 +143938,11 @@ function resolveScalarStyle(state, node, layout, iskey, inblock) {
}
const string2 = node.value;
if (string2.length === 0) {
if (state.quoteStyle === "auto" && (node.style.tagged || resolveImplicitTag(state, string2) === node.tag)) return STYLE_PLAIN;
if (node.style.tagged || resolveImplicitTag(state, string2) === node.tag) return STYLE_PLAIN;
return state.quoteStyle === "double" ? STYLE_DOUBLE : STYLE_SINGLE;
}
const style = chooseScalarStyle(state, string2, layout, singleLineOnly, inblock);
if (style === STYLE_PLAIN && !node.style.tagged && resolveImplicitTag(state, string2) !== node.tag) return STYLE_SINGLE;
const style = chooseScalarStyle(state, string2, layout, singleLineOnly, state.forceQuotes && !iskey, inblock);
if (style === STYLE_PLAIN && !node.style.tagged && resolveImplicitTag(state, string2) !== node.tag) return state.quoteStyle === "double" ? STYLE_DOUBLE : STYLE_SINGLE;
return style;
}
function blockHeader(string2, indentPerLevel) {
@@ -144031,7 +144062,7 @@ function writeFlowMapping(state, level, node) {
for (const { key, value } of items) {
let pairBuffer = "";
if (result !== "") pairBuffer += `,${!state.flowSkipCommaSpace ? " " : ""}`;
const keyText = writeNode(state, level, key, {});
const keyText = writeNode(state, level, key, { iskey: true });
const explicitPair = keyText.length > 1024;
if (explicitPair) pairBuffer += "? ";
else if (state.quoteFlowKeys) pairBuffer += '"';
@@ -151493,7 +151524,7 @@ extensions:
`;
let data = ranges.map((range2) => {
const filename = path15.join(checkoutPath, range2.path).replaceAll(path15.sep, "/");
return ` - [${dump(filename, { quoteStyle: "single" }).trim()}, ${range2.startLine}, ${range2.endLine}]
return ` - [${dump(filename, { forceQuotes: true, quoteStyle: "single" }).trim()}, ${range2.startLine}, ${range2.endLine}]
`;
}).join("");
if (!data) {
@@ -162434,7 +162465,7 @@ tmp/lib/tmp.js:
*)
js-yaml/dist/js-yaml.mjs:
(*! js-yaml 5.0.0 https://github.com/nodeca/js-yaml @license MIT *)
(*! js-yaml 5.1.0 https://github.com/nodeca/js-yaml @license MIT *)
long/index.js:
(**

8
package-lock.json generated
View File

@@ -28,7 +28,7 @@
"follow-redirects": "^1.16.0",
"get-folder-size": "^5.0.0",
"https-proxy-agent": "^7.0.6",
"js-yaml": "^5.0.0",
"js-yaml": "^5.1.0",
"jsonschema": "1.5.0",
"long": "^5.3.2",
"node-forge": "^1.4.0",
@@ -6986,9 +6986,9 @@
}
},
"node_modules/js-yaml": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.0.0.tgz",
"integrity": "sha512-GSvaPUbk1U+FMZ7rJzF+F8e5YVtu7KnD40et/5rBXXRBv2jCO9L3qCewvIDDdudC0QycTFlf6EAA+h3kxBsuUw==",
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.1.0.tgz",
"integrity": "sha512-s8VA5jkR8f22S3NAXmhKPFqGUduqZGlsufabVOgN14iTdw/RXcym7bKkbwjxLK9Yw2lEvvmJjFp119+KPeo8Kg==",
"funding": [
{
"type": "github",

View File

@@ -36,7 +36,7 @@
"follow-redirects": "^1.16.0",
"get-folder-size": "^5.0.0",
"https-proxy-agent": "^7.0.6",
"js-yaml": "^5.0.0",
"js-yaml": "^5.1.0",
"jsonschema": "1.5.0",
"long": "^5.3.2",
"node-forge": "^1.4.0",

View File

@@ -285,7 +285,7 @@ extensions:
// characters are escaped, and that the path is always rendered as a
// quoted string on a single line.
return (
` - [${yaml.dump(filename, { quoteStyle: "single" }).trim()}, ` +
` - [${yaml.dump(filename, { forceQuotes: true, quoteStyle: "single" }).trim()}, ` +
`${range.startLine}, ${range.endLine}]\n`
);
})