@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.
Files changed (99) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/cjs/Error.cjs +10 -13
  3. package/cjs/Literal.cjs +9 -11
  4. package/cjs/Node.cjs +23 -32
  5. package/cjs/ParseResult.cjs +5 -12
  6. package/cjs/Position.cjs +20 -32
  7. package/cjs/json/nodes/JsonArray.cjs +5 -11
  8. package/cjs/json/nodes/JsonDocument.cjs +5 -12
  9. package/cjs/json/nodes/JsonEscapeSequence.cjs +3 -6
  10. package/cjs/json/nodes/JsonFalse.cjs +3 -6
  11. package/cjs/json/nodes/JsonKey.cjs +3 -6
  12. package/cjs/json/nodes/JsonNode.cjs +1 -2
  13. package/cjs/json/nodes/JsonNull.cjs +3 -6
  14. package/cjs/json/nodes/JsonNumber.cjs +3 -6
  15. package/cjs/json/nodes/JsonObject.cjs +5 -11
  16. package/cjs/json/nodes/JsonProperty.cjs +8 -17
  17. package/cjs/json/nodes/JsonString.cjs +8 -16
  18. package/cjs/json/nodes/JsonStringContent.cjs +3 -6
  19. package/cjs/json/nodes/JsonTrue.cjs +3 -6
  20. package/cjs/json/nodes/JsonValue.cjs +10 -12
  21. package/cjs/json/nodes/predicates.cjs +24 -12
  22. package/cjs/predicates.cjs +9 -5
  23. package/cjs/yaml/nodes/YamlAlias.cjs +10 -12
  24. package/cjs/yaml/nodes/YamlAnchor.cjs +10 -12
  25. package/cjs/yaml/nodes/YamlCollection.cjs +1 -2
  26. package/cjs/yaml/nodes/YamlComment.cjs +10 -12
  27. package/cjs/yaml/nodes/YamlDirective.cjs +14 -17
  28. package/cjs/yaml/nodes/YamlDocument.cjs +3 -6
  29. package/cjs/yaml/nodes/YamlKeyValuePair.cjs +28 -27
  30. package/cjs/yaml/nodes/YamlMapping.cjs +7 -13
  31. package/cjs/yaml/nodes/YamlNode.cjs +12 -15
  32. package/cjs/yaml/nodes/YamlScalar.cjs +10 -12
  33. package/cjs/yaml/nodes/YamlSequence.cjs +10 -16
  34. package/cjs/yaml/nodes/YamlStream.cjs +7 -15
  35. package/cjs/yaml/nodes/YamlStyle.cjs +2 -11
  36. package/cjs/yaml/nodes/YamlTag.cjs +10 -13
  37. package/cjs/yaml/nodes/predicates.cjs +20 -10
  38. package/cjs/yaml/schemas/ScalarTag.cjs +23 -32
  39. package/cjs/yaml/schemas/Tag.cjs +16 -7
  40. package/cjs/yaml/schemas/failsafe/GenericMapping.cjs +7 -19
  41. package/cjs/yaml/schemas/failsafe/GenericSequence.cjs +7 -19
  42. package/cjs/yaml/schemas/failsafe/GenericString.cjs +3 -16
  43. package/cjs/yaml/schemas/failsafe/index.cjs +81 -87
  44. package/cjs/yaml/schemas/json/Boolean.cjs +13 -21
  45. package/cjs/yaml/schemas/json/FloatingPoint.cjs +13 -21
  46. package/cjs/yaml/schemas/json/Integer.cjs +13 -21
  47. package/cjs/yaml/schemas/json/Null.cjs +12 -20
  48. package/cjs/yaml/schemas/json/index.cjs +20 -26
  49. package/dist/apidom-ast.browser.js +577 -893
  50. package/dist/apidom-ast.browser.min.js +1 -1
  51. package/es/Error.mjs +10 -13
  52. package/es/Literal.mjs +9 -11
  53. package/es/Node.mjs +23 -31
  54. package/es/ParseResult.mjs +5 -12
  55. package/es/Position.mjs +19 -31
  56. package/es/json/nodes/JsonArray.mjs +5 -11
  57. package/es/json/nodes/JsonDocument.mjs +5 -12
  58. package/es/json/nodes/JsonEscapeSequence.mjs +3 -6
  59. package/es/json/nodes/JsonFalse.mjs +3 -6
  60. package/es/json/nodes/JsonKey.mjs +3 -6
  61. package/es/json/nodes/JsonNode.mjs +1 -2
  62. package/es/json/nodes/JsonNull.mjs +3 -6
  63. package/es/json/nodes/JsonNumber.mjs +3 -6
  64. package/es/json/nodes/JsonObject.mjs +5 -11
  65. package/es/json/nodes/JsonProperty.mjs +8 -17
  66. package/es/json/nodes/JsonString.mjs +8 -16
  67. package/es/json/nodes/JsonStringContent.mjs +3 -6
  68. package/es/json/nodes/JsonTrue.mjs +3 -6
  69. package/es/json/nodes/JsonValue.mjs +10 -12
  70. package/es/json/nodes/predicates.mjs +12 -12
  71. package/es/predicates.mjs +5 -5
  72. package/es/yaml/nodes/YamlAlias.mjs +10 -12
  73. package/es/yaml/nodes/YamlAnchor.mjs +10 -12
  74. package/es/yaml/nodes/YamlCollection.mjs +1 -2
  75. package/es/yaml/nodes/YamlComment.mjs +10 -12
  76. package/es/yaml/nodes/YamlDirective.mjs +14 -17
  77. package/es/yaml/nodes/YamlDocument.mjs +3 -6
  78. package/es/yaml/nodes/YamlKeyValuePair.mjs +28 -27
  79. package/es/yaml/nodes/YamlMapping.mjs +7 -13
  80. package/es/yaml/nodes/YamlNode.mjs +12 -15
  81. package/es/yaml/nodes/YamlScalar.mjs +10 -12
  82. package/es/yaml/nodes/YamlSequence.mjs +10 -16
  83. package/es/yaml/nodes/YamlStream.mjs +7 -15
  84. package/es/yaml/nodes/YamlStyle.mjs +1 -9
  85. package/es/yaml/nodes/YamlTag.mjs +10 -13
  86. package/es/yaml/nodes/predicates.mjs +10 -10
  87. package/es/yaml/schemas/ScalarTag.mjs +23 -31
  88. package/es/yaml/schemas/Tag.mjs +17 -6
  89. package/es/yaml/schemas/failsafe/GenericMapping.mjs +8 -19
  90. package/es/yaml/schemas/failsafe/GenericSequence.mjs +8 -19
  91. package/es/yaml/schemas/failsafe/GenericString.mjs +3 -16
  92. package/es/yaml/schemas/failsafe/index.mjs +84 -90
  93. package/es/yaml/schemas/json/Boolean.mjs +14 -21
  94. package/es/yaml/schemas/json/FloatingPoint.mjs +14 -21
  95. package/es/yaml/schemas/json/Integer.mjs +14 -21
  96. package/es/yaml/schemas/json/Null.mjs +13 -20
  97. package/es/yaml/schemas/json/index.mjs +24 -30
  98. package/package.json +3 -4
  99. package/types/dist.d.ts +222 -157
