Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59557,7 +59557,7 @@ function composeCollection(CN, ctx, token, props, onError) {
let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType);
if (!tag) {
const kt = ctx.schema.knownTags[tagName];
if (kt && kt.collection === expType) {
if (kt?.collection === expType) {
ctx.schema.tags.push(Object.assign({}, kt, { default: false }));
tag = kt;
}
Expand Down Expand Up @@ -60443,7 +60443,7 @@ function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, ta
});
if (!props.found) {
if (props.anchor || props.tag || value) {
if (value && value.type === 'block-seq')
if (value?.type === 'block-seq')
onError(props.end, 'BAD_INDENT', 'All sequence items must start at the same column');
else
onError(offset, 'MISSING_CHAR', 'Sequence item without - indicator');
Expand Down Expand Up @@ -60660,7 +60660,7 @@ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onErr
}
}
else if (value) {
if ('source' in value && value.source && value.source[0] === ':')
if ('source' in value && value.source?.[0] === ':')
onError(value, 'MISSING_CHAR', `Missing space after : in ${fcName}`);
else
onError(valueProps.start, 'MISSING_CHAR', `Missing , or : between ${fcName} items`);
Expand Down Expand Up @@ -60704,7 +60704,7 @@ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onErr
const expectedEnd = isMap ? '}' : ']';
const [ce, ...ee] = fc.end;
let cePos = offset;
if (ce && ce.source === expectedEnd)
if (ce?.source === expectedEnd)
cePos = ce.offset + ce.source.length;
else {
const name = fcName[0].toUpperCase() + fcName.substring(1);
Expand Down Expand Up @@ -62085,7 +62085,7 @@ const prettifyError = (src, lc) => (error) => {
if (/[^ ]/.test(lineStr)) {
let count = 1;
const end = error.linePos[1];
if (end && end.line === line && end.col > col) {
if (end?.line === line && end.col > col) {
count = Math.max(1, Math.min(end.col - col, 80 - ci));
}
const pointer = ' '.repeat(ci) + '^'.repeat(count);
Expand Down Expand Up @@ -62253,7 +62253,7 @@ class Alias extends Node.NodeBase {
data = anchors.get(source);
}
/* istanbul ignore if */
if (!data || data.res === undefined) {
if (data?.res === undefined) {
const msg = 'This should not happen: Alias anchor was not resolved?';
throw new ReferenceError(msg);
}
Expand Down Expand Up @@ -64595,7 +64595,7 @@ class Parser {
}
*step() {
const top = this.peek(1);
if (this.type === 'doc-end' && (!top || top.type !== 'doc-end')) {
if (this.type === 'doc-end' && top?.type !== 'doc-end') {
while (this.stack.length > 0)
yield* this.pop();
this.stack.push({
Expand Down Expand Up @@ -65127,7 +65127,7 @@ class Parser {
do {
yield* this.pop();
top = this.peek(1);
} while (top && top.type === 'flow-collection');
} while (top?.type === 'flow-collection');
}
else if (fc.end.length === 0) {
switch (this.type) {
Expand Down Expand Up @@ -67313,7 +67313,7 @@ function stringifyNumber({ format, minFractionDigits, tag, value }) {
const num = typeof value === 'number' ? value : Number(value);
if (!isFinite(num))
return isNaN(num) ? '.nan' : num < 0 ? '-.inf' : '.inf';
let n = JSON.stringify(value);
let n = Object.is(value, -0) ? '-0' : JSON.stringify(value);
if (!format &&
minFractionDigits &&
(!tag || tag === 'tag:yaml.org,2002:float') &&
Expand Down Expand Up @@ -67444,7 +67444,7 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
ws += `\n${stringifyComment.indentComment(cs, ctx.indent)}`;
}
if (valueStr === '' && !ctx.inFlow) {
if (ws === '\n')
if (ws === '\n' && valueComment)
ws = '\n\n';
}
else {
Expand Down
15 changes: 11 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@actions/core": "^1.10.1",
"@aws-sdk/client-codedeploy": "^3.922.0",
"@aws-sdk/client-ecs": "^3.908.0",
"yaml": "^2.8.1"
"yaml": "^2.8.2"
},
"devDependencies": {
"@eslint/js": "^9.38.0",
Expand Down