yaml 1.9.1 → 1.10.2

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 (162) hide show
  1. package/README.md +25 -25
  2. package/browser/dist/PlainValue-b8036b75.js +1275 -0
  3. package/browser/dist/Schema-e94716c8.js +682 -0
  4. package/browser/dist/index.js +860 -27
  5. package/browser/dist/legacy-exports.js +3 -0
  6. package/browser/dist/package.json +1 -0
  7. package/browser/dist/parse-cst.js +1904 -0
  8. package/browser/dist/resolveSeq-492ab440.js +2419 -0
  9. package/browser/dist/types.js +4 -0
  10. package/browser/dist/util.js +2 -0
  11. package/browser/dist/warnings-df54cb69.js +499 -0
  12. package/browser/index.js +1 -1
  13. package/browser/map.js +2 -4
  14. package/browser/pair.js +2 -4
  15. package/browser/parse-cst.js +1 -1
  16. package/browser/scalar.js +2 -4
  17. package/browser/schema.js +7 -10
  18. package/browser/seq.js +2 -4
  19. package/browser/types/binary.js +7 -5
  20. package/browser/types/omap.js +3 -4
  21. package/browser/types/pairs.js +3 -4
  22. package/browser/types/set.js +3 -4
  23. package/browser/types/timestamp.js +9 -5
  24. package/browser/types.js +1 -13
  25. package/browser/util.js +1 -18
  26. package/dist/Document-9b4560a1.js +757 -0
  27. package/dist/PlainValue-ec8e588e.js +876 -0
  28. package/dist/Schema-88e323a7.js +525 -0
  29. package/dist/index.js +20 -84
  30. package/dist/legacy-exports.js +16 -0
  31. package/dist/parse-cst.js +1753 -0
  32. package/dist/resolveSeq-d03cb037.js +2161 -0
  33. package/dist/test-events.js +11 -9
  34. package/dist/types.js +23 -0
  35. package/dist/util.js +19 -0
  36. package/dist/warnings-1000a372.js +416 -0
  37. package/index.d.ts +23 -9
  38. package/map.js +2 -2
  39. package/package.json +27 -42
  40. package/pair.js +2 -2
  41. package/parse-cst.d.ts +4 -0
  42. package/parse-cst.js +1 -1
  43. package/scalar.js +2 -2
  44. package/schema.js +8 -6
  45. package/seq.js +2 -2
  46. package/types/binary.js +3 -2
  47. package/types/omap.js +3 -2
  48. package/types/pairs.js +3 -2
  49. package/types/set.js +3 -2
  50. package/types/timestamp.js +6 -6
  51. package/types.d.ts +113 -98
  52. package/types.js +16 -11
  53. package/types.mjs +15 -19
  54. package/util.js +14 -14
  55. package/util.mjs +13 -20
  56. package/browser/dist/Anchors.js +0 -130
  57. package/browser/dist/Document.js +0 -824
  58. package/browser/dist/addComment.js +0 -8
  59. package/browser/dist/constants.js +0 -26
  60. package/browser/dist/cst/Alias.js +0 -46
  61. package/browser/dist/cst/BlankLine.js +0 -52
  62. package/browser/dist/cst/BlockValue.js +0 -251
  63. package/browser/dist/cst/Collection.js +0 -278
  64. package/browser/dist/cst/CollectionItem.js +0 -140
  65. package/browser/dist/cst/Comment.js +0 -44
  66. package/browser/dist/cst/Directive.js +0 -76
  67. package/browser/dist/cst/Document.js +0 -286
  68. package/browser/dist/cst/FlowCollection.js +0 -220
  69. package/browser/dist/cst/Node.js +0 -386
  70. package/browser/dist/cst/ParseContext.js +0 -246
  71. package/browser/dist/cst/PlainValue.js +0 -170
  72. package/browser/dist/cst/QuoteDouble.js +0 -245
  73. package/browser/dist/cst/QuoteSingle.js +0 -120
  74. package/browser/dist/cst/Range.js +0 -64
  75. package/browser/dist/cst/parse.js +0 -48
  76. package/browser/dist/cst/source-utils.js +0 -168
  77. package/browser/dist/errors.js +0 -127
  78. package/browser/dist/foldFlowLines.js +0 -138
  79. package/browser/dist/listTagNames.js +0 -28
  80. package/browser/dist/schema/Alias.js +0 -135
  81. package/browser/dist/schema/Collection.js +0 -260
  82. package/browser/dist/schema/Map.js +0 -161
  83. package/browser/dist/schema/Merge.js +0 -118
  84. package/browser/dist/schema/Node.js +0 -4
  85. package/browser/dist/schema/Pair.js +0 -194
  86. package/browser/dist/schema/Scalar.js +0 -42
  87. package/browser/dist/schema/Seq.js +0 -116
  88. package/browser/dist/schema/index.js +0 -368
  89. package/browser/dist/schema/parseMap.js +0 -312
  90. package/browser/dist/schema/parseSeq.js +0 -168
  91. package/browser/dist/schema/parseUtils.js +0 -106
  92. package/browser/dist/stringify.js +0 -332
  93. package/browser/dist/tags/core.js +0 -141
  94. package/browser/dist/tags/failsafe/index.js +0 -4
  95. package/browser/dist/tags/failsafe/map.js +0 -53
  96. package/browser/dist/tags/failsafe/seq.js +0 -39
  97. package/browser/dist/tags/failsafe/string.js +0 -28
  98. package/browser/dist/tags/index.js +0 -36
  99. package/browser/dist/tags/json.js +0 -77
  100. package/browser/dist/tags/options.js +0 -26
  101. package/browser/dist/tags/yaml-1.1/binary.js +0 -87
  102. package/browser/dist/tags/yaml-1.1/index.js +0 -189
  103. package/browser/dist/tags/yaml-1.1/omap.js +0 -137
  104. package/browser/dist/tags/yaml-1.1/pairs.js +0 -78
  105. package/browser/dist/tags/yaml-1.1/set.js +0 -118
  106. package/browser/dist/tags/yaml-1.1/timestamp.js +0 -97
  107. package/browser/dist/test-events.js +0 -163
  108. package/browser/dist/toJSON.js +0 -19
  109. package/browser/dist/warnings.js +0 -39
  110. package/dist/Anchors.js +0 -120
  111. package/dist/Document.js +0 -714
  112. package/dist/addComment.js +0 -14
  113. package/dist/constants.js +0 -31
  114. package/dist/cst/Alias.js +0 -33
  115. package/dist/cst/BlankLine.js +0 -40
  116. package/dist/cst/BlockValue.js +0 -243
  117. package/dist/cst/Collection.js +0 -266
  118. package/dist/cst/CollectionItem.js +0 -135
  119. package/dist/cst/Comment.js +0 -33
  120. package/dist/cst/Directive.js +0 -59
  121. package/dist/cst/Document.js +0 -276
  122. package/dist/cst/FlowCollection.js +0 -213
  123. package/dist/cst/Node.js +0 -360
  124. package/dist/cst/ParseContext.js +0 -253
  125. package/dist/cst/PlainValue.js +0 -156
  126. package/dist/cst/QuoteDouble.js +0 -232
  127. package/dist/cst/QuoteSingle.js +0 -108
  128. package/dist/cst/Range.js +0 -60
  129. package/dist/cst/parse.js +0 -50
  130. package/dist/cst/source-utils.js +0 -175
  131. package/dist/errors.js +0 -97
  132. package/dist/foldFlowLines.js +0 -143
  133. package/dist/listTagNames.js +0 -33
  134. package/dist/schema/Alias.js +0 -105
  135. package/dist/schema/Collection.js +0 -184
  136. package/dist/schema/Map.js +0 -98
  137. package/dist/schema/Merge.js +0 -75
  138. package/dist/schema/Node.js +0 -7
  139. package/dist/schema/Pair.js +0 -174
  140. package/dist/schema/Scalar.js +0 -26
  141. package/dist/schema/Seq.js +0 -73
  142. package/dist/schema/index.js +0 -310
  143. package/dist/schema/parseMap.js +0 -334
  144. package/dist/schema/parseSeq.js +0 -175
  145. package/dist/schema/parseUtils.js +0 -101
  146. package/dist/stringify.js +0 -352
  147. package/dist/tags/core.js +0 -121
  148. package/dist/tags/failsafe/index.js +0 -12
  149. package/dist/tags/failsafe/map.js +0 -32
  150. package/dist/tags/failsafe/seq.js +0 -29
  151. package/dist/tags/failsafe/string.js +0 -37
  152. package/dist/tags/index.js +0 -53
  153. package/dist/tags/json.js +0 -64
  154. package/dist/tags/options.js +0 -36
  155. package/dist/tags/yaml-1.1/binary.js +0 -94
  156. package/dist/tags/yaml-1.1/index.js +0 -162
  157. package/dist/tags/yaml-1.1/omap.js +0 -100
  158. package/dist/tags/yaml-1.1/pairs.js +0 -75
  159. package/dist/tags/yaml-1.1/set.js +0 -82
  160. package/dist/tags/yaml-1.1/timestamp.js +0 -90
  161. package/dist/toJSON.js +0 -21
  162. package/dist/warnings.js +0 -48