@@ -1,8 +1,5 @@
1
- import stampit from 'stampit';
2
1
  import JsonValue from "./JsonValue.mjs";
3
- const JsonFalse = stampit(JsonValue, {
4
- statics: {
5
- type: 'false'
6
- }
7
- });
2
+ class JsonFalse extends JsonValue {
3
+ static type = 'false';
4
+ }
8
5
  export default JsonFalse;
@@ -1,8 +1,5 @@
1
- import stampit from 'stampit';
2
1
  import JsonString from "./JsonString.mjs";
3
- const JsonKey = stampit(JsonString, {
4
- statics: {
5
- type: 'key'
6
- }
7
- });
2
+ class JsonKey extends JsonString {
3
+ static type = 'key';
4
+ }
8
5
  export default JsonKey;
@@ -1,4 +1,3 @@
1
- import stampit from 'stampit';
2
1
  import Node from "../../Node.mjs";
3
- const JsonNode = stampit(Node);
2
+ class JsonNode extends Node {}
4
3
  export default JsonNode;
@@ -1,8 +1,5 @@
1
- import stampit from 'stampit';
2
1
  import JsonValue from "./JsonValue.mjs";
3
- const JsonNull = stampit(JsonValue, {
4
- statics: {
5
- type: 'null'
6
- }
7
- });
2
+ class JsonNull extends JsonValue {
3
+ static type = 'null';
4
+ }
8
5
  export default JsonNull;
@@ -1,8 +1,5 @@
1
- import stampit from 'stampit';
2
1
  import JsonValue from "./JsonValue.mjs";
3
- const JsonNumber = stampit(JsonValue, {
4
- statics: {
5
- type: 'number'
6
- }
7
- });
2
+ class JsonNumber extends JsonValue {
3
+ static type = 'number';
4
+ }
8
5
  export default JsonNumber;
@@ -1,15 +1,9 @@
1
- import stampit from 'stampit';
2
1
  import JsonNode from "./JsonNode.mjs";
3
2
  import { isProperty } from "./predicates.mjs";
