aboutsummaryrefslogtreecommitdiff
path: root/node_modules/yaml/browser/dist/nodes/Node.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/yaml/browser/dist/nodes/Node.js')
-rw-r--r--node_modules/yaml/browser/dist/nodes/Node.js48
1 files changed, 0 insertions, 48 deletions
diff --git a/node_modules/yaml/browser/dist/nodes/Node.js b/node_modules/yaml/browser/dist/nodes/Node.js
deleted file mode 100644
index 718f363..0000000
--- a/node_modules/yaml/browser/dist/nodes/Node.js
+++ /dev/null
@@ -1,48 +0,0 @@
-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;
-class NodeBase {
- constructor(type) {
- Object.defineProperty(this, NODE_TYPE, { value: type });
- }
- /** Create a copy of this node. */
- clone() {
- const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
- if (this.range)
- copy.range = this.range.slice();
- return copy;
- }
-}
-
-export { ALIAS, DOC, MAP, NODE_TYPE, NodeBase, PAIR, SCALAR, SEQ, hasAnchor, isAlias, isCollection, isDocument, isMap, isNode, isPair, isScalar, isSeq };