@swagger-api/apidom-ast 0.92.0 → 0.93.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/cjs/Error.cjs +10 -13
- package/cjs/Literal.cjs +9 -11
- package/cjs/Node.cjs +23 -32
- package/cjs/ParseResult.cjs +5 -12
- package/cjs/Position.cjs +20 -32
- package/cjs/json/nodes/JsonArray.cjs +5 -11
- package/cjs/json/nodes/JsonDocument.cjs +5 -12
- package/cjs/json/nodes/JsonEscapeSequence.cjs +3 -6
- package/cjs/json/nodes/JsonFalse.cjs +3 -6
- package/cjs/json/nodes/JsonKey.cjs +3 -6
- package/cjs/json/nodes/JsonNode.cjs +1 -2
- package/cjs/json/nodes/JsonNull.cjs +3 -6
- package/cjs/json/nodes/JsonNumber.cjs +3 -6
- package/cjs/json/nodes/JsonObject.cjs +5 -11
- package/cjs/json/nodes/JsonProperty.cjs +8 -17
- package/cjs/json/nodes/JsonString.cjs +8 -16
- package/cjs/json/nodes/JsonStringContent.cjs +3 -6
- package/cjs/json/nodes/JsonTrue.cjs +3 -6
- package/cjs/json/nodes/JsonValue.cjs +10 -12
- package/cjs/json/nodes/predicates.cjs +24 -12
- package/cjs/predicates.cjs +9 -5
- package/cjs/yaml/nodes/YamlAlias.cjs +10 -12
- package/cjs/yaml/nodes/YamlAnchor.cjs +10 -12
- package/cjs/yaml/nodes/YamlCollection.cjs +1 -2
- package/cjs/yaml/nodes/YamlComment.cjs +10 -12
- package/cjs/yaml/nodes/YamlDirective.cjs +14 -17
- package/cjs/yaml/nodes/YamlDocument.cjs +3 -6
- package/cjs/yaml/nodes/YamlKeyValuePair.cjs +28 -27
- package/cjs/yaml/nodes/YamlMapping.cjs +7 -13
- package/cjs/yaml/nodes/YamlNode.cjs +12 -15
- package/cjs/yaml/nodes/YamlScalar.cjs +10 -12
- package/cjs/yaml/nodes/YamlSequence.cjs +10 -16
- package/cjs/yaml/nodes/YamlStream.cjs +7 -15
- package/cjs/yaml/nodes/YamlStyle.cjs +2 -11
- package/cjs/yaml/nodes/YamlTag.cjs +10 -13
- package/cjs/yaml/nodes/predicates.cjs +20 -10
- package/cjs/yaml/schemas/ScalarTag.cjs +23 -32
- package/cjs/yaml/schemas/Tag.cjs +16 -7
- package/cjs/yaml/schemas/failsafe/GenericMapping.cjs +7 -19
- package/cjs/yaml/schemas/failsafe/GenericSequence.cjs +7 -19
- package/cjs/yaml/schemas/failsafe/GenericString.cjs +3 -16
- package/cjs/yaml/schemas/failsafe/index.cjs +81 -87
- package/cjs/yaml/schemas/json/Boolean.cjs +13 -21
- package/cjs/yaml/schemas/json/FloatingPoint.cjs +13 -21
- package/cjs/yaml/schemas/json/Integer.cjs +13 -21
- package/cjs/yaml/schemas/json/Null.cjs +12 -20
- package/cjs/yaml/schemas/json/index.cjs +20 -26
- package/dist/apidom-ast.browser.js +577 -893
- package/dist/apidom-ast.browser.min.js +1 -1
- package/es/Error.mjs +10 -13
- package/es/Literal.mjs +9 -11
- package/es/Node.mjs +23 -31
- package/es/ParseResult.mjs +5 -12
- package/es/Position.mjs +19 -31
- package/es/json/nodes/JsonArray.mjs +5 -11
- package/es/json/nodes/JsonDocument.mjs +5 -12
- package/es/json/nodes/JsonEscapeSequence.mjs +3 -6
- package/es/json/nodes/JsonFalse.mjs +3 -6
- package/es/json/nodes/JsonKey.mjs +3 -6
- package/es/json/nodes/JsonNode.mjs +1 -2
- package/es/json/nodes/JsonNull.mjs +3 -6
- package/es/json/nodes/JsonNumber.mjs +3 -6
- package/es/json/nodes/JsonObject.mjs +5 -11
- package/es/json/nodes/JsonProperty.mjs +8 -17
- package/es/json/nodes/JsonString.mjs +8 -16
- package/es/json/nodes/JsonStringContent.mjs +3 -6
- package/es/json/nodes/JsonTrue.mjs +3 -6
- package/es/json/nodes/JsonValue.mjs +10 -12
- package/es/json/nodes/predicates.mjs +12 -12
- package/es/predicates.mjs +5 -5
- package/es/yaml/nodes/YamlAlias.mjs +10 -12
- package/es/yaml/nodes/YamlAnchor.mjs +10 -12
- package/es/yaml/nodes/YamlCollection.mjs +1 -2
- package/es/yaml/nodes/YamlComment.mjs +10 -12
- package/es/yaml/nodes/YamlDirective.mjs +14 -17
- package/es/yaml/nodes/YamlDocument.mjs +3 -6
- package/es/yaml/nodes/YamlKeyValuePair.mjs +28 -27
- package/es/yaml/nodes/YamlMapping.mjs +7 -13
- package/es/yaml/nodes/YamlNode.mjs +12 -15
- package/es/yaml/nodes/YamlScalar.mjs +10 -12
- package/es/yaml/nodes/YamlSequence.mjs +10 -16
- package/es/yaml/nodes/YamlStream.mjs +7 -15
- package/es/yaml/nodes/YamlStyle.mjs +1 -9
- package/es/yaml/nodes/YamlTag.mjs +10 -13
- package/es/yaml/nodes/predicates.mjs +10 -10
- package/es/yaml/schemas/ScalarTag.mjs +23 -31
- package/es/yaml/schemas/Tag.mjs +17 -6
- package/es/yaml/schemas/failsafe/GenericMapping.mjs +8 -19
- package/es/yaml/schemas/failsafe/GenericSequence.mjs +8 -19
- package/es/yaml/schemas/failsafe/GenericString.mjs +3 -16
- package/es/yaml/schemas/failsafe/index.mjs +84 -90
- package/es/yaml/schemas/json/Boolean.mjs +14 -21
- package/es/yaml/schemas/json/FloatingPoint.mjs +14 -21
- package/es/yaml/schemas/json/Integer.mjs +14 -21
- package/es/yaml/schemas/json/Null.mjs +13 -20
- package/es/yaml/schemas/json/index.mjs +24 -30
- package/package.json +3 -4
- package/types/dist.d.ts +222 -157
@@ -1,15 +1,9 @@
|
|
1
|
-
import stampit from 'stampit';
|
2
1
|
import JsonNode from "./JsonNode.mjs";
|
3
2
|
import { isProperty } from "./predicates.mjs";
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
methods: {
|
9
|
-
get properties() {
|
10
|
-
// @ts-ignore
|
11
|
-
return this.children.filter(isProperty);
|
12
|
-
}
|
3
|
+
class JsonObject extends JsonNode {
|
4
|
+
static type = 'object';
|
5
|
+
get properties() {
|
6
|
+
return this.children.filter(isProperty);
|
13
7
|
}
|
14
|
-
}
|
8
|
+
}
|
15
9
|
export default JsonObject;
|
@@ -1,21 +1,12 @@
|
|
1
|
-
import stampit from 'stampit';
|
2
1
|
import JsonNode from "./JsonNode.mjs";
|
3
2
|
import { isArray, isFalse, isKey, isNull, isNumber, isObject, isString, isTrue } from "./predicates.mjs";
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
methods: {
|
9
|
-
// @ts-ignore
|
10
|
-
get key() {
|
11
|
-
// @ts-ignore
|
12
|
-
return this.children.find(isKey);
|
13
|
-
},
|
14
|
-
// @ts-ignore
|
15
|
-
get value() {
|
16
|
-
// @ts-ignore
|
17
|
-
return this.children.find(node => isFalse(node) || isTrue(node) || isNull(node) || isNumber(node) || isString(node) || isArray(node) || isObject(node));
|
18
|
-
}
|
3
|
+
class JsonProperty extends JsonNode {
|
4
|
+
static type = 'property';
|
5
|
+
get key() {
|
6
|
+
return this.children.find(isKey);
|
19
7
|
}
|
20
|
-
|
8
|
+
get value() {
|
9
|
+
return this.children.find(node => isFalse(node) || isTrue(node) || isNull(node) || isNumber(node) || isString(node) || isArray(node) || isObject(node));
|
10
|
+
}
|
11
|
+
}
|
21
12
|
export default JsonProperty;
|
@@ -1,21 +1,13 @@
|
|
1
|
-
import stampit from 'stampit';
|
2
1
|
import JsonNode from "./JsonNode.mjs";
|
3
2
|
import { isEscapeSequence, isStringContent } from "./predicates.mjs";
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
// @ts-ignore
|
11
|
-
if (this.children.length === 1) {
|
12
|
-
// @ts-ignore
|
13
|
-
return this.children[0].value;
|
14
|
-
}
|
15
|
-
return this.children
|
16
|
-
// @ts-ignore
|
17
|
-
.filter(node => isStringContent(node) || isEscapeSequence(node)).reduce((acc, cur) => acc + cur.value, '');
|
3
|
+
class JsonString extends JsonNode {
|
4
|
+
static type = 'string';
|
5
|
+
get value() {
|
6
|
+
if (this.children.length === 1) {
|
7
|
+
const onlyChild = this.children[0];
|
8
|
+
return onlyChild.value;
|
18
9
|
}
|
10
|
+
return this.children.filter(node => isStringContent(node) || isEscapeSequence(node)).reduce((acc, cur) => acc + cur.value, '');
|
19
11
|
}
|
20
|
-
}
|
12
|
+
}
|
21
13
|
export default JsonString;
|
@@ -1,8 +1,5 @@
|
|
1
|
-
import stampit from 'stampit';
|
2
1
|
import JsonValue from "./JsonValue.mjs";
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
}
|
7
|
-
});
|
2
|
+
class JsonStringContent extends JsonValue {
|
3
|
+
static type = 'stringContent';
|
4
|
+
}
|
8
5
|
export default JsonStringContent;
|
@@ -1,16 +1,14 @@
|
|
1
|
-
import stampit from 'stampit';
|
2
1
|
import JsonNode from "./JsonNode.mjs";
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
} = {}) {
|
2
|
+
class JsonValue extends JsonNode {
|
3
|
+
static type = 'value';
|
4
|
+
constructor({
|
5
|
+
value,
|
6
|
+
...rest
|
7
|
+
}) {
|
8
|
+
super({
|
9
|
+
...rest
|
10
|
+
});
|
13
11
|
this.value = value;
|
14
12
|
}
|
15
|
-
}
|
13
|
+
}
|
16
14
|
export default JsonValue;
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { isNodeType } from "../../predicates.mjs";
|
2
|
-
export const isDocument = isNodeType
|
3
|
-
export const isString = isNodeType
|
4
|
-
export const isFalse = isNodeType
|
5
|
-
export const isTrue = isNodeType
|
6
|
-
export const isNull = isNodeType
|
7
|
-
export const isNumber = isNodeType
|
8
|
-
export const isArray = isNodeType
|
9
|
-
export const isObject = isNodeType
|
10
|
-
export const isStringContent = isNodeType
|
11
|
-
export const isEscapeSequence = isNodeType
|
12
|
-
export const isProperty = isNodeType
|
13
|
-
export const isKey = isNodeType
|
2
|
+
export const isDocument = node => isNodeType('document', node);
|
3
|
+
export const isString = node => isNodeType('string', node);
|
4
|
+
export const isFalse = node => isNodeType('false', node);
|
5
|
+
export const isTrue = node => isNodeType('true', node);
|
6
|
+
export const isNull = node => isNodeType('null', node);
|
7
|
+
export const isNumber = node => isNodeType('number', node);
|
8
|
+
export const isArray = node => isNodeType('array', node);
|
9
|
+
export const isObject = node => isNodeType('object', node);
|
10
|
+
export const isStringContent = node => isNodeType('stringContent', node);
|
11
|
+
export const isEscapeSequence = node => isNodeType('escapeSequence', node);
|
12
|
+
export const isProperty = node => isNodeType('property', node);
|
13
|
+
export const isKey = node => isNodeType('key', node);
|
package/es/predicates.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
export const isNodeType = (type, node) =>
|
2
|
-
export const isLiteral = isNodeType
|
3
|
-
export const isPosition = isNodeType
|
4
|
-
export const isPoint = isNodeType
|
5
|
-
export const isParseResult = isNodeType
|
1
|
+
export const isNodeType = (type, node) => node != null && typeof node === 'object' && 'type' in node && node.type === type;
|
2
|
+
export const isLiteral = node => isNodeType('literal', node);
|
3
|
+
export const isPosition = node => isNodeType('position', node);
|
4
|
+
export const isPoint = node => isNodeType('point', node);
|
5
|
+
export const isParseResult = node => isNodeType('parseResult', node);
|
@@ -1,16 +1,14 @@
|
|
1
|
-
import stampit from 'stampit';
|
2
1
|
import Node from "../../Node.mjs";
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
} = {}) {
|
2
|
+
class YamlAlias extends Node {
|
3
|
+
static type = 'alias';
|
4
|
+
constructor({
|
5
|
+
content,
|
6
|
+
...rest
|
7
|
+
}) {
|
8
|
+
super({
|
9
|
+
...rest
|
10
|
+
});
|
13
11
|
this.content = content;
|
14
12
|
}
|
15
|
-
}
|
13
|
+
}
|
16
14
|
export default YamlAlias;
|
@@ -1,16 +1,14 @@
|
|
1
|
-
import stampit from 'stampit';
|
2
1
|
import Node from "../../Node.mjs";
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
} = {}) {
|
2
|
+
class YamlAnchor extends Node {
|
3
|
+
static type = 'anchor';
|
4
|
+
constructor({
|
5
|
+
name,
|
6
|
+
...rest
|
7
|
+
}) {
|
8
|
+
super({
|
9
|
+
...rest
|
10
|
+
});
|
13
11
|
this.name = name;
|
14
12
|
}
|
15
|
-
}
|
13
|
+
}
|
16
14
|
export default YamlAnchor;
|
@@ -1,16 +1,14 @@
|
|
1
|
-
import stampit from 'stampit';
|
2
1
|
import Node from "../../Node.mjs";
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
} = {}) {
|
2
|
+
class YamlComment extends Node {
|
3
|
+
static type = 'comment';
|
4
|
+
constructor({
|
5
|
+
content,
|
6
|
+
...rest
|
7
|
+
}) {
|
8
|
+
super({
|
9
|
+
...rest
|
10
|
+
});
|
13
11
|
this.content = content;
|
14
12
|
}
|
15
|
-
}
|
13
|
+
}
|
16
14
|
export default YamlComment;
|
@@ -1,24 +1,21 @@
|
|
1
|
-
import stampit from 'stampit';
|
2
1
|
import { mergeRight } from 'ramda';
|
3
2
|
import Node from "../../Node.mjs";
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
parameters = {}
|
15
|
-
} = {}) {
|
3
|
+
class YamlDirective extends Node {
|
4
|
+
static type = 'directive';
|
5
|
+
constructor({
|
6
|
+
name,
|
7
|
+
parameters,
|
8
|
+
...rest
|
9
|
+
}) {
|
10
|
+
super({
|
11
|
+
...rest
|
12
|
+
});
|
16
13
|
this.name = name;
|
17
14
|
this.parameters = mergeRight({
|
18
|
-
version:
|
19
|
-
handle:
|
20
|
-
prefix:
|
15
|
+
version: undefined,
|
16
|
+
handle: undefined,
|
17
|
+
prefix: undefined
|
21
18
|
}, parameters);
|
22
19
|
}
|
23
|
-
}
|
20
|
+
}
|
24
21
|
export default YamlDirective;
|
@@ -1,34 +1,35 @@
|
|
1
|
-
import stampit from 'stampit';
|
2
1
|
import Node from "../../Node.mjs";
|
3
|
-
import YamlStyleModel from "./YamlStyle.mjs";
|
4
2
|
import { isScalar, isMapping, isSequence, isAlias } from "./predicates.mjs";
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
class YamlKeyValuePair extends Node {
|
4
|
+
static type = 'keyValuePair';
|
5
|
+
constructor({
|
6
|
+
styleGroup,
|
7
|
+
...rest
|
8
|
+
}) {
|
9
|
+
super({
|
10
|
+
...rest
|
11
|
+
});
|
12
|
+
this.styleGroup = styleGroup;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
Object.defineProperties(YamlKeyValuePair.prototype, {
|
16
|
+
key: {
|
17
|
+
get() {
|
18
|
+
return this.children.filter(node => isScalar(node) || isMapping(node) || isSequence(node))[0];
|
19
|
+
},
|
20
|
+
enumerable: true
|
8
21
|
},
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
}
|
15
|
-
|
22
|
+
value: {
|
23
|
+
get() {
|
24
|
+
const {
|
25
|
+
key,
|
26
|
+
children
|
27
|
+
} = this;
|
28
|
+
const excludeKeyPredicate = node => node !== key;
|
29
|
+
const valuePredicate = node => isScalar(node) || isMapping(node) || isSequence(node) || isAlias(node);
|
30
|
+
return children.filter(node => excludeKeyPredicate(node) && valuePredicate(node))[0];
|
16
31
|
},
|
17
|
-
|
18
|
-
get() {
|
19
|
-
// @ts-ignore
|
20
|
-
const {
|
21
|
-
key,
|
22
|
-
children
|
23
|
-
} = this;
|
24
|
-
const excludeKeyPredicate = node => node !== key;
|
25
|
-
const valuePredicate = node => isScalar(node) || isMapping(node) || isSequence(node) || isAlias(node);
|
26
|
-
|
27
|
-
// @ts-ignore
|
28
|
-
return children.filter(node => excludeKeyPredicate(node) && valuePredicate(node))[0];
|
29
|
-
},
|
30
|
-
enumerable: true
|
31
|
-
}
|
32
|
+
enumerable: true
|
32
33
|
}
|
33
34
|
});
|
34
35
|
export default YamlKeyValuePair;
|
@@ -1,18 +1,12 @@
|
|
1
|
-
import stampit from 'stampit';
|
2
1
|
import YamlCollection from "./YamlCollection.mjs";
|
3
2
|
import { isKeyValuePair } from "./predicates.mjs";
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
class YamlMapping extends YamlCollection {
|
4
|
+
static type = 'mapping';
|
5
|
+
}
|
6
|
+
Object.defineProperty(YamlMapping.prototype, 'content', {
|
7
|
+
get() {
|
8
|
+
return Array.isArray(this.children) ? this.children.filter(isKeyValuePair) : [];
|
7
9
|
},
|
8
|
-
|
9
|
-
content: {
|
10
|
-
get() {
|
11
|
-
// @ts-ignore
|
12
|
-
return Array.isArray(this.children) ? this.children.filter(isKeyValuePair) : [];
|
13
|
-
},
|
14
|
-
enumerable: true
|
15
|
-
}
|
16
|
-
}
|
10
|
+
enumerable: true
|
17
11
|
});
|
18
12
|
export default YamlMapping;
|
@@ -1,22 +1,19 @@
|
|
1
|
-
import stampit from 'stampit';
|
2
1
|
import Node from "../../Node.mjs";
|
3
|
-
|
4
|
-
|
5
|
-
anchor
|
6
|
-
tag
|
7
|
-
style
|
8
|
-
styleGroup
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
styleGroup = null
|
15
|
-
} = {}) {
|
2
|
+
class YamlNode extends Node {
|
3
|
+
constructor({
|
4
|
+
anchor,
|
5
|
+
tag,
|
6
|
+
style,
|
7
|
+
styleGroup,
|
8
|
+
...rest
|
9
|
+
}) {
|
10
|
+
super({
|
11
|
+
...rest
|
12
|
+
});
|
16
13
|
this.anchor = anchor;
|
17
14
|
this.tag = tag;
|
18
15
|
this.style = style;
|
19
16
|
this.styleGroup = styleGroup;
|
20
17
|
}
|
21
|
-
}
|
18
|
+
}
|
22
19
|
export default YamlNode;
|
@@ -1,16 +1,14 @@
|
|
1
|
-
import stampit from 'stampit';
|
2
1
|
import YamlNode from "./YamlNode.mjs";
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
} = {}) {
|
2
|
+
class YamlScalar extends YamlNode {
|
3
|
+
static type = 'scalar';
|
4
|
+
constructor({
|
5
|
+
content,
|
6
|
+
...rest
|
7
|
+
}) {
|
8
|
+
super({
|
9
|
+
...rest
|
10
|
+
});
|
13
11
|
this.content = content;
|
14
12
|
}
|
15
|
-
}
|
13
|
+
}
|
16
14
|
export default YamlScalar;
|
@@ -1,21 +1,15 @@
|
|
1
|
-
import stampit from 'stampit';
|
2
1
|
import YamlCollection from "./YamlCollection.mjs";
|
3
2
|
import { isMapping, isScalar, isSequence, isAlias } from "./predicates.mjs";
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
class YamlSequence extends YamlCollection {
|
4
|
+
static type = 'sequence';
|
5
|
+
}
|
6
|
+
Object.defineProperty(YamlSequence.prototype, 'content', {
|
7
|
+
get() {
|
8
|
+
const {
|
9
|
+
children
|
10
|
+
} = this;
|
11
|
+
return Array.isArray(children) ? children.filter(node => isSequence(node) || isMapping(node) || isScalar(node) || isAlias(node)) : [];
|
7
12
|
},
|
8
|
-
|
9
|
-
content: {
|
10
|
-
get() {
|
11
|
-
// @ts-ignore
|
12
|
-
const {
|
13
|
-
children
|
14
|
-
} = this;
|
15
|
-
return Array.isArray(children) ? children.filter(node => isSequence(node) || isMapping(node) || isScalar(node) || isAlias(node)) : [];
|
16
|
-
},
|
17
|
-
enumerable: true
|
18
|
-
}
|
19
|
-
}
|
13
|
+
enumerable: true
|
20
14
|
});
|
21
15
|
export default YamlSequence;
|
@@ -1,20 +1,12 @@
|
|
1
|
-
import stampit from 'stampit';
|
2
1
|
import Node from "../../Node.mjs";
|
3
2
|
import { isComment, isDocument } from "./predicates.mjs";
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
class YamlStream extends Node {
|
4
|
+
static type = 'stream';
|
5
|
+
}
|
6
|
+
Object.defineProperty(YamlStream.prototype, 'content', {
|
7
|
+
get() {
|
8
|
+
return Array.isArray(this.children) ? this.children.filter(node => isDocument(node) || isComment(node)) : [];
|
7
9
|
},
|
8
|
-
|
9
|
-
content: {
|
10
|
-
get() {
|
11
|
-
// @ts-ignore
|
12
|
-
return Array.isArray(this.children) ?
|
13
|
-
// @ts-ignore
|
14
|
-
this.children.filter(node => isDocument(node) || isComment(node)) : [];
|
15
|
-
},
|
16
|
-
enumerable: true
|
17
|
-
}
|
18
|
-
}
|
10
|
+
enumerable: true
|
19
11
|
});
|
20
12
|
export default YamlStream;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import stampit from 'stampit';
|
2
1
|
export let YamlStyle = /*#__PURE__*/function (YamlStyle) {
|
3
2
|
YamlStyle["Plain"] = "Plain";
|
4
3
|
YamlStyle["SingleQuoted"] = "SingleQuoted";
|
@@ -15,11 +14,4 @@ export let YamlStyleGroup = /*#__PURE__*/function (YamlStyleGroup) {
|
|
15
14
|
YamlStyleGroup["Flow"] = "Flow";
|
16
15
|
YamlStyleGroup["Block"] = "Block";
|
17
16
|
return YamlStyleGroup;
|
18
|
-
}({});
|
19
|
-
const YamlStyleModel = stampit({
|
20
|
-
props: {
|
21
|
-
styleGroup: null,
|
22
|
-
style: null
|
23
|
-
}
|
24
|
-
});
|
25
|
-
export default YamlStyleModel;
|
17
|
+
}({});
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import stampit from 'stampit';
|
2
1
|
import Node from "../../Node.mjs";
|
3
2
|
export let YamlNodeKind = /*#__PURE__*/function (YamlNodeKind) {
|
4
3
|
YamlNodeKind["Scalar"] = "Scalar";
|
@@ -6,20 +5,18 @@ export let YamlNodeKind = /*#__PURE__*/function (YamlNodeKind) {
|
|
6
5
|
YamlNodeKind["Mapping"] = "Mapping";
|
7
6
|
return YamlNodeKind;
|
8
7
|
}({});
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
},
|
13
|
-
props: {
|
14
|
-
explicitName: '',
|
15
|
-
kind: null
|
16
|
-
},
|
17
|
-
init({
|
8
|
+
class YamlTag extends Node {
|
9
|
+
static type = 'tag';
|
10
|
+
constructor({
|
18
11
|
explicitName,
|
19
|
-
kind
|
20
|
-
|
12
|
+
kind,
|
13
|
+
...rest
|
14
|
+
}) {
|
15
|
+
super({
|
16
|
+
...rest
|
17
|
+
});
|
21
18
|
this.explicitName = explicitName;
|
22
19
|
this.kind = kind;
|
23
20
|
}
|
24
|
-
}
|
21
|
+
}
|
25
22
|
export default YamlTag;
|