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:
19
node_modules/yaml/dist/nodes/Collection.js
generated
vendored
19
node_modules/yaml/dist/nodes/Collection.js
generated
vendored
@@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
var createNode = require('../doc/createNode.js');
|
||||
var identity = require('./identity.js');
|
||||
var Node = require('./Node.js');
|
||||
|
||||
function collectionFromPath(schema, path, value) {
|
||||
@@ -49,7 +50,7 @@ class Collection extends Node.NodeBase {
|
||||
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
||||
if (schema)
|
||||
copy.schema = schema;
|
||||
copy.items = copy.items.map(it => Node.isNode(it) || Node.isPair(it) ? it.clone(schema) : it);
|
||||
copy.items = copy.items.map(it => identity.isNode(it) || identity.isPair(it) ? it.clone(schema) : it);
|
||||
if (this.range)
|
||||
copy.range = this.range.slice();
|
||||
return copy;
|
||||
@@ -65,7 +66,7 @@ class Collection extends Node.NodeBase {
|
||||
else {
|
||||
const [key, ...rest] = path;
|
||||
const node = this.get(key, true);
|
||||
if (Node.isCollection(node))
|
||||
if (identity.isCollection(node))
|
||||
node.addIn(rest, value);
|
||||
else if (node === undefined && this.schema)
|
||||
this.set(key, collectionFromPath(this.schema, rest, value));
|
||||
@@ -82,7 +83,7 @@ class Collection extends Node.NodeBase {
|
||||
if (rest.length === 0)
|
||||
return this.delete(key);
|
||||
const node = this.get(key, true);
|
||||
if (Node.isCollection(node))
|
||||
if (identity.isCollection(node))
|
||||
return node.deleteIn(rest);
|
||||
else
|
||||
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
|
||||
@@ -96,18 +97,18 @@ class Collection extends Node.NodeBase {
|
||||
const [key, ...rest] = path;
|
||||
const node = this.get(key, true);
|
||||
if (rest.length === 0)
|
||||
return !keepScalar && Node.isScalar(node) ? node.value : node;
|
||||
return !keepScalar && identity.isScalar(node) ? node.value : node;
|
||||
else
|
||||
return Node.isCollection(node) ? node.getIn(rest, keepScalar) : undefined;
|
||||
return identity.isCollection(node) ? node.getIn(rest, keepScalar) : undefined;
|
||||
}
|
||||
hasAllNullValues(allowScalar) {
|
||||
return this.items.every(node => {
|
||||
if (!Node.isPair(node))
|
||||
if (!identity.isPair(node))
|
||||
return false;
|
||||
const n = node.value;
|
||||
return (n == null ||
|
||||
(allowScalar &&
|
||||
Node.isScalar(n) &&
|
||||
identity.isScalar(n) &&
|
||||
n.value == null &&
|
||||
!n.commentBefore &&
|
||||
!n.comment &&
|
||||
@@ -122,7 +123,7 @@ class Collection extends Node.NodeBase {
|
||||
if (rest.length === 0)
|
||||
return this.has(key);
|
||||
const node = this.get(key, true);
|
||||
return Node.isCollection(node) ? node.hasIn(rest) : false;
|
||||
return identity.isCollection(node) ? node.hasIn(rest) : false;
|
||||
}
|
||||
/**
|
||||
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
||||
@@ -135,7 +136,7 @@ class Collection extends Node.NodeBase {
|
||||
}
|
||||
else {
|
||||
const node = this.get(key, true);
|
||||
if (Node.isCollection(node))
|
||||
if (identity.isCollection(node))
|
||||
node.setIn(rest, value);
|
||||
else if (node === undefined && this.schema)
|
||||
this.set(key, collectionFromPath(this.schema, rest, value));
|
||||
|
||||
Reference in New Issue
Block a user