@@ -13877,7 +13877,7 @@ var Alias = class extends NodeBase {
1387713877 toJS(source, null, ctx);
1387813878 data = anchors.get(source);
1387913879 }
13880- if (! data || data.res === void 0) {
13880+ if (( data == null ? void 0 : data.res) === void 0) {
1388113881 const msg = "This should not happen: Alias anchor was not resolved?";
1388213882 throw new ReferenceError(msg);
1388313883 }
@@ -14766,7 +14766,7 @@ ${indent}:`;
1476614766${indentComment(cs, ctx.indent)}`;
1476714767 }
1476814768 if (valueStr === "" && !ctx.inFlow) {
14769- if (ws === "\n")
14769+ if (ws === "\n" && valueComment )
1477014770 ws = "\n\n";
1477114771 } else {
1477214772 ws += `
@@ -15390,7 +15390,7 @@ function stringifyNumber({ format, minFractionDigits, tag, value }) {
1539015390 const num = typeof value === "number" ? value : Number(value);
1539115391 if (!isFinite(num))
1539215392 return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
15393- let n4 = JSON.stringify(value);
15393+ let n4 = Object.is(value, -0) ? "-0" : JSON.stringify(value);
1539415394 if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^\d/.test(n4)) {
1539515395 let i = n4.indexOf(".");
1539615396 if (i < 0) {
@@ -16553,7 +16553,7 @@ var prettifyError = (src, lc) => (error) => {
1655316553 if (/[^ ]/.test(lineStr)) {
1655416554 let count = 1;
1655516555 const end = error.linePos[1];
16556- if (end && end.line === line && end.col > col) {
16556+ if (( end == null ? void 0 : end.line) === line && end.col > col) {
1655716557 count = Math.max(1, Math.min(end.col - col, 80 - ci2));
1655816558 }
1655916559 const pointer = " ".repeat(ci2) + "^".repeat(count);
@@ -16868,7 +16868,7 @@ function resolveBlockSeq({ composeNode: composeNode2, composeEmptyNode: composeE
1686816868 });
1686916869 if (!props.found) {
1687016870 if (props.anchor || props.tag || value) {
16871- if (value && value.type === "block-seq")
16871+ if (( value == null ? void 0 : value.type) === "block-seq")
1687216872 onError(props.end, "BAD_INDENT", "All sequence items must start at the same column");
1687316873 else
1687416874 onError(offset, "MISSING_CHAR", "Sequence item without - indicator");
@@ -16930,7 +16930,7 @@ function resolveEnd(end, offset, reqSpace, onError) {
1693016930var blockMsg = "Block collections are not allowed within flow collections";
1693116931var isBlock = (token) => token && (token.type === "block-map" || token.type === "block-seq");
1693216932function resolveFlowCollection({ composeNode: composeNode2, composeEmptyNode: composeEmptyNode2 }, ctx, fc, onError, tag) {
16933- var _a2, _b2;
16933+ var _a2, _b2, _c ;
1693416934 const isMap2 = fc.start.source === "{";
1693516935 const fcName = isMap2 ? "flow map" : "flow sequence";
1693616936 const NodeClass = (_a2 = tag == null ? void 0 : tag.nodeClass) != null ? _a2 : isMap2 ? YAMLMap : YAMLSeq;
@@ -17046,7 +17046,7 @@ function resolveFlowCollection({ composeNode: composeNode2, composeEmptyNode: co
1704617046 onError(valueProps.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");
1704717047 }
1704817048 } else if (value) {
17049- if ("source" in value && value.source && value.source[0] === ":")
17049+ if ("source" in value && ((_c = value.source) == null ? void 0 : _c [0]) === ":")
1705017050 onError(value, "MISSING_CHAR", `Missing space after : in ${fcName}`);
1705117051 else
1705217052 onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
@@ -17083,7 +17083,7 @@ function resolveFlowCollection({ composeNode: composeNode2, composeEmptyNode: co
1708317083 const expectedEnd = isMap2 ? "}" : "]";
1708417084 const [ce, ...ee2] = fc.end;
1708517085 let cePos = offset;
17086- if (ce && ce.source === expectedEnd)
17086+ if (( ce == null ? void 0 : ce.source) === expectedEnd)
1708717087 cePos = ce.offset + ce.source.length;
1708817088 else {
1708917089 const name = fcName[0].toUpperCase() + fcName.substring(1);
@@ -17138,7 +17138,7 @@ function composeCollection(CN2, ctx, token, props, onError) {
1713817138 let tag = ctx.schema.tags.find((t3) => t3.tag === tagName && t3.collection === expType);
1713917139 if (!tag) {
1714017140 const kt2 = ctx.schema.knownTags[tagName];
17141- if (kt2 && kt2.collection === expType) {
17141+ if (( kt2 == null ? void 0 : kt2.collection) === expType) {
1714217142 ctx.schema.tags.push(Object.assign({}, kt2, { default: false }));
1714317143 tag = kt2;
1714417144 } else {
@@ -19130,7 +19130,7 @@ var Parser = class {
1913019130 }
1913119131 *step() {
1913219132 const top = this.peek(1);
19133- if (this.type === "doc-end" && (! top || top.type !== "doc-end") ) {
19133+ if (this.type === "doc-end" && (top == null ? void 0 : top.type) !== "doc-end") {
1913419134 while (this.stack.length > 0)
1913519135 yield* __yieldStar(this.pop());
1913619136 this.stack.push({
@@ -19610,7 +19610,7 @@ var Parser = class {
1961019610 do {
1961119611 yield* __yieldStar(this.pop());
1961219612 top = this.peek(1);
19613- } while (top && top.type === "flow-collection");
19613+ } while (( top == null ? void 0 : top.type) === "flow-collection");
1961419614 } else if (fc.end.length === 0) {
1961519615 switch (this.type) {
1961619616 case "comma":
0 commit comments