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:
35
node_modules/yaml/browser/dist/nodes/Alias.js
generated
vendored
35
node_modules/yaml/browser/dist/nodes/Alias.js
generated
vendored
@@ -1,6 +1,6 @@
|
||||
import { anchorIsValid } from '../doc/anchors.js';
|
||||
import { visit } from '../visit.js';
|
||||
import { ALIAS, isAlias, isCollection, isPair } from './identity.js';
|
||||
import { ALIAS, isAlias, isCollection, isPair, hasAnchor } from './identity.js';
|
||||
import { NodeBase } from './Node.js';
|
||||
import { toJS } from './toJS.js';
|
||||
|
||||
@@ -18,23 +18,36 @@ class Alias extends 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(doc, {
|
||||
Node: (_key, node) => {
|
||||
if (isAlias(node) || hasAnchor(node))
|
||||
nodes.push(node);
|
||||
}
|
||||
});
|
||||
if (ctx)
|
||||
ctx.aliasResolveCache = nodes;
|
||||
}
|
||||
let found = undefined;
|
||||
visit(doc, {
|
||||
Node: (_key, node) => {
|
||||
if (node === this)
|
||||
return 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