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:
17
node_modules/yaml/dist/nodes/Alias.js
generated
vendored
17
node_modules/yaml/dist/nodes/Alias.js
generated
vendored
@@ -2,11 +2,13 @@
|
||||
|
||||
var anchors = require('../doc/anchors.js');
|
||||
var visit = require('../visit.js');
|
||||
var identity = require('./identity.js');
|
||||
var Node = require('./Node.js');
|
||||
var toJS = require('./toJS.js');
|
||||
|
||||
class Alias extends Node.NodeBase {
|
||||
constructor(source) {
|
||||
super(Node.ALIAS);
|
||||
super(identity.ALIAS);
|
||||
this.source = source;
|
||||
Object.defineProperty(this, 'tag', {
|
||||
set() {
|
||||
@@ -39,7 +41,12 @@ class Alias extends Node.NodeBase {
|
||||
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
||||
throw new ReferenceError(msg);
|
||||
}
|
||||
const data = anchors.get(source);
|
||||
let data = anchors.get(source);
|
||||
if (!data) {
|
||||
// Resolve anchors for Node.prototype.toJS()
|
||||
toJS.toJS(source, null, ctx);
|
||||
data = anchors.get(source);
|
||||
}
|
||||
/* istanbul ignore if */
|
||||
if (!data || data.res === undefined) {
|
||||
const msg = 'This should not happen: Alias anchor was not resolved?';
|
||||
@@ -71,12 +78,12 @@ class Alias extends Node.NodeBase {
|
||||
}
|
||||
}
|
||||
function getAliasCount(doc, node, anchors) {
|
||||
if (Node.isAlias(node)) {
|
||||
if (identity.isAlias(node)) {
|
||||
const source = node.resolve(doc);
|
||||
const anchor = anchors && source && anchors.get(source);
|
||||
return anchor ? anchor.count * anchor.aliasCount : 0;
|
||||
}
|
||||
else if (Node.isCollection(node)) {
|
||||
else if (identity.isCollection(node)) {
|
||||
let count = 0;
|
||||
for (const item of node.items) {
|
||||
const c = getAliasCount(doc, item, anchors);
|
||||
@@ -85,7 +92,7 @@ function getAliasCount(doc, node, anchors) {
|
||||
}
|
||||
return count;
|
||||
}
|
||||
else if (Node.isPair(node)) {
|
||||
else if (identity.isPair(node)) {
|
||||
const kc = getAliasCount(doc, node.key, anchors);
|
||||
const vc = getAliasCount(doc, node.value, anchors);
|
||||
return Math.max(kc, vc);
|
||||
|
||||
Reference in New Issue
Block a user