@dev-blinq/cucumber_client 1.0.1428-dev → 1.0.1428-stage
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/bin/assets/bundled_scripts/recorder.js +73 -73
- package/bin/assets/preload/css_gen.js +10 -10
- package/bin/assets/preload/toolbar.js +27 -29
- package/bin/assets/preload/unique_locators.js +1 -1
- package/bin/assets/preload/yaml.js +288 -275
- package/bin/assets/scripts/aria_snapshot.js +223 -220
- package/bin/assets/scripts/dom_attr.js +329 -329
- package/bin/assets/scripts/dom_parent.js +169 -174
- package/bin/assets/scripts/event_utils.js +94 -94
- package/bin/assets/scripts/pw.js +2050 -1949
- package/bin/assets/scripts/recorder.js +70 -45
- package/bin/assets/scripts/snapshot_capturer.js +147 -147
- package/bin/assets/scripts/unique_locators.js +170 -49
- package/bin/assets/scripts/yaml.js +796 -783
- package/bin/assets/templates/_hooks_template.txt +6 -2
- package/bin/assets/templates/utils_template.txt +16 -16
- package/bin/client/code_cleanup/find_step_definition_references.js +0 -1
- package/bin/client/code_gen/api_codegen.js +2 -2
- package/bin/client/code_gen/code_inversion.js +63 -2
- package/bin/client/code_gen/function_signature.js +4 -0
- package/bin/client/code_gen/page_reflection.js +52 -11
- package/bin/client/code_gen/playwright_codeget.js +25 -3
- package/bin/client/cucumber/feature_data.js +2 -2
- package/bin/client/cucumber/project_to_document.js +8 -2
- package/bin/client/cucumber/steps_definitions.js +19 -3
- package/bin/client/local_agent.js +3 -2
- package/bin/client/parse_feature_file.js +23 -26
- package/bin/client/playground/projects/env.json +2 -2
- package/bin/client/recorderv3/bvt_init.js +363 -0
- package/bin/client/recorderv3/bvt_recorder.js +1009 -47
- package/bin/client/recorderv3/implemented_steps.js +2 -0
- package/bin/client/recorderv3/index.js +3 -283
- package/bin/client/recorderv3/scriptTest.js +1 -1
- package/bin/client/recorderv3/services.js +818 -142
- package/bin/client/recorderv3/step_runner.js +28 -8
- package/bin/client/recorderv3/step_utils.js +511 -39
- package/bin/client/recorderv3/update_feature.js +32 -13
- package/bin/client/recorderv3/wbr_entry.js +61 -0
- package/bin/client/recording.js +1 -0
- package/bin/client/upload-service.js +4 -2
- package/bin/client/utils/socket_logger.js +1 -1
- package/bin/index.js +4 -1
- package/package.json +6 -4
|
@@ -45,7 +45,7 @@ var Yaml = (function (e) {
|
|
|
45
45
|
}
|
|
46
46
|
function v(e, t, n, s) {
|
|
47
47
|
const i = O(e, t, n, s);
|
|
48
|
-
if (m(i) || f(i)) return A(e, s, i), v(e, i, n, s);
|
|
48
|
+
if (m(i) || f(i)) return (A(e, s, i), v(e, i, n, s));
|
|
49
49
|
if ("symbol" != typeof i)
|
|
50
50
|
if (p(t)) {
|
|
51
51
|
s = Object.freeze(s.concat(t));
|
|
@@ -76,7 +76,7 @@ var Yaml = (function (e) {
|
|
|
76
76
|
}
|
|
77
77
|
async function E(e, t, n, s) {
|
|
78
78
|
const i = await O(e, t, n, s);
|
|
79
|
-
if (m(i) || f(i)) return A(e, s, i), E(e, i, n, s);
|
|
79
|
+
if (m(i) || f(i)) return (A(e, s, i), E(e, i, n, s));
|
|
80
80
|
if ("symbol" != typeof i)
|
|
81
81
|
if (p(t)) {
|
|
82
82
|
s = Object.freeze(s.concat(t));
|
|
@@ -102,11 +102,11 @@ var Yaml = (function (e) {
|
|
|
102
102
|
function N(e) {
|
|
103
103
|
return "object" == typeof e && (e.Collection || e.Node || e.Value)
|
|
104
104
|
? Object.assign(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
105
|
+
{ Alias: e.Node, Map: e.Node, Scalar: e.Node, Seq: e.Node },
|
|
106
|
+
e.Value && { Map: e.Value, Scalar: e.Value, Seq: e.Value },
|
|
107
|
+
e.Collection && { Map: e.Collection, Seq: e.Collection },
|
|
108
|
+
e
|
|
109
|
+
)
|
|
110
110
|
: e;
|
|
111
111
|
}
|
|
112
112
|
function O(e, t, n, s) {
|
|
@@ -136,18 +136,18 @@ var Yaml = (function (e) {
|
|
|
136
136
|
s.contents = n;
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
(w.BREAK = g), (w.SKIP = b), (w.REMOVE = k), (S.BREAK = g), (S.SKIP = b), (S.REMOVE = k);
|
|
139
|
+
((w.BREAK = g), (w.SKIP = b), (w.REMOVE = k), (S.BREAK = g), (S.SKIP = b), (S.REMOVE = k));
|
|
140
140
|
const I = { "!": "%21", ",": "%2C", "[": "%5B", "]": "%5D", "{": "%7B", "}": "%7D" };
|
|
141
141
|
class T {
|
|
142
142
|
constructor(e, t) {
|
|
143
|
-
(this.docStart = null),
|
|
143
|
+
((this.docStart = null),
|
|
144
144
|
(this.docEnd = !1),
|
|
145
145
|
(this.yaml = Object.assign({}, T.defaultYaml, e)),
|
|
146
|
-
(this.tags = Object.assign({}, T.defaultTags, t));
|
|
146
|
+
(this.tags = Object.assign({}, T.defaultTags, t)));
|
|
147
147
|
}
|
|
148
148
|
clone() {
|
|
149
149
|
const e = new T(this.yaml, this.tags);
|
|
150
|
-
return (e.docStart = this.docStart), e;
|
|
150
|
+
return ((e.docStart = this.docStart), e);
|
|
151
151
|
}
|
|
152
152
|
atDocument() {
|
|
153
153
|
const e = new T(this.yaml, this.tags);
|
|
@@ -156,39 +156,39 @@ var Yaml = (function (e) {
|
|
|
156
156
|
this.atNextDocument = !0;
|
|
157
157
|
break;
|
|
158
158
|
case "1.2":
|
|
159
|
-
(this.atNextDocument = !1),
|
|
159
|
+
((this.atNextDocument = !1),
|
|
160
160
|
(this.yaml = { explicit: T.defaultYaml.explicit, version: "1.2" }),
|
|
161
|
-
(this.tags = Object.assign({}, T.defaultTags));
|
|
161
|
+
(this.tags = Object.assign({}, T.defaultTags)));
|
|
162
162
|
}
|
|
163
163
|
return e;
|
|
164
164
|
}
|
|
165
165
|
add(e, t) {
|
|
166
166
|
this.atNextDocument &&
|
|
167
167
|
((this.yaml = { explicit: T.defaultYaml.explicit, version: "1.1" }),
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
(this.tags = Object.assign({}, T.defaultTags)),
|
|
169
|
+
(this.atNextDocument = !1));
|
|
170
170
|
const n = e.trim().split(/[ \t]+/),
|
|
171
171
|
s = n.shift();
|
|
172
172
|
switch (s) {
|
|
173
173
|
case "%TAG": {
|
|
174
174
|
if (2 !== n.length && (t(0, "%TAG directive should contain exactly two parts"), n.length < 2)) return !1;
|
|
175
175
|
const [e, s] = n;
|
|
176
|
-
return (this.tags[e] = s), !0;
|
|
176
|
+
return ((this.tags[e] = s), !0);
|
|
177
177
|
}
|
|
178
178
|
case "%YAML": {
|
|
179
179
|
if (((this.yaml.explicit = !0), 1 !== n.length))
|
|
180
|
-
return t(0, "%YAML directive should contain exactly one part"), !1;
|
|
180
|
+
return (t(0, "%YAML directive should contain exactly one part"), !1);
|
|
181
181
|
const [e] = n;
|
|
182
|
-
if ("1.1" === e || "1.2" === e) return (this.yaml.version = e), !0;
|
|
183
|
-
return t(6, `Unsupported YAML version ${e}`, /^\d+\.\d+$/.test(e)), !1;
|
|
182
|
+
if ("1.1" === e || "1.2" === e) return ((this.yaml.version = e), !0);
|
|
183
|
+
return (t(6, `Unsupported YAML version ${e}`, /^\d+\.\d+$/.test(e)), !1);
|
|
184
184
|
}
|
|
185
185
|
default:
|
|
186
|
-
return t(0, `Unknown directive ${s}`, !0), !1;
|
|
186
|
+
return (t(0, `Unknown directive ${s}`, !0), !1);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
tagName(e, t) {
|
|
190
190
|
if ("!" === e) return "!";
|
|
191
|
-
if ("!" !== e[0]) return t(`Not a valid tag: ${e}`), null;
|
|
191
|
+
if ("!" !== e[0]) return (t(`Not a valid tag: ${e}`), null);
|
|
192
192
|
if ("<" === e[1]) {
|
|
193
193
|
const n = e.slice(2, -1);
|
|
194
194
|
return "!" === n || "!!" === n
|
|
@@ -202,7 +202,7 @@ var Yaml = (function (e) {
|
|
|
202
202
|
try {
|
|
203
203
|
return i + decodeURIComponent(s);
|
|
204
204
|
} catch (e) {
|
|
205
|
-
return t(String(e)), null;
|
|
205
|
+
return (t(String(e)), null);
|
|
206
206
|
}
|
|
207
207
|
return "!" === n ? e : (t(`Could not resolve tag: ${e}`), null);
|
|
208
208
|
}
|
|
@@ -217,10 +217,10 @@ var Yaml = (function (e) {
|
|
|
217
217
|
let s;
|
|
218
218
|
if (e && n.length > 0 && m(e.contents)) {
|
|
219
219
|
const t = {};
|
|
220
|
-
w(e.contents, (e, n) => {
|
|
220
|
+
(w(e.contents, (e, n) => {
|
|
221
221
|
m(n) && n.tag && (t[n.tag] = !0);
|
|
222
222
|
}),
|
|
223
|
-
(s = Object.keys(t));
|
|
223
|
+
(s = Object.keys(t)));
|
|
224
224
|
} else s = [];
|
|
225
225
|
for (const [i, o] of n)
|
|
226
226
|
("!!" === i && "tag:yaml.org,2002:" === o) ||
|
|
@@ -284,34 +284,34 @@ var Yaml = (function (e) {
|
|
|
284
284
|
if (e && "function" == typeof e.toJSON) {
|
|
285
285
|
if (!n || !y(e)) return e.toJSON(t, n);
|
|
286
286
|
const s = { aliasCount: 0, count: 1, res: void 0 };
|
|
287
|
-
n.anchors.set(e, s),
|
|
287
|
+
(n.anchors.set(e, s),
|
|
288
288
|
(n.onCreate = (e) => {
|
|
289
|
-
(s.res = e), delete n.onCreate;
|
|
290
|
-
});
|
|
289
|
+
((s.res = e), delete n.onCreate);
|
|
290
|
+
}));
|
|
291
291
|
const i = e.toJSON(t, n);
|
|
292
|
-
return n.onCreate && n.onCreate(i), i;
|
|
292
|
+
return (n.onCreate && n.onCreate(i), i);
|
|
293
293
|
}
|
|
294
294
|
return "bigint" != typeof e || n?.keep ? e : Number(e);
|
|
295
295
|
}
|
|
296
|
-
(T.defaultYaml = { explicit: !1, version: "1.2" }), (T.defaultTags = { "!!": "tag:yaml.org,2002:" });
|
|
296
|
+
((T.defaultYaml = { explicit: !1, version: "1.2" }), (T.defaultTags = { "!!": "tag:yaml.org,2002:" }));
|
|
297
297
|
class K {
|
|
298
298
|
constructor(e) {
|
|
299
299
|
Object.defineProperty(this, a, { value: e });
|
|
300
300
|
}
|
|
301
301
|
clone() {
|
|
302
302
|
const e = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
303
|
-
return this.range && (e.range = this.range.slice()), e;
|
|
303
|
+
return (this.range && (e.range = this.range.slice()), e);
|
|
304
304
|
}
|
|
305
305
|
toJS(e, { mapAsMap: t, maxAliasCount: n, onAnchor: s, reviver: i } = {}) {
|
|
306
306
|
if (!l(e)) throw new TypeError("A document argument is required");
|
|
307
307
|
const o = {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
308
|
+
anchors: new Map(),
|
|
309
|
+
doc: e,
|
|
310
|
+
keep: !0,
|
|
311
|
+
mapAsMap: !0 === t,
|
|
312
|
+
mapKeyWarned: !1,
|
|
313
|
+
maxAliasCount: "number" == typeof n ? n : 100,
|
|
314
|
+
},
|
|
315
315
|
r = _(this, "", o);
|
|
316
316
|
if ("function" == typeof s) for (const { count: e, res: t } of o.anchors.values()) s(t, e);
|
|
317
317
|
return "function" == typeof i ? C(i, { "": r }, "", r) : r;
|
|
@@ -319,13 +319,13 @@ var Yaml = (function (e) {
|
|
|
319
319
|
}
|
|
320
320
|
class B extends K {
|
|
321
321
|
constructor(e) {
|
|
322
|
-
super(t),
|
|
322
|
+
(super(t),
|
|
323
323
|
(this.source = e),
|
|
324
324
|
Object.defineProperty(this, "tag", {
|
|
325
325
|
set() {
|
|
326
326
|
throw new Error("Alias nodes cannot have tags");
|
|
327
327
|
},
|
|
328
|
-
});
|
|
328
|
+
}));
|
|
329
329
|
}
|
|
330
330
|
resolve(e, t) {
|
|
331
331
|
let n, s;
|
|
@@ -397,7 +397,7 @@ var Yaml = (function (e) {
|
|
|
397
397
|
const M = (e) => !e || ("function" != typeof e && "object" != typeof e);
|
|
398
398
|
class D extends K {
|
|
399
399
|
constructor(e) {
|
|
400
|
-
super(o), (this.value = e);
|
|
400
|
+
(super(o), (this.value = e));
|
|
401
401
|
}
|
|
402
402
|
toJSON(e, t) {
|
|
403
403
|
return t?.keep ? this.value : _(this.value, e, t);
|
|
@@ -406,16 +406,16 @@ var Yaml = (function (e) {
|
|
|
406
406
|
return String(this.value);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
|
-
(D.BLOCK_FOLDED = "BLOCK_FOLDED"),
|
|
409
|
+
((D.BLOCK_FOLDED = "BLOCK_FOLDED"),
|
|
410
410
|
(D.BLOCK_LITERAL = "BLOCK_LITERAL"),
|
|
411
411
|
(D.PLAIN = "PLAIN"),
|
|
412
412
|
(D.QUOTE_DOUBLE = "QUOTE_DOUBLE"),
|
|
413
|
-
(D.QUOTE_SINGLE = "QUOTE_SINGLE");
|
|
413
|
+
(D.QUOTE_SINGLE = "QUOTE_SINGLE"));
|
|
414
414
|
function q(e, t, n) {
|
|
415
415
|
if ((l(e) && (e = e.contents), m(e))) return e;
|
|
416
416
|
if (f(e)) {
|
|
417
417
|
const t = n.schema[s].createNode?.(n.schema, null, n);
|
|
418
|
-
return t.items.push(e), t;
|
|
418
|
+
return (t.items.push(e), t);
|
|
419
419
|
}
|
|
420
420
|
(e instanceof String ||
|
|
421
421
|
e instanceof Number ||
|
|
@@ -425,8 +425,8 @@ var Yaml = (function (e) {
|
|
|
425
425
|
const { aliasDuplicateObjects: i, onAnchor: o, onTagObj: a, schema: c, sourceObjects: u } = n;
|
|
426
426
|
let h;
|
|
427
427
|
if (i && e && "object" == typeof e) {
|
|
428
|
-
if (((h = u.get(e)), h)) return h.anchor || (h.anchor = o(e)), new B(h.anchor);
|
|
429
|
-
(h = { anchor: null, node: null }), u.set(e, h);
|
|
428
|
+
if (((h = u.get(e)), h)) return (h.anchor || (h.anchor = o(e)), new B(h.anchor));
|
|
429
|
+
((h = { anchor: null, node: null }), u.set(e, h));
|
|
430
430
|
}
|
|
431
431
|
t?.startsWith("!!") && (t = "tag:yaml.org,2002:" + t.slice(2));
|
|
432
432
|
let d = (function (e, t, n) {
|
|
@@ -441,7 +441,7 @@ var Yaml = (function (e) {
|
|
|
441
441
|
if (!d) {
|
|
442
442
|
if ((e && "function" == typeof e.toJSON && (e = e.toJSON()), !e || "object" != typeof e)) {
|
|
443
443
|
const t = new D(e);
|
|
444
|
-
return h && (h.node = t), t;
|
|
444
|
+
return (h && (h.node = t), t);
|
|
445
445
|
}
|
|
446
446
|
d = e instanceof Map ? c[s] : Symbol.iterator in Object(e) ? c[r] : c[s];
|
|
447
447
|
}
|
|
@@ -451,7 +451,7 @@ var Yaml = (function (e) {
|
|
|
451
451
|
: "function" == typeof d?.nodeClass?.from
|
|
452
452
|
? d.nodeClass.from(n.schema, e, n)
|
|
453
453
|
: new D(e);
|
|
454
|
-
return t ? (p.tag = t) : d.default || (p.tag = d.tag), h && (h.node = p), p;
|
|
454
|
+
return (t ? (p.tag = t) : d.default || (p.tag = d.tag), h && (h.node = p), p);
|
|
455
455
|
}
|
|
456
456
|
function P(e, t, n) {
|
|
457
457
|
let s = n;
|
|
@@ -459,7 +459,7 @@ var Yaml = (function (e) {
|
|
|
459
459
|
const n = t[e];
|
|
460
460
|
if ("number" == typeof n && Number.isInteger(n) && n >= 0) {
|
|
461
461
|
const e = [];
|
|
462
|
-
(e[n] = s), (s = e);
|
|
462
|
+
((e[n] = s), (s = e));
|
|
463
463
|
} else s = new Map([[n, s]]);
|
|
464
464
|
}
|
|
465
465
|
return q(s, void 0, {
|
|
@@ -475,7 +475,7 @@ var Yaml = (function (e) {
|
|
|
475
475
|
const U = (e) => null == e || ("object" == typeof e && !!e[Symbol.iterator]().next().done);
|
|
476
476
|
class R extends K {
|
|
477
477
|
constructor(e, t) {
|
|
478
|
-
super(e), Object.defineProperty(this, "schema", { value: t, configurable: !0, enumerable: !1, writable: !0 });
|
|
478
|
+
(super(e), Object.defineProperty(this, "schema", { value: t, configurable: !0, enumerable: !1, writable: !0 }));
|
|
479
479
|
}
|
|
480
480
|
clone(e) {
|
|
481
481
|
const t = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
@@ -541,7 +541,7 @@ var Yaml = (function (e) {
|
|
|
541
541
|
return /^\n+$/.test(e) ? e.substring(1) : t ? e.replace(/^(?! *$)/gm, t) : e;
|
|
542
542
|
}
|
|
543
543
|
const J = (e, t, n) =>
|
|
544
|
-
|
|
544
|
+
e.endsWith("\n") ? V(n, t) : n.includes("\n") ? "\n" + V(n, t) : (e.endsWith(" ") ? "" : " ") + n,
|
|
545
545
|
Y = "flow",
|
|
546
546
|
W = "block",
|
|
547
547
|
G = "quoted";
|
|
@@ -566,7 +566,7 @@ var Yaml = (function (e) {
|
|
|
566
566
|
y = -1,
|
|
567
567
|
g = -1;
|
|
568
568
|
n === W && ((m = H(e, m, t.length)), -1 !== m && (d = m + c));
|
|
569
|
-
for (let s; (s = e[(m += 1)]);) {
|
|
569
|
+
for (let s; (s = e[(m += 1)]); ) {
|
|
570
570
|
if (n === G && "\\" === s) {
|
|
571
571
|
switch (((y = m), e[m + 1])) {
|
|
572
572
|
case "x":
|
|
@@ -583,19 +583,19 @@ var Yaml = (function (e) {
|
|
|
583
583
|
}
|
|
584
584
|
g = m;
|
|
585
585
|
}
|
|
586
|
-
if ("\n" === s) n === W && (m = H(e, m, t.length)), (d = m + t.length + c), (f = void 0);
|
|
586
|
+
if ("\n" === s) (n === W && (m = H(e, m, t.length)), (d = m + t.length + c), (f = void 0));
|
|
587
587
|
else {
|
|
588
588
|
if (" " === s && h && " " !== h && "\n" !== h && "\t" !== h) {
|
|
589
589
|
const t = e[m + 1];
|
|
590
590
|
t && " " !== t && "\n" !== t && "\t" !== t && (f = m);
|
|
591
591
|
}
|
|
592
592
|
if (m >= d)
|
|
593
|
-
if (f) l.push(f), (d = f + c), (f = void 0);
|
|
593
|
+
if (f) (l.push(f), (d = f + c), (f = void 0));
|
|
594
594
|
else if (n === G) {
|
|
595
|
-
for (; " " === h || "\t" === h;) (h = s), (s = e[(m += 1)]), (p = !0);
|
|
595
|
+
for (; " " === h || "\t" === h; ) ((h = s), (s = e[(m += 1)]), (p = !0));
|
|
596
596
|
const t = m > g + 1 ? m - 2 : y - 1;
|
|
597
597
|
if (u[t]) return e;
|
|
598
|
-
l.push(t), (u[t] = !0), (d = t + c), (f = void 0);
|
|
598
|
+
(l.push(t), (u[t] = !0), (d = t + c), (f = void 0));
|
|
599
599
|
} else p = !0;
|
|
600
600
|
}
|
|
601
601
|
h = s;
|
|
@@ -616,21 +616,21 @@ var Yaml = (function (e) {
|
|
|
616
616
|
let s = t,
|
|
617
617
|
i = t + 1,
|
|
618
618
|
o = e[i];
|
|
619
|
-
for (; " " === o || "\t" === o;)
|
|
619
|
+
for (; " " === o || "\t" === o; )
|
|
620
620
|
if (t < i + n) o = e[++t];
|
|
621
621
|
else {
|
|
622
622
|
do {
|
|
623
623
|
o = e[++t];
|
|
624
624
|
} while (o && "\n" !== o);
|
|
625
|
-
(s = t), (i = t + 1), (o = e[i]);
|
|
625
|
+
((s = t), (i = t + 1), (o = e[i]));
|
|
626
626
|
}
|
|
627
627
|
return s;
|
|
628
628
|
}
|
|
629
629
|
const X = (e, t) => ({
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
630
|
+
indentAtStart: t ? e.indent.length : e.indentAtStart,
|
|
631
|
+
lineWidth: e.options.lineWidth,
|
|
632
|
+
minContentWidth: e.options.minContentWidth,
|
|
633
|
+
}),
|
|
634
634
|
z = (e) => /^(%|---|\.\.\.)/m.test(e);
|
|
635
635
|
function Z(e, t) {
|
|
636
636
|
const n = JSON.stringify(e);
|
|
@@ -646,7 +646,7 @@ var Yaml = (function (e) {
|
|
|
646
646
|
"\\" === n[e + 1] &&
|
|
647
647
|
"n" === n[e + 2] &&
|
|
648
648
|
((r += n.slice(a, e) + "\\ "), (e += 1), (a = e), (t = "\\")),
|
|
649
|
-
|
|
649
|
+
"\\" === t)
|
|
650
650
|
)
|
|
651
651
|
switch (n[e + 1]) {
|
|
652
652
|
case "u":
|
|
@@ -681,21 +681,21 @@ var Yaml = (function (e) {
|
|
|
681
681
|
default:
|
|
682
682
|
"00" === t.substr(0, 2) ? (r += "\\x" + t.substr(2)) : (r += n.substr(e, 6));
|
|
683
683
|
}
|
|
684
|
-
(e += 5), (a = e + 1);
|
|
684
|
+
((e += 5), (a = e + 1));
|
|
685
685
|
}
|
|
686
686
|
break;
|
|
687
687
|
case "n":
|
|
688
688
|
if (s || '"' === n[e + 2] || n.length < i) e += 1;
|
|
689
689
|
else {
|
|
690
|
-
for (r += n.slice(a, e) + "\n\n"; "\\" === n[e + 2] && "n" === n[e + 3] && '"' !== n[e + 4];)
|
|
691
|
-
(r += "\n"), (e += 2);
|
|
692
|
-
(r += o), " " === n[e + 2] && (r += "\\"), (e += 1), (a = e + 1);
|
|
690
|
+
for (r += n.slice(a, e) + "\n\n"; "\\" === n[e + 2] && "n" === n[e + 3] && '"' !== n[e + 4]; )
|
|
691
|
+
((r += "\n"), (e += 2));
|
|
692
|
+
((r += o), " " === n[e + 2] && (r += "\\"), (e += 1), (a = e + 1));
|
|
693
693
|
}
|
|
694
694
|
break;
|
|
695
695
|
default:
|
|
696
696
|
e += 1;
|
|
697
697
|
}
|
|
698
|
-
return (r = a ? r + n.slice(a) : n), s ? r : Q(r, o, G, X(t, !1));
|
|
698
|
+
return ((r = a ? r + n.slice(a) : n), s ? r : Q(r, o, G, X(t, !1)));
|
|
699
699
|
}
|
|
700
700
|
function ee(e, t) {
|
|
701
701
|
if (!1 === t.options.singleQuote || (t.implicitKey && e.includes("\n")) || /[ \t]\n|\n[ \t]/.test(e))
|
|
@@ -750,9 +750,9 @@ var Yaml = (function (e) {
|
|
|
750
750
|
}
|
|
751
751
|
let d = n.substring(h);
|
|
752
752
|
const p = d.indexOf("\n");
|
|
753
|
-
-1 === p ? (f = "-") : n === d || p !== d.length - 1 ? ((f = "+"), o && o()) : (f = ""),
|
|
753
|
+
(-1 === p ? (f = "-") : n === d || p !== d.length - 1 ? ((f = "+"), o && o()) : (f = ""),
|
|
754
754
|
d &&
|
|
755
|
-
|
|
755
|
+
((n = n.slice(0, -d.length)), "\n" === d[d.length - 1] && (d = d.slice(0, -1)), (d = d.replace(ne, `$&${l}`))));
|
|
756
756
|
let m,
|
|
757
757
|
y = !1,
|
|
758
758
|
g = -1;
|
|
@@ -807,7 +807,7 @@ var Yaml = (function (e) {
|
|
|
807
807
|
return a || u || !o.includes("\n") ? te(o, t) : se(e, t, n, s);
|
|
808
808
|
if (!a && !u && i !== D.PLAIN && o.includes("\n")) return se(e, t, n, s);
|
|
809
809
|
if (z(o)) {
|
|
810
|
-
if ("" === c) return (t.forceBlockIndent = !0), se(e, t, n, s);
|
|
810
|
+
if ("" === c) return ((t.forceBlockIndent = !0), se(e, t, n, s));
|
|
811
811
|
if (a && c === l) return te(o, t);
|
|
812
812
|
}
|
|
813
813
|
const f = o.replace(/\n+/g, `$&\n${c}`);
|
|
@@ -880,7 +880,7 @@ var Yaml = (function (e) {
|
|
|
880
880
|
if (c(e)) {
|
|
881
881
|
if (t.doc.directives) return e.toString(t);
|
|
882
882
|
if (t.resolvedAliases?.has(e)) throw new TypeError("Cannot stringify circular structure without alias nodes");
|
|
883
|
-
t.resolvedAliases ? t.resolvedAliases.add(e) : (t.resolvedAliases = new Set([e])), (e = e.resolve(t.doc));
|
|
883
|
+
(t.resolvedAliases ? t.resolvedAliases.add(e) : (t.resolvedAliases = new Set([e])), (e = e.resolve(t.doc)));
|
|
884
884
|
}
|
|
885
885
|
let i;
|
|
886
886
|
const o = m(e) ? e : t.doc.createNode(e, { onTagObj: (e) => (i = e) });
|
|
@@ -899,7 +899,7 @@ var Yaml = (function (e) {
|
|
|
899
899
|
e.length > 0 && (i = e);
|
|
900
900
|
}
|
|
901
901
|
n = i.find((e) => e.format === t.format) ?? i.find((e) => !e.format);
|
|
902
|
-
} else (s = t), (n = e.find((e) => e.nodeClass && s instanceof e.nodeClass));
|
|
902
|
+
} else ((s = t), (n = e.find((e) => e.nodeClass && s instanceof e.nodeClass)));
|
|
903
903
|
if (!n)
|
|
904
904
|
throw new Error(`Tag not resolved for ${s?.constructor?.name ?? (null === s ? "null" : typeof s)} value`);
|
|
905
905
|
return n;
|
|
@@ -910,7 +910,7 @@ var Yaml = (function (e) {
|
|
|
910
910
|
o = (h(e) || p(e)) && e.anchor;
|
|
911
911
|
o && L(o) && (n.add(o), i.push(`&${o}`));
|
|
912
912
|
const r = e.tag ? e.tag : t.default ? null : t.tag;
|
|
913
|
-
return r && i.push(s.directives.tagString(r)), i.join(" ");
|
|
913
|
+
return (r && i.push(s.directives.tagString(r)), i.join(" "));
|
|
914
914
|
})(o, i, t);
|
|
915
915
|
r.length > 0 && (t.indentAtStart = (t.indentAtStart ?? 0) + r.length + 1);
|
|
916
916
|
const a = "function" == typeof i.stringify ? i.stringify(o, t, n, s) : h(o) ? ie(o, t, n, s) : o.toString(t, n, s);
|
|
@@ -943,7 +943,7 @@ var Yaml = (function (e) {
|
|
|
943
943
|
: t instanceof Set
|
|
944
944
|
? t.add(e)
|
|
945
945
|
: Object.prototype.hasOwnProperty.call(t, e) ||
|
|
946
|
-
|
|
946
|
+
Object.defineProperty(t, e, { value: n, writable: !0, enumerable: !0, configurable: !0 });
|
|
947
947
|
return t;
|
|
948
948
|
}
|
|
949
949
|
function he(e, t, { key: n, value: s }) {
|
|
@@ -960,27 +960,27 @@ var Yaml = (function (e) {
|
|
|
960
960
|
else if (t instanceof Set) t.add(i);
|
|
961
961
|
else {
|
|
962
962
|
const o = (function (e, t, n) {
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
963
|
+
if (null === t) return "";
|
|
964
|
+
if ("object" != typeof t) return String(t);
|
|
965
|
+
if (m(e) && n?.doc) {
|
|
966
|
+
const t = oe(n.doc, {});
|
|
967
|
+
t.anchors = new Set();
|
|
968
|
+
for (const e of n.anchors.keys()) t.anchors.add(e.anchor);
|
|
969
|
+
((t.inFlow = !0), (t.inStringifyKey = !0));
|
|
970
|
+
const s = e.toString(t);
|
|
971
|
+
if (!n.mapKeyWarned) {
|
|
972
|
+
let e = JSON.stringify(s);
|
|
973
|
+
(e.length > 40 && (e = e.substring(0, 36) + '..."'),
|
|
974
|
+
ae(
|
|
975
|
+
n.doc.options.logLevel,
|
|
976
|
+
`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`
|
|
977
|
+
),
|
|
978
|
+
(n.mapKeyWarned = !0));
|
|
979
|
+
}
|
|
980
|
+
return s;
|
|
979
981
|
}
|
|
980
|
-
return
|
|
981
|
-
}
|
|
982
|
-
return JSON.stringify(t);
|
|
983
|
-
})(n, i, e),
|
|
982
|
+
return JSON.stringify(t);
|
|
983
|
+
})(n, i, e),
|
|
984
984
|
r = _(s, o, e);
|
|
985
985
|
o in t ? Object.defineProperty(t, o, { value: r, writable: !0, enumerable: !0, configurable: !0 }) : (t[o] = r);
|
|
986
986
|
}
|
|
@@ -994,11 +994,11 @@ var Yaml = (function (e) {
|
|
|
994
994
|
}
|
|
995
995
|
class pe {
|
|
996
996
|
constructor(e, t = null) {
|
|
997
|
-
Object.defineProperty(this, a, { value: i }), (this.key = e), (this.value = t);
|
|
997
|
+
(Object.defineProperty(this, a, { value: i }), (this.key = e), (this.value = t));
|
|
998
998
|
}
|
|
999
999
|
clone(e) {
|
|
1000
1000
|
let { key: t, value: n } = this;
|
|
1001
|
-
return m(t) && (t = t.clone(e)), m(n) && (n = n.clone(e)), new pe(t, n);
|
|
1001
|
+
return (m(t) && (t = t.clone(e)), m(n) && (n = n.clone(e)), new pe(t, n));
|
|
1002
1002
|
}
|
|
1003
1003
|
toJSON(e, t) {
|
|
1004
1004
|
return he(t, t?.mapAsMap ? new Map() : {}, this);
|
|
@@ -1006,98 +1006,98 @@ var Yaml = (function (e) {
|
|
|
1006
1006
|
toString(e, t, n) {
|
|
1007
1007
|
return e?.doc
|
|
1008
1008
|
? (function ({ key: e, value: t }, n, s, i) {
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1009
|
+
const {
|
|
1010
|
+
allNullValues: o,
|
|
1011
|
+
doc: r,
|
|
1012
|
+
indent: a,
|
|
1013
|
+
indentStep: c,
|
|
1014
|
+
options: { commentString: l, indentSeq: u, simpleKeys: f },
|
|
1015
|
+
} = n;
|
|
1016
|
+
let y = (m(e) && e.comment) || null;
|
|
1017
|
+
if (f) {
|
|
1018
|
+
if (y) throw new Error("With simple keys, key nodes cannot have comments");
|
|
1019
|
+
if (p(e) || (!m(e) && "object" == typeof e))
|
|
1020
|
+
throw new Error("With simple keys, collection cannot be used as a key value");
|
|
1021
|
+
}
|
|
1022
|
+
let g =
|
|
1023
|
+
!f &&
|
|
1024
|
+
(!e ||
|
|
1025
|
+
(y && null == t && !n.inFlow) ||
|
|
1026
|
+
p(e) ||
|
|
1027
|
+
(h(e) ? e.type === D.BLOCK_FOLDED || e.type === D.BLOCK_LITERAL : "object" == typeof e));
|
|
1028
|
+
n = Object.assign({}, n, { allNullValues: !1, implicitKey: !g && (f || !o), indent: a + c });
|
|
1029
|
+
let b,
|
|
1030
|
+
k,
|
|
1031
|
+
w,
|
|
1032
|
+
v = !1,
|
|
1033
|
+
S = !1,
|
|
1034
|
+
E = re(
|
|
1035
|
+
e,
|
|
1036
|
+
n,
|
|
1037
|
+
() => (v = !0),
|
|
1038
|
+
() => (S = !0)
|
|
1039
|
+
);
|
|
1040
|
+
if (!g && !n.inFlow && E.length > 1024) {
|
|
1041
|
+
if (f) throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
|
|
1042
|
+
g = !0;
|
|
1043
|
+
}
|
|
1044
|
+
if (n.inFlow) {
|
|
1045
|
+
if (o || null == t) return (v && s && s(), "" === E ? "?" : g ? `? ${E}` : E);
|
|
1046
|
+
} else if ((o && !f) || (null == t && g))
|
|
1047
|
+
return ((E = `? ${E}`), y && !v ? (E += J(E, n.indent, l(y))) : S && i && i(), E);
|
|
1048
|
+
(v && (y = null),
|
|
1049
|
+
g
|
|
1050
|
+
? (y && (E += J(E, n.indent, l(y))), (E = `? ${E}\n${a}:`))
|
|
1051
|
+
: ((E = `${E}:`), y && (E += J(E, n.indent, l(y)))),
|
|
1052
|
+
m(t)
|
|
1053
|
+
? ((b = !!t.spaceBefore), (k = t.commentBefore), (w = t.comment))
|
|
1054
|
+
: ((b = !1), (k = null), (w = null), t && "object" == typeof t && (t = r.createNode(t))),
|
|
1055
|
+
(n.implicitKey = !1),
|
|
1056
|
+
g || y || !h(t) || (n.indentAtStart = E.length + 1),
|
|
1057
|
+
(S = !1),
|
|
1058
|
+
u ||
|
|
1059
|
+
!(c.length >= 2) ||
|
|
1060
|
+
n.inFlow ||
|
|
1061
|
+
g ||
|
|
1062
|
+
!d(t) ||
|
|
1063
|
+
t.flow ||
|
|
1064
|
+
t.tag ||
|
|
1065
|
+
t.anchor ||
|
|
1066
|
+
(n.indent = n.indent.substring(2)));
|
|
1067
|
+
let N = !1;
|
|
1068
|
+
const O = re(
|
|
1069
|
+
t,
|
|
1036
1070
|
n,
|
|
1037
|
-
() => (
|
|
1071
|
+
() => (N = !0),
|
|
1038
1072
|
() => (S = !0)
|
|
1039
1073
|
);
|
|
1040
|
-
|
|
1041
|
-
if (
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
if (
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
u ||
|
|
1059
|
-
!(c.length >= 2) ||
|
|
1060
|
-
n.inFlow ||
|
|
1061
|
-
g ||
|
|
1062
|
-
!d(t) ||
|
|
1063
|
-
t.flow ||
|
|
1064
|
-
t.tag ||
|
|
1065
|
-
t.anchor ||
|
|
1066
|
-
(n.indent = n.indent.substring(2));
|
|
1067
|
-
let N = !1;
|
|
1068
|
-
const O = re(
|
|
1069
|
-
t,
|
|
1070
|
-
n,
|
|
1071
|
-
() => (N = !0),
|
|
1072
|
-
() => (S = !0)
|
|
1073
|
-
);
|
|
1074
|
-
let A = " ";
|
|
1075
|
-
if (y || b || k)
|
|
1076
|
-
(A = b ? "\n" : ""),
|
|
1077
|
-
k && (A += `\n${V(l(k), n.indent)}`),
|
|
1078
|
-
"" !== O || n.inFlow ? (A += `\n${n.indent}`) : "\n" === A && (A = "\n\n");
|
|
1079
|
-
else if (!g && p(t)) {
|
|
1080
|
-
const e = O[0],
|
|
1081
|
-
s = O.indexOf("\n"),
|
|
1082
|
-
i = -1 !== s,
|
|
1083
|
-
o = n.inFlow ?? t.flow ?? 0 === t.items.length;
|
|
1084
|
-
if (i || !o) {
|
|
1085
|
-
let t = !1;
|
|
1086
|
-
if (i && ("&" === e || "!" === e)) {
|
|
1087
|
-
let n = O.indexOf(" ");
|
|
1088
|
-
"&" === e && -1 !== n && n < s && "!" === O[n + 1] && (n = O.indexOf(" ", n + 1)),
|
|
1089
|
-
(-1 === n || s < n) && (t = !0);
|
|
1074
|
+
let A = " ";
|
|
1075
|
+
if (y || b || k)
|
|
1076
|
+
((A = b ? "\n" : ""),
|
|
1077
|
+
k && (A += `\n${V(l(k), n.indent)}`),
|
|
1078
|
+
"" !== O || n.inFlow ? (A += `\n${n.indent}`) : "\n" === A && (A = "\n\n"));
|
|
1079
|
+
else if (!g && p(t)) {
|
|
1080
|
+
const e = O[0],
|
|
1081
|
+
s = O.indexOf("\n"),
|
|
1082
|
+
i = -1 !== s,
|
|
1083
|
+
o = n.inFlow ?? t.flow ?? 0 === t.items.length;
|
|
1084
|
+
if (i || !o) {
|
|
1085
|
+
let t = !1;
|
|
1086
|
+
if (i && ("&" === e || "!" === e)) {
|
|
1087
|
+
let n = O.indexOf(" ");
|
|
1088
|
+
("&" === e && -1 !== n && n < s && "!" === O[n + 1] && (n = O.indexOf(" ", n + 1)),
|
|
1089
|
+
(-1 === n || s < n) && (t = !0));
|
|
1090
|
+
}
|
|
1091
|
+
t || (A = `\n${n.indent}`);
|
|
1090
1092
|
}
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
}
|
|
1094
|
-
return (E += A + O), n.inFlow ? N && s && s() : w && !N ? (E += J(E, n.indent, l(w))) : S && i && i(), E;
|
|
1095
|
-
})(this, e, t, n)
|
|
1093
|
+
} else ("" !== O && "\n" !== O[0]) || (A = "");
|
|
1094
|
+
return ((E += A + O), n.inFlow ? N && s && s() : w && !N ? (E += J(E, n.indent, l(w))) : S && i && i(), E);
|
|
1095
|
+
})(this, e, t, n)
|
|
1096
1096
|
: JSON.stringify(this);
|
|
1097
1097
|
}
|
|
1098
1098
|
}
|
|
1099
1099
|
function me(e, t, n) {
|
|
1100
|
-
return (t.inFlow ?? e.flow ? ge : ye)(e, t, n);
|
|
1100
|
+
return ((t.inFlow ?? e.flow) ? ge : ye)(e, t, n);
|
|
1101
1101
|
}
|
|
1102
1102
|
function ye(
|
|
1103
1103
|
{ comment: e, items: t },
|
|
@@ -1105,16 +1105,16 @@ var Yaml = (function (e) {
|
|
|
1105
1105
|
{ blockItemPrefix: s, flowChars: i, itemIndent: o, onChompKeep: r, onComment: a }
|
|
1106
1106
|
) {
|
|
1107
1107
|
const {
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1108
|
+
indent: c,
|
|
1109
|
+
options: { commentString: l },
|
|
1110
|
+
} = n,
|
|
1111
1111
|
u = Object.assign({}, n, { indent: o, type: null });
|
|
1112
1112
|
let h = !1;
|
|
1113
1113
|
const d = [];
|
|
1114
1114
|
for (let e = 0; e < t.length; ++e) {
|
|
1115
1115
|
const i = t[e];
|
|
1116
1116
|
let r = null;
|
|
1117
|
-
if (m(i)) !h && i.spaceBefore && d.push(""), be(n, d, i.commentBefore, h), i.comment && (r = i.comment);
|
|
1117
|
+
if (m(i)) (!h && i.spaceBefore && d.push(""), be(n, d, i.commentBefore, h), i.comment && (r = i.comment));
|
|
1118
1118
|
else if (f(i)) {
|
|
1119
1119
|
const e = m(i.key) ? i.key : null;
|
|
1120
1120
|
e && (!h && e.spaceBefore && d.push(""), be(n, d, e.commentBefore, h));
|
|
@@ -1126,7 +1126,7 @@ var Yaml = (function (e) {
|
|
|
1126
1126
|
() => (r = null),
|
|
1127
1127
|
() => (h = !0)
|
|
1128
1128
|
);
|
|
1129
|
-
r && (a += J(a, o, l(r))), h && r && (h = !1), d.push(s + a);
|
|
1129
|
+
(r && (a += J(a, o, l(r))), h && r && (h = !1), d.push(s + a));
|
|
1130
1130
|
}
|
|
1131
1131
|
let p;
|
|
1132
1132
|
if (0 === d.length) p = i.start + i.end;
|
|
@@ -1137,7 +1137,7 @@ var Yaml = (function (e) {
|
|
|
1137
1137
|
p += t ? `\n${c}${t}` : "\n";
|
|
1138
1138
|
}
|
|
1139
1139
|
}
|
|
1140
|
-
return e ? ((p += "\n" + V(l(e), c)), a && a()) : h && r && r(), p;
|
|
1140
|
+
return (e ? ((p += "\n" + V(l(e), c)), a && a()) : h && r && r(), p);
|
|
1141
1141
|
}
|
|
1142
1142
|
function ge({ items: e }, t, { flowChars: n, itemIndent: s }) {
|
|
1143
1143
|
const {
|
|
@@ -1154,7 +1154,7 @@ var Yaml = (function (e) {
|
|
|
1154
1154
|
for (let n = 0; n < e.length; ++n) {
|
|
1155
1155
|
const i = e[n];
|
|
1156
1156
|
let o = null;
|
|
1157
|
-
if (m(i)) i.spaceBefore && h.push(""), be(t, h, i.commentBefore, !1), i.comment && (o = i.comment);
|
|
1157
|
+
if (m(i)) (i.spaceBefore && h.push(""), be(t, h, i.commentBefore, !1), i.comment && (o = i.comment));
|
|
1158
1158
|
else if (f(i)) {
|
|
1159
1159
|
const e = m(i.key) ? i.key : null;
|
|
1160
1160
|
e && (e.spaceBefore && h.push(""), be(t, h, e.commentBefore, !1), e.comment && (l = !0));
|
|
@@ -1165,11 +1165,11 @@ var Yaml = (function (e) {
|
|
|
1165
1165
|
}
|
|
1166
1166
|
o && (l = !0);
|
|
1167
1167
|
let r = re(i, c, () => (o = null));
|
|
1168
|
-
n < e.length - 1 && (r += ","),
|
|
1168
|
+
(n < e.length - 1 && (r += ","),
|
|
1169
1169
|
o && (r += J(r, s, a(o))),
|
|
1170
1170
|
!l && (h.length > u || r.includes("\n")) && (l = !0),
|
|
1171
1171
|
h.push(r),
|
|
1172
|
-
(u = h.length);
|
|
1172
|
+
(u = h.length));
|
|
1173
1173
|
}
|
|
1174
1174
|
const { start: d, end: p } = n;
|
|
1175
1175
|
if (0 === h.length) return d + p;
|
|
@@ -1203,7 +1203,7 @@ var Yaml = (function (e) {
|
|
|
1203
1203
|
return "tag:yaml.org,2002:map";
|
|
1204
1204
|
}
|
|
1205
1205
|
constructor(e) {
|
|
1206
|
-
super(s, e), (this.items = []);
|
|
1206
|
+
(super(s, e), (this.items = []));
|
|
1207
1207
|
}
|
|
1208
1208
|
static from(e, t, n) {
|
|
1209
1209
|
const { keepUndefined: s, replacer: i } = n,
|
|
@@ -1215,7 +1215,7 @@ var Yaml = (function (e) {
|
|
|
1215
1215
|
};
|
|
1216
1216
|
if (t instanceof Map) for (const [e, n] of t) r(e, n);
|
|
1217
1217
|
else if (t && "object" == typeof t) for (const e of Object.keys(t)) r(e, t[e]);
|
|
1218
|
-
return "function" == typeof e.sortMapEntries && o.items.sort(e.sortMapEntries), o;
|
|
1218
|
+
return ("function" == typeof e.sortMapEntries && o.items.sort(e.sortMapEntries), o);
|
|
1219
1219
|
}
|
|
1220
1220
|
add(e, t) {
|
|
1221
1221
|
let n;
|
|
@@ -1281,7 +1281,7 @@ var Yaml = (function (e) {
|
|
|
1281
1281
|
return "tag:yaml.org,2002:seq";
|
|
1282
1282
|
}
|
|
1283
1283
|
constructor(e) {
|
|
1284
|
-
super(r, e), (this.items = []);
|
|
1284
|
+
(super(r, e), (this.items = []));
|
|
1285
1285
|
}
|
|
1286
1286
|
add(e) {
|
|
1287
1287
|
this.items.push(e);
|
|
@@ -1317,12 +1317,12 @@ var Yaml = (function (e) {
|
|
|
1317
1317
|
toString(e, t, n) {
|
|
1318
1318
|
return e
|
|
1319
1319
|
? me(this, e, {
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1320
|
+
blockItemPrefix: "- ",
|
|
1321
|
+
flowChars: { start: "[", end: "]" },
|
|
1322
|
+
itemIndent: (e.indent || "") + " ",
|
|
1323
|
+
onChompKeep: n,
|
|
1324
|
+
onComment: t,
|
|
1325
|
+
})
|
|
1326
1326
|
: JSON.stringify(this);
|
|
1327
1327
|
}
|
|
1328
1328
|
static from(e, t, n) {
|
|
@@ -1344,17 +1344,18 @@ var Yaml = (function (e) {
|
|
|
1344
1344
|
function Ee(e) {
|
|
1345
1345
|
let t = h(e) ? e.value : e;
|
|
1346
1346
|
return (
|
|
1347
|
-
t && "string" == typeof t && (t = Number(t)),
|
|
1347
|
+
t && "string" == typeof t && (t = Number(t)),
|
|
1348
|
+
"number" == typeof t && Number.isInteger(t) && t >= 0 ? t : null
|
|
1348
1349
|
);
|
|
1349
1350
|
}
|
|
1350
1351
|
const Ne = {
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1352
|
+
collection: "seq",
|
|
1353
|
+
default: !0,
|
|
1354
|
+
nodeClass: Se,
|
|
1355
|
+
tag: "tag:yaml.org,2002:seq",
|
|
1356
|
+
resolve: (e, t) => (d(e) || t("Expected a sequence for this tag"), e),
|
|
1357
|
+
createNode: (e, t, n) => Se.from(e, t, n),
|
|
1358
|
+
},
|
|
1358
1359
|
Oe = {
|
|
1359
1360
|
identify: (e) => "string" == typeof e,
|
|
1360
1361
|
default: !0,
|
|
@@ -1393,19 +1394,19 @@ var Yaml = (function (e) {
|
|
|
1393
1394
|
let e = o.indexOf(".");
|
|
1394
1395
|
e < 0 && ((e = o.length), (o += "."));
|
|
1395
1396
|
let n = t - (o.length - e - 1);
|
|
1396
|
-
for (; n-- > 0;) o += "0";
|
|
1397
|
+
for (; n-- > 0; ) o += "0";
|
|
1397
1398
|
}
|
|
1398
1399
|
return o;
|
|
1399
1400
|
}
|
|
1400
1401
|
const Le = {
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1402
|
+
identify: (e) => "number" == typeof e,
|
|
1403
|
+
default: !0,
|
|
1404
|
+
tag: "tag:yaml.org,2002:float",
|
|
1405
|
+
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
1406
|
+
resolve: (e) =>
|
|
1407
|
+
"nan" === e.slice(-3).toLowerCase() ? NaN : "-" === e[0] ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
|
1408
|
+
stringify: Te,
|
|
1409
|
+
},
|
|
1409
1410
|
xe = {
|
|
1410
1411
|
identify: (e) => "number" == typeof e,
|
|
1411
1412
|
default: !0,
|
|
@@ -1426,7 +1427,7 @@ var Yaml = (function (e) {
|
|
|
1426
1427
|
resolve(e) {
|
|
1427
1428
|
const t = new D(parseFloat(e)),
|
|
1428
1429
|
n = e.indexOf(".");
|
|
1429
|
-
return -1 !== n && "0" === e[e.length - 1] && (t.minFractionDigits = e.length - n - 1), t;
|
|
1430
|
+
return (-1 !== n && "0" === e[e.length - 1] && (t.minFractionDigits = e.length - n - 1), t);
|
|
1430
1431
|
},
|
|
1431
1432
|
stringify: Te,
|
|
1432
1433
|
},
|
|
@@ -1437,14 +1438,14 @@ var Yaml = (function (e) {
|
|
|
1437
1438
|
return Ce(s) && s >= 0 ? n + s.toString(t) : Te(e);
|
|
1438
1439
|
}
|
|
1439
1440
|
const Be = {
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1441
|
+
identify: (e) => Ce(e) && e >= 0,
|
|
1442
|
+
default: !0,
|
|
1443
|
+
tag: "tag:yaml.org,2002:int",
|
|
1444
|
+
format: "OCT",
|
|
1445
|
+
test: /^0o[0-7]+$/,
|
|
1446
|
+
resolve: (e, t, n) => _e(e, 2, 8, n),
|
|
1447
|
+
stringify: (e) => Ke(e, 8, "0o"),
|
|
1448
|
+
},
|
|
1448
1449
|
je = {
|
|
1449
1450
|
identify: Ce,
|
|
1450
1451
|
default: !0,
|
|
@@ -1523,7 +1524,7 @@ var Yaml = (function (e) {
|
|
|
1523
1524
|
for (let e = 0; e < t.length; ++e) n[e] = t.charCodeAt(e);
|
|
1524
1525
|
return n;
|
|
1525
1526
|
}
|
|
1526
|
-
return t("This environment does not support reading binary tags; either Buffer or atob is required"), e;
|
|
1527
|
+
return (t("This environment does not support reading binary tags; either Buffer or atob is required"), e);
|
|
1527
1528
|
},
|
|
1528
1529
|
stringify({ comment: e, type: t, value: n }, s, i, o) {
|
|
1529
1530
|
if (!n) return "";
|
|
@@ -1559,7 +1560,7 @@ var Yaml = (function (e) {
|
|
|
1559
1560
|
(e.key.commentBefore = e.key.commentBefore
|
|
1560
1561
|
? `${s.commentBefore}\n${e.key.commentBefore}`
|
|
1561
1562
|
: s.commentBefore),
|
|
1562
|
-
|
|
1563
|
+
s.comment)
|
|
1563
1564
|
) {
|
|
1564
1565
|
const t = e.value ?? e.key;
|
|
1565
1566
|
t.comment = t.comment ? `${s.comment}\n${t.comment}` : s.comment;
|
|
@@ -1582,11 +1583,11 @@ var Yaml = (function (e) {
|
|
|
1582
1583
|
let r, a;
|
|
1583
1584
|
if (("function" == typeof s && (e = s.call(t, String(o++), e)), Array.isArray(e))) {
|
|
1584
1585
|
if (2 !== e.length) throw new TypeError(`Expected [key, value] tuple: ${e}`);
|
|
1585
|
-
(r = e[0]), (a = e[1]);
|
|
1586
|
+
((r = e[0]), (a = e[1]));
|
|
1586
1587
|
} else if (e && e instanceof Object) {
|
|
1587
1588
|
const t = Object.keys(e);
|
|
1588
1589
|
if (1 !== t.length) throw new TypeError(`Expected tuple with one key, not ${t.length} keys`);
|
|
1589
|
-
(r = t[0]), (a = e[r]);
|
|
1590
|
+
((r = t[0]), (a = e[r]));
|
|
1590
1591
|
} else r = e;
|
|
1591
1592
|
i.items.push(de(r, a, n));
|
|
1592
1593
|
}
|
|
@@ -1595,13 +1596,13 @@ var Yaml = (function (e) {
|
|
|
1595
1596
|
const Je = { collection: "seq", default: !1, tag: "tag:yaml.org,2002:pairs", resolve: Fe, createNode: Ve };
|
|
1596
1597
|
class Ye extends Se {
|
|
1597
1598
|
constructor() {
|
|
1598
|
-
super(),
|
|
1599
|
+
(super(),
|
|
1599
1600
|
(this.add = we.prototype.add.bind(this)),
|
|
1600
1601
|
(this.delete = we.prototype.delete.bind(this)),
|
|
1601
1602
|
(this.get = we.prototype.get.bind(this)),
|
|
1602
1603
|
(this.has = we.prototype.has.bind(this)),
|
|
1603
1604
|
(this.set = we.prototype.set.bind(this)),
|
|
1604
|
-
(this.tag = Ye.tag);
|
|
1605
|
+
(this.tag = Ye.tag));
|
|
1605
1606
|
}
|
|
1606
1607
|
toJSON(e, t) {
|
|
1607
1608
|
if (!t) return super.toJSON(e);
|
|
@@ -1618,7 +1619,7 @@ var Yaml = (function (e) {
|
|
|
1618
1619
|
static from(e, t, n) {
|
|
1619
1620
|
const s = Ve(e, t, n),
|
|
1620
1621
|
i = new this();
|
|
1621
|
-
return (i.items = s.items), i;
|
|
1622
|
+
return ((i.items = s.items), i);
|
|
1622
1623
|
}
|
|
1623
1624
|
}
|
|
1624
1625
|
Ye.tag = "tag:yaml.org,2002:omap";
|
|
@@ -1641,13 +1642,13 @@ var Yaml = (function (e) {
|
|
|
1641
1642
|
return t && (e ? Qe : He).test.test(t) ? t : e ? n.options.trueStr : n.options.falseStr;
|
|
1642
1643
|
}
|
|
1643
1644
|
const Qe = {
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1645
|
+
identify: (e) => !0 === e,
|
|
1646
|
+
default: !0,
|
|
1647
|
+
tag: "tag:yaml.org,2002:bool",
|
|
1648
|
+
test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
|
|
1649
|
+
resolve: () => new D(!0),
|
|
1650
|
+
stringify: Ge,
|
|
1651
|
+
},
|
|
1651
1652
|
He = {
|
|
1652
1653
|
identify: (e) => !1 === e,
|
|
1653
1654
|
default: !0,
|
|
@@ -1722,14 +1723,14 @@ var Yaml = (function (e) {
|
|
|
1722
1723
|
return Te(e);
|
|
1723
1724
|
}
|
|
1724
1725
|
const st = {
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1726
|
+
identify: et,
|
|
1727
|
+
default: !0,
|
|
1728
|
+
tag: "tag:yaml.org,2002:int",
|
|
1729
|
+
format: "BIN",
|
|
1730
|
+
test: /^[-+]?0b[0-1_]+$/,
|
|
1731
|
+
resolve: (e, t, n) => tt(e, 2, 2, n),
|
|
1732
|
+
stringify: (e) => nt(e, 2, "0b"),
|
|
1733
|
+
},
|
|
1733
1734
|
it = {
|
|
1734
1735
|
identify: et,
|
|
1735
1736
|
default: !0,
|
|
@@ -1758,7 +1759,7 @@ var Yaml = (function (e) {
|
|
|
1758
1759
|
};
|
|
1759
1760
|
class at extends we {
|
|
1760
1761
|
constructor(e) {
|
|
1761
|
-
super(e), (this.tag = at.tag);
|
|
1762
|
+
(super(e), (this.tag = at.tag));
|
|
1762
1763
|
}
|
|
1763
1764
|
add(e) {
|
|
1764
1765
|
let t;
|
|
@@ -1791,7 +1792,7 @@ var Yaml = (function (e) {
|
|
|
1791
1792
|
const { replacer: s } = n,
|
|
1792
1793
|
i = new this(e);
|
|
1793
1794
|
if (t && Symbol.iterator in Object(t))
|
|
1794
|
-
for (let e of t) "function" == typeof s && (e = s.call(t, e, e)), i.items.push(de(e, null, n));
|
|
1795
|
+
for (let e of t) ("function" == typeof s && (e = s.call(t, e, e)), i.items.push(de(e, null, n)));
|
|
1795
1796
|
return i;
|
|
1796
1797
|
}
|
|
1797
1798
|
}
|
|
@@ -1833,21 +1834,21 @@ var Yaml = (function (e) {
|
|
|
1833
1834
|
return (
|
|
1834
1835
|
t < 60 ? o.unshift(0) : ((t = (t - o[0]) / i), o.unshift(t % i), t >= 60 && ((t = (t - o[0]) / i), o.unshift(t))),
|
|
1835
1836
|
s +
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1837
|
+
o
|
|
1838
|
+
.map((e) => String(e).padStart(2, "0"))
|
|
1839
|
+
.join(":")
|
|
1840
|
+
.replace(/000000\d*$/, "")
|
|
1840
1841
|
);
|
|
1841
1842
|
}
|
|
1842
1843
|
const ft = {
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1844
|
+
identify: (e) => "bigint" == typeof e || Number.isInteger(e),
|
|
1845
|
+
default: !0,
|
|
1846
|
+
tag: "tag:yaml.org,2002:int",
|
|
1847
|
+
format: "TIME",
|
|
1848
|
+
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
|
|
1849
|
+
resolve: (e, t, { intAsBigInt: n }) => lt(e, n),
|
|
1850
|
+
stringify: ut,
|
|
1851
|
+
},
|
|
1851
1852
|
ht = {
|
|
1852
1853
|
identify: (e) => "number" == typeof e,
|
|
1853
1854
|
default: !0,
|
|
@@ -1873,7 +1874,7 @@ var Yaml = (function (e) {
|
|
|
1873
1874
|
const u = t[8];
|
|
1874
1875
|
if (u && "Z" !== u) {
|
|
1875
1876
|
let e = lt(u, !1);
|
|
1876
|
-
Math.abs(e) < 30 && (e *= 60), (l -= 6e4 * e);
|
|
1877
|
+
(Math.abs(e) < 30 && (e *= 60), (l -= 6e4 * e));
|
|
1877
1878
|
}
|
|
1878
1879
|
return new Date(l);
|
|
1879
1880
|
},
|
|
@@ -1942,7 +1943,7 @@ var Yaml = (function (e) {
|
|
|
1942
1943
|
.join(", ");
|
|
1943
1944
|
throw new Error(`Unknown custom tag ${e}; use one of ${n}`);
|
|
1944
1945
|
}
|
|
1945
|
-
return e.includes(n) || e.push(n), e;
|
|
1946
|
+
return (e.includes(n) || e.push(n), e);
|
|
1946
1947
|
}, [])
|
|
1947
1948
|
);
|
|
1948
1949
|
}
|
|
@@ -1957,7 +1958,7 @@ var Yaml = (function (e) {
|
|
|
1957
1958
|
sortMapEntries: c,
|
|
1958
1959
|
toStringDefaults: l,
|
|
1959
1960
|
}) {
|
|
1960
|
-
(this.compat = Array.isArray(e) ? bt(e, "compat") : e ? bt(null, e) : null),
|
|
1961
|
+
((this.compat = Array.isArray(e) ? bt(e, "compat") : e ? bt(null, e) : null),
|
|
1961
1962
|
(this.name = ("string" == typeof a && a) || "core"),
|
|
1962
1963
|
(this.knownTags = i ? gt : {}),
|
|
1963
1964
|
(this.tags = bt(t, this.name, n)),
|
|
@@ -1965,20 +1966,20 @@ var Yaml = (function (e) {
|
|
|
1965
1966
|
Object.defineProperty(this, s, { value: ve }),
|
|
1966
1967
|
Object.defineProperty(this, o, { value: Oe }),
|
|
1967
1968
|
Object.defineProperty(this, r, { value: Ne }),
|
|
1968
|
-
(this.sortMapEntries = "function" == typeof c ? c : !0 === c ? kt : null);
|
|
1969
|
+
(this.sortMapEntries = "function" == typeof c ? c : !0 === c ? kt : null));
|
|
1969
1970
|
}
|
|
1970
1971
|
clone() {
|
|
1971
1972
|
const e = Object.create(wt.prototype, Object.getOwnPropertyDescriptors(this));
|
|
1972
|
-
return (e.tags = this.tags.slice()), e;
|
|
1973
|
+
return ((e.tags = this.tags.slice()), e);
|
|
1973
1974
|
}
|
|
1974
1975
|
}
|
|
1975
1976
|
class vt {
|
|
1976
1977
|
constructor(e, t, s) {
|
|
1977
|
-
(this.commentBefore = null),
|
|
1978
|
+
((this.commentBefore = null),
|
|
1978
1979
|
(this.comment = null),
|
|
1979
1980
|
(this.errors = []),
|
|
1980
1981
|
(this.warnings = []),
|
|
1981
|
-
Object.defineProperty(this, a, { value: n });
|
|
1982
|
+
Object.defineProperty(this, a, { value: n }));
|
|
1982
1983
|
let i = null;
|
|
1983
1984
|
"function" == typeof t || Array.isArray(t) ? (i = t) : void 0 === s && t && ((s = t), (t = void 0));
|
|
1984
1985
|
const o = Object.assign(
|
|
@@ -1996,12 +1997,12 @@ var Yaml = (function (e) {
|
|
|
1996
1997
|
);
|
|
1997
1998
|
this.options = o;
|
|
1998
1999
|
let { version: r } = o;
|
|
1999
|
-
s?._directives
|
|
2000
|
+
(s?._directives
|
|
2000
2001
|
? ((this.directives = s._directives.atDocument()),
|
|
2001
2002
|
this.directives.yaml.explicit && (r = this.directives.yaml.version))
|
|
2002
2003
|
: (this.directives = new T({ version: r })),
|
|
2003
2004
|
this.setSchema(r, s),
|
|
2004
|
-
(this.contents = void 0 === e ? null : this.createNode(e, i, s));
|
|
2005
|
+
(this.contents = void 0 === e ? null : this.createNode(e, i, s)));
|
|
2005
2006
|
}
|
|
2006
2007
|
clone() {
|
|
2007
2008
|
const e = Object.create(vt.prototype, { [a]: { value: n } });
|
|
@@ -2033,11 +2034,11 @@ var Yaml = (function (e) {
|
|
|
2033
2034
|
}
|
|
2034
2035
|
createNode(e, t, n) {
|
|
2035
2036
|
let s;
|
|
2036
|
-
if ("function" == typeof t) (e = t.call({ "": e }, "", e)), (s = t);
|
|
2037
|
+
if ("function" == typeof t) ((e = t.call({ "": e }, "", e)), (s = t));
|
|
2037
2038
|
else if (Array.isArray(t)) {
|
|
2038
2039
|
const e = (e) => "number" == typeof e || e instanceof String || e instanceof Number,
|
|
2039
2040
|
n = t.filter(e).map(String);
|
|
2040
|
-
n.length > 0 && (t = t.concat(n)), (s = t);
|
|
2041
|
+
(n.length > 0 && (t = t.concat(n)), (s = t));
|
|
2041
2042
|
} else void 0 === n && t && ((n = t), (t = void 0));
|
|
2042
2043
|
const { aliasDuplicateObjects: i, anchorPrefix: o, flow: r, keepUndefined: a, onTagObj: c, tag: l } = n ?? {},
|
|
2043
2044
|
{
|
|
@@ -2050,9 +2051,9 @@ var Yaml = (function (e) {
|
|
|
2050
2051
|
let i = null;
|
|
2051
2052
|
return {
|
|
2052
2053
|
onAnchor: (s) => {
|
|
2053
|
-
n.push(s), i || (i = x(e));
|
|
2054
|
+
(n.push(s), i || (i = x(e)));
|
|
2054
2055
|
const o = $(t, i);
|
|
2055
|
-
return i.add(o), o;
|
|
2056
|
+
return (i.add(o), o);
|
|
2056
2057
|
},
|
|
2057
2058
|
setAnchors: () => {
|
|
2058
2059
|
for (const e of n) {
|
|
@@ -2076,7 +2077,7 @@ var Yaml = (function (e) {
|
|
|
2076
2077
|
schema: this.schema,
|
|
2077
2078
|
sourceObjects: d,
|
|
2078
2079
|
});
|
|
2079
|
-
return r && p(m) && (m.flow = !0), f(), m;
|
|
2080
|
+
return (r && p(m) && (m.flow = !0), f(), m);
|
|
2080
2081
|
}
|
|
2081
2082
|
createPair(e, t, n = {}) {
|
|
2082
2083
|
const s = this.createNode(e, null, n),
|
|
@@ -2123,16 +2124,16 @@ var Yaml = (function (e) {
|
|
|
2123
2124
|
let n;
|
|
2124
2125
|
switch (("number" == typeof e && (e = String(e)), e)) {
|
|
2125
2126
|
case "1.1":
|
|
2126
|
-
this.directives ? (this.directives.yaml.version = "1.1") : (this.directives = new T({ version: "1.1" })),
|
|
2127
|
-
(n = { resolveKnownTags: !1, schema: "yaml-1.1" });
|
|
2127
|
+
(this.directives ? (this.directives.yaml.version = "1.1") : (this.directives = new T({ version: "1.1" })),
|
|
2128
|
+
(n = { resolveKnownTags: !1, schema: "yaml-1.1" }));
|
|
2128
2129
|
break;
|
|
2129
2130
|
case "1.2":
|
|
2130
2131
|
case "next":
|
|
2131
|
-
this.directives ? (this.directives.yaml.version = e) : (this.directives = new T({ version: e })),
|
|
2132
|
-
(n = { resolveKnownTags: !0, schema: "core" });
|
|
2132
|
+
(this.directives ? (this.directives.yaml.version = e) : (this.directives = new T({ version: e })),
|
|
2133
|
+
(n = { resolveKnownTags: !0, schema: "core" }));
|
|
2133
2134
|
break;
|
|
2134
2135
|
case null:
|
|
2135
|
-
this.directives && delete this.directives, (n = null);
|
|
2136
|
+
(this.directives && delete this.directives, (n = null));
|
|
2136
2137
|
break;
|
|
2137
2138
|
default: {
|
|
2138
2139
|
const t = JSON.stringify(e);
|
|
@@ -2147,13 +2148,13 @@ var Yaml = (function (e) {
|
|
|
2147
2148
|
}
|
|
2148
2149
|
toJS({ json: e, jsonArg: t, mapAsMap: n, maxAliasCount: s, onAnchor: i, reviver: o } = {}) {
|
|
2149
2150
|
const r = {
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2151
|
+
anchors: new Map(),
|
|
2152
|
+
doc: this,
|
|
2153
|
+
keep: !e,
|
|
2154
|
+
mapAsMap: !0 === n,
|
|
2155
|
+
mapKeyWarned: !1,
|
|
2156
|
+
maxAliasCount: "number" == typeof s ? s : 100,
|
|
2157
|
+
},
|
|
2157
2158
|
a = _(this.contents, t ?? "", r);
|
|
2158
2159
|
if ("function" == typeof i) for (const { count: e, res: t } of r.anchors.values()) i(t, e);
|
|
2159
2160
|
return "function" == typeof o ? C(o, { "": a }, "", a) : a;
|
|
@@ -2190,12 +2191,12 @@ var Yaml = (function (e) {
|
|
|
2190
2191
|
const t = o(e.contents.commentBefore);
|
|
2191
2192
|
n.push(V(t, ""));
|
|
2192
2193
|
}
|
|
2193
|
-
(i.forceBlockIndent = !!e.comment), (a = e.contents.comment);
|
|
2194
|
+
((i.forceBlockIndent = !!e.comment), (a = e.contents.comment));
|
|
2194
2195
|
}
|
|
2195
2196
|
const t = a ? void 0 : () => (r = !0);
|
|
2196
2197
|
let c = re(e.contents, i, () => (a = null), t);
|
|
2197
|
-
a && (c += J(c, "", o(a))),
|
|
2198
|
-
("|" !== c[0] && ">" !== c[0]) || "---" !== n[n.length - 1] ? n.push(c) : (n[n.length - 1] = `--- ${c}`);
|
|
2198
|
+
(a && (c += J(c, "", o(a))),
|
|
2199
|
+
("|" !== c[0] && ">" !== c[0]) || "---" !== n[n.length - 1] ? n.push(c) : (n[n.length - 1] = `--- ${c}`));
|
|
2199
2200
|
} else n.push(re(e.contents, i));
|
|
2200
2201
|
if (e.directives?.docEnd)
|
|
2201
2202
|
if (e.comment) {
|
|
@@ -2204,8 +2205,8 @@ var Yaml = (function (e) {
|
|
|
2204
2205
|
} else n.push("...");
|
|
2205
2206
|
else {
|
|
2206
2207
|
let t = e.comment;
|
|
2207
|
-
t && r && (t = t.replace(/^\n+/, "")),
|
|
2208
|
-
t && ((r && !a) || "" === n[n.length - 1] || n.push(""), n.push(V(o(t), "")));
|
|
2208
|
+
(t && r && (t = t.replace(/^\n+/, "")),
|
|
2209
|
+
t && ((r && !a) || "" === n[n.length - 1] || n.push(""), n.push(V(o(t), ""))));
|
|
2209
2210
|
}
|
|
2210
2211
|
return n.join("\n") + "\n";
|
|
2211
2212
|
})(this, e);
|
|
@@ -2217,7 +2218,7 @@ var Yaml = (function (e) {
|
|
|
2217
2218
|
}
|
|
2218
2219
|
class Et extends Error {
|
|
2219
2220
|
constructor(e, t, n, s) {
|
|
2220
|
-
super(), (this.name = e), (this.code = n), (this.message = s), (this.pos = t);
|
|
2221
|
+
(super(), (this.name = e), (this.code = n), (this.message = s), (this.pos = t));
|
|
2221
2222
|
}
|
|
2222
2223
|
}
|
|
2223
2224
|
class Nt extends Et {
|
|
@@ -2239,11 +2240,11 @@ var Yaml = (function (e) {
|
|
|
2239
2240
|
r = e.substring(t.lineStarts[s - 1], t.lineStarts[s]).replace(/[\n\r]+$/, "");
|
|
2240
2241
|
if (o >= 60 && r.length > 80) {
|
|
2241
2242
|
const e = Math.min(o - 39, r.length - 79);
|
|
2242
|
-
(r = "…" + r.substring(e)), (o -= e - 1);
|
|
2243
|
+
((r = "…" + r.substring(e)), (o -= e - 1));
|
|
2243
2244
|
}
|
|
2244
2245
|
if ((r.length > 80 && (r = r.substring(0, 79) + "…"), s > 1 && /^ *$/.test(r.substring(0, o)))) {
|
|
2245
2246
|
let n = e.substring(t.lineStarts[s - 2], t.lineStarts[s - 1]);
|
|
2246
|
-
n.length > 80 && (n = n.substring(0, 79) + "…\n"), (r = n + r);
|
|
2247
|
+
(n.length > 80 && (n = n.substring(0, 79) + "…\n"), (r = n + r));
|
|
2247
2248
|
}
|
|
2248
2249
|
if (/[^ ]/.test(r)) {
|
|
2249
2250
|
let e = 1;
|
|
@@ -2270,82 +2271,82 @@ var Yaml = (function (e) {
|
|
|
2270
2271
|
v = null;
|
|
2271
2272
|
for (const i of e)
|
|
2272
2273
|
switch (
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2274
|
+
(p &&
|
|
2275
|
+
("space" !== i.type &&
|
|
2276
|
+
"newline" !== i.type &&
|
|
2277
|
+
"comma" !== i.type &&
|
|
2278
|
+
o(i.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"),
|
|
2278
2279
|
(p = !1)),
|
|
2279
2280
|
m &&
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2281
|
+
(l &&
|
|
2282
|
+
"comment" !== i.type &&
|
|
2283
|
+
"newline" !== i.type &&
|
|
2284
|
+
o(m, "TAB_AS_INDENT", "Tabs are not allowed as indentation"),
|
|
2284
2285
|
(m = null)),
|
|
2285
2286
|
i.type)
|
|
2286
2287
|
) {
|
|
2287
2288
|
case "space":
|
|
2288
|
-
t || ("doc-start" === n && "flow-collection" === s?.type) || !i.source.includes("\t") || (m = i), (u = !0);
|
|
2289
|
+
(t || ("doc-start" === n && "flow-collection" === s?.type) || !i.source.includes("\t") || (m = i), (u = !0));
|
|
2289
2290
|
break;
|
|
2290
2291
|
case "comment": {
|
|
2291
2292
|
u || o(i, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
|
|
2292
2293
|
const e = i.source.substring(1) || " ";
|
|
2293
|
-
f ? (f += h + e) : (f = e), (h = ""), (l = !1);
|
|
2294
|
+
(f ? (f += h + e) : (f = e), (h = ""), (l = !1));
|
|
2294
2295
|
break;
|
|
2295
2296
|
}
|
|
2296
2297
|
case "newline":
|
|
2297
|
-
l ? (f ? (f += i.source) : (w && "seq-item-ind" === n) || (c = !0)) : (h += i.source),
|
|
2298
|
+
(l ? (f ? (f += i.source) : (w && "seq-item-ind" === n) || (c = !0)) : (h += i.source),
|
|
2298
2299
|
(l = !0),
|
|
2299
2300
|
(d = !0),
|
|
2300
2301
|
(y || g) && (b = i),
|
|
2301
|
-
(u = !0);
|
|
2302
|
+
(u = !0));
|
|
2302
2303
|
break;
|
|
2303
2304
|
case "anchor":
|
|
2304
|
-
y && o(i, "MULTIPLE_ANCHORS", "A node can have at most one anchor"),
|
|
2305
|
+
(y && o(i, "MULTIPLE_ANCHORS", "A node can have at most one anchor"),
|
|
2305
2306
|
i.source.endsWith(":") &&
|
|
2306
|
-
|
|
2307
|
+
o(i.offset + i.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", !0),
|
|
2307
2308
|
(y = i),
|
|
2308
2309
|
null === v && (v = i.offset),
|
|
2309
2310
|
(l = !1),
|
|
2310
2311
|
(u = !1),
|
|
2311
|
-
(p = !0);
|
|
2312
|
+
(p = !0));
|
|
2312
2313
|
break;
|
|
2313
2314
|
case "tag":
|
|
2314
|
-
g && o(i, "MULTIPLE_TAGS", "A node can have at most one tag"),
|
|
2315
|
+
(g && o(i, "MULTIPLE_TAGS", "A node can have at most one tag"),
|
|
2315
2316
|
(g = i),
|
|
2316
2317
|
null === v && (v = i.offset),
|
|
2317
2318
|
(l = !1),
|
|
2318
2319
|
(u = !1),
|
|
2319
|
-
(p = !0);
|
|
2320
|
+
(p = !0));
|
|
2320
2321
|
break;
|
|
2321
2322
|
case n:
|
|
2322
|
-
(y || g) && o(i, "BAD_PROP_ORDER", `Anchors and tags must be after the ${i.source} indicator`),
|
|
2323
|
+
((y || g) && o(i, "BAD_PROP_ORDER", `Anchors and tags must be after the ${i.source} indicator`),
|
|
2323
2324
|
w && o(i, "UNEXPECTED_TOKEN", `Unexpected ${i.source} in ${t ?? "collection"}`),
|
|
2324
2325
|
(w = i),
|
|
2325
2326
|
(l = "seq-item-ind" === n || "explicit-key-ind" === n),
|
|
2326
|
-
(u = !1);
|
|
2327
|
+
(u = !1));
|
|
2327
2328
|
break;
|
|
2328
2329
|
case "comma":
|
|
2329
2330
|
if (t) {
|
|
2330
|
-
k && o(i, "UNEXPECTED_TOKEN", `Unexpected , in ${t}`), (k = i), (l = !1), (u = !1);
|
|
2331
|
+
(k && o(i, "UNEXPECTED_TOKEN", `Unexpected , in ${t}`), (k = i), (l = !1), (u = !1));
|
|
2331
2332
|
break;
|
|
2332
2333
|
}
|
|
2333
2334
|
default:
|
|
2334
|
-
o(i, "UNEXPECTED_TOKEN", `Unexpected ${i.type} token`), (l = !1), (u = !1);
|
|
2335
|
+
(o(i, "UNEXPECTED_TOKEN", `Unexpected ${i.type} token`), (l = !1), (u = !1));
|
|
2335
2336
|
}
|
|
2336
2337
|
const S = e[e.length - 1],
|
|
2337
2338
|
E = S ? S.offset + S.source.length : i;
|
|
2338
2339
|
return (
|
|
2339
2340
|
p &&
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2341
|
+
s &&
|
|
2342
|
+
"space" !== s.type &&
|
|
2343
|
+
"newline" !== s.type &&
|
|
2344
|
+
"comma" !== s.type &&
|
|
2345
|
+
("scalar" !== s.type || "" !== s.source) &&
|
|
2346
|
+
o(s.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"),
|
|
2346
2347
|
m &&
|
|
2347
|
-
|
|
2348
|
-
|
|
2348
|
+
((l && m.indent <= r) || "block-map" === s?.type || "block-seq" === s?.type) &&
|
|
2349
|
+
o(m, "TAB_AS_INDENT", "Tabs are not allowed as indentation"),
|
|
2349
2350
|
{
|
|
2350
2351
|
comma: k,
|
|
2351
2352
|
found: w,
|
|
@@ -2410,11 +2411,11 @@ var Yaml = (function (e) {
|
|
|
2410
2411
|
case "comment": {
|
|
2411
2412
|
n && !o && s(a, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
|
|
2412
2413
|
const t = e.substring(1) || " ";
|
|
2413
|
-
i ? (i += r + t) : (i = t), (r = "");
|
|
2414
|
+
(i ? (i += r + t) : (i = t), (r = ""));
|
|
2414
2415
|
break;
|
|
2415
2416
|
}
|
|
2416
2417
|
case "newline":
|
|
2417
|
-
i && (r += e), (o = !0);
|
|
2418
|
+
(i && (r += e), (o = !0));
|
|
2418
2419
|
break;
|
|
2419
2420
|
default:
|
|
2420
2421
|
s(a, "UNEXPECTED_TOKEN", `Unexpected ${c} at node end`);
|
|
@@ -2428,257 +2429,257 @@ var Yaml = (function (e) {
|
|
|
2428
2429
|
Kt = (e) => e && ("block-map" === e.type || "block-seq" === e.type);
|
|
2429
2430
|
function Bt(e, t, n, s, i, o) {
|
|
2430
2431
|
const r =
|
|
2431
|
-
|
|
2432
|
-
? (function ({ composeNode: e, composeEmptyNode: t }, n, s, i, o) {
|
|
2433
|
-
const r = new (o?.nodeClass ?? we)(n.schema);
|
|
2434
|
-
n.atRoot && (n.atRoot = !1);
|
|
2435
|
-
let a = s.offset,
|
|
2436
|
-
c = null;
|
|
2437
|
-
for (const o of s.items) {
|
|
2438
|
-
const { start: l, key: u, sep: f, value: h } = o,
|
|
2439
|
-
d = It(l, {
|
|
2440
|
-
indicator: "explicit-key-ind",
|
|
2441
|
-
next: u ?? f?.[0],
|
|
2442
|
-
offset: a,
|
|
2443
|
-
onError: i,
|
|
2444
|
-
parentIndent: s.indent,
|
|
2445
|
-
startOnNewline: !0,
|
|
2446
|
-
}),
|
|
2447
|
-
p = !d.found;
|
|
2448
|
-
if (p) {
|
|
2449
|
-
if (
|
|
2450
|
-
(u &&
|
|
2451
|
-
("block-seq" === u.type
|
|
2452
|
-
? i(a, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key")
|
|
2453
|
-
: "indent" in u && u.indent !== s.indent && i(a, "BAD_INDENT", $t)),
|
|
2454
|
-
!d.anchor && !d.tag && !f)
|
|
2455
|
-
) {
|
|
2456
|
-
(c = d.end), d.comment && (r.comment ? (r.comment += "\n" + d.comment) : (r.comment = d.comment));
|
|
2457
|
-
continue;
|
|
2458
|
-
}
|
|
2459
|
-
(d.newlineAfterProp || Tt(u)) &&
|
|
2460
|
-
i(u ?? l[l.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
|
2461
|
-
} else d.found?.indent !== s.indent && i(a, "BAD_INDENT", $t);
|
|
2462
|
-
n.atKey = !0;
|
|
2463
|
-
const m = d.end,
|
|
2464
|
-
y = u ? e(n, u, d, i) : t(n, m, l, null, d, i);
|
|
2465
|
-
n.schema.compat && Lt(s.indent, u, i),
|
|
2466
|
-
(n.atKey = !1),
|
|
2467
|
-
xt(n, r.items, y) && i(m, "DUPLICATE_KEY", "Map keys must be unique");
|
|
2468
|
-
const g = It(f ?? [], {
|
|
2469
|
-
indicator: "map-value-ind",
|
|
2470
|
-
next: h,
|
|
2471
|
-
offset: y.range[2],
|
|
2472
|
-
onError: i,
|
|
2473
|
-
parentIndent: s.indent,
|
|
2474
|
-
startOnNewline: !u || "block-scalar" === u.type,
|
|
2475
|
-
});
|
|
2476
|
-
if (((a = g.end), g.found)) {
|
|
2477
|
-
p &&
|
|
2478
|
-
("block-map" !== h?.type ||
|
|
2479
|
-
g.hasNewline ||
|
|
2480
|
-
i(a, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"),
|
|
2481
|
-
n.options.strict &&
|
|
2482
|
-
d.start < g.found.offset - 1024 &&
|
|
2483
|
-
i(
|
|
2484
|
-
y.range,
|
|
2485
|
-
"KEY_OVER_1024_CHARS",
|
|
2486
|
-
"The : indicator must be at most 1024 chars after the start of an implicit block mapping key"
|
|
2487
|
-
));
|
|
2488
|
-
const c = h ? e(n, h, g, i) : t(n, a, f, null, g, i);
|
|
2489
|
-
n.schema.compat && Lt(s.indent, h, i), (a = c.range[2]);
|
|
2490
|
-
const l = new pe(y, c);
|
|
2491
|
-
n.options.keepSourceTokens && (l.srcToken = o), r.items.push(l);
|
|
2492
|
-
} else {
|
|
2493
|
-
p && i(y.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"),
|
|
2494
|
-
g.comment && (y.comment ? (y.comment += "\n" + g.comment) : (y.comment = g.comment));
|
|
2495
|
-
const e = new pe(y);
|
|
2496
|
-
n.options.keepSourceTokens && (e.srcToken = o), r.items.push(e);
|
|
2497
|
-
}
|
|
2498
|
-
}
|
|
2499
|
-
return (
|
|
2500
|
-
c && c < a && i(c, "IMPOSSIBLE", "Map comment with trailing content"),
|
|
2501
|
-
(r.range = [s.offset, a, c ?? a]),
|
|
2502
|
-
r
|
|
2503
|
-
);
|
|
2504
|
-
})(e, t, n, s, o)
|
|
2505
|
-
: "block-seq" === n.type
|
|
2432
|
+
"block-map" === n.type
|
|
2506
2433
|
? (function ({ composeNode: e, composeEmptyNode: t }, n, s, i, o) {
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
flow: a,
|
|
2547
|
-
indicator: "explicit-key-ind",
|
|
2548
|
-
next: d ?? p?.[0],
|
|
2549
|
-
offset: u,
|
|
2434
|
+
const r = new (o?.nodeClass ?? we)(n.schema);
|
|
2435
|
+
n.atRoot && (n.atRoot = !1);
|
|
2436
|
+
let a = s.offset,
|
|
2437
|
+
c = null;
|
|
2438
|
+
for (const o of s.items) {
|
|
2439
|
+
const { start: l, key: u, sep: f, value: h } = o,
|
|
2440
|
+
d = It(l, {
|
|
2441
|
+
indicator: "explicit-key-ind",
|
|
2442
|
+
next: u ?? f?.[0],
|
|
2443
|
+
offset: a,
|
|
2444
|
+
onError: i,
|
|
2445
|
+
parentIndent: s.indent,
|
|
2446
|
+
startOnNewline: !0,
|
|
2447
|
+
}),
|
|
2448
|
+
p = !d.found;
|
|
2449
|
+
if (p) {
|
|
2450
|
+
if (
|
|
2451
|
+
(u &&
|
|
2452
|
+
("block-seq" === u.type
|
|
2453
|
+
? i(a, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key")
|
|
2454
|
+
: "indent" in u && u.indent !== s.indent && i(a, "BAD_INDENT", $t)),
|
|
2455
|
+
!d.anchor && !d.tag && !f)
|
|
2456
|
+
) {
|
|
2457
|
+
((c = d.end), d.comment && (r.comment ? (r.comment += "\n" + d.comment) : (r.comment = d.comment)));
|
|
2458
|
+
continue;
|
|
2459
|
+
}
|
|
2460
|
+
(d.newlineAfterProp || Tt(u)) &&
|
|
2461
|
+
i(u ?? l[l.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
|
2462
|
+
} else d.found?.indent !== s.indent && i(a, "BAD_INDENT", $t);
|
|
2463
|
+
n.atKey = !0;
|
|
2464
|
+
const m = d.end,
|
|
2465
|
+
y = u ? e(n, u, d, i) : t(n, m, l, null, d, i);
|
|
2466
|
+
(n.schema.compat && Lt(s.indent, u, i),
|
|
2467
|
+
(n.atKey = !1),
|
|
2468
|
+
xt(n, r.items, y) && i(m, "DUPLICATE_KEY", "Map keys must be unique"));
|
|
2469
|
+
const g = It(f ?? [], {
|
|
2470
|
+
indicator: "map-value-ind",
|
|
2471
|
+
next: h,
|
|
2472
|
+
offset: y.range[2],
|
|
2550
2473
|
onError: i,
|
|
2551
2474
|
parentIndent: s.indent,
|
|
2552
|
-
startOnNewline: !
|
|
2475
|
+
startOnNewline: !u || "block-scalar" === u.type,
|
|
2553
2476
|
});
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2477
|
+
if (((a = g.end), g.found)) {
|
|
2478
|
+
p &&
|
|
2479
|
+
("block-map" !== h?.type ||
|
|
2480
|
+
g.hasNewline ||
|
|
2481
|
+
i(a, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"),
|
|
2482
|
+
n.options.strict &&
|
|
2483
|
+
d.start < g.found.offset - 1024 &&
|
|
2484
|
+
i(
|
|
2485
|
+
y.range,
|
|
2486
|
+
"KEY_OVER_1024_CHARS",
|
|
2487
|
+
"The : indicator must be at most 1024 chars after the start of an implicit block mapping key"
|
|
2488
|
+
));
|
|
2489
|
+
const c = h ? e(n, h, g, i) : t(n, a, f, null, g, i);
|
|
2490
|
+
(n.schema.compat && Lt(s.indent, h, i), (a = c.range[2]));
|
|
2491
|
+
const l = new pe(y, c);
|
|
2492
|
+
(n.options.keepSourceTokens && (l.srcToken = o), r.items.push(l));
|
|
2493
|
+
} else {
|
|
2494
|
+
(p && i(y.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"),
|
|
2495
|
+
g.comment && (y.comment ? (y.comment += "\n" + g.comment) : (y.comment = g.comment)));
|
|
2496
|
+
const e = new pe(y);
|
|
2497
|
+
(n.options.keepSourceTokens && (e.srcToken = o), r.items.push(e));
|
|
2562
2498
|
}
|
|
2563
|
-
!r &&
|
|
2564
|
-
n.options.strict &&
|
|
2565
|
-
Tt(d) &&
|
|
2566
|
-
i(
|
|
2567
|
-
d,
|
|
2568
|
-
"MULTILINE_IMPLICIT_KEY",
|
|
2569
|
-
"Implicit keys of flow sequence pairs need to be on a single line"
|
|
2570
|
-
);
|
|
2571
2499
|
}
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2500
|
+
return (
|
|
2501
|
+
c && c < a && i(c, "IMPOSSIBLE", "Map comment with trailing content"),
|
|
2502
|
+
(r.range = [s.offset, a, c ?? a]),
|
|
2503
|
+
r
|
|
2504
|
+
);
|
|
2505
|
+
})(e, t, n, s, o)
|
|
2506
|
+
: "block-seq" === n.type
|
|
2507
|
+
? (function ({ composeNode: e, composeEmptyNode: t }, n, s, i, o) {
|
|
2508
|
+
const r = new (o?.nodeClass ?? Se)(n.schema);
|
|
2509
|
+
(n.atRoot && (n.atRoot = !1), n.atKey && (n.atKey = !1));
|
|
2510
|
+
let a = s.offset,
|
|
2511
|
+
c = null;
|
|
2512
|
+
for (const { start: o, value: l } of s.items) {
|
|
2513
|
+
const u = It(o, {
|
|
2514
|
+
indicator: "seq-item-ind",
|
|
2515
|
+
next: l,
|
|
2516
|
+
offset: a,
|
|
2517
|
+
onError: i,
|
|
2518
|
+
parentIndent: s.indent,
|
|
2519
|
+
startOnNewline: !0,
|
|
2520
|
+
});
|
|
2521
|
+
if (!u.found) {
|
|
2522
|
+
if (!(u.anchor || u.tag || l)) {
|
|
2523
|
+
((c = u.end), u.comment && (r.comment = u.comment));
|
|
2524
|
+
continue;
|
|
2525
|
+
}
|
|
2526
|
+
l && "block-seq" === l.type
|
|
2527
|
+
? i(u.end, "BAD_INDENT", "All sequence items must start at the same column")
|
|
2528
|
+
: i(a, "MISSING_CHAR", "Sequence item without - indicator");
|
|
2585
2529
|
}
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
f(t) && (t = t.value ?? t.key),
|
|
2589
|
-
t.comment ? (t.comment += "\n" + e) : (t.comment = e),
|
|
2590
|
-
(y.comment = y.comment.substring(e.length + 1));
|
|
2530
|
+
const f = l ? e(n, l, u, i) : t(n, u.end, o, null, u, i);
|
|
2531
|
+
(n.schema.compat && Lt(s.indent, l, i), (a = f.range[2]), r.items.push(f));
|
|
2591
2532
|
}
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
const
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2533
|
+
return ((r.range = [s.offset, a, c ?? a]), r);
|
|
2534
|
+
})(e, t, n, s, o)
|
|
2535
|
+
: (function ({ composeNode: e, composeEmptyNode: t }, n, s, i, o) {
|
|
2536
|
+
const r = "{" === s.start.source,
|
|
2537
|
+
a = r ? "flow map" : "flow sequence",
|
|
2538
|
+
c = new (o?.nodeClass ?? (r ? we : Se))(n.schema);
|
|
2539
|
+
c.flow = !0;
|
|
2540
|
+
const l = n.atRoot;
|
|
2541
|
+
(l && (n.atRoot = !1), n.atKey && (n.atKey = !1));
|
|
2542
|
+
let u = s.offset + s.start.source.length;
|
|
2543
|
+
for (let o = 0; o < s.items.length; ++o) {
|
|
2544
|
+
const l = s.items[o],
|
|
2545
|
+
{ start: h, key: d, sep: p, value: m } = l,
|
|
2546
|
+
y = It(h, {
|
|
2547
|
+
flow: a,
|
|
2548
|
+
indicator: "explicit-key-ind",
|
|
2549
|
+
next: d ?? p?.[0],
|
|
2550
|
+
offset: u,
|
|
2551
|
+
onError: i,
|
|
2552
|
+
parentIndent: s.indent,
|
|
2553
|
+
startOnNewline: !1,
|
|
2554
|
+
});
|
|
2555
|
+
if (!y.found) {
|
|
2556
|
+
if (!(y.anchor || y.tag || p || m)) {
|
|
2557
|
+
(0 === o && y.comma
|
|
2558
|
+
? i(y.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${a}`)
|
|
2559
|
+
: o < s.items.length - 1 && i(y.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${a}`),
|
|
2560
|
+
y.comment && (c.comment ? (c.comment += "\n" + y.comment) : (c.comment = y.comment)),
|
|
2561
|
+
(u = y.end));
|
|
2562
|
+
continue;
|
|
2563
|
+
}
|
|
2564
|
+
!r &&
|
|
2565
|
+
n.options.strict &&
|
|
2566
|
+
Tt(d) &&
|
|
2567
|
+
i(
|
|
2568
|
+
d,
|
|
2569
|
+
"MULTILINE_IMPLICIT_KEY",
|
|
2570
|
+
"Implicit keys of flow sequence pairs need to be on a single line"
|
|
2571
|
+
);
|
|
2572
|
+
}
|
|
2573
|
+
if (0 === o) y.comma && i(y.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${a}`);
|
|
2574
|
+
else if ((y.comma || i(y.start, "MISSING_CHAR", `Missing , between ${a} items`), y.comment)) {
|
|
2575
|
+
let e = "";
|
|
2576
|
+
e: for (const t of h)
|
|
2577
|
+
switch (t.type) {
|
|
2578
|
+
case "comma":
|
|
2579
|
+
case "space":
|
|
2580
|
+
break;
|
|
2581
|
+
case "comment":
|
|
2582
|
+
e = t.source.substring(1);
|
|
2583
|
+
break e;
|
|
2584
|
+
default:
|
|
2585
|
+
break e;
|
|
2586
|
+
}
|
|
2587
|
+
if (e) {
|
|
2588
|
+
let t = c.items[c.items.length - 1];
|
|
2589
|
+
(f(t) && (t = t.value ?? t.key),
|
|
2590
|
+
t.comment ? (t.comment += "\n" + e) : (t.comment = e),
|
|
2591
|
+
(y.comment = y.comment.substring(e.length + 1)));
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2594
|
+
if (r || p || y.found) {
|
|
2595
|
+
n.atKey = !0;
|
|
2596
|
+
const o = y.end,
|
|
2597
|
+
f = d ? e(n, d, y, i) : t(n, o, h, null, y, i);
|
|
2598
|
+
(Kt(d) && i(f.range, "BLOCK_IN_FLOW", _t), (n.atKey = !1));
|
|
2599
|
+
const g = It(p ?? [], {
|
|
2600
|
+
flow: a,
|
|
2601
|
+
indicator: "map-value-ind",
|
|
2602
|
+
next: m,
|
|
2603
|
+
offset: f.range[2],
|
|
2604
|
+
onError: i,
|
|
2605
|
+
parentIndent: s.indent,
|
|
2606
|
+
startOnNewline: !1,
|
|
2607
|
+
});
|
|
2608
|
+
if (g.found) {
|
|
2609
|
+
if (!r && !y.found && n.options.strict) {
|
|
2610
|
+
if (p)
|
|
2611
|
+
for (const e of p) {
|
|
2612
|
+
if (e === g.found) break;
|
|
2613
|
+
if ("newline" === e.type) {
|
|
2614
|
+
i(
|
|
2615
|
+
e,
|
|
2616
|
+
"MULTILINE_IMPLICIT_KEY",
|
|
2617
|
+
"Implicit keys of flow sequence pairs need to be on a single line"
|
|
2618
|
+
);
|
|
2619
|
+
break;
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2622
|
+
y.start < g.found.offset - 1024 &&
|
|
2613
2623
|
i(
|
|
2614
|
-
|
|
2615
|
-
"
|
|
2616
|
-
"
|
|
2624
|
+
g.found,
|
|
2625
|
+
"KEY_OVER_1024_CHARS",
|
|
2626
|
+
"The : indicator must be at most 1024 chars after the start of an implicit flow sequence key"
|
|
2617
2627
|
);
|
|
2618
|
-
break;
|
|
2619
|
-
}
|
|
2620
2628
|
}
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2629
|
+
} else
|
|
2630
|
+
m &&
|
|
2631
|
+
("source" in m && m.source && ":" === m.source[0]
|
|
2632
|
+
? i(m, "MISSING_CHAR", `Missing space after : in ${a}`)
|
|
2633
|
+
: i(g.start, "MISSING_CHAR", `Missing , or : between ${a} items`));
|
|
2634
|
+
const b = m ? e(n, m, g, i) : g.found ? t(n, g.end, p, null, g, i) : null;
|
|
2635
|
+
b
|
|
2636
|
+
? Kt(m) && i(b.range, "BLOCK_IN_FLOW", _t)
|
|
2637
|
+
: g.comment && (f.comment ? (f.comment += "\n" + g.comment) : (f.comment = g.comment));
|
|
2638
|
+
const k = new pe(f, b);
|
|
2639
|
+
if ((n.options.keepSourceTokens && (k.srcToken = l), r)) {
|
|
2640
|
+
const e = c;
|
|
2641
|
+
(xt(n, e.items, f) && i(o, "DUPLICATE_KEY", "Map keys must be unique"), e.items.push(k));
|
|
2642
|
+
} else {
|
|
2643
|
+
const e = new we(n.schema);
|
|
2644
|
+
((e.flow = !0), e.items.push(k));
|
|
2645
|
+
const t = (b ?? f).range;
|
|
2646
|
+
((e.range = [f.range[0], t[1], t[2]]), c.items.push(e));
|
|
2647
|
+
}
|
|
2648
|
+
u = b ? b.range[2] : g.end;
|
|
2649
|
+
} else {
|
|
2650
|
+
const s = m ? e(n, m, y, i) : t(n, y.end, p, null, y, i);
|
|
2651
|
+
(c.items.push(s), (u = s.range[2]), Kt(m) && i(s.range, "BLOCK_IN_FLOW", _t));
|
|
2627
2652
|
}
|
|
2628
|
-
} else
|
|
2629
|
-
m &&
|
|
2630
|
-
("source" in m && m.source && ":" === m.source[0]
|
|
2631
|
-
? i(m, "MISSING_CHAR", `Missing space after : in ${a}`)
|
|
2632
|
-
: i(g.start, "MISSING_CHAR", `Missing , or : between ${a} items`));
|
|
2633
|
-
const b = m ? e(n, m, g, i) : g.found ? t(n, g.end, p, null, g, i) : null;
|
|
2634
|
-
b
|
|
2635
|
-
? Kt(m) && i(b.range, "BLOCK_IN_FLOW", _t)
|
|
2636
|
-
: g.comment && (f.comment ? (f.comment += "\n" + g.comment) : (f.comment = g.comment));
|
|
2637
|
-
const k = new pe(f, b);
|
|
2638
|
-
if ((n.options.keepSourceTokens && (k.srcToken = l), r)) {
|
|
2639
|
-
const e = c;
|
|
2640
|
-
xt(n, e.items, f) && i(o, "DUPLICATE_KEY", "Map keys must be unique"), e.items.push(k);
|
|
2641
|
-
} else {
|
|
2642
|
-
const e = new we(n.schema);
|
|
2643
|
-
(e.flow = !0), e.items.push(k);
|
|
2644
|
-
const t = (b ?? f).range;
|
|
2645
|
-
(e.range = [f.range[0], t[1], t[2]]), c.items.push(e);
|
|
2646
2653
|
}
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
const e = Ct(p, m, n.options.strict, i);
|
|
2670
|
-
e.comment && (c.comment ? (c.comment += "\n" + e.comment) : (c.comment = e.comment)),
|
|
2671
|
-
(c.range = [s.offset, m, e.offset]);
|
|
2672
|
-
} else c.range = [s.offset, m, m];
|
|
2673
|
-
return c;
|
|
2674
|
-
})(e, t, n, s, o),
|
|
2654
|
+
const h = r ? "}" : "]",
|
|
2655
|
+
[d, ...p] = s.end;
|
|
2656
|
+
let m = u;
|
|
2657
|
+
if (d && d.source === h) m = d.offset + d.source.length;
|
|
2658
|
+
else {
|
|
2659
|
+
const e = a[0].toUpperCase() + a.substring(1);
|
|
2660
|
+
(i(
|
|
2661
|
+
u,
|
|
2662
|
+
l ? "MISSING_CHAR" : "BAD_INDENT",
|
|
2663
|
+
l
|
|
2664
|
+
? `${e} must end with a ${h}`
|
|
2665
|
+
: `${e} in block collection must be sufficiently indented and end with a ${h}`
|
|
2666
|
+
),
|
|
2667
|
+
d && 1 !== d.source.length && p.unshift(d));
|
|
2668
|
+
}
|
|
2669
|
+
if (p.length > 0) {
|
|
2670
|
+
const e = Ct(p, m, n.options.strict, i);
|
|
2671
|
+
(e.comment && (c.comment ? (c.comment += "\n" + e.comment) : (c.comment = e.comment)),
|
|
2672
|
+
(c.range = [s.offset, m, e.offset]));
|
|
2673
|
+
} else c.range = [s.offset, m, m];
|
|
2674
|
+
return c;
|
|
2675
|
+
})(e, t, n, s, o),
|
|
2675
2676
|
a = r.constructor;
|
|
2676
2677
|
return "!" === i || i === a.tagName ? ((r.tag = a.tagName), r) : (i && (r.tag = i), r);
|
|
2677
2678
|
}
|
|
2678
2679
|
function jt(e, t, n) {
|
|
2679
2680
|
const s = t.offset,
|
|
2680
2681
|
i = (function ({ offset: e, props: t }, n, s) {
|
|
2681
|
-
if ("block-scalar-header" !== t[0].type) return s(t[0], "IMPOSSIBLE", "Block scalar header not found"), null;
|
|
2682
|
+
if ("block-scalar-header" !== t[0].type) return (s(t[0], "IMPOSSIBLE", "Block scalar header not found"), null);
|
|
2682
2683
|
const { source: i } = t[0],
|
|
2683
2684
|
o = i[0];
|
|
2684
2685
|
let r = 0,
|
|
@@ -2707,10 +2708,10 @@ var Yaml = (function (e) {
|
|
|
2707
2708
|
if (n && !l) {
|
|
2708
2709
|
s(i, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
|
|
2709
2710
|
}
|
|
2710
|
-
(f += i.source.length), (u = i.source.substring(1));
|
|
2711
|
+
((f += i.source.length), (u = i.source.substring(1)));
|
|
2711
2712
|
break;
|
|
2712
2713
|
case "error":
|
|
2713
|
-
s(i, "UNEXPECTED_TOKEN", i.message), (f += i.source.length);
|
|
2714
|
+
(s(i, "UNEXPECTED_TOKEN", i.message), (f += i.source.length));
|
|
2714
2715
|
break;
|
|
2715
2716
|
default: {
|
|
2716
2717
|
s(i, "UNEXPECTED_TOKEN", `Unexpected token in block scalar header: ${i.type}`);
|
|
@@ -2725,13 +2726,13 @@ var Yaml = (function (e) {
|
|
|
2725
2726
|
const o = ">" === i.mode ? D.BLOCK_FOLDED : D.BLOCK_LITERAL,
|
|
2726
2727
|
r = t.source
|
|
2727
2728
|
? (function (e) {
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2729
|
+
const t = e.split(/\n( *)/),
|
|
2730
|
+
n = t[0],
|
|
2731
|
+
s = n.match(/^( *)/),
|
|
2732
|
+
i = [s?.[1] ? [s[1], n.slice(s[1].length)] : ["", n]];
|
|
2733
|
+
for (let e = 1; e < t.length; e += 2) i.push([t[e], t[e + 1]]);
|
|
2734
|
+
return i;
|
|
2735
|
+
})(t.source)
|
|
2735
2736
|
: [];
|
|
2736
2737
|
let a = r.length;
|
|
2737
2738
|
for (let e = r.length - 1; e >= 0; --e) {
|
|
@@ -2742,7 +2743,7 @@ var Yaml = (function (e) {
|
|
|
2742
2743
|
if (0 === a) {
|
|
2743
2744
|
const e = "+" === i.chomp && r.length > 0 ? "\n".repeat(Math.max(1, r.length - 1)) : "";
|
|
2744
2745
|
let n = s + i.length;
|
|
2745
|
-
return t.source && (n += t.source.length), { value: e, type: o, comment: i.comment, range: [s, n, n] };
|
|
2746
|
+
return (t.source && (n += t.source.length), { value: e, type: o, comment: i.comment, range: [s, n, n] });
|
|
2746
2747
|
}
|
|
2747
2748
|
let c = t.indent + i.indent,
|
|
2748
2749
|
l = t.offset + i.length,
|
|
@@ -2759,7 +2760,7 @@ var Yaml = (function (e) {
|
|
|
2759
2760
|
}
|
|
2760
2761
|
break;
|
|
2761
2762
|
}
|
|
2762
|
-
0 === i.indent && s.length > c && (c = s.length), (l += s.length + o.length + 1);
|
|
2763
|
+
(0 === i.indent && s.length > c && (c = s.length), (l += s.length + o.length + 1));
|
|
2763
2764
|
}
|
|
2764
2765
|
for (let e = r.length - 1; e >= a; --e) r[e][0].length > c && (a = e + 1);
|
|
2765
2766
|
let f = "",
|
|
@@ -2772,7 +2773,7 @@ var Yaml = (function (e) {
|
|
|
2772
2773
|
const a = "\r" === s[s.length - 1];
|
|
2773
2774
|
if ((a && (s = s.slice(0, -1)), s && t.length < c)) {
|
|
2774
2775
|
const e = `Block scalar lines must not be less indented than their ${i.indent ? "explicit indentation indicator" : "first line"}`;
|
|
2775
|
-
n(l - s.length - (a ? 2 : 1), "BAD_INDENT", e), (t = "");
|
|
2776
|
+
(n(l - s.length - (a ? 2 : 1), "BAD_INDENT", e), (t = ""));
|
|
2776
2777
|
}
|
|
2777
2778
|
o === D.BLOCK_LITERAL
|
|
2778
2779
|
? ((f += h + t.slice(c) + s), (h = "\n"))
|
|
@@ -2803,7 +2804,7 @@ var Yaml = (function (e) {
|
|
|
2803
2804
|
const l = (e, t, i) => n(s + e, t, i);
|
|
2804
2805
|
switch (i) {
|
|
2805
2806
|
case "scalar":
|
|
2806
|
-
(a = D.PLAIN),
|
|
2807
|
+
((a = D.PLAIN),
|
|
2807
2808
|
(c = (function (e, t) {
|
|
2808
2809
|
let n = "";
|
|
2809
2810
|
switch (e[0]) {
|
|
@@ -2826,17 +2827,17 @@ var Yaml = (function (e) {
|
|
|
2826
2827
|
}
|
|
2827
2828
|
n && t(0, "BAD_SCALAR_START", `Plain value cannot start with ${n}`);
|
|
2828
2829
|
return Dt(e);
|
|
2829
|
-
})(o, l));
|
|
2830
|
+
})(o, l)));
|
|
2830
2831
|
break;
|
|
2831
2832
|
case "single-quoted-scalar":
|
|
2832
|
-
(a = D.QUOTE_SINGLE),
|
|
2833
|
+
((a = D.QUOTE_SINGLE),
|
|
2833
2834
|
(c = (function (e, t) {
|
|
2834
2835
|
("'" === e[e.length - 1] && 1 !== e.length) || t(e.length, "MISSING_CHAR", "Missing closing 'quote");
|
|
2835
2836
|
return Dt(e.slice(1, -1)).replace(/''/g, "'");
|
|
2836
|
-
})(o, l));
|
|
2837
|
+
})(o, l)));
|
|
2837
2838
|
break;
|
|
2838
2839
|
case "double-quoted-scalar":
|
|
2839
|
-
(a = D.QUOTE_DOUBLE),
|
|
2840
|
+
((a = D.QUOTE_DOUBLE),
|
|
2840
2841
|
(c = (function (e, t) {
|
|
2841
2842
|
let n = "";
|
|
2842
2843
|
for (let s = 1; s < e.length - 1; ++s) {
|
|
@@ -2844,31 +2845,31 @@ var Yaml = (function (e) {
|
|
|
2844
2845
|
if ("\r" !== i || "\n" !== e[s + 1])
|
|
2845
2846
|
if ("\n" === i) {
|
|
2846
2847
|
const { fold: t, offset: i } = qt(e, s);
|
|
2847
|
-
(n += t), (s = i);
|
|
2848
|
+
((n += t), (s = i));
|
|
2848
2849
|
} else if ("\\" === i) {
|
|
2849
2850
|
let i = e[++s];
|
|
2850
2851
|
const o = Pt[i];
|
|
2851
2852
|
if (o) n += o;
|
|
2852
|
-
else if ("\n" === i) for (i = e[s + 1]; " " === i || "\t" === i;) i = e[1 + ++s];
|
|
2853
|
+
else if ("\n" === i) for (i = e[s + 1]; " " === i || "\t" === i; ) i = e[1 + ++s];
|
|
2853
2854
|
else if ("\r" === i && "\n" === e[s + 1])
|
|
2854
|
-
for (i = e[1 + ++s]; " " === i || "\t" === i;) i = e[1 + ++s];
|
|
2855
|
+
for (i = e[1 + ++s]; " " === i || "\t" === i; ) i = e[1 + ++s];
|
|
2855
2856
|
else if ("x" === i || "u" === i || "U" === i) {
|
|
2856
2857
|
const o = { x: 2, u: 4, U: 8 }[i];
|
|
2857
|
-
(n += Ut(e, s + 1, o, t)), (s += o);
|
|
2858
|
+
((n += Ut(e, s + 1, o, t)), (s += o));
|
|
2858
2859
|
} else {
|
|
2859
2860
|
const i = e.substr(s - 1, 2);
|
|
2860
|
-
t(s - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${i}`), (n += i);
|
|
2861
|
+
(t(s - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${i}`), (n += i));
|
|
2861
2862
|
}
|
|
2862
2863
|
} else if (" " === i || "\t" === i) {
|
|
2863
2864
|
const t = s;
|
|
2864
2865
|
let o = e[s + 1];
|
|
2865
|
-
for (; " " === o || "\t" === o;) o = e[1 + ++s];
|
|
2866
|
+
for (; " " === o || "\t" === o; ) o = e[1 + ++s];
|
|
2866
2867
|
"\n" === o || ("\r" === o && "\n" === e[s + 2]) || (n += s > t ? e.slice(t, s + 1) : i);
|
|
2867
2868
|
} else n += i;
|
|
2868
2869
|
}
|
|
2869
2870
|
('"' === e[e.length - 1] && 1 !== e.length) || t(e.length, "MISSING_CHAR", 'Missing closing "quote');
|
|
2870
2871
|
return n;
|
|
2871
|
-
})(o, l));
|
|
2872
|
+
})(o, l)));
|
|
2872
2873
|
break;
|
|
2873
2874
|
default:
|
|
2874
2875
|
return (
|
|
@@ -2883,27 +2884,27 @@ var Yaml = (function (e) {
|
|
|
2883
2884
|
function Dt(e) {
|
|
2884
2885
|
let t, n;
|
|
2885
2886
|
try {
|
|
2886
|
-
(t = new RegExp("(.*?)(?<![ \t])[ \t]*\r?\n", "sy")),
|
|
2887
|
-
(n = new RegExp("[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n", "sy"));
|
|
2887
|
+
((t = new RegExp("(.*?)(?<![ \t])[ \t]*\r?\n", "sy")),
|
|
2888
|
+
(n = new RegExp("[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n", "sy")));
|
|
2888
2889
|
} catch {
|
|
2889
|
-
(t = /(.*?)[ \t]*\r?\n/sy), (n = /[ \t]*(.*?)[ \t]*\r?\n/sy);
|
|
2890
|
+
((t = /(.*?)[ \t]*\r?\n/sy), (n = /[ \t]*(.*?)[ \t]*\r?\n/sy));
|
|
2890
2891
|
}
|
|
2891
2892
|
let s = t.exec(e);
|
|
2892
2893
|
if (!s) return e;
|
|
2893
2894
|
let i = s[1],
|
|
2894
2895
|
o = " ",
|
|
2895
2896
|
r = t.lastIndex;
|
|
2896
|
-
for (n.lastIndex = r; (s = n.exec(e));)
|
|
2897
|
-
"" === s[1] ? ("\n" === o ? (i += o) : (o = "\n")) : ((i += o + s[1]), (o = " ")), (r = n.lastIndex);
|
|
2897
|
+
for (n.lastIndex = r; (s = n.exec(e)); )
|
|
2898
|
+
("" === s[1] ? ("\n" === o ? (i += o) : (o = "\n")) : ((i += o + s[1]), (o = " ")), (r = n.lastIndex));
|
|
2898
2899
|
const a = /[ \t]*(.*)/sy;
|
|
2899
|
-
return (a.lastIndex = r), (s = a.exec(e)), i + o + (s?.[1] ?? "");
|
|
2900
|
+
return ((a.lastIndex = r), (s = a.exec(e)), i + o + (s?.[1] ?? ""));
|
|
2900
2901
|
}
|
|
2901
2902
|
function qt(e, t) {
|
|
2902
2903
|
let n = "",
|
|
2903
2904
|
s = e[t + 1];
|
|
2904
|
-
for (; !((" " !== s && "\t" !== s && "\n" !== s && "\r" !== s) || ("\r" === s && "\n" !== e[t + 2]));)
|
|
2905
|
-
"\n" === s && (n += "\n"), (s = e[(t += 1) + 1]);
|
|
2906
|
-
return n || (n = " "), { fold: n, offset: t };
|
|
2905
|
+
for (; !((" " !== s && "\t" !== s && "\n" !== s && "\r" !== s) || ("\r" === s && "\n" !== e[t + 2])); )
|
|
2906
|
+
("\n" === s && (n += "\n"), (s = e[(t += 1) + 1]));
|
|
2907
|
+
return (n || (n = " "), { fold: n, offset: t });
|
|
2907
2908
|
}
|
|
2908
2909
|
const Pt = {
|
|
2909
2910
|
0: "\0",
|
|
@@ -2930,17 +2931,17 @@ var Yaml = (function (e) {
|
|
|
2930
2931
|
o = i.length === n && /^[0-9a-fA-F]+$/.test(i) ? parseInt(i, 16) : NaN;
|
|
2931
2932
|
if (isNaN(o)) {
|
|
2932
2933
|
const i = e.substr(t - 2, n + 2);
|
|
2933
|
-
return s(t - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${i}`), i;
|
|
2934
|
+
return (s(t - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${i}`), i);
|
|
2934
2935
|
}
|
|
2935
2936
|
return String.fromCodePoint(o);
|
|
2936
2937
|
}
|
|
2937
2938
|
function Rt(e, t, n, s) {
|
|
2938
2939
|
const {
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2940
|
+
value: i,
|
|
2941
|
+
type: r,
|
|
2942
|
+
comment: a,
|
|
2943
|
+
range: c,
|
|
2944
|
+
} = "block-scalar" === t.type ? jt(e, t, s) : Mt(t, e.options.strict, s),
|
|
2944
2945
|
l = n ? e.directives.tagName(n.source, (e) => s(n, "TAG_RESOLVE_FAILED", e)) : null;
|
|
2945
2946
|
let u, f;
|
|
2946
2947
|
u =
|
|
@@ -2948,42 +2949,42 @@ var Yaml = (function (e) {
|
|
|
2948
2949
|
? e.schema[o]
|
|
2949
2950
|
: l
|
|
2950
2951
|
? (function (e, t, n, s, i) {
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2952
|
+
if ("!" === n) return e[o];
|
|
2953
|
+
const r = [];
|
|
2954
|
+
for (const t of e.tags)
|
|
2955
|
+
if (!t.collection && t.tag === n) {
|
|
2956
|
+
if (!t.default || !t.test) return t;
|
|
2957
|
+
r.push(t);
|
|
2958
|
+
}
|
|
2959
|
+
for (const e of r) if (e.test?.test(t)) return e;
|
|
2960
|
+
const a = e.knownTags[n];
|
|
2961
|
+
if (a && !a.collection) return (e.tags.push(Object.assign({}, a, { default: !1, test: void 0 })), a);
|
|
2962
|
+
return (i(s, "TAG_RESOLVE_FAILED", `Unresolved tag: ${n}`, "tag:yaml.org,2002:str" !== n), e[o]);
|
|
2963
|
+
})(e.schema, i, l, n, s)
|
|
2963
2964
|
: "scalar" === t.type
|
|
2964
2965
|
? (function ({ atKey: e, directives: t, schema: n }, s, i, r) {
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2966
|
+
const a =
|
|
2967
|
+
n.tags.find((t) => (!0 === t.default || (e && "key" === t.default)) && t.test?.test(s)) || n[o];
|
|
2968
|
+
if (n.compat) {
|
|
2969
|
+
const e = n.compat.find((e) => e.default && e.test?.test(s)) ?? n[o];
|
|
2970
|
+
if (a.tag !== e.tag) {
|
|
2971
|
+
r(
|
|
2972
|
+
i,
|
|
2973
|
+
"TAG_RESOLVE_FAILED",
|
|
2974
|
+
`Value may be parsed as either ${t.tagString(a.tag)} or ${t.tagString(e.tag)}`,
|
|
2975
|
+
!0
|
|
2976
|
+
);
|
|
2977
|
+
}
|
|
2976
2978
|
}
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
})(e, i, t, s)
|
|
2979
|
+
return a;
|
|
2980
|
+
})(e, i, t, s)
|
|
2980
2981
|
: e.schema[o];
|
|
2981
2982
|
try {
|
|
2982
2983
|
const o = u.resolve(i, (e) => s(n ?? t, "TAG_RESOLVE_FAILED", e), e.options);
|
|
2983
2984
|
f = h(o) ? o : new D(o);
|
|
2984
2985
|
} catch (e) {
|
|
2985
2986
|
const o = e instanceof Error ? e.message : String(e);
|
|
2986
|
-
s(n ?? t, "TAG_RESOLVE_FAILED", o), (f = new D(i));
|
|
2987
|
+
(s(n ?? t, "TAG_RESOLVE_FAILED", o), (f = new D(i)));
|
|
2987
2988
|
}
|
|
2988
2989
|
return (
|
|
2989
2990
|
(f.range = c),
|
|
@@ -3007,7 +3008,7 @@ var Yaml = (function (e) {
|
|
|
3007
3008
|
e -= n.source.length;
|
|
3008
3009
|
continue;
|
|
3009
3010
|
}
|
|
3010
|
-
for (n = t[++s]; "space" === n?.type;) (e += n.source.length), (n = t[++s]);
|
|
3011
|
+
for (n = t[++s]; "space" === n?.type; ) ((e += n.source.length), (n = t[++s]));
|
|
3011
3012
|
break;
|
|
3012
3013
|
}
|
|
3013
3014
|
}
|
|
@@ -3021,32 +3022,32 @@ var Yaml = (function (e) {
|
|
|
3021
3022
|
u = !0;
|
|
3022
3023
|
switch (t.type) {
|
|
3023
3024
|
case "alias":
|
|
3024
|
-
(l = (function ({ options: e }, { offset: t, source: n, end: s }, i) {
|
|
3025
|
+
((l = (function ({ options: e }, { offset: t, source: n, end: s }, i) {
|
|
3025
3026
|
const o = new B(n.substring(1));
|
|
3026
3027
|
"" === o.source && i(t, "BAD_ALIAS", "Alias cannot be an empty string");
|
|
3027
3028
|
o.source.endsWith(":") && i(t + n.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", !0);
|
|
3028
3029
|
const r = t + n.length,
|
|
3029
3030
|
a = Ct(s, r, e.strict, i);
|
|
3030
|
-
(o.range = [t, r, a.offset]), a.comment && (o.comment = a.comment);
|
|
3031
|
+
((o.range = [t, r, a.offset]), a.comment && (o.comment = a.comment));
|
|
3031
3032
|
return o;
|
|
3032
3033
|
})(e, t, s)),
|
|
3033
|
-
(a || c) && s(t, "ALIAS_PROPS", "An alias node must not specify any properties");
|
|
3034
|
+
(a || c) && s(t, "ALIAS_PROPS", "An alias node must not specify any properties"));
|
|
3034
3035
|
break;
|
|
3035
3036
|
case "scalar":
|
|
3036
3037
|
case "single-quoted-scalar":
|
|
3037
3038
|
case "double-quoted-scalar":
|
|
3038
3039
|
case "block-scalar":
|
|
3039
|
-
(l = Rt(e, t, c, s)), a && (l.anchor = a.source.substring(1));
|
|
3040
|
+
((l = Rt(e, t, c, s)), a && (l.anchor = a.source.substring(1)));
|
|
3040
3041
|
break;
|
|
3041
3042
|
case "block-map":
|
|
3042
3043
|
case "block-seq":
|
|
3043
3044
|
case "flow-collection":
|
|
3044
|
-
(l = (function (e, t, n, s, i) {
|
|
3045
|
+
((l = (function (e, t, n, s, i) {
|
|
3045
3046
|
const o = s.tag,
|
|
3046
3047
|
r = o ? t.directives.tagName(o.source, (e) => i(o, "TAG_RESOLVE_FAILED", e)) : null;
|
|
3047
3048
|
if ("block-seq" === n.type) {
|
|
3048
3049
|
const { anchor: e, newlineAfterProp: t } = s,
|
|
3049
|
-
n = e && o ? (e.offset > o.offset ? e : o) : e ?? o;
|
|
3050
|
+
n = e && o ? (e.offset > o.offset ? e : o) : (e ?? o);
|
|
3050
3051
|
n && (!t || t.offset < n.offset) && i(n, "MISSING_CHAR", "Missing newline after block sequence props");
|
|
3051
3052
|
}
|
|
3052
3053
|
const a =
|
|
@@ -3060,31 +3061,31 @@ var Yaml = (function (e) {
|
|
|
3060
3061
|
return (
|
|
3061
3062
|
s
|
|
3062
3063
|
? i(
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3064
|
+
o,
|
|
3065
|
+
"BAD_COLLECTION_TYPE",
|
|
3066
|
+
`${s.tag} used for ${a} collection, but expects ${s.collection ?? "scalar"}`,
|
|
3067
|
+
!0
|
|
3068
|
+
)
|
|
3068
3069
|
: i(o, "TAG_RESOLVE_FAILED", `Unresolved tag: ${r}`, !0),
|
|
3069
3070
|
Bt(e, t, n, i, r)
|
|
3070
3071
|
);
|
|
3071
|
-
t.schema.tags.push(Object.assign({}, s, { default: !1 })), (c = s);
|
|
3072
|
+
(t.schema.tags.push(Object.assign({}, s, { default: !1 })), (c = s));
|
|
3072
3073
|
}
|
|
3073
3074
|
const l = Bt(e, t, n, i, r, c),
|
|
3074
3075
|
u = c.resolve?.(l, (e) => i(o, "TAG_RESOLVE_FAILED", e), t.options) ?? l,
|
|
3075
3076
|
f = m(u) ? u : new D(u);
|
|
3076
|
-
return (f.range = l.range), (f.tag = r), c?.format && (f.format = c.format), f;
|
|
3077
|
+
return ((f.range = l.range), (f.tag = r), c?.format && (f.format = c.format), f);
|
|
3077
3078
|
})(Vt, e, t, n, s)),
|
|
3078
|
-
a && (l.anchor = a.source.substring(1));
|
|
3079
|
+
a && (l.anchor = a.source.substring(1)));
|
|
3079
3080
|
break;
|
|
3080
3081
|
default:
|
|
3081
|
-
s(t, "UNEXPECTED_TOKEN", "error" === t.type ? t.message : `Unsupported token (type: ${t.type})`),
|
|
3082
|
+
(s(t, "UNEXPECTED_TOKEN", "error" === t.type ? t.message : `Unsupported token (type: ${t.type})`),
|
|
3082
3083
|
(l = Yt(e, t.offset, void 0, null, n, s)),
|
|
3083
|
-
(u = !1);
|
|
3084
|
+
(u = !1));
|
|
3084
3085
|
}
|
|
3085
3086
|
if (
|
|
3086
3087
|
(a && "" === l.anchor && s(a, "BAD_ALIAS", "Anchor cannot be an empty string"),
|
|
3087
|
-
|
|
3088
|
+
i &&
|
|
3088
3089
|
e.options.stringKeys &&
|
|
3089
3090
|
(!h(l) || "string" != typeof l.value || (l.tag && "tag:yaml.org,2002:str" !== l.tag)))
|
|
3090
3091
|
) {
|
|
@@ -3101,7 +3102,7 @@ var Yaml = (function (e) {
|
|
|
3101
3102
|
const u = Rt(e, { type: "scalar", offset: Ft(t, n, s), indent: -1, source: "" }, a, l);
|
|
3102
3103
|
return (
|
|
3103
3104
|
r &&
|
|
3104
|
-
|
|
3105
|
+
((u.anchor = r.source.substring(1)), "" === u.anchor && l(r, "BAD_ALIAS", "Anchor cannot be an empty string")),
|
|
3105
3106
|
i && (u.spaceBefore = !0),
|
|
3106
3107
|
o && ((u.comment = o), (u.range[2] = c)),
|
|
3107
3108
|
u
|
|
@@ -3121,20 +3122,20 @@ var Yaml = (function (e) {
|
|
|
3121
3122
|
const o = e[i];
|
|
3122
3123
|
switch (o[0]) {
|
|
3123
3124
|
case "#":
|
|
3124
|
-
(t += ("" === t ? "" : s ? "\n\n" : "\n") + (o.substring(1) || " ")), (n = !0), (s = !1);
|
|
3125
|
+
((t += ("" === t ? "" : s ? "\n\n" : "\n") + (o.substring(1) || " ")), (n = !0), (s = !1));
|
|
3125
3126
|
break;
|
|
3126
3127
|
case "%":
|
|
3127
|
-
"#" !== e[i + 1]?.[0] && (i += 1), (n = !1);
|
|
3128
|
+
("#" !== e[i + 1]?.[0] && (i += 1), (n = !1));
|
|
3128
3129
|
break;
|
|
3129
3130
|
default:
|
|
3130
|
-
n || (s = !0), (n = !1);
|
|
3131
|
+
(n || (s = !0), (n = !1));
|
|
3131
3132
|
}
|
|
3132
3133
|
}
|
|
3133
3134
|
return { comment: t, afterEmptyLine: s };
|
|
3134
3135
|
}
|
|
3135
3136
|
class Qt {
|
|
3136
3137
|
constructor(e = {}) {
|
|
3137
|
-
(this.doc = null),
|
|
3138
|
+
((this.doc = null),
|
|
3138
3139
|
(this.atDirectives = !1),
|
|
3139
3140
|
(this.prelude = []),
|
|
3140
3141
|
(this.errors = []),
|
|
@@ -3144,7 +3145,7 @@ var Yaml = (function (e) {
|
|
|
3144
3145
|
s ? this.warnings.push(new Ot(i, t, n)) : this.errors.push(new Nt(i, t, n));
|
|
3145
3146
|
}),
|
|
3146
3147
|
(this.directives = new T({ version: e.version || "1.2" })),
|
|
3147
|
-
(this.options = e);
|
|
3148
|
+
(this.options = e));
|
|
3148
3149
|
}
|
|
3149
3150
|
decorate(e, t) {
|
|
3150
3151
|
const { comment: n, afterEmptyLine: s } = Gt(this.prelude);
|
|
@@ -3162,12 +3163,12 @@ var Yaml = (function (e) {
|
|
|
3162
3163
|
i.commentBefore = e ? `${n}\n${e}` : n;
|
|
3163
3164
|
}
|
|
3164
3165
|
}
|
|
3165
|
-
t
|
|
3166
|
+
(t
|
|
3166
3167
|
? (Array.prototype.push.apply(e.errors, this.errors), Array.prototype.push.apply(e.warnings, this.warnings))
|
|
3167
3168
|
: ((e.errors = this.errors), (e.warnings = this.warnings)),
|
|
3168
3169
|
(this.prelude = []),
|
|
3169
3170
|
(this.errors = []),
|
|
3170
|
-
(this.warnings = []);
|
|
3171
|
+
(this.warnings = []));
|
|
3171
3172
|
}
|
|
3172
3173
|
streamInfo() {
|
|
3173
3174
|
return {
|
|
@@ -3184,12 +3185,12 @@ var Yaml = (function (e) {
|
|
|
3184
3185
|
*next(e) {
|
|
3185
3186
|
switch (e.type) {
|
|
3186
3187
|
case "directive":
|
|
3187
|
-
this.directives.add(e.source, (t, n, s) => {
|
|
3188
|
+
(this.directives.add(e.source, (t, n, s) => {
|
|
3188
3189
|
const i = Wt(e);
|
|
3189
|
-
(i[0] += t), this.onError(i, "BAD_DIRECTIVE", n, s);
|
|
3190
|
+
((i[0] += t), this.onError(i, "BAD_DIRECTIVE", n, s));
|
|
3190
3191
|
}),
|
|
3191
3192
|
this.prelude.push(e.source),
|
|
3192
|
-
(this.atDirectives = !0);
|
|
3193
|
+
(this.atDirectives = !0));
|
|
3193
3194
|
break;
|
|
3194
3195
|
case "document": {
|
|
3195
3196
|
const t = (function (e, t, { offset: n, start: s, value: i, end: o }, r) {
|
|
@@ -3204,24 +3205,24 @@ var Yaml = (function (e) {
|
|
|
3204
3205
|
parentIndent: 0,
|
|
3205
3206
|
startOnNewline: !0,
|
|
3206
3207
|
});
|
|
3207
|
-
u.found &&
|
|
3208
|
+
(u.found &&
|
|
3208
3209
|
((c.directives.docStart = !0),
|
|
3209
|
-
|
|
3210
|
+
!i ||
|
|
3210
3211
|
("block-map" !== i.type && "block-seq" !== i.type) ||
|
|
3211
3212
|
u.hasNewline ||
|
|
3212
3213
|
r(u.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")),
|
|
3213
|
-
(c.contents = i ? Jt(l, i, u, r) : Yt(l, u.end, s, null, u, r));
|
|
3214
|
+
(c.contents = i ? Jt(l, i, u, r) : Yt(l, u.end, s, null, u, r)));
|
|
3214
3215
|
const f = c.contents.range[2],
|
|
3215
3216
|
h = Ct(o, f, !1, r);
|
|
3216
|
-
return h.comment && (c.comment = h.comment), (c.range = [n, f, h.offset]), c;
|
|
3217
|
+
return (h.comment && (c.comment = h.comment), (c.range = [n, f, h.offset]), c);
|
|
3217
3218
|
})(this.options, this.directives, e, this.onError);
|
|
3218
|
-
this.atDirectives &&
|
|
3219
|
+
(this.atDirectives &&
|
|
3219
3220
|
!t.directives.docStart &&
|
|
3220
3221
|
this.onError(e, "MISSING_CHAR", "Missing directives-end/doc-start indicator line"),
|
|
3221
3222
|
this.decorate(t, !1),
|
|
3222
3223
|
this.doc && (yield this.doc),
|
|
3223
3224
|
(this.doc = t),
|
|
3224
|
-
(this.atDirectives = !1);
|
|
3225
|
+
(this.atDirectives = !1));
|
|
3225
3226
|
break;
|
|
3226
3227
|
}
|
|
3227
3228
|
case "byte-order-mark":
|
|
@@ -3257,14 +3258,14 @@ var Yaml = (function (e) {
|
|
|
3257
3258
|
}
|
|
3258
3259
|
}
|
|
3259
3260
|
*end(e = !1, t = -1) {
|
|
3260
|
-
if (this.doc) this.decorate(this.doc, !0), yield this.doc, (this.doc = null);
|
|
3261
|
+
if (this.doc) (this.decorate(this.doc, !0), yield this.doc, (this.doc = null));
|
|
3261
3262
|
else if (e) {
|
|
3262
3263
|
const e = Object.assign({ _directives: this.directives }, this.options),
|
|
3263
3264
|
n = new vt(void 0, e);
|
|
3264
|
-
this.atDirectives && this.onError(t, "MISSING_CHAR", "Missing directives-end indicator line"),
|
|
3265
|
+
(this.atDirectives && this.onError(t, "MISSING_CHAR", "Missing directives-end indicator line"),
|
|
3265
3266
|
(n.range = [0, t, t]),
|
|
3266
3267
|
this.decorate(n, !1),
|
|
3267
|
-
yield n;
|
|
3268
|
+
yield n);
|
|
3268
3269
|
}
|
|
3269
3270
|
}
|
|
3270
3271
|
}
|
|
@@ -3277,7 +3278,7 @@ var Yaml = (function (e) {
|
|
|
3277
3278
|
e.push(n);
|
|
3278
3279
|
break;
|
|
3279
3280
|
case "newline":
|
|
3280
|
-
return e.push(n), !0;
|
|
3281
|
+
return (e.push(n), !0);
|
|
3281
3282
|
}
|
|
3282
3283
|
return !1;
|
|
3283
3284
|
}
|
|
@@ -3286,20 +3287,20 @@ var Yaml = (function (e) {
|
|
|
3286
3287
|
case "scalar":
|
|
3287
3288
|
case "double-quoted-scalar":
|
|
3288
3289
|
case "single-quoted-scalar":
|
|
3289
|
-
(e.type = n), (e.source = t);
|
|
3290
|
+
((e.type = n), (e.source = t));
|
|
3290
3291
|
break;
|
|
3291
3292
|
case "block-scalar": {
|
|
3292
3293
|
const s = e.props.slice(1);
|
|
3293
3294
|
let i = t.length;
|
|
3294
3295
|
"block-scalar-header" === e.props[0].type && (i -= e.props[0].source.length);
|
|
3295
3296
|
for (const e of s) e.offset += i;
|
|
3296
|
-
delete e.props, Object.assign(e, { type: n, source: t, end: s });
|
|
3297
|
+
(delete e.props, Object.assign(e, { type: n, source: t, end: s }));
|
|
3297
3298
|
break;
|
|
3298
3299
|
}
|
|
3299
3300
|
case "block-map":
|
|
3300
3301
|
case "block-seq": {
|
|
3301
3302
|
const s = { type: "newline", offset: e.offset + t.length, indent: e.indent, source: "\n" };
|
|
3302
|
-
delete e.items, Object.assign(e, { type: n, source: t, end: [s] });
|
|
3303
|
+
(delete e.items, Object.assign(e, { type: n, source: t, end: [s] }));
|
|
3303
3304
|
break;
|
|
3304
3305
|
}
|
|
3305
3306
|
default: {
|
|
@@ -3348,13 +3349,13 @@ var Yaml = (function (e) {
|
|
|
3348
3349
|
let i = "";
|
|
3349
3350
|
for (const t of e) i += t.source;
|
|
3350
3351
|
if ((t && (i += zt(t)), n)) for (const e of n) i += e.source;
|
|
3351
|
-
return s && (i += zt(s)), i;
|
|
3352
|
+
return (s && (i += zt(s)), i);
|
|
3352
3353
|
}
|
|
3353
3354
|
const en = Symbol("break visit"),
|
|
3354
3355
|
tn = Symbol("skip children"),
|
|
3355
3356
|
nn = Symbol("remove item");
|
|
3356
3357
|
function sn(e, t) {
|
|
3357
|
-
"type" in e && "document" === e.type && (e = { start: e.start, value: e.value }), on(Object.freeze([]), e, t);
|
|
3358
|
+
("type" in e && "document" === e.type && (e = { start: e.start, value: e.value }), on(Object.freeze([]), e, t));
|
|
3358
3359
|
}
|
|
3359
3360
|
function on(e, t, n) {
|
|
3360
3361
|
let s = n(t, e);
|
|
@@ -3375,7 +3376,7 @@ var Yaml = (function (e) {
|
|
|
3375
3376
|
}
|
|
3376
3377
|
return "function" == typeof s ? s(t, e) : s;
|
|
3377
3378
|
}
|
|
3378
|
-
(sn.BREAK = en),
|
|
3379
|
+
((sn.BREAK = en),
|
|
3379
3380
|
(sn.SKIP = tn),
|
|
3380
3381
|
(sn.REMOVE = nn),
|
|
3381
3382
|
(sn.itemAtPath = (e, t) => {
|
|
@@ -3393,7 +3394,7 @@ var Yaml = (function (e) {
|
|
|
3393
3394
|
i = n?.[s];
|
|
3394
3395
|
if (i && "items" in i) return i;
|
|
3395
3396
|
throw new Error("Parent collection not found");
|
|
3396
|
-
});
|
|
3397
|
+
}));
|
|
3397
3398
|
const rn = "\ufeff",
|
|
3398
3399
|
an = "",
|
|
3399
3400
|
cn = "",
|
|
@@ -3568,7 +3569,7 @@ var Yaml = (function (e) {
|
|
|
3568
3569
|
if ("block-scalar" === e.type) {
|
|
3569
3570
|
const t = e.props[0];
|
|
3570
3571
|
if ("block-scalar-header" !== t.type) throw new Error("Invalid block scalar header");
|
|
3571
|
-
(t.source = s), (e.source = i);
|
|
3572
|
+
((t.source = s), (e.source = i));
|
|
3572
3573
|
} else {
|
|
3573
3574
|
const { offset: t } = e,
|
|
3574
3575
|
n = "indent" in e ? e.indent : -1,
|
|
@@ -3612,7 +3613,7 @@ var Yaml = (function (e) {
|
|
|
3612
3613
|
gn = (e) => !e || yn.has(e);
|
|
3613
3614
|
class bn {
|
|
3614
3615
|
constructor() {
|
|
3615
|
-
(this.atEnd = !1),
|
|
3616
|
+
((this.atEnd = !1),
|
|
3616
3617
|
(this.blockScalarIndent = -1),
|
|
3617
3618
|
(this.blockScalarKeep = !1),
|
|
3618
3619
|
(this.buffer = ""),
|
|
@@ -3622,21 +3623,21 @@ var Yaml = (function (e) {
|
|
|
3622
3623
|
(this.indentValue = 0),
|
|
3623
3624
|
(this.lineEndPos = null),
|
|
3624
3625
|
(this.next = null),
|
|
3625
|
-
(this.pos = 0);
|
|
3626
|
+
(this.pos = 0));
|
|
3626
3627
|
}
|
|
3627
3628
|
*lex(e, t = !1) {
|
|
3628
3629
|
if (e) {
|
|
3629
3630
|
if ("string" != typeof e) throw TypeError("source is not a string");
|
|
3630
|
-
(this.buffer = this.buffer ? this.buffer + e : e), (this.lineEndPos = null);
|
|
3631
|
+
((this.buffer = this.buffer ? this.buffer + e : e), (this.lineEndPos = null));
|
|
3631
3632
|
}
|
|
3632
3633
|
this.atEnd = !t;
|
|
3633
3634
|
let n = this.next ?? "stream";
|
|
3634
|
-
for (; n && (t || this.hasChars(1));) n = yield* this.parseNext(n);
|
|
3635
|
+
for (; n && (t || this.hasChars(1)); ) n = yield* this.parseNext(n);
|
|
3635
3636
|
}
|
|
3636
3637
|
atLineEnd() {
|
|
3637
3638
|
let e = this.pos,
|
|
3638
3639
|
t = this.buffer[e];
|
|
3639
|
-
for (; " " === t || "\t" === t;) t = this.buffer[++e];
|
|
3640
|
+
for (; " " === t || "\t" === t; ) t = this.buffer[++e];
|
|
3640
3641
|
return !t || "#" === t || "\n" === t || ("\r" === t && "\n" === this.buffer[e + 1]);
|
|
3641
3642
|
}
|
|
3642
3643
|
charAt(e) {
|
|
@@ -3646,7 +3647,7 @@ var Yaml = (function (e) {
|
|
|
3646
3647
|
let t = this.buffer[e];
|
|
3647
3648
|
if (this.indentNext > 0) {
|
|
3648
3649
|
let n = 0;
|
|
3649
|
-
for (; " " === t;) t = this.buffer[++n + e];
|
|
3650
|
+
for (; " " === t; ) t = this.buffer[++n + e];
|
|
3650
3651
|
if ("\r" === t) {
|
|
3651
3652
|
const t = this.buffer[n + e + 1];
|
|
3652
3653
|
if ("\n" === t || (!t && !this.atEnd)) return e + n + 1;
|
|
@@ -3663,7 +3664,7 @@ var Yaml = (function (e) {
|
|
|
3663
3664
|
let e = this.lineEndPos;
|
|
3664
3665
|
return (
|
|
3665
3666
|
("number" != typeof e || (-1 !== e && e < this.pos)) &&
|
|
3666
|
-
|
|
3667
|
+
((e = this.buffer.indexOf("\n", this.pos)), (this.lineEndPos = e)),
|
|
3667
3668
|
-1 === e
|
|
3668
3669
|
? this.atEnd
|
|
3669
3670
|
? this.buffer.substring(this.pos)
|
|
@@ -3676,7 +3677,11 @@ var Yaml = (function (e) {
|
|
|
3676
3677
|
}
|
|
3677
3678
|
setNext(e) {
|
|
3678
3679
|
return (
|
|
3679
|
-
(this.buffer = this.buffer.substring(this.pos)),
|
|
3680
|
+
(this.buffer = this.buffer.substring(this.pos)),
|
|
3681
|
+
(this.pos = 0),
|
|
3682
|
+
(this.lineEndPos = null),
|
|
3683
|
+
(this.next = e),
|
|
3684
|
+
null
|
|
3680
3685
|
);
|
|
3681
3686
|
}
|
|
3682
3687
|
peek(e) {
|
|
@@ -3708,7 +3713,7 @@ var Yaml = (function (e) {
|
|
|
3708
3713
|
if ((e[0] === rn && (yield* this.pushCount(1), (e = e.substring(1))), "%" === e[0])) {
|
|
3709
3714
|
let t = e.length,
|
|
3710
3715
|
n = e.indexOf("#");
|
|
3711
|
-
for (; -1 !== n;) {
|
|
3716
|
+
for (; -1 !== n; ) {
|
|
3712
3717
|
const s = e[n - 1];
|
|
3713
3718
|
if (" " === s || "\t" === s) {
|
|
3714
3719
|
t = n - 1;
|
|
@@ -3716,19 +3721,19 @@ var Yaml = (function (e) {
|
|
|
3716
3721
|
}
|
|
3717
3722
|
n = e.indexOf("#", n + 1);
|
|
3718
3723
|
}
|
|
3719
|
-
for (
|
|
3724
|
+
for (;;) {
|
|
3720
3725
|
const n = e[t - 1];
|
|
3721
3726
|
if (" " !== n && "\t" !== n) break;
|
|
3722
3727
|
t -= 1;
|
|
3723
3728
|
}
|
|
3724
3729
|
const s = (yield* this.pushCount(t)) + (yield* this.pushSpaces(!0));
|
|
3725
|
-
return yield* this.pushCount(e.length - s), this.pushNewline(), "stream";
|
|
3730
|
+
return (yield* this.pushCount(e.length - s), this.pushNewline(), "stream");
|
|
3726
3731
|
}
|
|
3727
3732
|
if (this.atLineEnd()) {
|
|
3728
3733
|
const t = yield* this.pushSpaces(!0);
|
|
3729
|
-
return yield* this.pushCount(e.length - t), yield* this.pushNewline(), "stream";
|
|
3734
|
+
return (yield* this.pushCount(e.length - t), yield* this.pushNewline(), "stream");
|
|
3730
3735
|
}
|
|
3731
|
-
return yield an, yield* this.parseLineStart();
|
|
3736
|
+
return (yield an, yield* this.parseLineStart());
|
|
3732
3737
|
}
|
|
3733
3738
|
*parseLineStart() {
|
|
3734
3739
|
const e = this.charAt(0);
|
|
@@ -3738,7 +3743,10 @@ var Yaml = (function (e) {
|
|
|
3738
3743
|
const e = this.peek(3);
|
|
3739
3744
|
if (("---" === e || "..." === e) && hn(this.charAt(3)))
|
|
3740
3745
|
return (
|
|
3741
|
-
yield* this.pushCount(3),
|
|
3746
|
+
yield* this.pushCount(3),
|
|
3747
|
+
(this.indentValue = 0),
|
|
3748
|
+
(this.indentNext = 0),
|
|
3749
|
+
"---" === e ? "doc" : "stream"
|
|
3742
3750
|
);
|
|
3743
3751
|
}
|
|
3744
3752
|
return (
|
|
@@ -3752,7 +3760,7 @@ var Yaml = (function (e) {
|
|
|
3752
3760
|
if (!t && !this.atEnd) return this.setNext("block-start");
|
|
3753
3761
|
if (("-" === e || "?" === e || ":" === e) && hn(t)) {
|
|
3754
3762
|
const e = (yield* this.pushCount(1)) + (yield* this.pushSpaces(!0));
|
|
3755
|
-
return (this.indentNext = this.indentValue + 1), (this.indentValue += e), yield* this.parseBlockStart();
|
|
3763
|
+
return ((this.indentNext = this.indentValue + 1), (this.indentValue += e), yield* this.parseBlockStart());
|
|
3756
3764
|
}
|
|
3757
3765
|
return "doc";
|
|
3758
3766
|
}
|
|
@@ -3765,15 +3773,15 @@ var Yaml = (function (e) {
|
|
|
3765
3773
|
case "#":
|
|
3766
3774
|
yield* this.pushCount(e.length - t);
|
|
3767
3775
|
case void 0:
|
|
3768
|
-
return yield* this.pushNewline(), yield* this.parseLineStart();
|
|
3776
|
+
return (yield* this.pushNewline(), yield* this.parseLineStart());
|
|
3769
3777
|
case "{":
|
|
3770
3778
|
case "[":
|
|
3771
|
-
return yield* this.pushCount(1), (this.flowKey = !1), (this.flowLevel = 1), "flow";
|
|
3779
|
+
return (yield* this.pushCount(1), (this.flowKey = !1), (this.flowLevel = 1), "flow");
|
|
3772
3780
|
case "}":
|
|
3773
3781
|
case "]":
|
|
3774
|
-
return yield* this.pushCount(1), "doc";
|
|
3782
|
+
return (yield* this.pushCount(1), "doc");
|
|
3775
3783
|
case "*":
|
|
3776
|
-
return yield* this.pushUntil(gn), "doc";
|
|
3784
|
+
return (yield* this.pushUntil(gn), "doc");
|
|
3777
3785
|
case '"':
|
|
3778
3786
|
case "'":
|
|
3779
3787
|
return yield* this.parseQuotedScalar();
|
|
@@ -3795,9 +3803,9 @@ var Yaml = (function (e) {
|
|
|
3795
3803
|
t,
|
|
3796
3804
|
n = -1;
|
|
3797
3805
|
do {
|
|
3798
|
-
(e = yield* this.pushNewline()),
|
|
3806
|
+
((e = yield* this.pushNewline()),
|
|
3799
3807
|
e > 0 ? ((t = yield* this.pushSpaces(!1)), (this.indentValue = n = t)) : (t = 0),
|
|
3800
|
-
(t += yield* this.pushSpaces(!0));
|
|
3808
|
+
(t += yield* this.pushSpaces(!0)));
|
|
3801
3809
|
} while (e + t > 0);
|
|
3802
3810
|
const s = this.getLine();
|
|
3803
3811
|
if (null === s) return this.setNext("flow");
|
|
@@ -3806,50 +3814,55 @@ var Yaml = (function (e) {
|
|
|
3806
3814
|
(0 === n && (s.startsWith("---") || s.startsWith("...")) && hn(s[3]))
|
|
3807
3815
|
) {
|
|
3808
3816
|
if (!(n === this.indentNext - 1 && 1 === this.flowLevel && ("]" === s[0] || "}" === s[0])))
|
|
3809
|
-
return (this.flowLevel = 0), yield cn, yield* this.parseLineStart();
|
|
3817
|
+
return ((this.flowLevel = 0), yield cn, yield* this.parseLineStart());
|
|
3810
3818
|
}
|
|
3811
3819
|
let i = 0;
|
|
3812
|
-
for (; "," === s[i];) (i += yield* this.pushCount(1)), (i += yield* this.pushSpaces(!0)), (this.flowKey = !1);
|
|
3820
|
+
for (; "," === s[i]; ) ((i += yield* this.pushCount(1)), (i += yield* this.pushSpaces(!0)), (this.flowKey = !1));
|
|
3813
3821
|
switch (((i += yield* this.pushIndicators()), s[i])) {
|
|
3814
3822
|
case void 0:
|
|
3815
3823
|
return "flow";
|
|
3816
3824
|
case "#":
|
|
3817
|
-
return yield* this.pushCount(s.length - i), "flow";
|
|
3825
|
+
return (yield* this.pushCount(s.length - i), "flow");
|
|
3818
3826
|
case "{":
|
|
3819
3827
|
case "[":
|
|
3820
|
-
return yield* this.pushCount(1), (this.flowKey = !1), (this.flowLevel += 1), "flow";
|
|
3828
|
+
return (yield* this.pushCount(1), (this.flowKey = !1), (this.flowLevel += 1), "flow");
|
|
3821
3829
|
case "}":
|
|
3822
3830
|
case "]":
|
|
3823
|
-
return
|
|
3831
|
+
return (
|
|
3832
|
+
yield* this.pushCount(1),
|
|
3833
|
+
(this.flowKey = !0),
|
|
3834
|
+
(this.flowLevel -= 1),
|
|
3835
|
+
this.flowLevel ? "flow" : "doc"
|
|
3836
|
+
);
|
|
3824
3837
|
case "*":
|
|
3825
|
-
return yield* this.pushUntil(gn), "flow";
|
|
3838
|
+
return (yield* this.pushUntil(gn), "flow");
|
|
3826
3839
|
case '"':
|
|
3827
3840
|
case "'":
|
|
3828
|
-
return (this.flowKey = !0), yield* this.parseQuotedScalar();
|
|
3841
|
+
return ((this.flowKey = !0), yield* this.parseQuotedScalar());
|
|
3829
3842
|
case ":": {
|
|
3830
3843
|
const e = this.charAt(1);
|
|
3831
3844
|
if (this.flowKey || hn(e) || "," === e)
|
|
3832
|
-
return (this.flowKey = !1), yield* this.pushCount(1), yield* this.pushSpaces(!0), "flow";
|
|
3845
|
+
return ((this.flowKey = !1), yield* this.pushCount(1), yield* this.pushSpaces(!0), "flow");
|
|
3833
3846
|
}
|
|
3834
3847
|
default:
|
|
3835
|
-
return (this.flowKey = !1), yield* this.parsePlainScalar();
|
|
3848
|
+
return ((this.flowKey = !1), yield* this.parsePlainScalar());
|
|
3836
3849
|
}
|
|
3837
3850
|
}
|
|
3838
3851
|
*parseQuotedScalar() {
|
|
3839
3852
|
const e = this.charAt(0);
|
|
3840
3853
|
let t = this.buffer.indexOf(e, this.pos + 1);
|
|
3841
|
-
if ("'" === e) for (; -1 !== t && "'" === this.buffer[t + 1];) t = this.buffer.indexOf("'", t + 2);
|
|
3854
|
+
if ("'" === e) for (; -1 !== t && "'" === this.buffer[t + 1]; ) t = this.buffer.indexOf("'", t + 2);
|
|
3842
3855
|
else
|
|
3843
|
-
for (; -1 !== t;) {
|
|
3856
|
+
for (; -1 !== t; ) {
|
|
3844
3857
|
let e = 0;
|
|
3845
|
-
for (; "\\" === this.buffer[t - 1 - e];) e += 1;
|
|
3858
|
+
for (; "\\" === this.buffer[t - 1 - e]; ) e += 1;
|
|
3846
3859
|
if (e % 2 == 0) break;
|
|
3847
3860
|
t = this.buffer.indexOf('"', t + 1);
|
|
3848
3861
|
}
|
|
3849
3862
|
const n = this.buffer.substring(0, t);
|
|
3850
3863
|
let s = n.indexOf("\n", this.pos);
|
|
3851
3864
|
if (-1 !== s) {
|
|
3852
|
-
for (; -1 !== s;) {
|
|
3865
|
+
for (; -1 !== s; ) {
|
|
3853
3866
|
const e = this.continueScalar(s + 1);
|
|
3854
3867
|
if (-1 === e) break;
|
|
3855
3868
|
s = n.indexOf("\n", e);
|
|
@@ -3860,12 +3873,12 @@ var Yaml = (function (e) {
|
|
|
3860
3873
|
if (!this.atEnd) return this.setNext("quoted-scalar");
|
|
3861
3874
|
t = this.buffer.length;
|
|
3862
3875
|
}
|
|
3863
|
-
return yield* this.pushToIndex(t + 1, !1), this.flowLevel ? "flow" : "doc";
|
|
3876
|
+
return (yield* this.pushToIndex(t + 1, !1), this.flowLevel ? "flow" : "doc");
|
|
3864
3877
|
}
|
|
3865
3878
|
*parseBlockScalarHeader() {
|
|
3866
|
-
(this.blockScalarIndent = -1), (this.blockScalarKeep = !1);
|
|
3879
|
+
((this.blockScalarIndent = -1), (this.blockScalarKeep = !1));
|
|
3867
3880
|
let e = this.pos;
|
|
3868
|
-
for (
|
|
3881
|
+
for (;;) {
|
|
3869
3882
|
const t = this.buffer[++e];
|
|
3870
3883
|
if ("+" === t) this.blockScalarKeep = !0;
|
|
3871
3884
|
else if (t > "0" && t <= "9") this.blockScalarIndent = Number(t) - 1;
|
|
@@ -3883,7 +3896,7 @@ var Yaml = (function (e) {
|
|
|
3883
3896
|
n += 1;
|
|
3884
3897
|
break;
|
|
3885
3898
|
case "\n":
|
|
3886
|
-
(t = s), (n = 0);
|
|
3899
|
+
((t = s), (n = 0));
|
|
3887
3900
|
break;
|
|
3888
3901
|
case "\r": {
|
|
3889
3902
|
const e = this.buffer[s + 1];
|
|
@@ -3909,28 +3922,28 @@ var Yaml = (function (e) {
|
|
|
3909
3922
|
}
|
|
3910
3923
|
}
|
|
3911
3924
|
let s = t + 1;
|
|
3912
|
-
for (e = this.buffer[s]; " " === e;) e = this.buffer[++s];
|
|
3925
|
+
for (e = this.buffer[s]; " " === e; ) e = this.buffer[++s];
|
|
3913
3926
|
if ("\t" === e) {
|
|
3914
|
-
for (; "\t" === e || " " === e || "\r" === e || "\n" === e;) e = this.buffer[++s];
|
|
3927
|
+
for (; "\t" === e || " " === e || "\r" === e || "\n" === e; ) e = this.buffer[++s];
|
|
3915
3928
|
t = s - 1;
|
|
3916
3929
|
} else if (!this.blockScalarKeep)
|
|
3917
|
-
for (
|
|
3930
|
+
for (;;) {
|
|
3918
3931
|
let e = t - 1,
|
|
3919
3932
|
s = this.buffer[e];
|
|
3920
3933
|
"\r" === s && (s = this.buffer[--e]);
|
|
3921
3934
|
const i = e;
|
|
3922
|
-
for (; " " === s;) s = this.buffer[--e];
|
|
3935
|
+
for (; " " === s; ) s = this.buffer[--e];
|
|
3923
3936
|
if (!("\n" === s && e >= this.pos && e + 1 + n > i)) break;
|
|
3924
3937
|
t = e;
|
|
3925
3938
|
}
|
|
3926
|
-
return yield ln, yield* this.pushToIndex(t + 1, !0), yield* this.parseLineStart();
|
|
3939
|
+
return (yield ln, yield* this.pushToIndex(t + 1, !0), yield* this.parseLineStart());
|
|
3927
3940
|
}
|
|
3928
3941
|
*parsePlainScalar() {
|
|
3929
3942
|
const e = this.flowLevel > 0;
|
|
3930
3943
|
let t,
|
|
3931
3944
|
n = this.pos - 1,
|
|
3932
3945
|
s = this.pos - 1;
|
|
3933
|
-
for (; (t = this.buffer[++s]);)
|
|
3946
|
+
for (; (t = this.buffer[++s]); )
|
|
3934
3947
|
if (":" === t) {
|
|
3935
3948
|
const t = this.buffer[s + 1];
|
|
3936
3949
|
if (hn(t) || (e && mn.has(t))) break;
|
|
@@ -3939,7 +3952,7 @@ var Yaml = (function (e) {
|
|
|
3939
3952
|
let i = this.buffer[s + 1];
|
|
3940
3953
|
if (
|
|
3941
3954
|
("\r" === t && ("\n" === i ? ((s += 1), (t = "\n"), (i = this.buffer[s + 1])) : (n = s)),
|
|
3942
|
-
|
|
3955
|
+
"#" === i || (e && mn.has(i)))
|
|
3943
3956
|
)
|
|
3944
3957
|
break;
|
|
3945
3958
|
if ("\n" === t) {
|
|
@@ -3986,13 +3999,13 @@ var Yaml = (function (e) {
|
|
|
3986
3999
|
if ("<" === this.charAt(1)) {
|
|
3987
4000
|
let e = this.pos + 2,
|
|
3988
4001
|
t = this.buffer[e];
|
|
3989
|
-
for (; !hn(t) && ">" !== t;) t = this.buffer[++e];
|
|
4002
|
+
for (; !hn(t) && ">" !== t; ) t = this.buffer[++e];
|
|
3990
4003
|
return yield* this.pushToIndex(">" === t ? e + 1 : e, !1);
|
|
3991
4004
|
}
|
|
3992
4005
|
{
|
|
3993
4006
|
let e = this.pos + 1,
|
|
3994
4007
|
t = this.buffer[e];
|
|
3995
|
-
for (; t;)
|
|
4008
|
+
for (; t; )
|
|
3996
4009
|
if (pn.has(t)) t = this.buffer[++e];
|
|
3997
4010
|
else {
|
|
3998
4011
|
if ("%" !== t || !dn.has(this.buffer[e + 1]) || !dn.has(this.buffer[e + 2])) break;
|
|
@@ -4016,30 +4029,30 @@ var Yaml = (function (e) {
|
|
|
4016
4029
|
t = this.buffer[++n];
|
|
4017
4030
|
} while (" " === t || (e && "\t" === t));
|
|
4018
4031
|
const s = n - this.pos;
|
|
4019
|
-
return s > 0 && (yield this.buffer.substr(this.pos, s), (this.pos = n)), s;
|
|
4032
|
+
return (s > 0 && (yield this.buffer.substr(this.pos, s), (this.pos = n)), s);
|
|
4020
4033
|
}
|
|
4021
4034
|
*pushUntil(e) {
|
|
4022
4035
|
let t = this.pos,
|
|
4023
4036
|
n = this.buffer[t];
|
|
4024
|
-
for (; !e(n);) n = this.buffer[++t];
|
|
4037
|
+
for (; !e(n); ) n = this.buffer[++t];
|
|
4025
4038
|
return yield* this.pushToIndex(t, !1);
|
|
4026
4039
|
}
|
|
4027
4040
|
}
|
|
4028
4041
|
class kn {
|
|
4029
4042
|
constructor() {
|
|
4030
|
-
(this.lineStarts = []),
|
|
4043
|
+
((this.lineStarts = []),
|
|
4031
4044
|
(this.addNewLine = (e) => this.lineStarts.push(e)),
|
|
4032
4045
|
(this.linePos = (e) => {
|
|
4033
4046
|
let t = 0,
|
|
4034
4047
|
n = this.lineStarts.length;
|
|
4035
|
-
for (; t < n;) {
|
|
4048
|
+
for (; t < n; ) {
|
|
4036
4049
|
const s = (t + n) >> 1;
|
|
4037
4050
|
this.lineStarts[s] < e ? (t = s + 1) : (n = s);
|
|
4038
4051
|
}
|
|
4039
4052
|
if (this.lineStarts[t] === e) return { line: t + 1, col: 1 };
|
|
4040
4053
|
if (0 === t) return { line: 0, col: e };
|
|
4041
4054
|
return { line: t, col: e - this.lineStarts[t - 1] + 1 };
|
|
4042
|
-
});
|
|
4055
|
+
}));
|
|
4043
4056
|
}
|
|
4044
4057
|
}
|
|
4045
4058
|
function wn(e, t) {
|
|
@@ -4087,7 +4100,7 @@ var Yaml = (function (e) {
|
|
|
4087
4100
|
function Nn(e) {
|
|
4088
4101
|
if (0 === e.length) return [];
|
|
4089
4102
|
let t = e.length;
|
|
4090
|
-
e: for (; --t >= 0;)
|
|
4103
|
+
e: for (; --t >= 0; )
|
|
4091
4104
|
switch (e[t].type) {
|
|
4092
4105
|
case "doc-start":
|
|
4093
4106
|
case "explicit-key-ind":
|
|
@@ -4096,7 +4109,7 @@ var Yaml = (function (e) {
|
|
|
4096
4109
|
case "newline":
|
|
4097
4110
|
break e;
|
|
4098
4111
|
}
|
|
4099
|
-
for (; "space" === e[++t]?.type;);
|
|
4112
|
+
for (; "space" === e[++t]?.type; );
|
|
4100
4113
|
return e.splice(t, e.length);
|
|
4101
4114
|
}
|
|
4102
4115
|
function On(e) {
|
|
@@ -4107,17 +4120,17 @@ var Yaml = (function (e) {
|
|
|
4107
4120
|
wn(t.start, "explicit-key-ind") ||
|
|
4108
4121
|
wn(t.sep, "map-value-ind") ||
|
|
4109
4122
|
(t.key && (t.value = t.key),
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4123
|
+
delete t.key,
|
|
4124
|
+
Sn(t.value)
|
|
4125
|
+
? t.value.end
|
|
4126
|
+
? Array.prototype.push.apply(t.value.end, t.sep)
|
|
4127
|
+
: (t.value.end = t.sep)
|
|
4128
|
+
: Array.prototype.push.apply(t.start, t.sep),
|
|
4129
|
+
delete t.sep);
|
|
4117
4130
|
}
|
|
4118
4131
|
class An {
|
|
4119
4132
|
constructor(e) {
|
|
4120
|
-
(this.atNewLine = !0),
|
|
4133
|
+
((this.atNewLine = !0),
|
|
4121
4134
|
(this.atScalar = !1),
|
|
4122
4135
|
(this.indent = 0),
|
|
4123
4136
|
(this.offset = 0),
|
|
@@ -4126,7 +4139,7 @@ var Yaml = (function (e) {
|
|
|
4126
4139
|
(this.source = ""),
|
|
4127
4140
|
(this.type = ""),
|
|
4128
4141
|
(this.lexer = new bn()),
|
|
4129
|
-
(this.onNewLine = e);
|
|
4142
|
+
(this.onNewLine = e));
|
|
4130
4143
|
}
|
|
4131
4144
|
*parse(e, t = !1) {
|
|
4132
4145
|
this.onNewLine && 0 === this.offset && this.onNewLine(0);
|
|
@@ -4135,14 +4148,14 @@ var Yaml = (function (e) {
|
|
|
4135
4148
|
}
|
|
4136
4149
|
*next(e) {
|
|
4137
4150
|
if (((this.source = e), this.atScalar))
|
|
4138
|
-
return (this.atScalar = !1), yield* this.step(), void (this.offset += e.length);
|
|
4151
|
+
return ((this.atScalar = !1), yield* this.step(), void (this.offset += e.length));
|
|
4139
4152
|
const t = un(e);
|
|
4140
4153
|
if (t)
|
|
4141
|
-
if ("scalar" === t) (this.atNewLine = !1), (this.atScalar = !0), (this.type = "scalar");
|
|
4154
|
+
if ("scalar" === t) ((this.atNewLine = !1), (this.atScalar = !0), (this.type = "scalar"));
|
|
4142
4155
|
else {
|
|
4143
4156
|
switch (((this.type = t), yield* this.step(), t)) {
|
|
4144
4157
|
case "newline":
|
|
4145
|
-
(this.atNewLine = !0), (this.indent = 0), this.onNewLine && this.onNewLine(this.offset + e.length);
|
|
4158
|
+
((this.atNewLine = !0), (this.indent = 0), this.onNewLine && this.onNewLine(this.offset + e.length));
|
|
4146
4159
|
break;
|
|
4147
4160
|
case "space":
|
|
4148
4161
|
this.atNewLine && " " === e[0] && (this.indent += e.length);
|
|
@@ -4162,11 +4175,11 @@ var Yaml = (function (e) {
|
|
|
4162
4175
|
}
|
|
4163
4176
|
else {
|
|
4164
4177
|
const t = `Not a YAML token: ${e}`;
|
|
4165
|
-
yield* this.pop({ type: "error", offset: this.offset, message: t, source: e }), (this.offset += e.length);
|
|
4178
|
+
(yield* this.pop({ type: "error", offset: this.offset, message: t, source: e }), (this.offset += e.length));
|
|
4166
4179
|
}
|
|
4167
4180
|
}
|
|
4168
4181
|
*end() {
|
|
4169
|
-
for (; this.stack.length > 0;) yield* this.pop();
|
|
4182
|
+
for (; this.stack.length > 0; ) yield* this.pop();
|
|
4170
4183
|
}
|
|
4171
4184
|
get sourceToken() {
|
|
4172
4185
|
return { type: this.type, offset: this.offset, indent: this.indent, source: this.source };
|
|
@@ -4196,7 +4209,7 @@ var Yaml = (function (e) {
|
|
|
4196
4209
|
}
|
|
4197
4210
|
yield* this.pop();
|
|
4198
4211
|
} else {
|
|
4199
|
-
for (; this.stack.length > 0;) yield* this.pop();
|
|
4212
|
+
for (; this.stack.length > 0; ) yield* this.pop();
|
|
4200
4213
|
this.stack.push({ type: "doc-end", offset: this.offset, source: this.source });
|
|
4201
4214
|
}
|
|
4202
4215
|
}
|
|
@@ -4210,9 +4223,9 @@ var Yaml = (function (e) {
|
|
|
4210
4223
|
else {
|
|
4211
4224
|
const e = this.peek(1);
|
|
4212
4225
|
switch (
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4226
|
+
("block-scalar" === t.type
|
|
4227
|
+
? (t.indent = "indent" in e ? e.indent : 0)
|
|
4228
|
+
: "flow-collection" === t.type && "document" === e.type && (t.indent = 0),
|
|
4216
4229
|
"flow-collection" === t.type && On(t),
|
|
4217
4230
|
e.type)
|
|
4218
4231
|
) {
|
|
@@ -4224,8 +4237,8 @@ var Yaml = (function (e) {
|
|
|
4224
4237
|
break;
|
|
4225
4238
|
case "block-map": {
|
|
4226
4239
|
const n = e.items[e.items.length - 1];
|
|
4227
|
-
if (n.value) return e.items.push({ start: [], key: t, sep: [] }), void (this.onKeyLine = !0);
|
|
4228
|
-
if (!n.sep) return Object.assign(n, { key: t, sep: [] }), void (this.onKeyLine = !n.explicitKey);
|
|
4240
|
+
if (n.value) return (e.items.push({ start: [], key: t, sep: [] }), void (this.onKeyLine = !0));
|
|
4241
|
+
if (!n.sep) return (Object.assign(n, { key: t, sep: [] }), void (this.onKeyLine = !n.explicitKey));
|
|
4229
4242
|
n.value = t;
|
|
4230
4243
|
break;
|
|
4231
4244
|
}
|
|
@@ -4243,7 +4256,7 @@ var Yaml = (function (e) {
|
|
|
4243
4256
|
: Object.assign(n, { key: t, sep: [] }));
|
|
4244
4257
|
}
|
|
4245
4258
|
default:
|
|
4246
|
-
yield* this.pop(), yield* this.pop(t);
|
|
4259
|
+
(yield* this.pop(), yield* this.pop(t));
|
|
4247
4260
|
}
|
|
4248
4261
|
if (
|
|
4249
4262
|
!(
|
|
@@ -4278,7 +4291,7 @@ var Yaml = (function (e) {
|
|
|
4278
4291
|
case "doc-mode":
|
|
4279
4292
|
case "doc-start": {
|
|
4280
4293
|
const e = { type: "document", offset: this.offset, start: [] };
|
|
4281
|
-
return "doc-start" === this.type && e.start.push(this.sourceToken), void this.stack.push(e);
|
|
4294
|
+
return ("doc-start" === this.type && e.start.push(this.sourceToken), void this.stack.push(e));
|
|
4282
4295
|
}
|
|
4283
4296
|
}
|
|
4284
4297
|
yield {
|
|
@@ -4304,11 +4317,11 @@ var Yaml = (function (e) {
|
|
|
4304
4317
|
t
|
|
4305
4318
|
? this.stack.push(t)
|
|
4306
4319
|
: yield {
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4320
|
+
type: "error",
|
|
4321
|
+
offset: this.offset,
|
|
4322
|
+
message: `Unexpected ${this.type} token in YAML document`,
|
|
4323
|
+
source: this.source,
|
|
4324
|
+
};
|
|
4312
4325
|
}
|
|
4313
4326
|
*scalar(e) {
|
|
4314
4327
|
if ("map-value-ind" === this.type) {
|
|
@@ -4316,7 +4329,7 @@ var Yaml = (function (e) {
|
|
|
4316
4329
|
let n;
|
|
4317
4330
|
e.end ? ((n = e.end), n.push(this.sourceToken), delete e.end) : (n = [this.sourceToken]);
|
|
4318
4331
|
const s = { type: "block-map", offset: e.offset, indent: e.indent, items: [{ start: t, key: e, sep: n }] };
|
|
4319
|
-
(this.onKeyLine = !0), (this.stack[this.stack.length - 1] = s);
|
|
4332
|
+
((this.onKeyLine = !0), (this.stack[this.stack.length - 1] = s));
|
|
4320
4333
|
} else yield* this.lineEnd(e);
|
|
4321
4334
|
}
|
|
4322
4335
|
*blockScalar(e) {
|
|
@@ -4328,12 +4341,12 @@ var Yaml = (function (e) {
|
|
|
4328
4341
|
case "scalar":
|
|
4329
4342
|
if (((e.source = this.source), (this.atNewLine = !0), (this.indent = 0), this.onNewLine)) {
|
|
4330
4343
|
let e = this.source.indexOf("\n") + 1;
|
|
4331
|
-
for (; 0 !== e;) this.onNewLine(this.offset + e), (e = this.source.indexOf("\n", e) + 1);
|
|
4344
|
+
for (; 0 !== e; ) (this.onNewLine(this.offset + e), (e = this.source.indexOf("\n", e) + 1));
|
|
4332
4345
|
}
|
|
4333
4346
|
yield* this.pop();
|
|
4334
4347
|
break;
|
|
4335
4348
|
default:
|
|
4336
|
-
yield* this.pop(), yield* this.step();
|
|
4349
|
+
(yield* this.pop(), yield* this.step());
|
|
4337
4350
|
}
|
|
4338
4351
|
}
|
|
4339
4352
|
*blockMap(e) {
|
|
@@ -4355,7 +4368,7 @@ var Yaml = (function (e) {
|
|
|
4355
4368
|
const n = e.items[e.items.length - 2],
|
|
4356
4369
|
s = n?.value?.end;
|
|
4357
4370
|
if (Array.isArray(s))
|
|
4358
|
-
return Array.prototype.push.apply(s, t.start), s.push(this.sourceToken), void e.items.pop();
|
|
4371
|
+
return (Array.prototype.push.apply(s, t.start), s.push(this.sourceToken), void e.items.pop());
|
|
4359
4372
|
}
|
|
4360
4373
|
t.start.push(this.sourceToken);
|
|
4361
4374
|
}
|
|
@@ -4398,11 +4411,11 @@ var Yaml = (function (e) {
|
|
|
4398
4411
|
? s || t.value
|
|
4399
4412
|
? (i.push(this.sourceToken), e.items.push({ start: i, explicitKey: !0 }))
|
|
4400
4413
|
: this.stack.push({
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4414
|
+
type: "block-map",
|
|
4415
|
+
offset: this.offset,
|
|
4416
|
+
indent: this.indent,
|
|
4417
|
+
items: [{ start: [this.sourceToken], explicitKey: !0 }],
|
|
4418
|
+
})
|
|
4406
4419
|
: (t.start.push(this.sourceToken), (t.explicitKey = !0)),
|
|
4407
4420
|
void (this.onKeyLine = !0)
|
|
4408
4421
|
);
|
|
@@ -4421,7 +4434,7 @@ var Yaml = (function (e) {
|
|
|
4421
4434
|
const e = Nn(t.start),
|
|
4422
4435
|
n = t.key,
|
|
4423
4436
|
s = t.sep;
|
|
4424
|
-
s.push(this.sourceToken),
|
|
4437
|
+
(s.push(this.sourceToken),
|
|
4425
4438
|
delete t.key,
|
|
4426
4439
|
delete t.sep,
|
|
4427
4440
|
this.stack.push({
|
|
@@ -4429,7 +4442,7 @@ var Yaml = (function (e) {
|
|
|
4429
4442
|
offset: this.offset,
|
|
4430
4443
|
indent: this.indent,
|
|
4431
4444
|
items: [{ start: e, key: n, sep: s }],
|
|
4432
|
-
});
|
|
4445
|
+
}));
|
|
4433
4446
|
} else i.length > 0 ? (t.sep = t.sep.concat(i, this.sourceToken)) : t.sep.push(this.sourceToken);
|
|
4434
4447
|
else if (wn(t.start, "newline")) Object.assign(t, { key: null, sep: [this.sourceToken] });
|
|
4435
4448
|
else {
|
|
@@ -4447,11 +4460,11 @@ var Yaml = (function (e) {
|
|
|
4447
4460
|
? e.items.push({ start: i, key: null, sep: [this.sourceToken] })
|
|
4448
4461
|
: wn(t.sep, "map-value-ind")
|
|
4449
4462
|
? this.stack.push({
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4463
|
+
type: "block-map",
|
|
4464
|
+
offset: this.offset,
|
|
4465
|
+
indent: this.indent,
|
|
4466
|
+
items: [{ start: [], key: null, sep: [this.sourceToken] }],
|
|
4467
|
+
})
|
|
4455
4468
|
: t.sep.push(this.sourceToken)
|
|
4456
4469
|
: Object.assign(t, { key: null, sep: [this.sourceToken] });
|
|
4457
4470
|
return void (this.onKeyLine = !0);
|
|
@@ -4483,7 +4496,7 @@ var Yaml = (function (e) {
|
|
|
4483
4496
|
}
|
|
4484
4497
|
}
|
|
4485
4498
|
}
|
|
4486
|
-
yield* this.pop(), yield* this.step();
|
|
4499
|
+
(yield* this.pop(), yield* this.step());
|
|
4487
4500
|
}
|
|
4488
4501
|
*blockSequence(e) {
|
|
4489
4502
|
const t = e.items[e.items.length - 1];
|
|
@@ -4503,7 +4516,7 @@ var Yaml = (function (e) {
|
|
|
4503
4516
|
const n = e.items[e.items.length - 2],
|
|
4504
4517
|
s = n?.value?.end;
|
|
4505
4518
|
if (Array.isArray(s))
|
|
4506
|
-
return Array.prototype.push.apply(s, t.start), s.push(this.sourceToken), void e.items.pop();
|
|
4519
|
+
return (Array.prototype.push.apply(s, t.start), s.push(this.sourceToken), void e.items.pop());
|
|
4507
4520
|
}
|
|
4508
4521
|
t.start.push(this.sourceToken);
|
|
4509
4522
|
}
|
|
@@ -4522,14 +4535,14 @@ var Yaml = (function (e) {
|
|
|
4522
4535
|
const t = this.startBlockValue(e);
|
|
4523
4536
|
if (t) return void this.stack.push(t);
|
|
4524
4537
|
}
|
|
4525
|
-
yield* this.pop(), yield* this.step();
|
|
4538
|
+
(yield* this.pop(), yield* this.step());
|
|
4526
4539
|
}
|
|
4527
4540
|
*flowCollection(e) {
|
|
4528
4541
|
const t = e.items[e.items.length - 1];
|
|
4529
4542
|
if ("flow-error-end" === this.type) {
|
|
4530
4543
|
let e;
|
|
4531
4544
|
do {
|
|
4532
|
-
yield* this.pop(), (e = this.peek(1));
|
|
4545
|
+
(yield* this.pop(), (e = this.peek(1)));
|
|
4533
4546
|
} while (e && "flow-collection" === e.type);
|
|
4534
4547
|
} else if (0 === e.end.length) {
|
|
4535
4548
|
switch (this.type) {
|
|
@@ -4576,21 +4589,21 @@ var Yaml = (function (e) {
|
|
|
4576
4589
|
(("map-value-ind" === this.type && t.indent === e.indent) ||
|
|
4577
4590
|
("newline" === this.type && !t.items[t.items.length - 1].sep))
|
|
4578
4591
|
)
|
|
4579
|
-
yield* this.pop(), yield* this.step();
|
|
4592
|
+
(yield* this.pop(), yield* this.step());
|
|
4580
4593
|
else if ("map-value-ind" === this.type && "flow-collection" !== t.type) {
|
|
4581
4594
|
const n = Nn(En(t));
|
|
4582
4595
|
On(e);
|
|
4583
4596
|
const s = e.end.splice(1, e.end.length);
|
|
4584
4597
|
s.push(this.sourceToken);
|
|
4585
4598
|
const i = { type: "block-map", offset: e.offset, indent: e.indent, items: [{ start: n, key: e, sep: s }] };
|
|
4586
|
-
(this.onKeyLine = !0), (this.stack[this.stack.length - 1] = i);
|
|
4599
|
+
((this.onKeyLine = !0), (this.stack[this.stack.length - 1] = i));
|
|
4587
4600
|
} else yield* this.lineEnd(e);
|
|
4588
4601
|
}
|
|
4589
4602
|
}
|
|
4590
4603
|
flowScalar(e) {
|
|
4591
4604
|
if (this.onNewLine) {
|
|
4592
4605
|
let e = this.source.indexOf("\n") + 1;
|
|
4593
|
-
for (; 0 !== e;) this.onNewLine(this.offset + e), (e = this.source.indexOf("\n", e) + 1);
|
|
4606
|
+
for (; 0 !== e; ) (this.onNewLine(this.offset + e), (e = this.source.indexOf("\n", e) + 1));
|
|
4594
4607
|
}
|
|
4595
4608
|
return { type: e, offset: this.offset, indent: this.indent, source: this.source };
|
|
4596
4609
|
}
|
|
@@ -4655,7 +4668,7 @@ var Yaml = (function (e) {
|
|
|
4655
4668
|
*documentEnd(e) {
|
|
4656
4669
|
"doc-mode" !== this.type &&
|
|
4657
4670
|
(e.end ? e.end.push(this.sourceToken) : (e.end = [this.sourceToken]),
|
|
4658
|
-
|
|
4671
|
+
"newline" === this.type && (yield* this.pop()));
|
|
4659
4672
|
}
|
|
4660
4673
|
*lineEnd(e) {
|
|
4661
4674
|
switch (this.type) {
|
|
@@ -4665,13 +4678,13 @@ var Yaml = (function (e) {
|
|
|
4665
4678
|
case "flow-seq-end":
|
|
4666
4679
|
case "flow-map-end":
|
|
4667
4680
|
case "map-value-ind":
|
|
4668
|
-
yield* this.pop(), yield* this.step();
|
|
4681
|
+
(yield* this.pop(), yield* this.step());
|
|
4669
4682
|
break;
|
|
4670
4683
|
case "newline":
|
|
4671
4684
|
this.onKeyLine = !1;
|
|
4672
4685
|
default:
|
|
4673
|
-
e.end ? e.end.push(this.sourceToken) : (e.end = [this.sourceToken]),
|
|
4674
|
-
"newline" === this.type && (yield* this.pop());
|
|
4686
|
+
(e.end ? e.end.push(this.sourceToken) : (e.end = [this.sourceToken]),
|
|
4687
|
+
"newline" === this.type && (yield* this.pop()));
|
|
4675
4688
|
}
|
|
4676
4689
|
}
|
|
4677
4690
|
}
|
|
@@ -4697,7 +4710,7 @@ var Yaml = (function (e) {
|
|
|
4697
4710
|
break;
|
|
4698
4711
|
}
|
|
4699
4712
|
} else r = t;
|
|
4700
|
-
return s && n && (r.errors.forEach(At(e, n)), r.warnings.forEach(At(e, n))), r;
|
|
4713
|
+
return (s && n && (r.errors.forEach(At(e, n)), r.warnings.forEach(At(e, n))), r);
|
|
4701
4714
|
}
|
|
4702
4715
|
return (
|
|
4703
4716
|
(e.Alias = B),
|
|
@@ -4739,7 +4752,7 @@ var Yaml = (function (e) {
|
|
|
4739
4752
|
i = new An(n?.addNewLine),
|
|
4740
4753
|
o = new Qt(t),
|
|
4741
4754
|
r = Array.from(o.compose(i.parse(e)));
|
|
4742
|
-
if (s && n) for (const t of r) t.errors.forEach(At(e, n)), t.warnings.forEach(At(e, n));
|
|
4755
|
+
if (s && n) for (const t of r) (t.errors.forEach(At(e, n)), t.warnings.forEach(At(e, n)));
|
|
4743
4756
|
return r.length > 0 ? r : Object.assign([], { empty: !0 }, o.streamInfo());
|
|
4744
4757
|
}),
|
|
4745
4758
|
(e.parseDocument = Tn),
|
|
@@ -4747,8 +4760,8 @@ var Yaml = (function (e) {
|
|
|
4747
4760
|
let s = null;
|
|
4748
4761
|
if (
|
|
4749
4762
|
("function" == typeof t || Array.isArray(t) ? (s = t) : void 0 === n && t && (n = t),
|
|
4750
|
-
|
|
4751
|
-
|
|
4763
|
+
"string" == typeof n && (n = n.length),
|
|
4764
|
+
"number" == typeof n)
|
|
4752
4765
|
) {
|
|
4753
4766
|
const e = Math.round(n);
|
|
4754
4767
|
n = e < 1 ? void 0 : e > 8 ? { indent: 8 } : { indent: e };
|