mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2025-12-09 22:30:41 -07:00
node_modules: upgrade
This commit is contained in:
33
node_modules/yaml/dist/nodes/Alias.js
generated
vendored
33
node_modules/yaml/dist/nodes/Alias.js
generated
vendored
@@ -20,23 +20,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);
|
||||
|
||||
Reference in New Issue
Block a user