From a790c2708583acc9bd0be1e863686acd56777423 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 May 2025 05:03:36 +0000 Subject: [PATCH 1/2] chore: Bump yaml from 2.7.1 to 2.8.0 Bumps [yaml](https://github.com/eemeli/yaml) from 2.7.1 to 2.8.0. - [Release notes](https://github.com/eemeli/yaml/releases) - [Commits](https://github.com/eemeli/yaml/compare/v2.7.1...v2.8.0) --- updated-dependencies: - dependency-name: yaml dependency-version: 2.8.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 10 +++++----- package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 06acc7bb..51e6f592 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@actions/core": "^1.10.1", "@aws-sdk/client-codedeploy": "^3.798.0", "@aws-sdk/client-ecs": "^3.741.0", - "yaml": "^2.7.1" + "yaml": "^2.8.0" }, "devDependencies": { "@eslint/js": "^9.27.0", @@ -10127,15 +10127,15 @@ "dev": true }, "node_modules/yaml": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.1.tgz", - "integrity": "sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", + "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", "license": "ISC", "bin": { "yaml": "bin.mjs" }, "engines": { - "node": ">= 14" + "node": ">= 14.6" } }, "node_modules/yargs": { diff --git a/package.json b/package.json index c84f149b..37126c01 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@actions/core": "^1.10.1", "@aws-sdk/client-codedeploy": "^3.798.0", "@aws-sdk/client-ecs": "^3.741.0", - "yaml": "^2.7.1" + "yaml": "^2.8.0" }, "devDependencies": { "@eslint/js": "^9.27.0", From c6c5a2fd1172841b448c631d951a2d52987e9df8 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 27 May 2025 05:04:09 +0000 Subject: [PATCH 2/2] chore: Update dist --- dist/index.js | 88 +++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 49 deletions(-) diff --git a/dist/index.js b/dist/index.js index b850f289..53f8f051 100644 --- a/dist/index.js +++ b/dist/index.js @@ -110627,14 +110627,6 @@ module.exports = require("net"); /***/ }), -/***/ 4573: -/***/ ((module) => { - -"use strict"; -module.exports = require("node:buffer"); - -/***/ }), - /***/ 77598: /***/ ((module) => { @@ -110651,14 +110643,6 @@ module.exports = require("node:events"); /***/ }), -/***/ 1708: -/***/ ((module) => { - -"use strict"; -module.exports = require("node:process"); - -/***/ }), - /***/ 57075: /***/ ((module) => { @@ -112786,7 +112770,7 @@ exports.composeScalar = composeScalar; "use strict"; -var node_process = __nccwpck_require__(1708); +var node_process = __nccwpck_require__(932); var directives = __nccwpck_require__(61342); var Document = __nccwpck_require__(3021); var errors = __nccwpck_require__(91464); @@ -113979,8 +113963,7 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn if (token.source.endsWith(':')) onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true); anchor = token; - if (start === null) - start = token.offset; + start ?? (start = token.offset); atNewline = false; hasSpace = false; reqSpace = true; @@ -113989,8 +113972,7 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn if (tag) onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag'); tag = token; - if (start === null) - start = token.offset; + start ?? (start = token.offset); atNewline = false; hasSpace = false; reqSpace = true; @@ -114109,8 +114091,7 @@ exports.containsNewline = containsNewline; function emptyScalarPosition(offset, before, pos) { if (before) { - if (pos === null) - pos = before.length; + pos ?? (pos = before.length); for (let i = pos - 1; i >= 0; --i) { let st = before[i]; switch (st.type) { @@ -114578,8 +114559,7 @@ function createNodeAnchors(doc, prefix) { return { onAnchor: (source) => { aliasObjects.push(source); - if (!prevAnchors) - prevAnchors = anchorNames(doc); + prevAnchors ?? (prevAnchors = anchorNames(doc)); const anchor = findNewAnchor(prefix, prevAnchors); prevAnchors.add(anchor); return anchor; @@ -114727,8 +114707,7 @@ function createNode(value, tagName, ctx) { if (aliasDuplicateObjects && value && typeof value === 'object') { ref = sourceObjects.get(value); if (ref) { - if (!ref.anchor) - ref.anchor = onAnchor(value); + ref.anchor ?? (ref.anchor = onAnchor(value)); return new Alias.Alias(ref.anchor); } else { @@ -115100,7 +115079,7 @@ exports.visitAsync = visit.visitAsync; "use strict"; -var node_process = __nccwpck_require__(1708); +var node_process = __nccwpck_require__(932); function debug(logLevel, ...messages) { if (logLevel === 'debug') @@ -115147,23 +115126,36 @@ class Alias extends Node.NodeBase { * Resolve the value of this alias within `doc`, finding the last * instance of the `source` anchor before this node. */ - resolve(doc) { + resolve(doc, ctx) { + let nodes; + if (ctx?.aliasResolveCache) { + nodes = ctx.aliasResolveCache; + } + else { + nodes = []; + visit.visit(doc, { + Node: (_key, node) => { + if (identity.isAlias(node) || identity.hasAnchor(node)) + nodes.push(node); + } + }); + if (ctx) + ctx.aliasResolveCache = nodes; + } let found = undefined; - visit.visit(doc, { - Node: (_key, node) => { - if (node === this) - return visit.visit.BREAK; - if (node.anchor === this.source) - found = node; - } - }); + for (const node of nodes) { + if (node === this) + break; + if (node.anchor === this.source) + found = node; + } return found; } toJSON(_arg, ctx) { if (!ctx) return { source: this.source }; const { anchors, doc, maxAliasCount } = ctx; - const source = this.resolve(doc); + const source = this.resolve(doc, ctx); if (!source) { const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`; throw new ReferenceError(msg); @@ -115844,6 +115836,7 @@ function addPairToJSMap(ctx, map, { key, value }) { function stringifyKey(key, jsKey, ctx) { if (jsKey === null) return ''; + // eslint-disable-next-line @typescript-eslint/no-base-to-string if (typeof jsKey !== 'object') return String(jsKey); if (identity.isNode(key) && ctx?.doc) { @@ -117285,7 +117278,7 @@ exports.LineCounter = LineCounter; "use strict"; -var node_process = __nccwpck_require__(1708); +var node_process = __nccwpck_require__(932); var cst = __nccwpck_require__(3461); var lexer = __nccwpck_require__(40361); @@ -118876,7 +118869,7 @@ exports.getTags = getTags; "use strict"; -var node_buffer = __nccwpck_require__(4573); +var node_buffer = __nccwpck_require__(20181); var Scalar = __nccwpck_require__(63301); var stringifyString = __nccwpck_require__(83069); @@ -118929,8 +118922,7 @@ const binary = { else { throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required'); } - if (!type) - type = Scalar.Scalar.BLOCK_LITERAL; + type ?? (type = Scalar.Scalar.BLOCK_LITERAL); if (type !== Scalar.Scalar.QUOTE_DOUBLE) { const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth); const n = Math.ceil(str.length / lineWidth); @@ -119880,7 +119872,7 @@ function getTagObject(tags, item) { tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass); } if (!tagObj) { - const name = obj?.constructor?.name ?? typeof obj; + const name = obj?.constructor?.name ?? (obj === null ? 'null' : typeof obj); throw new Error(`Tag not resolved for ${name} value`); } return tagObj; @@ -119895,7 +119887,7 @@ function stringifyProps(node, tagObj, { anchors: anchors$1, doc }) { anchors$1.add(anchor); props.push(`&${anchor}`); } - const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag; + const tag = node.tag ?? (tagObj.default ? null : tagObj.tag); if (tag) props.push(doc.directives.tagString(tag)); return props.join(' '); @@ -119921,8 +119913,7 @@ function stringify(item, ctx, onComment, onChompKeep) { const node = identity.isNode(item) ? item : ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) }); - if (!tagObj) - tagObj = getTagObject(ctx.doc.schema.tags, node); + tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node)); const props = stringifyProps(node, tagObj, ctx); if (props.length > 0) ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1; @@ -120679,10 +120670,9 @@ function plainString(item, ctx, onComment, onChompKeep) { (inFlow && /[[\]{},]/.test(value))) { return quotedString(value, ctx); } - if (!value || - /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) { + if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) { // not allowed: - // - empty string, '-' or '?' + // - '-' or '?' // - start with an indicator character (except [?:-]) or /[?-] / // - '\n ', ': ' or ' \n' anywhere // - '#' not preceded by a non-space char