From ab7e8f142c71c5aed8dcdad575c0fcd9d949bab3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 13:31:36 +0000 Subject: [PATCH 1/2] 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 b99395fa..df74c1ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "jszip": "3.10.1", "semver": "^7.7.2", "uuid": "^11.1.0", - "yaml": "^2.7.1" + "yaml": "^2.8.0" }, "devDependencies": { "@babel/core": "^7.27.4", @@ -11094,14 +11094,14 @@ } }, "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==", "bin": { "yaml": "bin.mjs" }, "engines": { - "node": ">= 14" + "node": ">= 14.6" } }, "node_modules/yargs": { diff --git a/package.json b/package.json index 241d6f45..6698fec7 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "jszip": "3.10.1", "semver": "^7.7.2", "uuid": "^11.1.0", - "yaml": "^2.7.1" + "yaml": "^2.8.0" }, "devDependencies": { "@babel/core": "^7.27.4", From 8b078204e3eebe75269cb4540d47aa3d07df91a6 Mon Sep 17 00:00:00 2001 From: Koen Vlaswinkel Date: Tue, 24 Jun 2025 09:53:35 +0200 Subject: [PATCH 2/2] Run npm run build --- dist/query.js | 67 +++++++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/dist/query.js b/dist/query.js index c590bda0..66a7c892 100644 --- a/dist/query.js +++ b/dist/query.js @@ -67466,8 +67466,7 @@ var require_anchors = __commonJS({ 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; @@ -67643,23 +67642,35 @@ var require_Alias = __commonJS({ * 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 = void 0; - 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: anchors2, 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); @@ -67788,8 +67799,7 @@ var require_createNode = __commonJS({ 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 { ref = { anchor: null, node: null }; @@ -68346,7 +68356,7 @@ ${indent}${start}${value}${end}`; if (implicitKey && value.includes("\n") || 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)) { return implicitKey || inFlow || !value.includes("\n") ? quotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep); } if (!implicitKey && !inFlow && type !== Scalar.Scalar.PLAIN && value.includes("\n")) { @@ -68478,7 +68488,7 @@ var require_stringify = __commonJS({ 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; @@ -68492,7 +68502,7 @@ var require_stringify = __commonJS({ 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(" "); @@ -68515,8 +68525,7 @@ var require_stringify = __commonJS({ } let tagObj = void 0; 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; @@ -68668,7 +68677,7 @@ ${ctx.indent}`; var require_log = __commonJS({ "node_modules/yaml/dist/log.js"(exports2) { "use strict"; - var node_process = require("node:process"); + var node_process = require("process"); function debug5(logLevel, ...messages) { if (logLevel === "debug") console.log(...messages); @@ -69573,7 +69582,7 @@ var require_schema2 = __commonJS({ var require_binary = __commonJS({ "node_modules/yaml/dist/schema/yaml-1.1/binary.js"(exports2) { "use strict"; - var node_buffer = require("node:buffer"); + var node_buffer = require("buffer"); var Scalar = require_Scalar(); var stringifyString = require_stringifyString(); var binary = { @@ -69618,8 +69627,7 @@ var require_binary = __commonJS({ } 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); @@ -70823,8 +70831,7 @@ var require_resolve_props = __commonJS({ 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; @@ -70833,8 +70840,7 @@ var require_resolve_props = __commonJS({ 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; @@ -71915,8 +71921,7 @@ var require_util_empty_scalar_position = __commonJS({ "use strict"; 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) { @@ -72088,7 +72093,7 @@ var require_compose_doc = __commonJS({ var require_composer = __commonJS({ "node_modules/yaml/dist/compose/composer.js"(exports2) { "use strict"; - var node_process = require("node:process"); + var node_process = require("process"); var directives = require_directives(); var Document = require_Document(); var errors = require_errors4(); @@ -73314,7 +73319,7 @@ var require_line_counter = __commonJS({ var require_parser = __commonJS({ "node_modules/yaml/dist/parse/parser.js"(exports2) { "use strict"; - var node_process = require("node:process"); + var node_process = require("process"); var cst = require_cst(); var lexer = require_lexer(); function includesToken(list, type) {