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:
60
node_modules/yaml/browser/dist/nodes/Node.js
generated
vendored
60
node_modules/yaml/browser/dist/nodes/Node.js
generated
vendored
@@ -1,37 +1,7 @@
|
||||
const ALIAS = Symbol.for('yaml.alias');
|
||||
const DOC = Symbol.for('yaml.document');
|
||||
const MAP = Symbol.for('yaml.map');
|
||||
const PAIR = Symbol.for('yaml.pair');
|
||||
const SCALAR = Symbol.for('yaml.scalar');
|
||||
const SEQ = Symbol.for('yaml.seq');
|
||||
const NODE_TYPE = Symbol.for('yaml.node.type');
|
||||
const isAlias = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === ALIAS;
|
||||
const isDocument = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === DOC;
|
||||
const isMap = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === MAP;
|
||||
const isPair = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === PAIR;
|
||||
const isScalar = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SCALAR;
|
||||
const isSeq = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SEQ;
|
||||
function isCollection(node) {
|
||||
if (node && typeof node === 'object')
|
||||
switch (node[NODE_TYPE]) {
|
||||
case MAP:
|
||||
case SEQ:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isNode(node) {
|
||||
if (node && typeof node === 'object')
|
||||
switch (node[NODE_TYPE]) {
|
||||
case ALIAS:
|
||||
case MAP:
|
||||
case SCALAR:
|
||||
case SEQ:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
const hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor;
|
||||
import { applyReviver } from '../doc/applyReviver.js';
|
||||
import { NODE_TYPE, isDocument } from './identity.js';
|
||||
import { toJS } from './toJS.js';
|
||||
|
||||
class NodeBase {
|
||||
constructor(type) {
|
||||
Object.defineProperty(this, NODE_TYPE, { value: type });
|
||||
@@ -43,6 +13,26 @@ class NodeBase {
|
||||
copy.range = this.range.slice();
|
||||
return copy;
|
||||
}
|
||||
/** A plain JavaScript representation of this node. */
|
||||
toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
|
||||
if (!isDocument(doc))
|
||||
throw new TypeError('A document argument is required');
|
||||
const ctx = {
|
||||
anchors: new Map(),
|
||||
doc,
|
||||
keep: true,
|
||||
mapAsMap: mapAsMap === true,
|
||||
mapKeyWarned: false,
|
||||
maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100
|
||||
};
|
||||
const res = toJS(this, '', ctx);
|
||||
if (typeof onAnchor === 'function')
|
||||
for (const { count, res } of ctx.anchors.values())
|
||||
onAnchor(res, count);
|
||||
return typeof reviver === 'function'
|
||||
? applyReviver(reviver, { '': res }, '', res)
|
||||
: res;
|
||||
}
|
||||
}
|
||||
|
||||
export { ALIAS, DOC, MAP, NODE_TYPE, NodeBase, PAIR, SCALAR, SEQ, hasAnchor, isAlias, isCollection, isDocument, isMap, isNode, isPair, isScalar, isSeq };
|
||||
export { NodeBase };
|
||||
|
||||
Reference in New Issue
Block a user