4
- const JsonObject = stampit(JsonNode, {
5
- statics: {
6
- type: 'object'
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
- const JsonProperty = stampit(JsonNode, {
5
- statics: {
6
- type: 'property'
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
- const JsonString = stampit(JsonNode, {
5
- statics: {
6
- type: 'string'
7
- },
8
- methods: {
9
- get value() {
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
- const JsonStringContent = stampit(JsonValue, {
4
- statics: {
5
- type: 'stringContent'
6
- }
7
- });
2
+ class JsonStringContent extends JsonValue {
3
+ static type = 'stringContent';
4
+ }
8
5
  export default JsonStringContent;
@@ -1,8 +1,5 @@
1
- import stampit from 'stampit';
2
1
  import JsonValue from "./JsonValue.mjs";
3
- const JsonTrue = stampit(JsonValue, {
4
- statics: {
5
- type: 'true'
6
- }
7
- });
2
+ class JsonTrue extends JsonValue {
3
+ static type = 'true';
4
+ }
8
5
  export default JsonTrue;
@@ -1,16 +1,14 @@
1
- import stampit from 'stampit';
2
1
  import JsonNode from "./JsonNode.mjs";
3
- const JsonValue = stampit(JsonNode, {
4
- statics: {
5
- type: 'value'
6
- },
7
- props: {
8
- value: null
9
- },
10
- init({
11
- value = null
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.bind(undefined, 'document');
3
- export const isString = isNodeType.bind(undefined, 'string');
4
- export const isFalse = isNodeType.bind(undefined, 'false');
5
- export const isTrue = isNodeType.bind(undefined, 'true');
6
- export const isNull = isNodeType.bind(undefined, 'null');
7
- export const isNumber = isNodeType.bind(undefined, 'number');
8
- export const isArray = isNodeType.bind(undefined, 'array');
9
- export const isObject = isNodeType.bind(undefined, 'object');
10
- export const isStringContent = isNodeType.bind(undefined, 'stringContent');
11
- export const isEscapeSequence = isNodeType.bind(undefined, 'escapeSequence');
12
- export const isProperty = isNodeType.bind(undefined, 'property');
13
- export const isKey = isNodeType.bind(undefined, 'key');
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) => (node === null || node === void 0 ? void 0 : node.type) === type;
2
- export const isLiteral = isNodeType.bind(undefined, 'literal');
3
- export const isPosition = isNodeType.bind(undefined, 'position');
4
- export const isPoint = isNodeType.bind(undefined, 'point');
5
- export const isParseResult = isNodeType.bind(undefined, 'parseResult');
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
- const YamlAlias = stampit(Node, {
4
- statics: {
5
- type: 'alias'
6
- },
7
- props: {
8
- content: null
9
- },
10
- init({
11
- content = null
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
- const YamlAnchor = stampit(Node, {
4
- statics: {
5
- type: 'anchor'
6
- },
7
- props: {
8
- name: null
9
- },
10
- init({
11
- name = null
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,4 +1,3 @@
1
- import stampit from 'stampit';
2
1
  import YamlNode from "./YamlNode.mjs";
3
- const YamlCollection = stampit(YamlNode, {});
2
+ class YamlCollection extends YamlNode {}
4
3
  export default YamlCollection;
@@ -1,16 +1,14 @@
1
- import stampit from 'stampit';
2
1
  import Node from "../../Node.mjs";
3
- const YamlComment = stampit(Node, {
4
- statics: {
5
- type: 'comment'
6
- },
7
- props: {
8
- content: null
9
- },
10
- init({
11
- content = null
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
- const YamlDirective = stampit(Node, {
5
- statics: {
6
- type: 'directive'
7
- },
8
- props: {
9
- name: null,
10
- parameters: null
11
- },
12
- init({
13
- name = null,
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: null,
19
- handle: null,
20
- prefix: null
15
+ version: undefined,
16
+ handle: undefined,
17
+ prefix: undefined
21
18
  }, parameters);
22
19
  }
23
- });
20
+ }
24
21
  export default YamlDirective;
@@ -1,8 +1,5 @@
1
- import stampit from 'stampit';
2
1
  import Node from "../../Node.mjs";
3
- const YamlDocument = stampit(Node, {
4
- statics: {
5
- type: 'document'
6
- }
7
- });
2
+ class YamlDocument extends Node {
3
+ static type = 'document';
4
+ }
8
5
  export default YamlDocument;
@@ -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
- const YamlKeyValuePair = stampit(Node, YamlStyleModel, {
6
- statics: {
7
- type: 'keyValuePair'
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
- propertyDescriptors: {
10
- key: {
11
- get() {
12
- // @ts-ignore
13
- return this.children.filter(node => isScalar(node) || isMapping(node) || isSequence(node))[0];
14
- },
15
- enumerable: true
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
- value: {
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
- const YamlMapping = stampit(YamlCollection, {
5
- statics: {
6
- type: 'mapping'
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
- propertyDescriptors: {
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
- const YamlNode = stampit(Node, {
4
- props: {
5
- anchor: null,
6
- tag: null,
7
- style: null,
8
- styleGroup: null
9
- },
10
- init({
11
- anchor = null,
12
- tag = null,
13
- style = null,
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
- const YamlScalar = stampit(YamlNode, {
4
- statics: {
5
- type: 'scalar'
6
- },
7
- props: {
8
- content: ''
9
- },
10
- init({
11
- content
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
- const YamlSequence = stampit(YamlCollection, {
5
- statics: {
6
- type: 'sequence'
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
- propertyDescriptors: {
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
- const YamlStream = stampit(Node, {
5
- statics: {
6
- type: 'stream'
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
- propertyDescriptors: {
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
- const YamlTag = stampit(Node, {
10
- statics: {
11
- type: 'tag'
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;