@@ -1,194 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _inherits from "@babel/runtime/helpers/inherits";
4
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
- import _typeof from "@babel/runtime/helpers/typeof";
8
-
9
- function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10
-
11
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
12
-
13
- // Published as 'yaml/pair'
14
- import { addComment } from '../addComment';
15
- import { Type } from '../constants';
16
- import { toJSON } from '../toJSON';
17
- import { Collection } from './Collection';
18
- import { Node } from './Node';
19
- import { Scalar } from './Scalar';
20
- import { YAMLSeq } from './Seq';
21
-
22
- var stringifyKey = function stringifyKey(key, jsKey, ctx) {
23
- if (jsKey === null) return '';
24
- if (_typeof(jsKey) !== 'object') return String(jsKey);
25
- if (key instanceof Node && ctx && ctx.doc) return key.toString({
26
- anchors: {},
27
- doc: ctx.doc,
28
- indent: '',
29
- indentStep: ctx.indentStep,
30
- inFlow: true,
31
- inStringifyKey: true
32
- });
33
- return JSON.stringify(jsKey);
34
- };
35
-
36
- export var Pair = /*#__PURE__*/function (_Node) {
37
- _inherits(Pair, _Node);
38
-
39
- var _super = _createSuper(Pair);
40
-
41
- function Pair(key) {
42
- var _this;
43
-
44
- var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
45
-
46
- _classCallCheck(this, Pair);
47
-
48
- _this = _super.call(this);
49
- _this.key = key;
50
- _this.value = value;
51
- _this.type = Pair.Type.PAIR;
52
- return _this;
53
- }
54
-
55
- _createClass(Pair, [{
56
- key: "addToJSMap",
57
- value: function addToJSMap(ctx, map) {
58
- var key = toJSON(this.key, '', ctx);
59
-
60
- if (map instanceof Map) {
61
- var value = toJSON(this.value, key, ctx);
62
- map.set(key, value);
63
- } else if (map instanceof Set) {
64
- map.add(key);
65
- } else {
66
- var stringKey = stringifyKey(this.key, key, ctx);
67
- map[stringKey] = toJSON(this.value, stringKey, ctx);
68
- }
69
-
70
- return map;
71
- }
72
- }, {
73
- key: "toJSON",
74
- value: function toJSON(_, ctx) {
75
- var pair = ctx && ctx.mapAsMap ? new Map() : {};
76
- return this.addToJSMap(ctx, pair);
77
- }
78
- }, {
79
- key: "toString",
80
- value: function toString(ctx, onComment, onChompKeep) {
81
- if (!ctx || !ctx.doc) return JSON.stringify(this);
82
- var _ctx$doc$options = ctx.doc.options,
83
- indentSize = _ctx$doc$options.indent,
84
- indentSeq = _ctx$doc$options.indentSeq,
85
- simpleKeys = _ctx$doc$options.simpleKeys;
86
- var key = this.key,
87
- value = this.value;
88
- var keyComment = key instanceof Node && key.comment;
89
-
90
- if (simpleKeys) {
91
- if (keyComment) {
92
- throw new Error('With simple keys, key nodes cannot have comments');
93
- }
94
-
95
- if (key instanceof Collection) {
96
- var msg = 'With simple keys, collection cannot be used as a key value';
97
- throw new Error(msg);
98
- }
99
- }
100
-
101
- var explicitKey = !simpleKeys && (!key || keyComment || key instanceof Collection || key.type === Type.BLOCK_FOLDED || key.type === Type.BLOCK_LITERAL);
102
- var _ctx = ctx,
103
- doc = _ctx.doc,
104
- indent = _ctx.indent,
105
- indentStep = _ctx.indentStep;
106
- ctx = Object.assign({}, ctx, {
107
- implicitKey: !explicitKey,
108
- indent: indent + indentStep
109
- });
110
- var chompKeep = false;
111
- var str = doc.schema.stringify(key, ctx, function () {
112
- return keyComment = null;
113
- }, function () {
114
- return chompKeep = true;
115
- });
116
- str = addComment(str, ctx.indent, keyComment);
117
-
118
- if (ctx.allNullValues && !simpleKeys) {
119
- if (this.comment) {
120
- str = addComment(str, ctx.indent, this.comment);
121
- if (onComment) onComment();
122
- } else if (chompKeep && !keyComment && onChompKeep) onChompKeep();
123
-
124
- return ctx.inFlow ? str : "? ".concat(str);
125
- }
126
-
127
- str = explicitKey ? "? ".concat(str, "\n").concat(indent, ":") : "".concat(str, ":");
128
-
129
- if (this.comment) {
130
- // expected (but not strictly required) to be a single-line comment
131
- str = addComment(str, ctx.indent, this.comment);
132
- if (onComment) onComment();
133
- }
134
-
135
- var vcb = '';
136
- var valueComment = null;
137
-
138
- if (value instanceof Node) {
139
- if (value.spaceBefore) vcb = '\n';
140
-
141
- if (value.commentBefore) {
142
- var cs = value.commentBefore.replace(/^/gm, "".concat(ctx.indent, "#"));
143
- vcb += "\n".concat(cs);
144
- }
145
-
146
- valueComment = value.comment;
147
- } else if (value && _typeof(value) === 'object') {
148
- value = doc.schema.createNode(value, true);
149
- }
150
-
151
- ctx.implicitKey = false;
152
- if (!explicitKey && !this.comment && value instanceof Scalar) ctx.indentAtStart = str.length + 1;
153
- chompKeep = false;
154
-
155
- if (!indentSeq && indentSize >= 2 && !ctx.inFlow && !explicitKey && value instanceof YAMLSeq && value.type !== Type.FLOW_SEQ && !value.tag && !doc.anchors.getName(value)) {
156
- // If indentSeq === false, consider '- ' as part of indentation where possible
157
- ctx.indent = ctx.indent.substr(2);
158
- }
159
-
160
- var valueStr = doc.schema.stringify(value, ctx, function () {
161
- return valueComment = null;
162
- }, function () {
163
- return chompKeep = true;
164
- });
165
- var ws = ' ';
166
-
167
- if (vcb || this.comment) {
168
- ws = "".concat(vcb, "\n").concat(ctx.indent);
169
- } else if (!explicitKey && value instanceof Collection) {
170
- var flow = valueStr[0] === '[' || valueStr[0] === '{';
171
- if (!flow || valueStr.includes('\n')) ws = "\n".concat(ctx.indent);
172
- }
173
-
174
- if (chompKeep && !valueComment && onChompKeep) onChompKeep();
175
- return addComment(str + ws + valueStr, ctx.indent, valueComment);
176
- }
177
- }, {
178
- key: "commentBefore",
179
- get: function get() {
180
- return this.key && this.key.commentBefore;
181
- },
182
- set: function set(cb) {
183
- if (this.key == null) this.key = new Scalar(null);
184
- this.key.commentBefore = cb;
185
- }
186
- }]);
187
-
188
- return Pair;
189
- }(Node);
190
-
191
- _defineProperty(Pair, "Type", {
192
- PAIR: 'PAIR',
193
- MERGE_PAIR: 'MERGE_PAIR'
194
- });
@@ -1,42 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _inherits from "@babel/runtime/helpers/inherits";
4
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
-
7
- function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
-
9
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
10
-
11
- // Published as 'yaml/scalar'
12
- import { toJSON as _toJSON } from '../toJSON';
13
- import { Node } from './Node';
14
- export var Scalar = /*#__PURE__*/function (_Node) {
15
- _inherits(Scalar, _Node);
16
-
17
- var _super = _createSuper(Scalar);
18
-
19
- function Scalar(value) {
20
- var _this;
21
-
22
- _classCallCheck(this, Scalar);
23
-
24
- _this = _super.call(this);
25
- _this.value = value;
26
- return _this;
27
- }
28
-
29
- _createClass(Scalar, [{
30
- key: "toJSON",
31
- value: function toJSON(arg, ctx) {
32
- return ctx && ctx.keep ? this.value : _toJSON(this.value, arg, ctx);
33
- }
34
- }, {
35
- key: "toString",
36
- value: function toString() {
37
- return String(this.value);
38
- }
39
- }]);
40
-
41
- return Scalar;
42
- }(Node);
@@ -1,116 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _get from "@babel/runtime/helpers/get";
4
- import _inherits from "@babel/runtime/helpers/inherits";
5
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
-
8
- function _createForOfIteratorHelper(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
9
-
10
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
-
12
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
13
-
14
- function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
15
-
16
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
17
-
18
- // Published as 'yaml/seq'
19
- import { toJSON as _toJSON } from '../toJSON';
20
- import { Collection } from './Collection';
21
- import { Scalar } from './Scalar';
22
-
23
- function asItemIndex(key) {
24
- var idx = key instanceof Scalar ? key.value : key;
25
- if (idx && typeof idx === 'string') idx = Number(idx);
26
- return Number.isInteger(idx) && idx >= 0 ? idx : null;
27
- }
28
-
29
- export var YAMLSeq = /*#__PURE__*/function (_Collection) {
30
- _inherits(YAMLSeq, _Collection);
31
-
32
- var _super = _createSuper(YAMLSeq);
33
-
34
- function YAMLSeq() {
35
- _classCallCheck(this, YAMLSeq);
36
-
37
- return _super.apply(this, arguments);
38
- }
39
-
40
- _createClass(YAMLSeq, [{
41
- key: "add",
42
- value: function add(value) {
43
- this.items.push(value);
44
- }
45
- }, {
46
- key: "delete",
47
- value: function _delete(key) {
48
- var idx = asItemIndex(key);
49
- if (typeof idx !== 'number') return false;
50
- var del = this.items.splice(idx, 1);
51
- return del.length > 0;
52
- }
53
- }, {
54
- key: "get",
55
- value: function get(key, keepScalar) {
56
- var idx = asItemIndex(key);
57
- if (typeof idx !== 'number') return undefined;
58
- var it = this.items[idx];
59
- return !keepScalar && it instanceof Scalar ? it.value : it;
60
- }
61
- }, {
62
- key: "has",
63
- value: function has(key) {
64
- var idx = asItemIndex(key);
65
- return typeof idx === 'number' && idx < this.items.length;
66
- }
67
- }, {
68
- key: "set",
69
- value: function set(key, value) {
70
- var idx = asItemIndex(key);
71
- if (typeof idx !== 'number') throw new Error("Expected a valid index, not ".concat(key, "."));
72
- this.items[idx] = value;
73
- }
74
- }, {
75
- key: "toJSON",
76
- value: function toJSON(_, ctx) {
77
- var seq = [];
78
- if (ctx && ctx.onCreate) ctx.onCreate(seq);
79
- var i = 0;
80
-
81
- var _iterator = _createForOfIteratorHelper(this.items),
82
- _step;
83
-
84
- try {
85
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
86
- var item = _step.value;
87
- seq.push(_toJSON(item, String(i++), ctx));
88
- }
89
- } catch (err) {
90
- _iterator.e(err);
91
- } finally {
92
- _iterator.f();
93
- }
94
-
95
- return seq;
96
- }
97
- }, {
98
- key: "toString",
99
- value: function toString(ctx, onComment, onChompKeep) {
100
- if (!ctx) return JSON.stringify(this);
101
- return _get(_getPrototypeOf(YAMLSeq.prototype), "toString", this).call(this, ctx, {
102
- blockItem: function blockItem(n) {
103
- return n.type === 'comment' ? n.str : "- ".concat(n.str);
104
- },
105
- flowChars: {
106
- start: '[',
107
- end: ']'
108
- },
109
- isMap: false,
110
- itemIndent: (ctx.indent || '') + ' '
111
- }, onComment, onChompKeep);
112
- }
113
- }]);
114
-
115
- return YAMLSeq;
116
- }(Collection);