diff --git a/dist/index.js b/dist/index.js index 70335d76..2f059b6a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -111230,8 +111230,8 @@ function composeCollection(CN, ctx, token, props, onError) { tag = kt; } else { - if (kt?.collection) { - onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true); + if (kt) { + onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true); } else { onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true); @@ -116696,7 +116696,20 @@ class Parser { default: { const bv = this.startBlockValue(map); if (bv) { - if (atMapIndent && bv.type !== 'block-seq') { + if (bv.type === 'block-seq') { + if (!it.explicitKey && + it.sep && + !includesToken(it.sep, 'newline')) { + yield* this.pop({ + type: 'error', + offset: this.offset, + message: 'Unexpected block-seq-ind on same line with key', + source: this.source + }); + return; + } + } + else if (atMapIndent) { map.items.push({ start }); } this.stack.push(bv); @@ -117635,6 +117648,8 @@ const binary = { } }, stringify({ comment, type, value }, ctx, onComment, onChompKeep) { + if (!value) + return ''; const buf = value; // checked earlier by binary.identify() let str; if (typeof node_buffer.Buffer === 'function') { @@ -118358,7 +118373,7 @@ const timestamp = { } return new Date(date); }, - stringify: ({ value }) => value.toISOString().replace(/(T00:00:00)?\.000Z$/, '') + stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, '') ?? '' }; exports.floatTime = floatTime; diff --git a/package-lock.json b/package-lock.json index 6d1f7a1e..af925a4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@actions/core": "^1.10.1", "@aws-sdk/client-codedeploy": "^3.758.0", "@aws-sdk/client-ecs": "^3.741.0", - "yaml": "^2.7.0" + "yaml": "^2.7.1" }, "devDependencies": { "@eslint/js": "^9.23.0", @@ -9816,9 +9816,10 @@ "dev": true }, "node_modules/yaml": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", - "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.1.tgz", + "integrity": "sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==", + "license": "ISC", "bin": { "yaml": "bin.mjs" }, diff --git a/package.json b/package.json index 8d36e237..275e9443 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@actions/core": "^1.10.1", "@aws-sdk/client-codedeploy": "^3.758.0", "@aws-sdk/client-ecs": "^3.741.0", - "yaml": "^2.7.0" + "yaml": "^2.7.1" }, "devDependencies": { "@eslint/js": "^9.23.0",