@depup/js-yaml 5.4.3-depup.9 → 5.5.0-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -9
- package/changes.json +3 -8
- package/dist/browser/js-yaml.esm.min.mjs +587 -563
- package/dist/browser/js-yaml.esm.min.mjs.map +1 -1
- package/dist/browser/js-yaml.umd.min.js +24 -24
- package/dist/browser/js-yaml.umd.min.js.map +1 -1
- package/dist/js-yaml.cjs.js +125 -71
- package/dist/js-yaml.cjs.js.map +1 -1
- package/dist/js-yaml.mjs +119 -65
- package/dist/js-yaml.mjs.map +1 -1
- package/package.json +17 -23
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! js-yaml 5.
|
|
1
|
+
/*! js-yaml 5.5.0 https://github.com/nodeca/js-yaml @license MIT */
|
|
2
2
|
//#region src/tag.ts
|
|
3
3
|
var e = Symbol("NOT_RESOLVED");
|
|
4
4
|
function t(e, t) {
|
|
@@ -6,8 +6,8 @@ function t(e, t) {
|
|
|
6
6
|
return {
|
|
7
7
|
tagName: e,
|
|
8
8
|
nodeKind: "scalar",
|
|
9
|
-
implicit: (n = t.implicit)
|
|
10
|
-
matchByTagPrefix: (r = t.matchByTagPrefix)
|
|
9
|
+
implicit: (n = t.implicit) != null && n,
|
|
10
|
+
matchByTagPrefix: (r = t.matchByTagPrefix) != null && r,
|
|
11
11
|
implicitFirstChars: (i = t.implicitFirstChars) == null ? null : i,
|
|
12
12
|
resolve: t.resolve,
|
|
13
13
|
identify: t.identify,
|
|
@@ -22,7 +22,7 @@ function n(e, t) {
|
|
|
22
22
|
tagName: e,
|
|
23
23
|
nodeKind: "sequence",
|
|
24
24
|
implicit: !1,
|
|
25
|
-
matchByTagPrefix: (n = t.matchByTagPrefix)
|
|
25
|
+
matchByTagPrefix: (n = t.matchByTagPrefix) != null && n,
|
|
26
26
|
create: t.create,
|
|
27
27
|
addItem: t.addItem,
|
|
28
28
|
finalize: (r = t.finalize) == null ? ((e) => e) : r,
|
|
@@ -39,7 +39,7 @@ function r(e, t) {
|
|
|
39
39
|
tagName: e,
|
|
40
40
|
nodeKind: "mapping",
|
|
41
41
|
implicit: !1,
|
|
42
|
-
matchByTagPrefix: (n = t.matchByTagPrefix)
|
|
42
|
+
matchByTagPrefix: (n = t.matchByTagPrefix) != null && n,
|
|
43
43
|
create: t.create,
|
|
44
44
|
addPair: t.addPair,
|
|
45
45
|
has: t.has,
|
|
@@ -113,13 +113,13 @@ var i = t("tag:yaml.org,2002:str", {
|
|
|
113
113
|
"f",
|
|
114
114
|
"F"
|
|
115
115
|
],
|
|
116
|
-
resolve: (t) => u.indexOf(t)
|
|
116
|
+
resolve: (t) => u.indexOf(t) !== -1 || d.indexOf(t) === -1 && e,
|
|
117
117
|
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
118
118
|
represent: (e) => e ? "true" : "false"
|
|
119
119
|
}), p = ["true"], m = ["false"], h = t("tag:yaml.org,2002:bool", {
|
|
120
120
|
implicit: !0,
|
|
121
121
|
implicitFirstChars: ["t", "f"],
|
|
122
|
-
resolve: (t) => p.indexOf(t)
|
|
122
|
+
resolve: (t) => p.indexOf(t) !== -1 || m.indexOf(t) === -1 && e,
|
|
123
123
|
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
124
124
|
represent: (e) => e ? "true" : "false"
|
|
125
125
|
}), ee = [
|
|
@@ -160,7 +160,7 @@ var i = t("tag:yaml.org,2002:str", {
|
|
|
160
160
|
"o",
|
|
161
161
|
"O"
|
|
162
162
|
],
|
|
163
|
-
resolve: (t) => ee.indexOf(t)
|
|
163
|
+
resolve: (t) => ee.indexOf(t) !== -1 || te.indexOf(t) === -1 && e,
|
|
164
164
|
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
165
165
|
represent: (e) => e ? "true" : "false"
|
|
166
166
|
}), re = /* @__PURE__ */ RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"), ie = /* @__PURE__ */ RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
|
|
@@ -220,7 +220,7 @@ function he(t) {
|
|
|
220
220
|
let n = me(t);
|
|
221
221
|
return Number.isFinite(n) ? n : e;
|
|
222
222
|
}
|
|
223
|
-
var
|
|
223
|
+
var g = t("tag:yaml.org,2002:int", {
|
|
224
224
|
implicit: !0,
|
|
225
225
|
implicitFirstChars: [
|
|
226
226
|
"-",
|
|
@@ -230,16 +230,16 @@ var ge = t("tag:yaml.org,2002:int", {
|
|
|
230
230
|
resolve: he,
|
|
231
231
|
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
|
|
232
232
|
represent: (e) => e.toString(10)
|
|
233
|
-
}),
|
|
234
|
-
function
|
|
235
|
-
if (!
|
|
233
|
+
}), ge = /* @__PURE__ */ RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"), _e = /* @__PURE__ */ RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
234
|
+
function ve(t) {
|
|
235
|
+
if (!ge.test(t)) return e;
|
|
236
236
|
let n = t.toLowerCase(), r = n[0] === "-" ? -1 : 1;
|
|
237
237
|
if ("+-".includes(n[0]) && (n = n.slice(1)), n === ".inf") return r === 1 ? Infinity : -Infinity;
|
|
238
238
|
if (n === ".nan") return NaN;
|
|
239
239
|
let i = r * parseFloat(n);
|
|
240
|
-
return Number.isFinite(i) ||
|
|
240
|
+
return Number.isFinite(i) || _e.test(t) ? i : e;
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function ye(e) {
|
|
243
243
|
if (isNaN(e)) return ".nan";
|
|
244
244
|
if (e === Infinity) return ".inf";
|
|
245
245
|
if (e === -Infinity) return "-.inf";
|
|
@@ -247,7 +247,7 @@ function be(e) {
|
|
|
247
247
|
let t = e.toString(10);
|
|
248
248
|
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
249
249
|
}
|
|
250
|
-
var
|
|
250
|
+
var be = t("tag:yaml.org,2002:float", {
|
|
251
251
|
implicit: !0,
|
|
252
252
|
implicitFirstChars: [
|
|
253
253
|
"-",
|
|
@@ -255,24 +255,24 @@ var xe = t("tag:yaml.org,2002:float", {
|
|
|
255
255
|
".",
|
|
256
256
|
..."0123456789"
|
|
257
257
|
],
|
|
258
|
-
resolve:
|
|
258
|
+
resolve: ve,
|
|
259
259
|
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
260
|
-
represent:
|
|
261
|
-
}),
|
|
262
|
-
function
|
|
260
|
+
represent: ye
|
|
261
|
+
}), xe = /* @__PURE__ */ RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"), Se = /* @__PURE__ */ RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
262
|
+
function Ce(t, n) {
|
|
263
263
|
if (n) {
|
|
264
|
-
if (!
|
|
264
|
+
if (!Se.test(t)) return e;
|
|
265
265
|
let n = t.toLowerCase(), r = n[0] === "-" ? -1 : 1;
|
|
266
266
|
if ("+-".includes(n[0]) && (n = n.slice(1)), n === ".inf") return r === 1 ? Infinity : -Infinity;
|
|
267
267
|
if (n === ".nan") return NaN;
|
|
268
268
|
let i = r * parseFloat(n);
|
|
269
269
|
return Number.isFinite(i) ? i : e;
|
|
270
270
|
}
|
|
271
|
-
if (!
|
|
271
|
+
if (!xe.test(t)) return e;
|
|
272
272
|
let r = Number(t);
|
|
273
273
|
return Number.isFinite(r) ? r : e;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function we(e) {
|
|
276
276
|
if (isNaN(e)) return ".nan";
|
|
277
277
|
if (e === Infinity) return ".inf";
|
|
278
278
|
if (e === -Infinity) return "-.inf";
|
|
@@ -280,15 +280,15 @@ function Te(e) {
|
|
|
280
280
|
let t = e.toString(10);
|
|
281
281
|
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
282
282
|
}
|
|
283
|
-
var
|
|
283
|
+
var Te = t("tag:yaml.org,2002:float", {
|
|
284
284
|
implicit: !0,
|
|
285
285
|
implicitFirstChars: ["-", ..."0123456789"],
|
|
286
|
-
resolve:
|
|
286
|
+
resolve: Ce,
|
|
287
287
|
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
288
|
-
represent:
|
|
289
|
-
}),
|
|
290
|
-
function
|
|
291
|
-
if (!
|
|
288
|
+
represent: we
|
|
289
|
+
}), Ee = /* @__PURE__ */ RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"), De = /* @__PURE__ */ RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
290
|
+
function Oe(t) {
|
|
291
|
+
if (!Ee.test(t)) return e;
|
|
292
292
|
let n = t.toLowerCase().replace(/_/g, ""), r = n[0] === "-" ? -1 : 1;
|
|
293
293
|
if ("+-".includes(n[0]) && (n = n.slice(1)), n === ".inf") return r === 1 ? Infinity : -Infinity;
|
|
294
294
|
if (n === ".nan") return NaN;
|
|
@@ -297,9 +297,9 @@ function ke(t) {
|
|
|
297
297
|
for (let e of n.split(":")) i = i * 60 + Number(e);
|
|
298
298
|
i *= r;
|
|
299
299
|
} else i = r * parseFloat(n);
|
|
300
|
-
return Number.isFinite(i) ||
|
|
300
|
+
return Number.isFinite(i) || De.test(t) ? i : e;
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function ke(e) {
|
|
303
303
|
if (isNaN(e)) return ".nan";
|
|
304
304
|
if (e === Infinity) return ".inf";
|
|
305
305
|
if (e === -Infinity) return "-.inf";
|
|
@@ -307,7 +307,7 @@ function Ae(e) {
|
|
|
307
307
|
let t = e.toString(10);
|
|
308
308
|
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
309
309
|
}
|
|
310
|
-
var
|
|
310
|
+
var Ae = t("tag:yaml.org,2002:float", {
|
|
311
311
|
implicit: !0,
|
|
312
312
|
implicitFirstChars: [
|
|
313
313
|
"-",
|
|
@@ -315,9 +315,9 @@ var g = t("tag:yaml.org,2002:float", {
|
|
|
315
315
|
".",
|
|
316
316
|
..."0123456789"
|
|
317
317
|
],
|
|
318
|
-
resolve:
|
|
318
|
+
resolve: Oe,
|
|
319
319
|
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
320
|
-
represent:
|
|
320
|
+
represent: ke
|
|
321
321
|
}), je = t("tag:yaml.org,2002:merge", {
|
|
322
322
|
implicit: !0,
|
|
323
323
|
implicitFirstChars: ["<"],
|
|
@@ -463,7 +463,7 @@ var Ue = n("tag:yaml.org,2002:omap", {
|
|
|
463
463
|
get: () => null
|
|
464
464
|
});
|
|
465
465
|
//#endregion
|
|
466
|
-
//#region \0@oxc-project+runtime@0.
|
|
466
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/typeof.js
|
|
467
467
|
function v(e) {
|
|
468
468
|
"@babel/helpers - typeof";
|
|
469
469
|
return v = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
@@ -473,7 +473,7 @@ function v(e) {
|
|
|
473
473
|
}, v(e);
|
|
474
474
|
}
|
|
475
475
|
//#endregion
|
|
476
|
-
//#region \0@oxc-project+runtime@0.
|
|
476
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPrimitive.js
|
|
477
477
|
function qe(e, t) {
|
|
478
478
|
if (v(e) != "object" || !e) return e;
|
|
479
479
|
var n = e[Symbol.toPrimitive];
|
|
@@ -485,13 +485,13 @@ function qe(e, t) {
|
|
|
485
485
|
return (t === "string" ? String : Number)(e);
|
|
486
486
|
}
|
|
487
487
|
//#endregion
|
|
488
|
-
//#region \0@oxc-project+runtime@0.
|
|
488
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPropertyKey.js
|
|
489
489
|
function Je(e) {
|
|
490
490
|
var t = qe(e, "string");
|
|
491
491
|
return v(t) == "symbol" ? t : t + "";
|
|
492
492
|
}
|
|
493
493
|
//#endregion
|
|
494
|
-
//#region \0@oxc-project+runtime@0.
|
|
494
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/defineProperty.js
|
|
495
495
|
function y(e, t, n) {
|
|
496
496
|
return (t = Je(t)) in e ? Object.defineProperty(e, t, {
|
|
497
497
|
value: n,
|
|
@@ -501,7 +501,7 @@ function y(e, t, n) {
|
|
|
501
501
|
}) : e[t] = n, e;
|
|
502
502
|
}
|
|
503
503
|
//#endregion
|
|
504
|
-
//#region \0@oxc-project+runtime@0.
|
|
504
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/objectSpread2.js
|
|
505
505
|
function Ye(e, t) {
|
|
506
506
|
var n = Object.keys(e);
|
|
507
507
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -570,9 +570,7 @@ var x = class t {
|
|
|
570
570
|
case "sequence":
|
|
571
571
|
e.matchByTagPrefix ? i.sequence.push(e) : r.sequence[e.tagName] = e;
|
|
572
572
|
break;
|
|
573
|
-
case "mapping":
|
|
574
|
-
e.matchByTagPrefix ? i.mapping.push(e) : r.mapping[e.tagName] = e;
|
|
575
|
-
break;
|
|
573
|
+
case "mapping": e.matchByTagPrefix ? i.mapping.push(e) : r.mapping[e.tagName] = e;
|
|
576
574
|
}
|
|
577
575
|
}
|
|
578
576
|
let a = n.filter((e) => e.implicitFirstChars === null), o = /* @__PURE__ */ new Set();
|
|
@@ -619,41 +617,41 @@ var x = class t {
|
|
|
619
617
|
for (let t of e) n = n.concat(t);
|
|
620
618
|
return new t([...this.tags, ...n]);
|
|
621
619
|
}
|
|
622
|
-
},
|
|
620
|
+
}, $e = new x([
|
|
623
621
|
i,
|
|
624
622
|
Ve,
|
|
625
623
|
Ge
|
|
626
|
-
]),
|
|
627
|
-
|
|
624
|
+
]), et = new x([
|
|
625
|
+
...$e.tags,
|
|
628
626
|
s,
|
|
629
627
|
h,
|
|
630
628
|
fe,
|
|
631
|
-
|
|
632
|
-
]),
|
|
633
|
-
|
|
629
|
+
Te
|
|
630
|
+
]), tt = new x([
|
|
631
|
+
...$e.tags,
|
|
634
632
|
o,
|
|
635
633
|
f,
|
|
636
634
|
se,
|
|
637
|
-
|
|
638
|
-
]),
|
|
639
|
-
|
|
635
|
+
be
|
|
636
|
+
]), nt = new x([
|
|
637
|
+
...$e.tags,
|
|
640
638
|
l,
|
|
641
639
|
ne,
|
|
642
|
-
ge,
|
|
643
640
|
g,
|
|
641
|
+
Ae,
|
|
644
642
|
Be,
|
|
645
643
|
je,
|
|
646
644
|
Fe,
|
|
647
645
|
Ue,
|
|
648
646
|
We,
|
|
649
647
|
Ke
|
|
650
|
-
]),
|
|
651
|
-
let i = ge.resolve(t, n, r);
|
|
652
|
-
return i === e ? se.resolve(t, n, r) : i;
|
|
653
|
-
} }), b(b({}, g), {}, { resolve: (t, n, r) => {
|
|
648
|
+
]), rt = nt.withTags(b(b({}, g), {}, { resolve: (t, n, r) => {
|
|
654
649
|
let i = g.resolve(t, n, r);
|
|
655
|
-
return i === e ?
|
|
656
|
-
} })),
|
|
650
|
+
return i === e ? se.resolve(t, n, r) : i;
|
|
651
|
+
} }), b(b({}, Ae), {}, { resolve: (t, n, r) => {
|
|
652
|
+
let i = Ae.resolve(t, n, r);
|
|
653
|
+
return i === e ? be.resolve(t, n, r) : i;
|
|
654
|
+
} })), it = r("tag:yaml.org,2002:map", {
|
|
657
655
|
create: () => /* @__PURE__ */ new Map(),
|
|
658
656
|
addPair: (e, t, n) => (e.set(t, n), ""),
|
|
659
657
|
has: (e, t) => e.has(t),
|
|
@@ -669,7 +667,7 @@ var x = class t {
|
|
|
669
667
|
});
|
|
670
668
|
//#endregion
|
|
671
669
|
//#region src/tag/mapping/legacy_map.ts
|
|
672
|
-
function
|
|
670
|
+
function at(e) {
|
|
673
671
|
if (Array.isArray(e)) {
|
|
674
672
|
let t = Array.prototype.slice.call(e);
|
|
675
673
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -680,7 +678,7 @@ function it(e) {
|
|
|
680
678
|
}
|
|
681
679
|
return typeof e == "object" && Object.prototype.toString.call(e) === "[object Object]" ? "[object Object]" : String(e);
|
|
682
680
|
}
|
|
683
|
-
var
|
|
681
|
+
var ot = r("tag:yaml.org,2002:map", {
|
|
684
682
|
create: () => ({}),
|
|
685
683
|
identify: _,
|
|
686
684
|
represent: (e) => {
|
|
@@ -689,7 +687,7 @@ var at = r("tag:yaml.org,2002:map", {
|
|
|
689
687
|
return t;
|
|
690
688
|
},
|
|
691
689
|
addPair: (e, t, n) => {
|
|
692
|
-
let r =
|
|
690
|
+
let r = at(t);
|
|
693
691
|
return r === null ? "nested arrays are not supported inside keys" : (r === "__proto__" ? Object.defineProperty(e, r, {
|
|
694
692
|
value: n,
|
|
695
693
|
enumerable: !0,
|
|
@@ -698,7 +696,7 @@ var at = r("tag:yaml.org,2002:map", {
|
|
|
698
696
|
}) : e[r] = n, "");
|
|
699
697
|
},
|
|
700
698
|
has: (e, t) => {
|
|
701
|
-
let n =
|
|
699
|
+
let n = at(t);
|
|
702
700
|
return n !== null && Object.prototype.hasOwnProperty.call(e, n);
|
|
703
701
|
},
|
|
704
702
|
keys: (e) => Object.keys(e),
|
|
@@ -706,52 +704,52 @@ var at = r("tag:yaml.org,2002:map", {
|
|
|
706
704
|
let n = String(t);
|
|
707
705
|
return Object.prototype.hasOwnProperty.call(e, n) ? e[n] : null;
|
|
708
706
|
}
|
|
709
|
-
}),
|
|
707
|
+
}), st = {
|
|
710
708
|
maxLength: 79,
|
|
711
709
|
indent: 1,
|
|
712
710
|
linesBefore: 3,
|
|
713
711
|
linesAfter: 2
|
|
714
712
|
};
|
|
715
|
-
function
|
|
713
|
+
function ct(e, t, n, r, i) {
|
|
716
714
|
let a = "", o = "", s = Math.floor(i / 2) - 1;
|
|
717
715
|
return r - t > s && (a = " ... ", t = r - s + a.length), n - r > s && (o = " ...", n = r + s - o.length), {
|
|
718
716
|
str: a + e.slice(t, n).replace(/\t/g, "→") + o,
|
|
719
717
|
pos: r - t + a.length
|
|
720
718
|
};
|
|
721
719
|
}
|
|
722
|
-
function
|
|
720
|
+
function lt(e, t) {
|
|
723
721
|
return " ".repeat(Math.max(t - e.length, 0)) + e;
|
|
724
722
|
}
|
|
725
|
-
function
|
|
723
|
+
function ut(e, t) {
|
|
726
724
|
if (!e.buffer) return null;
|
|
727
|
-
let n = b(b({},
|
|
725
|
+
let n = b(b({}, st), t), r = /\r?\n|\r|\0/g, i = [0], a = [], o, s = -1;
|
|
728
726
|
for (; o = r.exec(e.buffer);) a.push(o.index), i.push(o.index + o[0].length), e.position <= o.index && s < 0 && (s = i.length - 2);
|
|
729
727
|
s < 0 && (s = i.length - 1);
|
|
730
728
|
let c = "", l = Math.min(e.line + n.linesAfter, a.length).toString().length, u = n.maxLength - (n.indent + l + 3);
|
|
731
729
|
for (let t = 1; t <= n.linesBefore && !(s - t < 0); t++) {
|
|
732
|
-
let r =
|
|
733
|
-
c = `${" ".repeat(n.indent)}${
|
|
730
|
+
let r = ct(e.buffer, i[s - t], a[s - t], e.position - (i[s] - i[s - t]), u);
|
|
731
|
+
c = `${" ".repeat(n.indent)}${lt((e.line - t + 1).toString(), l)} | ${r.str}\n${c}`;
|
|
734
732
|
}
|
|
735
|
-
let d =
|
|
736
|
-
c += `${" ".repeat(n.indent)}${
|
|
733
|
+
let d = ct(e.buffer, i[s], a[s], e.position, u);
|
|
734
|
+
c += `${" ".repeat(n.indent)}${lt((e.line + 1).toString(), l)} | ${d.str}\n`, c += `${"-".repeat(n.indent + l + 3 + d.pos)}^\n`;
|
|
737
735
|
for (let t = 1; t <= n.linesAfter && !(s + t >= a.length); t++) {
|
|
738
|
-
let r =
|
|
739
|
-
c += `${" ".repeat(n.indent)}${
|
|
736
|
+
let r = ct(e.buffer, i[s + t], a[s + t], e.position - (i[s] - i[s + t]), u);
|
|
737
|
+
c += `${" ".repeat(n.indent)}${lt((e.line + t + 1).toString(), l)} | ${r.str}\n`;
|
|
740
738
|
}
|
|
741
739
|
return c.replace(/\n$/, "");
|
|
742
740
|
}
|
|
743
741
|
//#endregion
|
|
744
742
|
//#region src/common/exception.ts
|
|
745
|
-
function
|
|
743
|
+
function dt(e, t) {
|
|
746
744
|
let n = "";
|
|
747
745
|
return e.mark ? (e.mark.name && (n += `in "${e.mark.name}" `), n += `(${e.mark.line + 1}:${e.mark.column + 1})`, !t && e.mark.snippet && (n += `\n\n${e.mark.snippet}`), `${e.reason} ${n}`) : e.reason;
|
|
748
746
|
}
|
|
749
|
-
var
|
|
747
|
+
var S = class e extends Error {
|
|
750
748
|
constructor(e, t) {
|
|
751
|
-
super(), y(this, "reason", void 0), y(this, "mark", void 0), this.name = "YAMLException", this.reason = e, this.mark = t, this.message =
|
|
749
|
+
super(), y(this, "reason", void 0), y(this, "mark", void 0), this.name = "YAMLException", this.reason = e, this.mark = t, this.message = dt(this, !1), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
|
|
752
750
|
}
|
|
753
751
|
toString(e) {
|
|
754
|
-
return `${this.name}: ${
|
|
752
|
+
return `${this.name}: ${dt(this, e)}`;
|
|
755
753
|
}
|
|
756
754
|
static throwAt(t, n, r, i = "") {
|
|
757
755
|
let a = 0, o = 0;
|
|
@@ -766,30 +764,30 @@ var C = class e extends Error {
|
|
|
766
764
|
line: a,
|
|
767
765
|
column: n - o
|
|
768
766
|
};
|
|
769
|
-
throw s.snippet =
|
|
767
|
+
throw s.snippet = ut(s), new e(r, s);
|
|
770
768
|
}
|
|
771
|
-
},
|
|
769
|
+
}, C = {
|
|
772
770
|
DOCUMENT: 1,
|
|
773
771
|
SEQUENCE: 2,
|
|
774
772
|
MAPPING: 3,
|
|
775
773
|
SCALAR: 4,
|
|
776
774
|
ALIAS: 5,
|
|
777
775
|
POP: 6
|
|
778
|
-
},
|
|
776
|
+
}, w = {
|
|
779
777
|
PLAIN: 1,
|
|
780
778
|
SINGLE_QUOTED: 2,
|
|
781
779
|
DOUBLE_QUOTED: 3,
|
|
782
780
|
LITERAL_BLOCK: 4,
|
|
783
781
|
FOLDED_BLOCK: 5
|
|
784
|
-
},
|
|
782
|
+
}, T = {
|
|
785
783
|
BLOCK: 1,
|
|
786
784
|
FLOW: 2
|
|
787
|
-
},
|
|
785
|
+
}, E = {
|
|
788
786
|
CLIP: 1,
|
|
789
787
|
STRIP: 2,
|
|
790
788
|
KEEP: 3
|
|
791
|
-
},
|
|
792
|
-
function
|
|
789
|
+
}, ft = -1;
|
|
790
|
+
function pt(e) {
|
|
793
791
|
switch (e) {
|
|
794
792
|
case 48: return "\0";
|
|
795
793
|
case 97: return "\x07";
|
|
@@ -812,18 +810,18 @@ function ft(e) {
|
|
|
812
810
|
default: return "";
|
|
813
811
|
}
|
|
814
812
|
}
|
|
815
|
-
var
|
|
816
|
-
for (let e = 0; e < 256; e++)
|
|
817
|
-
function
|
|
813
|
+
var mt = Array(256), ht = Array(256);
|
|
814
|
+
for (let e = 0; e < 256; e++) mt[e] = +!!pt(e), ht[e] = pt(e);
|
|
815
|
+
function gt(e) {
|
|
818
816
|
return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode((e - 65536 >> 10) + 55296, (e - 65536 & 1023) + 56320);
|
|
819
817
|
}
|
|
820
|
-
function
|
|
818
|
+
function _t(e) {
|
|
821
819
|
return e >= 48 && e <= 57 ? e - 48 : (e | 32) - 97 + 10;
|
|
822
820
|
}
|
|
823
|
-
function
|
|
821
|
+
function vt(e) {
|
|
824
822
|
return e === 120 ? 2 : e === 117 ? 4 : 8;
|
|
825
823
|
}
|
|
826
|
-
function
|
|
824
|
+
function D(e, t, n) {
|
|
827
825
|
let r = 0;
|
|
828
826
|
for (; t < n;) {
|
|
829
827
|
let n = e.charCodeAt(t);
|
|
@@ -837,62 +835,62 @@ function O(e, t, n) {
|
|
|
837
835
|
breaks: r
|
|
838
836
|
};
|
|
839
837
|
}
|
|
840
|
-
function
|
|
838
|
+
function yt(e) {
|
|
841
839
|
return e === 1 ? " " : "\n".repeat(e - 1);
|
|
842
840
|
}
|
|
843
|
-
function
|
|
841
|
+
function bt(e, t, n) {
|
|
844
842
|
let r = "", i = t, a = t, o = t;
|
|
845
843
|
for (; i < n;) {
|
|
846
844
|
let t = e.charCodeAt(i);
|
|
847
845
|
if (t === 10 || t === 13) {
|
|
848
846
|
r += e.slice(a, o);
|
|
849
|
-
let t =
|
|
850
|
-
r +=
|
|
847
|
+
let t = D(e, i, n);
|
|
848
|
+
r += yt(t.breaks), i = a = o = t.position;
|
|
851
849
|
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
852
850
|
}
|
|
853
851
|
return r + e.slice(a, o);
|
|
854
852
|
}
|
|
855
|
-
function
|
|
853
|
+
function xt(e, t, n) {
|
|
856
854
|
let r = "", i = t, a = t, o = t;
|
|
857
855
|
for (; i < n;) {
|
|
858
856
|
let t = e.charCodeAt(i);
|
|
859
857
|
if (t === 39) r += e.slice(a, i) + "'", i += 2, a = o = i;
|
|
860
858
|
else if (t === 10 || t === 13) {
|
|
861
859
|
r += e.slice(a, o);
|
|
862
|
-
let t =
|
|
863
|
-
r +=
|
|
860
|
+
let t = D(e, i, n);
|
|
861
|
+
r += yt(t.breaks), i = a = o = t.position;
|
|
864
862
|
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
865
863
|
}
|
|
866
864
|
return r + e.slice(a, n);
|
|
867
865
|
}
|
|
868
|
-
function
|
|
866
|
+
function St(e, t, n) {
|
|
869
867
|
let r = "", i = t, a = t, o = t;
|
|
870
868
|
for (; i < n;) {
|
|
871
869
|
let t = e.charCodeAt(i);
|
|
872
870
|
if (t === 92) {
|
|
873
871
|
r += e.slice(a, i), i++;
|
|
874
872
|
let t = e.charCodeAt(i);
|
|
875
|
-
if (t === 10 || t === 13) i =
|
|
876
|
-
else if (t < 256 &&
|
|
873
|
+
if (t === 10 || t === 13) i = D(e, i, n).position;
|
|
874
|
+
else if (t < 256 && mt[t]) r += ht[t], i++;
|
|
877
875
|
else {
|
|
878
|
-
let n =
|
|
876
|
+
let n = vt(t), a = 0;
|
|
879
877
|
for (; n > 0; n--) {
|
|
880
878
|
i++;
|
|
881
|
-
let t =
|
|
879
|
+
let t = _t(e.charCodeAt(i));
|
|
882
880
|
a = (a << 4) + t;
|
|
883
881
|
}
|
|
884
|
-
r +=
|
|
882
|
+
r += gt(a), i++;
|
|
885
883
|
}
|
|
886
884
|
a = o = i;
|
|
887
885
|
} else if (t === 10 || t === 13) {
|
|
888
886
|
r += e.slice(a, o);
|
|
889
|
-
let t =
|
|
890
|
-
r +=
|
|
887
|
+
let t = D(e, i, n);
|
|
888
|
+
r += yt(t.breaks), i = a = o = t.position;
|
|
891
889
|
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
892
890
|
}
|
|
893
891
|
return r + e.slice(a, n);
|
|
894
892
|
}
|
|
895
|
-
function
|
|
893
|
+
function Ct(e, t, n, r, i, a) {
|
|
896
894
|
let o = r < 0 ? 0 : r, s = e.slice(t, n).replace(/\r\n?/g, "\n"), c = s === "" ? [] : (s.endsWith("\n") ? s.slice(0, -1) : s).split("\n"), l = "", u = !1, d = 0, f = !1;
|
|
897
895
|
for (let e of c) {
|
|
898
896
|
let t = 0;
|
|
@@ -904,71 +902,95 @@ function St(e, t, n, r, i, a) {
|
|
|
904
902
|
let n = e.slice(o), i = n.charCodeAt(0);
|
|
905
903
|
a ? i === 32 || i === 9 ? (f = !0, l += "\n".repeat(u ? 1 + d : d)) : f ? (f = !1, l += "\n".repeat(d + 1)) : d === 0 ? u && (l += " ") : l += "\n".repeat(d) : l += "\n".repeat(u ? 1 + d : d), l += n, u = !0, d = 0;
|
|
906
904
|
}
|
|
907
|
-
return i ===
|
|
905
|
+
return i === E.KEEP ? l += "\n".repeat(u ? 1 + d : d) : i !== E.STRIP && u && (l += "\n"), l;
|
|
908
906
|
}
|
|
909
|
-
function
|
|
910
|
-
if (t.valueStart ===
|
|
907
|
+
function wt(e, t) {
|
|
908
|
+
if (t.valueStart === ft) return "";
|
|
911
909
|
let { valueStart: n, valueEnd: r } = t;
|
|
912
910
|
if (t.fast) return e.slice(n, r);
|
|
913
911
|
switch (t.style) {
|
|
914
|
-
case
|
|
915
|
-
case
|
|
916
|
-
case
|
|
917
|
-
case
|
|
918
|
-
default: return
|
|
912
|
+
case w.SINGLE_QUOTED: return xt(e, n, r);
|
|
913
|
+
case w.DOUBLE_QUOTED: return St(e, n, r);
|
|
914
|
+
case w.LITERAL_BLOCK: return Ct(e, n, r, t.indent, t.chomping, !1);
|
|
915
|
+
case w.FOLDED_BLOCK: return Ct(e, n, r, t.indent, t.chomping, !0);
|
|
916
|
+
default: return bt(e, n, r);
|
|
919
917
|
}
|
|
920
918
|
}
|
|
921
919
|
//#endregion
|
|
922
920
|
//#region src/common/tagname.ts
|
|
923
|
-
var
|
|
921
|
+
var Tt = Object.assign(Object.create(null), {
|
|
924
922
|
"!": "!",
|
|
925
923
|
"!!": "tag:yaml.org,2002:"
|
|
926
|
-
});
|
|
927
|
-
function
|
|
928
|
-
return
|
|
924
|
+
}), Et = "-#;/?:@&=+$_.~*'()", Dt = Et + "!,[]", Ot = "0123456789ABCDEF";
|
|
925
|
+
function O(e) {
|
|
926
|
+
return "%" + Ot[e >> 4] + Ot[e & 15];
|
|
929
927
|
}
|
|
930
|
-
function
|
|
928
|
+
function kt(e, t) {
|
|
929
|
+
let n = t ? Et : Dt, r = "";
|
|
930
|
+
for (let t = 0; t < e.length; t++) {
|
|
931
|
+
let i = e.charCodeAt(t);
|
|
932
|
+
i >= 48 && i <= 57 || i >= 65 && i <= 90 || i >= 97 && i <= 122 || n.includes(e[t]) ? r += e[t] : (i >= 55296 && i <= 56319 && (i = 65536 + ((i & 1023) << 10) + (e.charCodeAt(++t) & 1023)), r += i < 128 ? O(i) : i < 2048 ? O(192 | i >> 6) + O(128 | i & 63) : i < 65536 ? O(224 | i >> 12) + O(128 | i >> 6 & 63) + O(128 | i & 63) : O(240 | i >> 18) + O(128 | i >> 12 & 63) + O(128 | i >> 6 & 63) + O(128 | i & 63));
|
|
933
|
+
}
|
|
934
|
+
return r;
|
|
935
|
+
}
|
|
936
|
+
function At(e) {
|
|
937
|
+
let t = "", n = 0;
|
|
938
|
+
for (; n < e.length;) {
|
|
939
|
+
if (e.charCodeAt(n) !== 37) {
|
|
940
|
+
t += e[n++];
|
|
941
|
+
continue;
|
|
942
|
+
}
|
|
943
|
+
let r = parseInt(e.slice(n + 1, n + 3), 16);
|
|
944
|
+
if (n += 3, r >= 192) {
|
|
945
|
+
let t = r < 224 ? 1 : r < 240 ? 2 : 3;
|
|
946
|
+
for (r &= (1 << 6 - t) - 1; t-- > 0;) r = r << 6 | parseInt(e.slice(n + 1, n + 3), 16) & 63, n += 3;
|
|
947
|
+
}
|
|
948
|
+
r < 65536 ? t += String.fromCharCode(r) : (r -= 65536, t += String.fromCharCode(55296 | r >> 10, 56320 | r & 1023));
|
|
949
|
+
}
|
|
950
|
+
return t;
|
|
951
|
+
}
|
|
952
|
+
function jt(e, t) {
|
|
931
953
|
var n, r;
|
|
932
|
-
if (e.startsWith("!<") && e.endsWith(">")) return
|
|
933
|
-
let i = e.indexOf("!", 1), a = i === -1 ? "!" : e.slice(0, i + 1)
|
|
934
|
-
return
|
|
954
|
+
if (e.startsWith("!<") && e.endsWith(">")) return At(e.slice(2, -1));
|
|
955
|
+
let i = e.indexOf("!", 1), a = i === -1 ? "!" : e.slice(0, i + 1);
|
|
956
|
+
return At((n = (r = t == null ? void 0 : t[a]) == null ? Tt[a] : r) == null ? a : n) + At(e.slice(a.length));
|
|
935
957
|
}
|
|
936
|
-
function
|
|
958
|
+
function Mt(e) {
|
|
937
959
|
let t = e;
|
|
938
|
-
return t.charCodeAt(0) === 33 ? (t = t.slice(1), `!${
|
|
960
|
+
return t.charCodeAt(0) === 33 ? (t = t.slice(1), `!${kt(t, !0)}`) : t.slice(0, 18) === "tag:yaml.org,2002:" ? `!!${kt(t.slice(18), !0)}` : `!<${kt(t, !1)}>`;
|
|
939
961
|
}
|
|
940
962
|
//#endregion
|
|
941
963
|
//#region src/parser/constructor.ts
|
|
942
|
-
var k = -1,
|
|
964
|
+
var k = -1, Nt = "tag:yaml.org,2002:merge", Pt = {
|
|
943
965
|
filename: "",
|
|
944
|
-
schema:
|
|
966
|
+
schema: tt,
|
|
945
967
|
json: !1,
|
|
946
968
|
maxTotalMergeKeys: 1e4,
|
|
947
969
|
maxAliases: -1
|
|
948
970
|
};
|
|
949
|
-
function
|
|
971
|
+
function Ft(e) {
|
|
950
972
|
return "tagStart" in e && e.tagStart !== k ? e.tagStart : "anchorStart" in e && e.anchorStart !== k ? e.anchorStart : "valueStart" in e && e.valueStart !== k ? e.valueStart : "start" in e ? e.start : 0;
|
|
951
973
|
}
|
|
952
974
|
function A(e, t) {
|
|
953
|
-
|
|
975
|
+
S.throwAt(e.source, e.position, t, e.filename);
|
|
954
976
|
}
|
|
955
|
-
function
|
|
977
|
+
function It(e, t, n, r) {
|
|
956
978
|
try {
|
|
957
979
|
return n.finalize(r);
|
|
958
980
|
} catch (n) {
|
|
959
|
-
if (n instanceof
|
|
960
|
-
|
|
981
|
+
if (n instanceof S) throw n;
|
|
982
|
+
S.throwAt(e.source, t, n instanceof Error ? n.message : String(n), e.filename);
|
|
961
983
|
}
|
|
962
984
|
}
|
|
963
|
-
function
|
|
964
|
-
let r =
|
|
985
|
+
function Lt(t, n) {
|
|
986
|
+
let r = wt(t.source, n), i = n.tagStart === k ? "" : t.source.slice(n.tagStart, n.tagEnd), a = t.schema.defaultScalarTag;
|
|
965
987
|
if (i !== "") {
|
|
966
988
|
var o;
|
|
967
989
|
if (i === "!") return {
|
|
968
990
|
value: r,
|
|
969
991
|
tag: a
|
|
970
992
|
};
|
|
971
|
-
let n =
|
|
993
|
+
let n = jt(i, t.tagHandlers), s = t.schema.lookupScalarTag(n);
|
|
972
994
|
if (s) {
|
|
973
995
|
let i = s.resolve(r, !0, n);
|
|
974
996
|
return i === e && A(t, `cannot resolve a node with !<${n}> explicit tag`), {
|
|
@@ -981,68 +1003,68 @@ function Mt(t, n) {
|
|
|
981
1003
|
r !== "" && A(t, `cannot resolve a node with !<${n}> explicit tag`);
|
|
982
1004
|
let e = c.create(n);
|
|
983
1005
|
return {
|
|
984
|
-
value: c.carrierIsResult ? e :
|
|
1006
|
+
value: c.carrierIsResult ? e : It(t, t.position, c, e),
|
|
985
1007
|
tag: c
|
|
986
1008
|
};
|
|
987
1009
|
}
|
|
988
1010
|
A(t, `unknown scalar tag !<${n}>`);
|
|
989
1011
|
}
|
|
990
|
-
return n.style ===
|
|
1012
|
+
return n.style === w.PLAIN ? t.schema.resolveImplicitScalarTag(r) : {
|
|
991
1013
|
value: a.resolve(r, !1, a.tagName),
|
|
992
1014
|
tag: a
|
|
993
1015
|
};
|
|
994
1016
|
}
|
|
995
|
-
function
|
|
1017
|
+
function Rt(e, t, n) {
|
|
996
1018
|
let r = t.tagStart === k ? "" : e.source.slice(t.tagStart, t.tagEnd);
|
|
997
|
-
return r === "" || r === "!" ? n :
|
|
1019
|
+
return r === "" || r === "!" ? n : jt(r, e.tagHandlers);
|
|
998
1020
|
}
|
|
999
|
-
function
|
|
1021
|
+
function zt(e) {
|
|
1000
1022
|
return e.nodeKind === "mapping";
|
|
1001
1023
|
}
|
|
1002
|
-
function
|
|
1024
|
+
function Bt(e) {
|
|
1003
1025
|
e.totalMergeKeys++, e.maxTotalMergeKeys !== -1 && e.totalMergeKeys > e.maxTotalMergeKeys && A(e, `merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`);
|
|
1004
1026
|
}
|
|
1005
|
-
function
|
|
1006
|
-
|
|
1027
|
+
function Vt(e, t, n, r) {
|
|
1028
|
+
Bt(e);
|
|
1007
1029
|
for (let i of r.keys(n)) {
|
|
1008
|
-
if (
|
|
1030
|
+
if (Bt(e), t.tag.has(t.value, i)) continue;
|
|
1009
1031
|
let a = t.tag.addPair(t.value, i, r.get(n, i));
|
|
1010
1032
|
a && A(e, a), t.overridable != null || (t.overridable = /* @__PURE__ */ new Set()), t.overridable.add(i);
|
|
1011
1033
|
}
|
|
1012
1034
|
}
|
|
1013
|
-
function
|
|
1014
|
-
if (e.position = t.keyPosition,
|
|
1035
|
+
function Ht(e, t, n, r) {
|
|
1036
|
+
if (e.position = t.keyPosition, zt(r)) Vt(e, t, n, r);
|
|
1015
1037
|
else if (r.nodeKind === "sequence" && Array.isArray(n)) {
|
|
1016
1038
|
n.length > 100 && A(e, "abnormal merge sequence size");
|
|
1017
1039
|
for (let r of n) {
|
|
1018
1040
|
let n = e.nodeTags.get(r);
|
|
1019
|
-
n || A(e, "cannot merge mappings; the provided source object is unacceptable"),
|
|
1041
|
+
n || A(e, "cannot merge mappings; the provided source object is unacceptable"), Vt(e, t, r, n);
|
|
1020
1042
|
}
|
|
1021
1043
|
} else A(e, "cannot merge mappings; the provided source object is unacceptable");
|
|
1022
1044
|
}
|
|
1023
|
-
function
|
|
1045
|
+
function Ut(e, t, n, r, i) {
|
|
1024
1046
|
var a, o;
|
|
1025
1047
|
if (e.position = t.keyPosition, t.keyIsMerge) {
|
|
1026
|
-
|
|
1048
|
+
Ht(e, t, r, i);
|
|
1027
1049
|
return;
|
|
1028
1050
|
}
|
|
1029
1051
|
!e.json && t.tag.has(t.value, n) && !((a = t.overridable) != null && a.has(n)) && A(e, "duplicated mapping key");
|
|
1030
1052
|
let s = t.tag.addPair(t.value, n, r);
|
|
1031
1053
|
s && A(e, s), (o = t.overridable) == null || o.delete(n);
|
|
1032
1054
|
}
|
|
1033
|
-
function
|
|
1055
|
+
function Wt(e, t, n) {
|
|
1034
1056
|
let r = e.frames[e.frames.length - 1];
|
|
1035
1057
|
if (r.kind === "document") r.value = t, r.hasValue = !0;
|
|
1036
1058
|
else if (r.kind === "sequence") {
|
|
1037
|
-
|
|
1059
|
+
zt(n) && e.nodeTags.set(t, n);
|
|
1038
1060
|
let i = r.tag.addItem(r.value, t, r.index++);
|
|
1039
1061
|
i && A(e, i);
|
|
1040
1062
|
} else if (r.hasKey) {
|
|
1041
1063
|
let i = r.key;
|
|
1042
|
-
r.key = void 0, r.hasKey = !1,
|
|
1043
|
-
} else r.key = t, r.keyPosition = e.position, r.hasKey = !0, r.keyIsMerge = n.tagName ===
|
|
1064
|
+
r.key = void 0, r.hasKey = !1, Ut(e, r, i, t, n);
|
|
1065
|
+
} else r.key = t, r.keyPosition = e.position, r.hasKey = !0, r.keyIsMerge = n.tagName === Nt;
|
|
1044
1066
|
}
|
|
1045
|
-
function
|
|
1067
|
+
function Gt(e, t, n, r, i) {
|
|
1046
1068
|
if (t.anchorStart !== k) {
|
|
1047
1069
|
let a = {
|
|
1048
1070
|
value: n,
|
|
@@ -1053,8 +1075,8 @@ function Bt(e, t, n, r, i) {
|
|
|
1053
1075
|
}
|
|
1054
1076
|
return null;
|
|
1055
1077
|
}
|
|
1056
|
-
function
|
|
1057
|
-
let n = b(b(b({},
|
|
1078
|
+
function Kt(e, t) {
|
|
1079
|
+
let n = b(b(b({}, Pt), t), {}, {
|
|
1058
1080
|
events: e,
|
|
1059
1081
|
documents: [],
|
|
1060
1082
|
eventIndex: 0,
|
|
@@ -1068,8 +1090,8 @@ function Vt(e, t) {
|
|
|
1068
1090
|
});
|
|
1069
1091
|
for (; n.eventIndex < n.events.length;) {
|
|
1070
1092
|
let e = n.events[n.eventIndex++];
|
|
1071
|
-
switch (n.position =
|
|
1072
|
-
case
|
|
1093
|
+
switch (n.position = Ft(e), e.type) {
|
|
1094
|
+
case C.DOCUMENT:
|
|
1073
1095
|
n.anchors = /* @__PURE__ */ new Map(), n.nodeTags = /* @__PURE__ */ new Map(), n.aliasCount = 0, n.tagHandlers = Object.create(null);
|
|
1074
1096
|
for (let t of e.directives) t.kind === "tag" && (n.tagHandlers[t.handle] = t.prefix);
|
|
1075
1097
|
n.frames.push({
|
|
@@ -1079,15 +1101,15 @@ function Vt(e, t) {
|
|
|
1079
1101
|
hasValue: !1
|
|
1080
1102
|
});
|
|
1081
1103
|
break;
|
|
1082
|
-
case
|
|
1083
|
-
let { value: t, tag: r } =
|
|
1084
|
-
|
|
1104
|
+
case C.SCALAR: {
|
|
1105
|
+
let { value: t, tag: r } = Lt(n, e);
|
|
1106
|
+
Gt(n, e, t, r, !0), Wt(n, t, r);
|
|
1085
1107
|
break;
|
|
1086
1108
|
}
|
|
1087
|
-
case
|
|
1088
|
-
let t =
|
|
1109
|
+
case C.SEQUENCE: {
|
|
1110
|
+
let t = Rt(n, e, "tag:yaml.org,2002:seq"), r = n.schema.lookupSequenceTag(t);
|
|
1089
1111
|
r || A(n, `unknown sequence tag !<${t}>`);
|
|
1090
|
-
let i = r.create(t), a =
|
|
1112
|
+
let i = r.create(t), a = Gt(n, e, i, r, r.carrierIsResult);
|
|
1091
1113
|
n.frames.push({
|
|
1092
1114
|
kind: "sequence",
|
|
1093
1115
|
position: n.position,
|
|
@@ -1098,10 +1120,10 @@ function Vt(e, t) {
|
|
|
1098
1120
|
});
|
|
1099
1121
|
break;
|
|
1100
1122
|
}
|
|
1101
|
-
case
|
|
1102
|
-
let t =
|
|
1123
|
+
case C.MAPPING: {
|
|
1124
|
+
let t = Rt(n, e, "tag:yaml.org,2002:map"), r = n.schema.lookupMappingTag(t);
|
|
1103
1125
|
r || A(n, `unknown mapping tag !<${t}>`);
|
|
1104
|
-
let i = r.create(t), a =
|
|
1126
|
+
let i = r.create(t), a = Gt(n, e, i, r, r.carrierIsResult);
|
|
1105
1127
|
n.frames.push({
|
|
1106
1128
|
kind: "mapping",
|
|
1107
1129
|
position: n.position,
|
|
@@ -1116,18 +1138,18 @@ function Vt(e, t) {
|
|
|
1116
1138
|
});
|
|
1117
1139
|
break;
|
|
1118
1140
|
}
|
|
1119
|
-
case
|
|
1141
|
+
case C.ALIAS: {
|
|
1120
1142
|
n.maxAliases !== -1 && ++n.aliasCount > n.maxAliases && A(n, `aliases exceeded maxAliases (${n.maxAliases})`);
|
|
1121
1143
|
let t = n.source.slice(e.anchorStart, e.anchorEnd), r = n.anchors.get(t);
|
|
1122
|
-
r || A(n, `unidentified alias "${t}"`), r.isValueFinal || A(n, `recursive alias "${t}" is not supported for tag ${r.tag.tagName} because it uses finalize()`),
|
|
1144
|
+
r || A(n, `unidentified alias "${t}"`), r.isValueFinal || A(n, `recursive alias "${t}" is not supported for tag ${r.tag.tagName} because it uses finalize()`), Wt(n, r.value, r.tag);
|
|
1123
1145
|
break;
|
|
1124
1146
|
}
|
|
1125
|
-
case
|
|
1147
|
+
case C.POP: {
|
|
1126
1148
|
let e = n.frames.pop();
|
|
1127
1149
|
if (e.kind === "mapping" && e.hasKey && (n.position = e.keyPosition, A(n, "incomplete mapping pair in event stream")), e.kind === "document") n.documents.push(e.value);
|
|
1128
1150
|
else {
|
|
1129
|
-
let t = e.tag.carrierIsResult ? e.value :
|
|
1130
|
-
e.anchor && (e.anchor.value = t, e.anchor.isValueFinal = !0),
|
|
1151
|
+
let t = e.tag.carrierIsResult ? e.value : It(n, e.position, e.tag, e.value);
|
|
1152
|
+
e.anchor && (e.anchor.value = t, e.anchor.isValueFinal = !0), Wt(n, t, e.tag);
|
|
1131
1153
|
}
|
|
1132
1154
|
break;
|
|
1133
1155
|
}
|
|
@@ -1137,21 +1159,21 @@ function Vt(e, t) {
|
|
|
1137
1159
|
}
|
|
1138
1160
|
//#endregion
|
|
1139
1161
|
//#region src/parser/parser.ts
|
|
1140
|
-
var j = -1,
|
|
1162
|
+
var j = -1, qt = Object.prototype.hasOwnProperty, M = 1, Jt = 2, Yt = 3, Xt = 4, Zt = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Qt = /[,\[\]{}]/, $t = /^(?:!|!!|![0-9A-Za-z-]+!)$/, en = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`, tn = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`, nn = RegExp(`^(?:${en})*$`), rn = RegExp(`^(?:${tn})+$`), an = RegExp(`^(?:!(?:${en})*|${tn}(?:${en})*)$`), on = {
|
|
1141
1163
|
filename: "",
|
|
1142
1164
|
maxDepth: 100
|
|
1143
1165
|
};
|
|
1144
|
-
function
|
|
1166
|
+
function sn(e, t, n) {
|
|
1145
1167
|
e.events.push({
|
|
1146
|
-
type:
|
|
1168
|
+
type: C.DOCUMENT,
|
|
1147
1169
|
explicitStart: t,
|
|
1148
1170
|
explicitEnd: n,
|
|
1149
1171
|
directives: e.directives
|
|
1150
1172
|
});
|
|
1151
1173
|
}
|
|
1152
|
-
function
|
|
1174
|
+
function cn(e, t, n, r, i, a, o) {
|
|
1153
1175
|
e.events.push({
|
|
1154
|
-
type:
|
|
1176
|
+
type: C.SEQUENCE,
|
|
1155
1177
|
start: t,
|
|
1156
1178
|
anchorStart: n,
|
|
1157
1179
|
anchorEnd: r,
|
|
@@ -1160,9 +1182,9 @@ function tn(e, t, n, r, i, a, o) {
|
|
|
1160
1182
|
style: o
|
|
1161
1183
|
});
|
|
1162
1184
|
}
|
|
1163
|
-
function
|
|
1185
|
+
function ln(e, t, n, r, i, a, o) {
|
|
1164
1186
|
e.events.push({
|
|
1165
|
-
type:
|
|
1187
|
+
type: C.MAPPING,
|
|
1166
1188
|
start: t,
|
|
1167
1189
|
anchorStart: n,
|
|
1168
1190
|
anchorEnd: r,
|
|
@@ -1171,20 +1193,20 @@ function nn(e, t, n, r, i, a, o) {
|
|
|
1171
1193
|
style: o
|
|
1172
1194
|
});
|
|
1173
1195
|
}
|
|
1174
|
-
function
|
|
1196
|
+
function un(e, t) {
|
|
1175
1197
|
e.events.splice(t.eventsLength, 0, {
|
|
1176
|
-
type:
|
|
1198
|
+
type: C.MAPPING,
|
|
1177
1199
|
start: t.position,
|
|
1178
1200
|
anchorStart: j,
|
|
1179
1201
|
anchorEnd: j,
|
|
1180
1202
|
tagStart: j,
|
|
1181
1203
|
tagEnd: j,
|
|
1182
|
-
style:
|
|
1204
|
+
style: T.FLOW
|
|
1183
1205
|
});
|
|
1184
1206
|
}
|
|
1185
|
-
function
|
|
1207
|
+
function N(e, t, n, r, i, a, o, s, c = E.CLIP, l = -1, u = !1) {
|
|
1186
1208
|
e.events.push({
|
|
1187
|
-
type:
|
|
1209
|
+
type: C.SCALAR,
|
|
1188
1210
|
valueStart: t,
|
|
1189
1211
|
valueEnd: n,
|
|
1190
1212
|
anchorStart: r,
|
|
@@ -1197,20 +1219,20 @@ function P(e, t, n, r, i, a, o, s, c = D.CLIP, l = -1, u = !1) {
|
|
|
1197
1219
|
fast: u
|
|
1198
1220
|
});
|
|
1199
1221
|
}
|
|
1200
|
-
function
|
|
1222
|
+
function dn(e, t, n) {
|
|
1201
1223
|
e.events.push({
|
|
1202
|
-
type:
|
|
1224
|
+
type: C.ALIAS,
|
|
1203
1225
|
anchorStart: t,
|
|
1204
1226
|
anchorEnd: n
|
|
1205
1227
|
});
|
|
1206
1228
|
}
|
|
1207
|
-
function
|
|
1208
|
-
e.events.push({ type:
|
|
1229
|
+
function P(e) {
|
|
1230
|
+
e.events.push({ type: C.POP });
|
|
1209
1231
|
}
|
|
1210
|
-
function
|
|
1211
|
-
|
|
1232
|
+
function F(e) {
|
|
1233
|
+
N(e, j, j, j, j, j, j, w.PLAIN);
|
|
1212
1234
|
}
|
|
1213
|
-
function
|
|
1235
|
+
function fn() {
|
|
1214
1236
|
return {
|
|
1215
1237
|
anchorStart: j,
|
|
1216
1238
|
anchorEnd: j,
|
|
@@ -1218,7 +1240,7 @@ function on() {
|
|
|
1218
1240
|
tagEnd: j
|
|
1219
1241
|
};
|
|
1220
1242
|
}
|
|
1221
|
-
function
|
|
1243
|
+
function I(e) {
|
|
1222
1244
|
return {
|
|
1223
1245
|
position: e.position,
|
|
1224
1246
|
line: e.line,
|
|
@@ -1228,116 +1250,117 @@ function L(e) {
|
|
|
1228
1250
|
eventsLength: e.events.length
|
|
1229
1251
|
};
|
|
1230
1252
|
}
|
|
1231
|
-
function
|
|
1253
|
+
function L(e, t) {
|
|
1232
1254
|
e.position = t.position, e.line = t.line, e.lineStart = t.lineStart, e.lineIndent = t.lineIndent, e.firstTabInLine = t.firstTabInLine, e.events.length = t.eventsLength;
|
|
1233
1255
|
}
|
|
1234
|
-
function
|
|
1235
|
-
|
|
1256
|
+
function R(e, t) {
|
|
1257
|
+
S.throwAt(e.input.slice(0, e.length), e.position, t, e.filename);
|
|
1236
1258
|
}
|
|
1237
|
-
function
|
|
1259
|
+
function z(e) {
|
|
1238
1260
|
return e === 10 || e === 13;
|
|
1239
1261
|
}
|
|
1240
|
-
function
|
|
1262
|
+
function B(e) {
|
|
1241
1263
|
return e === 9 || e === 32;
|
|
1242
1264
|
}
|
|
1265
|
+
function V(e) {
|
|
1266
|
+
return B(e) || z(e);
|
|
1267
|
+
}
|
|
1243
1268
|
function H(e) {
|
|
1244
|
-
return
|
|
1269
|
+
return e === 0 || V(e);
|
|
1245
1270
|
}
|
|
1246
1271
|
function U(e) {
|
|
1247
|
-
return e === 0 || H(e);
|
|
1248
|
-
}
|
|
1249
|
-
function W(e) {
|
|
1250
1272
|
return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
|
|
1251
1273
|
}
|
|
1252
|
-
function
|
|
1274
|
+
function pn(e) {
|
|
1253
1275
|
return e >= 48 && e <= 57 ? e - 48 : -1;
|
|
1254
1276
|
}
|
|
1255
|
-
function
|
|
1277
|
+
function mn(e) {
|
|
1256
1278
|
if (e >= 48 && e <= 57) return e - 48;
|
|
1257
1279
|
let t = e | 32;
|
|
1258
1280
|
return t >= 97 && t <= 102 ? t - 97 + 10 : -1;
|
|
1259
1281
|
}
|
|
1260
|
-
function
|
|
1282
|
+
function hn(e) {
|
|
1261
1283
|
return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
|
|
1262
1284
|
}
|
|
1263
|
-
function
|
|
1285
|
+
function gn(e) {
|
|
1264
1286
|
return e === 48 || e === 97 || e === 98 || e === 116 || e === 9 || e === 110 || e === 118 || e === 102 || e === 114 || e === 101 || e === 32 || e === 34 || e === 47 || e === 92 || e === 78 || e === 95 || e === 76 || e === 80;
|
|
1265
1287
|
}
|
|
1266
|
-
function
|
|
1288
|
+
function _n(e) {
|
|
1267
1289
|
e.input.charCodeAt(e.position) === 10 ? e.position++ : (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++), e.line++, e.lineStart = e.position, e.lineIndent = 0, e.firstTabInLine = -1;
|
|
1268
1290
|
}
|
|
1269
|
-
function
|
|
1270
|
-
let n = 0, r = e.input.charCodeAt(e.position), i = e.position === e.lineStart ||
|
|
1291
|
+
function W(e, t) {
|
|
1292
|
+
let n = 0, r = e.input.charCodeAt(e.position), i = e.position === e.lineStart || V(e.input.charCodeAt(e.position - 1));
|
|
1271
1293
|
for (; r !== 0;) {
|
|
1272
|
-
for (;
|
|
1294
|
+
for (; B(r);) i = !0, r === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), r = e.input.charCodeAt(++e.position);
|
|
1273
1295
|
if (t && i && r === 35) do
|
|
1274
1296
|
r = e.input.charCodeAt(++e.position);
|
|
1275
|
-
while (!
|
|
1276
|
-
if (!
|
|
1277
|
-
for (
|
|
1297
|
+
while (!z(r) && r !== 0);
|
|
1298
|
+
if (!z(r)) break;
|
|
1299
|
+
for (_n(e), n++, i = !0, r = e.input.charCodeAt(e.position); r === 32;) e.lineIndent++, r = e.input.charCodeAt(++e.position);
|
|
1278
1300
|
}
|
|
1279
1301
|
return n;
|
|
1280
1302
|
}
|
|
1281
|
-
function
|
|
1303
|
+
function G(e, t = e.position) {
|
|
1282
1304
|
let n = e.input.charCodeAt(t);
|
|
1283
1305
|
if ((n === 45 || n === 46) && n === e.input.charCodeAt(t + 1) && n === e.input.charCodeAt(t + 2)) {
|
|
1284
1306
|
let n = e.input.charCodeAt(t + 3);
|
|
1285
|
-
return n === 0 ||
|
|
1307
|
+
return n === 0 || V(n);
|
|
1286
1308
|
}
|
|
1287
1309
|
return !1;
|
|
1288
1310
|
}
|
|
1289
|
-
function
|
|
1311
|
+
function vn(e) {
|
|
1290
1312
|
e.position === e.lineStart && e.input.charCodeAt(e.position) === 65279 && (e.position++, e.lineStart = e.position);
|
|
1291
1313
|
}
|
|
1292
|
-
function
|
|
1314
|
+
function yn(e) {
|
|
1293
1315
|
if (e.position !== e.lineStart) return !1;
|
|
1294
|
-
if (
|
|
1316
|
+
if (G(e)) return !0;
|
|
1295
1317
|
if (e.input.charCodeAt(e.position) !== 65279) return !1;
|
|
1296
|
-
let t =
|
|
1297
|
-
|
|
1298
|
-
let n = e.input.charCodeAt(e.position), r = e.position === e.lineStart && (n === 37 || n === 45 &&
|
|
1299
|
-
return
|
|
1318
|
+
let t = I(e);
|
|
1319
|
+
vn(e), W(e, !0);
|
|
1320
|
+
let n = e.input.charCodeAt(e.position), r = e.position === e.lineStart && (n === 37 || n === 45 && G(e));
|
|
1321
|
+
return L(e, t), r;
|
|
1300
1322
|
}
|
|
1301
|
-
function
|
|
1323
|
+
function bn(e) {
|
|
1302
1324
|
let t = e.input.charCodeAt(e.position);
|
|
1303
|
-
for (; t !== 0 && !
|
|
1325
|
+
for (; t !== 0 && !z(t);) t = e.input.charCodeAt(++e.position);
|
|
1304
1326
|
}
|
|
1305
|
-
function
|
|
1306
|
-
|
|
1327
|
+
function xn(e, t, n) {
|
|
1328
|
+
let r = Zt.exec(e.input.slice(t, n));
|
|
1329
|
+
r !== null && (e.position = t + r.index + r[0].length - 1, R(e, "the stream contains non-printable characters"));
|
|
1307
1330
|
}
|
|
1308
|
-
function
|
|
1331
|
+
function Sn(e, t, n) {
|
|
1309
1332
|
if (e.input.charCodeAt(e.position) !== 33) return !1;
|
|
1310
|
-
t.tagStart !== j &&
|
|
1333
|
+
t.tagStart !== j && R(e, "duplication of a tag property");
|
|
1311
1334
|
let r = e.position, i = !1, a = !1, o = "!", s = e.input.charCodeAt(++e.position);
|
|
1312
1335
|
s === 60 ? (i = !0, s = e.input.charCodeAt(++e.position)) : s === 33 && (a = !0, o = "!!", s = e.input.charCodeAt(++e.position));
|
|
1313
1336
|
let c = e.position, l;
|
|
1314
1337
|
if (i) {
|
|
1315
1338
|
for (; s !== 0 && s !== 62;) s = e.input.charCodeAt(++e.position);
|
|
1316
|
-
s !== 62 &&
|
|
1339
|
+
s !== 62 && R(e, "unexpected end of the stream within a verbatim tag"), l = e.input.slice(c, e.position), e.position++;
|
|
1317
1340
|
} else {
|
|
1318
|
-
for (; s !== 0 && !
|
|
1319
|
-
l = e.input.slice(c, e.position),
|
|
1341
|
+
for (; s !== 0 && !V(s) && !(n && U(s));) s === 33 && (a ? R(e, "tag suffix cannot contain exclamation marks") : (o = e.input.slice(c - 1, e.position + 1), $t.test(o) || R(e, "named tag handle cannot contain such characters"), a = !0, c = e.position + 1)), s = e.input.charCodeAt(++e.position);
|
|
1342
|
+
l = e.input.slice(c, e.position), Qt.test(l) && R(e, "tag suffix cannot contain flow indicator characters");
|
|
1320
1343
|
}
|
|
1321
|
-
return l && !(i ?
|
|
1344
|
+
return l && !(i ? nn.test(l) : rn.test(l)) && R(e, `tag name cannot contain such characters: ${l}`), !i && o !== "!" && o !== "!!" && !qt.call(e.tagHandlers, o) && R(e, `undeclared tag handle "${o}"`), t.tagStart = r, t.tagEnd = e.position, !0;
|
|
1322
1345
|
}
|
|
1323
|
-
function
|
|
1346
|
+
function Cn(e, t) {
|
|
1324
1347
|
if (e.input.charCodeAt(e.position) !== 38) return !1;
|
|
1325
|
-
t.anchorStart !== j &&
|
|
1348
|
+
t.anchorStart !== j && R(e, "duplication of an anchor property"), e.position++;
|
|
1326
1349
|
let n = e.position;
|
|
1327
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1328
|
-
return e.position === n &&
|
|
1350
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !V(e.input.charCodeAt(e.position)) && !U(e.input.charCodeAt(e.position));) e.position++;
|
|
1351
|
+
return e.position === n && R(e, "name of an anchor node must contain at least one character"), t.anchorStart = n, t.anchorEnd = e.position, !0;
|
|
1329
1352
|
}
|
|
1330
|
-
function
|
|
1353
|
+
function wn(e, t) {
|
|
1331
1354
|
if (e.input.charCodeAt(e.position) !== 42) return !1;
|
|
1332
|
-
(t.anchorStart !== j || t.tagStart !== j) &&
|
|
1355
|
+
(t.anchorStart !== j || t.tagStart !== j) && R(e, "alias node should not have any properties"), e.position++;
|
|
1333
1356
|
let n = e.position;
|
|
1334
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1335
|
-
return e.position === n &&
|
|
1357
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !V(e.input.charCodeAt(e.position)) && !U(e.input.charCodeAt(e.position));) e.position++;
|
|
1358
|
+
return e.position === n && R(e, "name of an alias node must contain at least one character"), dn(e, n, e.position), !0;
|
|
1336
1359
|
}
|
|
1337
|
-
function
|
|
1338
|
-
|
|
1360
|
+
function Tn(e, t) {
|
|
1361
|
+
W(e, !1), e.lineIndent < t && R(e, "deficient indentation");
|
|
1339
1362
|
}
|
|
1340
|
-
function
|
|
1363
|
+
function En(e, t, n) {
|
|
1341
1364
|
if (e.input.charCodeAt(e.position) !== 39) return !1;
|
|
1342
1365
|
e.position++;
|
|
1343
1366
|
let r = e.position, i = !0;
|
|
@@ -1349,13 +1372,13 @@ function bn(e, t, n) {
|
|
|
1349
1372
|
continue;
|
|
1350
1373
|
}
|
|
1351
1374
|
let t = e.position;
|
|
1352
|
-
return e.position++,
|
|
1375
|
+
return e.position++, N(e, r, t, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, w.SINGLE_QUOTED, E.CLIP, -1, i), !0;
|
|
1353
1376
|
}
|
|
1354
|
-
|
|
1377
|
+
z(a) ? (i = !1, Tn(e, t)) : e.position === e.lineStart && G(e) ? R(e, "unexpected end of the document within a single quoted scalar") : a !== 9 && a < 32 ? R(e, "expected valid JSON character") : e.position++;
|
|
1355
1378
|
}
|
|
1356
|
-
|
|
1379
|
+
R(e, "unexpected end of the stream within a single quoted scalar");
|
|
1357
1380
|
}
|
|
1358
|
-
function
|
|
1381
|
+
function Dn(e, t, n) {
|
|
1359
1382
|
if (e.input.charCodeAt(e.position) !== 34) return !1;
|
|
1360
1383
|
e.position++;
|
|
1361
1384
|
let r = e.position, i = !0;
|
|
@@ -1363,35 +1386,35 @@ function xn(e, t, n) {
|
|
|
1363
1386
|
let a = e.input.charCodeAt(e.position);
|
|
1364
1387
|
if (a === 34) {
|
|
1365
1388
|
let t = e.position;
|
|
1366
|
-
return e.position++,
|
|
1389
|
+
return e.position++, N(e, r, t, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, w.DOUBLE_QUOTED, E.CLIP, -1, i), !0;
|
|
1367
1390
|
}
|
|
1368
1391
|
if (a === 92) {
|
|
1369
1392
|
i = !1;
|
|
1370
1393
|
let n = e.input.charCodeAt(++e.position);
|
|
1371
|
-
if (
|
|
1372
|
-
else if (
|
|
1394
|
+
if (z(n)) Tn(e, t);
|
|
1395
|
+
else if (gn(n)) e.position++;
|
|
1373
1396
|
else {
|
|
1374
|
-
let t =
|
|
1375
|
-
for (t === 0 &&
|
|
1397
|
+
let t = hn(n);
|
|
1398
|
+
for (t === 0 && R(e, "unknown escape sequence"); t-- > 0;) e.position++, mn(e.input.charCodeAt(e.position)) < 0 && R(e, "expected hexadecimal character");
|
|
1376
1399
|
e.position++;
|
|
1377
1400
|
}
|
|
1378
|
-
} else
|
|
1401
|
+
} else z(a) ? (i = !1, Tn(e, t)) : e.position === e.lineStart && G(e) ? R(e, "unexpected end of the document within a double quoted scalar") : a !== 9 && a < 32 ? R(e, "expected valid JSON character") : e.position++;
|
|
1379
1402
|
}
|
|
1380
|
-
|
|
1403
|
+
R(e, "unexpected end of the stream within a double quoted scalar");
|
|
1381
1404
|
}
|
|
1382
|
-
function
|
|
1383
|
-
let r = e.input.charCodeAt(e.position), i =
|
|
1405
|
+
function On(e, t, n) {
|
|
1406
|
+
let r = e.input.charCodeAt(e.position), i = E.CLIP, a = -1, o = !1;
|
|
1384
1407
|
if (r !== 124 && r !== 62) return !1;
|
|
1385
|
-
let s = r === 124 ?
|
|
1408
|
+
let s = r === 124 ? w.LITERAL_BLOCK : w.FOLDED_BLOCK;
|
|
1386
1409
|
for (e.position++; e.input.charCodeAt(e.position) !== 0;) {
|
|
1387
|
-
let n = e.input.charCodeAt(e.position), r =
|
|
1388
|
-
if (n === 43 || n === 45) i !==
|
|
1389
|
-
else if (r >= 0) r === 0 &&
|
|
1410
|
+
let n = e.input.charCodeAt(e.position), r = pn(n);
|
|
1411
|
+
if (n === 43 || n === 45) i !== E.CLIP && R(e, "repeat of a chomping mode identifier"), i = n === 43 ? E.KEEP : E.STRIP, e.position++;
|
|
1412
|
+
else if (r >= 0) r === 0 && R(e, "bad explicit indentation width of a block scalar; it cannot be less than one"), o && R(e, "repeat of an indentation width identifier"), a = t + r - 1, o = !0, e.position++;
|
|
1390
1413
|
else break;
|
|
1391
1414
|
}
|
|
1392
1415
|
let c = !1;
|
|
1393
|
-
for (;
|
|
1394
|
-
c && e.input.charCodeAt(e.position) === 35 &&
|
|
1416
|
+
for (; B(e.input.charCodeAt(e.position));) c = !0, e.position++;
|
|
1417
|
+
c && e.input.charCodeAt(e.position) === 35 && bn(e), z(e.input.charCodeAt(e.position)) ? _n(e) : e.input.charCodeAt(e.position) !== 0 && R(e, "a line break is expected");
|
|
1395
1418
|
let l = o ? a : -1, u = 0, d = e.position, f = e.position;
|
|
1396
1419
|
for (; e.input.charCodeAt(e.position) !== 0;) {
|
|
1397
1420
|
let n = e.position, r = 0;
|
|
@@ -1401,173 +1424,174 @@ function Sn(e, t, n) {
|
|
|
1401
1424
|
l >= 0 ? r > l && (f = n + r) : r > 0 && (f = n + r);
|
|
1402
1425
|
break;
|
|
1403
1426
|
}
|
|
1404
|
-
if (
|
|
1405
|
-
if (!o && l === -1 &&
|
|
1427
|
+
if (yn(e)) break;
|
|
1428
|
+
if (!o && l === -1 && z(i) && (u = Math.max(u, r)), !o && l === -1 && !z(i) && (i === 9 && r < t && (e.position = n + r, R(e, "tab characters must not be used in indentation")), r >= t && r < u && (e.position = n + r, R(e, "bad indentation of a mapping entry"))), l === -1 && i !== 0 && !z(i) && r < t) {
|
|
1406
1429
|
e.lineIndent = r, e.position = n + r;
|
|
1407
1430
|
break;
|
|
1408
1431
|
}
|
|
1409
|
-
!o && i !== 0 && !
|
|
1432
|
+
!o && i !== 0 && !z(i) && l === -1 && (l = r);
|
|
1410
1433
|
let a = l === -1 ? t + 1 : l;
|
|
1411
|
-
if (i !== 0 && !
|
|
1434
|
+
if (i !== 0 && !z(i) && r < a) {
|
|
1412
1435
|
e.lineIndent = r, e.position = n + r;
|
|
1413
1436
|
break;
|
|
1414
1437
|
}
|
|
1415
|
-
|
|
1438
|
+
bn(e), f = e.position, z(e.input.charCodeAt(e.position)) && (_n(e), f = e.position);
|
|
1416
1439
|
}
|
|
1417
|
-
return
|
|
1440
|
+
return xn(e, d, f), N(e, d, f, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, s, i, l), !0;
|
|
1418
1441
|
}
|
|
1419
|
-
function
|
|
1442
|
+
function kn(e, t) {
|
|
1420
1443
|
let n = e.input.charCodeAt(e.position), r = t === M;
|
|
1421
|
-
if (n === 0 ||
|
|
1444
|
+
if (n === 0 || V(n) || n === 35 || n === 38 || n === 42 || n === 33 || n === 124 || n === 62 || n === 39 || n === 34 || n === 37 || n === 64 || n === 96 || U(n)) return !1;
|
|
1422
1445
|
if (n === 63 || n === 45) {
|
|
1423
1446
|
let t = e.input.charCodeAt(e.position + 1);
|
|
1424
|
-
if (
|
|
1447
|
+
if (H(t) || r && U(t)) return !1;
|
|
1425
1448
|
}
|
|
1426
1449
|
return !0;
|
|
1427
1450
|
}
|
|
1428
|
-
function
|
|
1429
|
-
if (!
|
|
1451
|
+
function An(e, t, n, r) {
|
|
1452
|
+
if (!kn(e, n)) return !1;
|
|
1430
1453
|
let i = e.position, a = e.position, o = e.input.charCodeAt(e.position), s = n === M, c = !1;
|
|
1431
|
-
for (; o !== 0 && !
|
|
1454
|
+
for (; o !== 0 && !yn(e);) {
|
|
1432
1455
|
if (o === 58) {
|
|
1433
1456
|
let t = e.input.charCodeAt(e.position + 1);
|
|
1434
|
-
if (
|
|
1457
|
+
if (H(t) || s && U(t)) break;
|
|
1435
1458
|
} else if (o === 35) {
|
|
1436
|
-
if (
|
|
1437
|
-
} else if (s &&
|
|
1438
|
-
else if (
|
|
1459
|
+
if (V(e.input.charCodeAt(e.position - 1))) break;
|
|
1460
|
+
} else if (s && U(o)) break;
|
|
1461
|
+
else if (z(o)) {
|
|
1439
1462
|
let n = e.position, r = e.line, i = e.lineStart, a = e.lineIndent;
|
|
1440
|
-
if (
|
|
1463
|
+
if (W(e, !1), e.lineIndent >= t) {
|
|
1441
1464
|
c = !0, o = e.input.charCodeAt(e.position);
|
|
1442
1465
|
continue;
|
|
1443
1466
|
}
|
|
1444
1467
|
e.position = n, e.line = r, e.lineStart = i, e.lineIndent = a;
|
|
1445
1468
|
break;
|
|
1446
1469
|
}
|
|
1447
|
-
|
|
1470
|
+
B(o) || (a = e.position + 1), o = e.input.charCodeAt(++e.position);
|
|
1448
1471
|
}
|
|
1449
|
-
return a
|
|
1472
|
+
return a !== i && (xn(e, i, a), N(e, i, a, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, w.PLAIN, E.CLIP, -1, !c), !0);
|
|
1450
1473
|
}
|
|
1451
|
-
function
|
|
1474
|
+
function K(e, t) {
|
|
1452
1475
|
let n = e.line;
|
|
1453
|
-
|
|
1476
|
+
W(e, !0), (e.line > n && e.lineIndent < t || e.firstTabInLine !== -1 && e.lineIndent < t) && R(e, "deficient indentation");
|
|
1454
1477
|
}
|
|
1455
|
-
function
|
|
1478
|
+
function jn(e, t, n) {
|
|
1456
1479
|
let r = e.input.charCodeAt(e.position), i = r === 123, a = e.position, o = !0;
|
|
1457
1480
|
if (r !== 91 && r !== 123) return !1;
|
|
1458
1481
|
let s = i ? 125 : 93;
|
|
1459
|
-
for (i ?
|
|
1460
|
-
|
|
1482
|
+
for (i ? ln(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, T.FLOW) : cn(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, T.FLOW), e.position++; e.input.charCodeAt(e.position) !== 0;) {
|
|
1483
|
+
K(e, t);
|
|
1461
1484
|
let n = e.input.charCodeAt(e.position);
|
|
1462
|
-
if (n === s) return e.position++,
|
|
1463
|
-
o ? n === 44 &&
|
|
1485
|
+
if (n === s) return e.position++, P(e), !0;
|
|
1486
|
+
o ? n === 44 && R(e, "expected the node content, but found ','") : R(e, "missed comma between flow collection entries");
|
|
1464
1487
|
let r = !1, a = !1;
|
|
1465
|
-
n === 63 &&
|
|
1466
|
-
let c = e.line, l =
|
|
1467
|
-
|
|
1488
|
+
n === 63 && V(e.input.charCodeAt(e.position + 1)) && (r = a = !0, e.position += 1, K(e, t));
|
|
1489
|
+
let c = e.line, l = I(e), u = q(e, t, M, !1, !0);
|
|
1490
|
+
K(e, t), n = e.input.charCodeAt(e.position), (i || a || e.line === c) && n === 58 ? (r = !0, e.position++, K(e, t), i || un(e, l), u || F(e), q(e, t, M, !1, !0) || F(e), K(e, t), i || P(e)) : i && r ? (u || F(e), F(e)) : i ? F(e) : r && (un(e, l), u || F(e), F(e), P(e)), n = e.input.charCodeAt(e.position), n === 44 ? (o = !0, e.position++) : o = !1;
|
|
1468
1491
|
}
|
|
1469
|
-
|
|
1492
|
+
R(e, "unexpected end of the stream within a flow collection");
|
|
1470
1493
|
}
|
|
1471
|
-
function
|
|
1472
|
-
if (e.firstTabInLine !== -1 || e.input.charCodeAt(e.position) !== 45 || !
|
|
1473
|
-
for (
|
|
1474
|
-
e.firstTabInLine !== -1 && (e.position = e.firstTabInLine,
|
|
1494
|
+
function Mn(e, t, n) {
|
|
1495
|
+
if (e.firstTabInLine !== -1 || e.input.charCodeAt(e.position) !== 45 || !H(e.input.charCodeAt(e.position + 1))) return !1;
|
|
1496
|
+
for (cn(e, e.position, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, T.BLOCK); e.input.charCodeAt(e.position) === 45 && H(e.input.charCodeAt(e.position + 1));) {
|
|
1497
|
+
e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, R(e, "tab characters must not be used in indentation"));
|
|
1475
1498
|
let n = e.line;
|
|
1476
1499
|
e.position++;
|
|
1477
|
-
let r =
|
|
1478
|
-
if (e.firstTabInLine !== -1 && e.input.charCodeAt(e.position) === 45 &&
|
|
1479
|
-
e.lineIndent > t &&
|
|
1500
|
+
let r = W(e, !0) > 0;
|
|
1501
|
+
if (e.firstTabInLine !== -1 && e.input.charCodeAt(e.position) === 45 && H(e.input.charCodeAt(e.position + 1)) && R(e, "bad indentation of a sequence entry"), r && e.lineIndent <= t ? F(e) : q(e, t, Yt, !1, !0), W(e, !0), e.lineIndent < t || e.position >= e.length) break;
|
|
1502
|
+
e.lineIndent > t && R(e, "bad indentation of a sequence entry"), e.line === n && e.input.charCodeAt(e.position) === 45 && H(e.input.charCodeAt(e.position + 1)) && R(e, "bad indentation of a sequence entry");
|
|
1480
1503
|
}
|
|
1481
|
-
return
|
|
1504
|
+
return P(e), !0;
|
|
1482
1505
|
}
|
|
1483
|
-
function
|
|
1506
|
+
function Nn(e, t, n, r) {
|
|
1484
1507
|
let i = !1, a = !1, o = !1, s = !1;
|
|
1485
1508
|
if (e.firstTabInLine !== -1) return !1;
|
|
1486
1509
|
let c = e.input.charCodeAt(e.position);
|
|
1487
1510
|
for (; c !== 0;) {
|
|
1488
|
-
!i && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine,
|
|
1511
|
+
!i && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, R(e, "tab characters must not be used in indentation"));
|
|
1489
1512
|
let l = e.input.charCodeAt(e.position + 1), u = e.line;
|
|
1490
|
-
if ((c === 63 || c === 58) &&
|
|
1513
|
+
if ((c === 63 || c === 58) && H(l)) o || (ln(e, e.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, T.BLOCK), o = !0), c === 63 ? (i && F(e), a = !0, i = !0) : (i || (F(e), a = !0), i = !1), e.position += 1, s = !0;
|
|
1491
1514
|
else {
|
|
1492
|
-
i && (
|
|
1493
|
-
let t =
|
|
1494
|
-
if (!
|
|
1515
|
+
i && (F(e), i = !1);
|
|
1516
|
+
let t = I(e);
|
|
1517
|
+
if (!q(e, n, Jt, !1, !0)) break;
|
|
1495
1518
|
if (e.line === u) {
|
|
1496
|
-
for (c = e.input.charCodeAt(e.position);
|
|
1497
|
-
if (c === 58) c = e.input.charCodeAt(++e.position),
|
|
1498
|
-
type:
|
|
1519
|
+
for (c = e.input.charCodeAt(e.position); B(c);) c = e.input.charCodeAt(++e.position);
|
|
1520
|
+
if (c === 58) c = e.input.charCodeAt(++e.position), H(c) || R(e, "a whitespace character is expected after the key-value separator within a block mapping"), o || (e.events.splice(t.eventsLength, 0, {
|
|
1521
|
+
type: C.MAPPING,
|
|
1499
1522
|
start: t.position,
|
|
1500
1523
|
anchorStart: r.anchorStart,
|
|
1501
1524
|
anchorEnd: r.anchorEnd,
|
|
1502
1525
|
tagStart: r.tagStart,
|
|
1503
1526
|
tagEnd: r.tagEnd,
|
|
1504
|
-
style:
|
|
1527
|
+
style: T.BLOCK
|
|
1505
1528
|
}), o = !0), a = !0, i = !1, s = !1;
|
|
1506
|
-
else if (a)
|
|
1507
|
-
else return r.anchorStart !== j || r.tagStart !== j ? (
|
|
1508
|
-
} else if (a)
|
|
1509
|
-
else return r.anchorStart !== j || r.tagStart !== j ? (
|
|
1529
|
+
else if (a) R(e, "expected ':' after a mapping key");
|
|
1530
|
+
else return r.anchorStart !== j || r.tagStart !== j ? (L(e, t), !1) : !0;
|
|
1531
|
+
} else if (a) R(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
1532
|
+
else return r.anchorStart !== j || r.tagStart !== j ? (L(e, t), !1) : !0;
|
|
1510
1533
|
}
|
|
1511
|
-
if (
|
|
1534
|
+
if (q(e, t, Xt, !0, s) && (s = !1), i || s && (F(e), s = !1), W(e, !0), c = e.input.charCodeAt(e.position), (e.line === u || e.lineIndent > t) && c !== 0) R(e, "bad indentation of a mapping entry");
|
|
1512
1535
|
else if (e.lineIndent < t) break;
|
|
1513
1536
|
}
|
|
1514
|
-
return a ? (i &&
|
|
1537
|
+
return a ? (i && F(e), o && P(e), !0) : !1;
|
|
1515
1538
|
}
|
|
1516
|
-
function
|
|
1517
|
-
e.depth >= e.maxDepth &&
|
|
1518
|
-
let o = 1, s = !1, c = !1, l = null, u =
|
|
1519
|
-
if (r &&
|
|
1520
|
-
let r = e.input.charCodeAt(e.position), i =
|
|
1539
|
+
function q(e, t, n, r, i, a = !0) {
|
|
1540
|
+
e.depth >= e.maxDepth && R(e, `nesting exceeded maxDepth (${e.maxDepth})`), e.depth++;
|
|
1541
|
+
let o = 1, s = !1, c = !1, l = null, u = fn(), d = n === Xt || n === Yt, f = d, p = d;
|
|
1542
|
+
if (r && W(e, !0) && (s = !0, o = e.lineIndent > t ? 1 : e.lineIndent === t ? 0 : -1), o === 1) for (;;) {
|
|
1543
|
+
let r = e.input.charCodeAt(e.position), i = I(e);
|
|
1521
1544
|
if (s && o !== 1 && (r === 33 || r === 38)) break;
|
|
1522
1545
|
if (s && p && (u.tagStart !== j || u.anchorStart !== j) && (r === 33 || r === 38)) {
|
|
1523
1546
|
var m;
|
|
1524
|
-
let n =
|
|
1525
|
-
if (
|
|
1526
|
-
|
|
1547
|
+
let n = I(e), r = t + 1;
|
|
1548
|
+
if (Nn(e, e.position - e.lineStart, r, u) && ((m = e.events[n.eventsLength]) == null ? void 0 : m.type) === C.MAPPING) return e.depth--, !0;
|
|
1549
|
+
L(e, n);
|
|
1527
1550
|
}
|
|
1528
|
-
if (s && (r === 33 && u.tagStart !== j || r === 38 && u.anchorStart !== j) || !
|
|
1529
|
-
l === null && (l = i),
|
|
1551
|
+
if (s && (r === 33 && u.tagStart !== j || r === 38 && u.anchorStart !== j) || !Sn(e, u, n === M) && !Cn(e, u)) break;
|
|
1552
|
+
l === null && (l = i), W(e, !0) ? (s = !0, f = p, o = e.lineIndent > t ? 1 : e.lineIndent === t ? 0 : -1) : f = !1;
|
|
1530
1553
|
}
|
|
1531
|
-
if (f && (f = s || i), o === 1 || n ===
|
|
1532
|
-
let r = n === M || n ===
|
|
1533
|
-
if (o === 1)
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1554
|
+
if (f && (f = s || i), o === 1 || n === Xt) {
|
|
1555
|
+
let r = n === M || n === Jt ? t : t + 1, i = e.position - e.lineStart;
|
|
1556
|
+
if (o === 1) {
|
|
1557
|
+
if (f && (Mn(e, i, u) || Nn(e, i, r, u)) || jn(e, r, u)) c = !0;
|
|
1558
|
+
else {
|
|
1559
|
+
let t = e.input.charCodeAt(e.position);
|
|
1560
|
+
if (l !== null && a && p && !f && t !== 124 && t !== 62) {
|
|
1561
|
+
var h;
|
|
1562
|
+
let t = I(e), n = l.position - l.lineStart;
|
|
1563
|
+
L(e, l), Nn(e, n, r, fn()) && ((h = e.events[t.eventsLength]) == null ? void 0 : h.type) === C.MAPPING ? c = !0 : L(e, t);
|
|
1564
|
+
}
|
|
1565
|
+
!c && (d && On(e, r, u) || En(e, r, u) || Dn(e, r, u) || wn(e, u) || An(e, r, n, u)) && (c = !0);
|
|
1540
1566
|
}
|
|
1541
|
-
|
|
1542
|
-
}
|
|
1543
|
-
else o === 0 && (c = f && En(e, i, u));
|
|
1567
|
+
} else o === 0 && (c = f && Mn(e, i, u));
|
|
1544
1568
|
}
|
|
1545
|
-
return d = d && !c, !c && (u.anchorStart !== j || u.tagStart !== j || d) && (
|
|
1569
|
+
return d = d && !c, !c && (u.anchorStart !== j || u.tagStart !== j || d) && (N(e, j, j, u.anchorStart, u.anchorEnd, u.tagStart, u.tagEnd, w.PLAIN), c = !0), e.depth--, c || u.anchorStart !== j || u.tagStart !== j;
|
|
1546
1570
|
}
|
|
1547
|
-
function
|
|
1571
|
+
function Pn(e) {
|
|
1548
1572
|
if (e.lineIndent > 0 || e.input.charCodeAt(e.position) !== 37) return !1;
|
|
1549
1573
|
e.position++;
|
|
1550
1574
|
let t = e.position;
|
|
1551
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1575
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !V(e.input.charCodeAt(e.position));) e.position++;
|
|
1552
1576
|
let n = e.input.slice(t, e.position), r = [];
|
|
1553
|
-
for (n.length === 0 &&
|
|
1554
|
-
for (;
|
|
1555
|
-
if (e.input.charCodeAt(e.position) === 35 ||
|
|
1577
|
+
for (n.length === 0 && R(e, "directive name must not be less than one character in length"); e.input.charCodeAt(e.position) !== 0 && !z(e.input.charCodeAt(e.position));) {
|
|
1578
|
+
for (; B(e.input.charCodeAt(e.position));) e.position++;
|
|
1579
|
+
if (e.input.charCodeAt(e.position) === 35 || z(e.input.charCodeAt(e.position)) || e.input.charCodeAt(e.position) === 0) break;
|
|
1556
1580
|
let t = e.position;
|
|
1557
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1581
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !V(e.input.charCodeAt(e.position));) e.position++;
|
|
1558
1582
|
r.push(e.input.slice(t, e.position));
|
|
1559
1583
|
}
|
|
1560
|
-
if (
|
|
1561
|
-
e.directives.some((e) => e.kind === "yaml") &&
|
|
1584
|
+
if (z(e.input.charCodeAt(e.position)) && _n(e), n === "YAML") {
|
|
1585
|
+
e.directives.some((e) => e.kind === "yaml") && R(e, "duplication of %YAML directive"), r.length !== 1 && R(e, "YAML directive accepts exactly one argument");
|
|
1562
1586
|
let t = /^([0-9]+)\.([0-9]+)$/.exec(r[0]);
|
|
1563
|
-
t === null &&
|
|
1587
|
+
t === null && R(e, "ill-formed argument of the YAML directive"), parseInt(t[1], 10) !== 1 && R(e, "unacceptable YAML version of the document"), e.directives.push({
|
|
1564
1588
|
kind: "yaml",
|
|
1565
1589
|
version: r[0]
|
|
1566
1590
|
});
|
|
1567
1591
|
} else if (n === "TAG") {
|
|
1568
|
-
r.length !== 2 &&
|
|
1592
|
+
r.length !== 2 && R(e, "TAG directive accepts exactly two arguments");
|
|
1569
1593
|
let [t, n] = r;
|
|
1570
|
-
|
|
1594
|
+
$t.test(t) || R(e, "ill-formed tag handle (first argument) of the TAG directive"), qt.call(e.tagHandlers, t) && R(e, `there is a previously declared suffix for "${t}" tag handle`), an.test(n) || R(e, "ill-formed tag prefix (second argument) of the TAG directive"), e.tagHandlers[t] = n, e.directives.push({
|
|
1571
1595
|
kind: "tag",
|
|
1572
1596
|
handle: t,
|
|
1573
1597
|
prefix: n
|
|
@@ -1575,30 +1599,30 @@ function On(e) {
|
|
|
1575
1599
|
}
|
|
1576
1600
|
return !0;
|
|
1577
1601
|
}
|
|
1578
|
-
function
|
|
1602
|
+
function Fn(e) {
|
|
1579
1603
|
e.directives = [], e.tagHandlers = Object.create(null);
|
|
1580
1604
|
let t = !1;
|
|
1581
|
-
for (
|
|
1605
|
+
for (W(e, !0); Pn(e);) t = !0, W(e, !0);
|
|
1582
1606
|
let n = !1, r = !1, i = !0;
|
|
1583
|
-
if (e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 &&
|
|
1607
|
+
if (e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 && H(e.input.charCodeAt(e.position + 3))) {
|
|
1584
1608
|
n = !0;
|
|
1585
1609
|
let t = e.line;
|
|
1586
|
-
e.position += 3,
|
|
1587
|
-
} else t &&
|
|
1610
|
+
e.position += 3, W(e, !0), i = e.line > t;
|
|
1611
|
+
} else t && R(e, "directives end mark is expected");
|
|
1588
1612
|
let a = e.events.length;
|
|
1589
|
-
if (!n && e.position === e.lineStart && e.input.charCodeAt(e.position) === 46 &&
|
|
1590
|
-
e.position += 3,
|
|
1613
|
+
if (!n && e.position === e.lineStart && e.input.charCodeAt(e.position) === 46 && G(e)) {
|
|
1614
|
+
e.position += 3, W(e, !0);
|
|
1591
1615
|
return;
|
|
1592
1616
|
}
|
|
1593
|
-
if (
|
|
1617
|
+
if (sn(e, n, !1), q(e, e.lineIndent - 1, Xt, !1, i, i) || F(e), W(e, !0), e.position === e.lineStart && G(e) && (r = e.input.charCodeAt(e.position) === 46, r)) {
|
|
1594
1618
|
let t = e.line;
|
|
1595
|
-
e.position += 3,
|
|
1619
|
+
e.position += 3, W(e, !0), e.line === t && e.position < e.length && R(e, "end of the stream or a document separator is expected");
|
|
1596
1620
|
}
|
|
1597
1621
|
let o = e.events[a];
|
|
1598
|
-
(o == null ? void 0 : o.type) ===
|
|
1622
|
+
(o == null ? void 0 : o.type) === C.DOCUMENT && (o.explicitEnd = r), P(e), !r && e.position < e.length && !yn(e) && R(e, "end of the stream or a document separator is expected");
|
|
1599
1623
|
}
|
|
1600
|
-
function
|
|
1601
|
-
let n = e.length, r = b(b(b({},
|
|
1624
|
+
function In(e, t) {
|
|
1625
|
+
let n = e.length, r = b(b(b({}, on), t), {}, {
|
|
1602
1626
|
input: `${e}\0`,
|
|
1603
1627
|
length: n,
|
|
1604
1628
|
position: 0,
|
|
@@ -1611,36 +1635,38 @@ function An(e, t) {
|
|
|
1611
1635
|
tagHandlers: Object.create(null),
|
|
1612
1636
|
events: []
|
|
1613
1637
|
}), i = e.indexOf("\0");
|
|
1614
|
-
for (i !== -1 &&
|
|
1638
|
+
for (i !== -1 && S.throwAt(e, i, "null byte is not allowed in input", r.filename); r.position < r.length && (vn(r), W(r, !0), !(r.position >= r.length));) {
|
|
1615
1639
|
let e = r.position;
|
|
1616
|
-
|
|
1640
|
+
Fn(r), r.position === e &&
|
|
1641
|
+
/* c8 ignore next */
|
|
1642
|
+
R(r, "can not read a document");
|
|
1617
1643
|
}
|
|
1618
1644
|
return r.events;
|
|
1619
1645
|
}
|
|
1620
1646
|
//#endregion
|
|
1621
1647
|
//#region src/load.ts
|
|
1622
|
-
var
|
|
1623
|
-
function
|
|
1624
|
-
let n = b(b({},
|
|
1625
|
-
return
|
|
1648
|
+
var Ln = b(b({}, on), Pt);
|
|
1649
|
+
function Rn(e, t = {}) {
|
|
1650
|
+
let n = b(b({}, Ln), t), r = String(e), i = Object.keys(on), a = Object.keys(Pt);
|
|
1651
|
+
return Kt(In(r, He(n, i)), b(b({}, He(n, a)), {}, { source: r }));
|
|
1626
1652
|
}
|
|
1627
|
-
function
|
|
1653
|
+
function zn(e, t, n) {
|
|
1628
1654
|
let r = null;
|
|
1629
1655
|
typeof t == "function" ? r = t : typeof t == "object" && t && (n = t);
|
|
1630
|
-
let i =
|
|
1656
|
+
let i = Rn(e, n);
|
|
1631
1657
|
if (r === null) return i;
|
|
1632
1658
|
for (let e of i) r(e);
|
|
1633
1659
|
}
|
|
1634
|
-
function
|
|
1635
|
-
let n =
|
|
1636
|
-
if (n.length === 0) throw new
|
|
1660
|
+
function Bn(e, t) {
|
|
1661
|
+
let n = Rn(e, t);
|
|
1662
|
+
if (n.length === 0) throw new S("expected a document, but the input is empty");
|
|
1637
1663
|
if (n.length === 1) return n[0];
|
|
1638
|
-
throw new
|
|
1664
|
+
throw new S("expected a single document in the stream, but found more");
|
|
1639
1665
|
}
|
|
1640
1666
|
//#endregion
|
|
1641
1667
|
//#region src/ast/from_js.ts
|
|
1642
|
-
var
|
|
1643
|
-
function
|
|
1668
|
+
var J = Symbol("INVALID");
|
|
1669
|
+
function Vn(e) {
|
|
1644
1670
|
let t = new Set([
|
|
1645
1671
|
e.defaultScalarTag,
|
|
1646
1672
|
e.defaultSequenceTag,
|
|
@@ -1661,7 +1687,7 @@ function Fn(e) {
|
|
|
1661
1687
|
}))
|
|
1662
1688
|
];
|
|
1663
1689
|
}
|
|
1664
|
-
function
|
|
1690
|
+
function Hn(e, t) {
|
|
1665
1691
|
for (let n = 0, r = e.representTypes.length; n < r; n += 1) {
|
|
1666
1692
|
let { tag: r, implicitTag: i } = e.representTypes[n];
|
|
1667
1693
|
if (r.identify(t)) {
|
|
@@ -1675,7 +1701,7 @@ function In(e, t) {
|
|
|
1675
1701
|
}
|
|
1676
1702
|
return null;
|
|
1677
1703
|
}
|
|
1678
|
-
function
|
|
1704
|
+
function Y(e, t) {
|
|
1679
1705
|
if (!e.noRefs && typeof t == "object" && t) {
|
|
1680
1706
|
let n = e.refs.get(t);
|
|
1681
1707
|
if (n) return n.anchor === void 0 && (n.anchor = `ref_${e.refCounter++}`), {
|
|
@@ -1683,17 +1709,17 @@ function X(e, t) {
|
|
|
1683
1709
|
anchor: n.anchor
|
|
1684
1710
|
};
|
|
1685
1711
|
}
|
|
1686
|
-
let n =
|
|
1712
|
+
let n = Hn(e, t);
|
|
1687
1713
|
if (!n) {
|
|
1688
|
-
if (t === void 0 || e.skipInvalid) return
|
|
1689
|
-
throw new
|
|
1714
|
+
if (t === void 0 || e.skipInvalid) return J;
|
|
1715
|
+
throw new S(`unacceptable kind of an object to dump ${Object.prototype.toString.call(t)}`);
|
|
1690
1716
|
}
|
|
1691
|
-
let { tag: r, tagName: i, implicitTag: a } = n, o = a ? i :
|
|
1717
|
+
let { tag: r, tagName: i, implicitTag: a } = n, o = a ? i : Mt(i);
|
|
1692
1718
|
if (r.nodeKind === "scalar") return {
|
|
1693
1719
|
kind: "scalar",
|
|
1694
1720
|
tag: o,
|
|
1695
1721
|
tagged: !a,
|
|
1696
|
-
style:
|
|
1722
|
+
style: w.PLAIN,
|
|
1697
1723
|
value: r.represent(t)
|
|
1698
1724
|
};
|
|
1699
1725
|
if (r.nodeKind === "sequence") {
|
|
@@ -1701,13 +1727,13 @@ function X(e, t) {
|
|
|
1701
1727
|
kind: "sequence",
|
|
1702
1728
|
tag: o,
|
|
1703
1729
|
tagged: !a,
|
|
1704
|
-
style:
|
|
1730
|
+
style: T.BLOCK,
|
|
1705
1731
|
items: []
|
|
1706
1732
|
};
|
|
1707
1733
|
e.noRefs || e.refs.set(t, i);
|
|
1708
1734
|
for (let t = 0, r = n.length; t < r; t += 1) {
|
|
1709
|
-
let r =
|
|
1710
|
-
r ===
|
|
1735
|
+
let r = Y(e, n[t]);
|
|
1736
|
+
r === J && n[t] === void 0 && (r = Y(e, null)), r !== J && i.items.push(r);
|
|
1711
1737
|
}
|
|
1712
1738
|
return i;
|
|
1713
1739
|
}
|
|
@@ -1715,67 +1741,65 @@ function X(e, t) {
|
|
|
1715
1741
|
kind: "mapping",
|
|
1716
1742
|
tag: o,
|
|
1717
1743
|
tagged: !a,
|
|
1718
|
-
style:
|
|
1744
|
+
style: T.BLOCK,
|
|
1719
1745
|
items: []
|
|
1720
1746
|
};
|
|
1721
1747
|
e.noRefs || e.refs.set(t, c);
|
|
1722
1748
|
for (let [t, n] of s) {
|
|
1723
|
-
let r =
|
|
1724
|
-
if (r ===
|
|
1725
|
-
let i =
|
|
1726
|
-
i !==
|
|
1749
|
+
let r = Y(e, t);
|
|
1750
|
+
if (r === J) continue;
|
|
1751
|
+
let i = Y(e, n);
|
|
1752
|
+
i !== J && c.items.push({
|
|
1727
1753
|
key: r,
|
|
1728
1754
|
value: i
|
|
1729
1755
|
});
|
|
1730
1756
|
}
|
|
1731
1757
|
return c;
|
|
1732
1758
|
}
|
|
1733
|
-
function
|
|
1759
|
+
function Un(e, t, n = {}) {
|
|
1734
1760
|
var r, i;
|
|
1735
|
-
let a =
|
|
1736
|
-
representTypes:
|
|
1737
|
-
noRefs: (r = n.noRefs)
|
|
1738
|
-
skipInvalid: (i = n.skipInvalid)
|
|
1761
|
+
let a = Y({
|
|
1762
|
+
representTypes: Vn(t),
|
|
1763
|
+
noRefs: (r = n.noRefs) != null && r,
|
|
1764
|
+
skipInvalid: (i = n.skipInvalid) != null && i,
|
|
1739
1765
|
refs: /* @__PURE__ */ new Map(),
|
|
1740
1766
|
refCounter: 0
|
|
1741
1767
|
}, e);
|
|
1742
1768
|
return [{
|
|
1743
|
-
contents: a ===
|
|
1769
|
+
contents: a === J ? null : a,
|
|
1744
1770
|
directives: []
|
|
1745
1771
|
}];
|
|
1746
1772
|
}
|
|
1747
1773
|
//#endregion
|
|
1748
1774
|
//#region src/ast/visit.ts
|
|
1749
|
-
var
|
|
1750
|
-
function
|
|
1775
|
+
var Wn = Symbol("visit:break"), Gn = Symbol("visit:skip");
|
|
1776
|
+
function Kn(e, t, n) {
|
|
1751
1777
|
let r = t(e, n);
|
|
1752
|
-
if (r ===
|
|
1753
|
-
if (r ===
|
|
1778
|
+
if (r === Wn) return !0;
|
|
1779
|
+
if (r === Gn) return !1;
|
|
1754
1780
|
let i = n.depth + 1;
|
|
1755
1781
|
switch (e.kind) {
|
|
1756
1782
|
case "sequence":
|
|
1757
|
-
for (let n of e.items) if (
|
|
1758
|
-
depth: i,
|
|
1759
|
-
parent: e,
|
|
1760
|
-
isKey: !1
|
|
1761
|
-
})) return !0;
|
|
1762
|
-
break;
|
|
1763
|
-
case "mapping":
|
|
1764
|
-
for (let { key: n, value: r } of e.items) if (Bn(n, t, {
|
|
1765
|
-
depth: i,
|
|
1766
|
-
parent: e,
|
|
1767
|
-
isKey: !0
|
|
1768
|
-
}) || Bn(r, t, {
|
|
1783
|
+
for (let n of e.items) if (Kn(n, t, {
|
|
1769
1784
|
depth: i,
|
|
1770
1785
|
parent: e,
|
|
1771
1786
|
isKey: !1
|
|
1772
1787
|
})) return !0;
|
|
1773
1788
|
break;
|
|
1789
|
+
case "mapping": for (let { key: n, value: r } of e.items) if (Kn(n, t, {
|
|
1790
|
+
depth: i,
|
|
1791
|
+
parent: e,
|
|
1792
|
+
isKey: !0
|
|
1793
|
+
}) || Kn(r, t, {
|
|
1794
|
+
depth: i,
|
|
1795
|
+
parent: e,
|
|
1796
|
+
isKey: !1
|
|
1797
|
+
})) return !0;
|
|
1774
1798
|
}
|
|
1775
1799
|
return !1;
|
|
1776
1800
|
}
|
|
1777
|
-
function
|
|
1778
|
-
for (let n of e) if (n.contents &&
|
|
1801
|
+
function qn(e, t) {
|
|
1802
|
+
for (let n of e) if (n.contents && Kn(n.contents, t, {
|
|
1779
1803
|
depth: 0,
|
|
1780
1804
|
parent: null,
|
|
1781
1805
|
isKey: !1
|
|
@@ -1783,43 +1807,43 @@ function Vn(e, t) {
|
|
|
1783
1807
|
}
|
|
1784
1808
|
//#endregion
|
|
1785
1809
|
//#region src/ast/styler_defaults.ts
|
|
1786
|
-
function
|
|
1787
|
-
return (e & 1 << t)
|
|
1788
|
-
}
|
|
1789
|
-
var
|
|
1790
|
-
applyQuoteFlowKeysOption:
|
|
1791
|
-
doubleQuoteForInvisibles:
|
|
1792
|
-
doubleQuoteWhitespaceOnly:
|
|
1793
|
-
applyForceQuotesOption:
|
|
1794
|
-
tryLongOrMultilineAsBlock:
|
|
1795
|
-
quoteInvalidPlain:
|
|
1796
|
-
fallbackToDoubleQuoted:
|
|
1810
|
+
function Jn(e, t) {
|
|
1811
|
+
return !!(e & 1 << t);
|
|
1812
|
+
}
|
|
1813
|
+
var Yn = {
|
|
1814
|
+
applyQuoteFlowKeysOption: Zn,
|
|
1815
|
+
doubleQuoteForInvisibles: Qn,
|
|
1816
|
+
doubleQuoteWhitespaceOnly: $n,
|
|
1817
|
+
applyForceQuotesOption: er,
|
|
1818
|
+
tryLongOrMultilineAsBlock: tr,
|
|
1819
|
+
quoteInvalidPlain: nr,
|
|
1820
|
+
fallbackToDoubleQuoted: rr
|
|
1797
1821
|
};
|
|
1798
|
-
function
|
|
1799
|
-
return e.presenterOptions.quoteStyle === "single" &&
|
|
1822
|
+
function Xn(e) {
|
|
1823
|
+
return e.presenterOptions.quoteStyle === "single" && Jn(e.allowedStylesMask, w.SINGLE_QUOTED) ? w.SINGLE_QUOTED : w.DOUBLE_QUOTED;
|
|
1800
1824
|
}
|
|
1801
|
-
function
|
|
1802
|
-
e.presenterOptions.quoteFlowKeys &&
|
|
1825
|
+
function Zn(e) {
|
|
1826
|
+
e.presenterOptions.quoteFlowKeys && e.isKey && e.flowOnly && e.style === w.PLAIN && (e.style = w.DOUBLE_QUOTED);
|
|
1803
1827
|
}
|
|
1804
|
-
function
|
|
1805
|
-
e.style ===
|
|
1828
|
+
function Qn(e) {
|
|
1829
|
+
e.style === w.PLAIN && /[\t\x7F-\xA0\u2028\u2029\uFEFF\uFFFE\uFFFF]/.test(e.node.value) && (e.style = w.DOUBLE_QUOTED);
|
|
1806
1830
|
}
|
|
1807
|
-
function
|
|
1808
|
-
e.style ===
|
|
1831
|
+
function $n(e) {
|
|
1832
|
+
e.style === w.PLAIN && /^\s+$/.test(e.node.value) && (e.style = w.DOUBLE_QUOTED);
|
|
1809
1833
|
}
|
|
1810
|
-
function
|
|
1811
|
-
e.presenterOptions.forceQuotes && (e.isKey || e.style !==
|
|
1834
|
+
function er(e) {
|
|
1835
|
+
e.presenterOptions.forceQuotes && (e.isKey || e.style !== w.PLAIN || e.node.tag === e.presenterOptions.schema.defaultScalarTag.tagName && (e.style = e.node.value.includes("\n") ? w.DOUBLE_QUOTED : Xn(e)));
|
|
1812
1836
|
}
|
|
1813
|
-
function
|
|
1814
|
-
if (e.style !==
|
|
1837
|
+
function tr(e) {
|
|
1838
|
+
if (e.style !== w.PLAIN || e.isKey) return;
|
|
1815
1839
|
let t = e.node.value, n = t.indexOf("\n") !== -1;
|
|
1816
|
-
if (!
|
|
1817
|
-
n && (e.style =
|
|
1840
|
+
if (!Jn(e.allowedStylesMask, w.LITERAL_BLOCK)) {
|
|
1841
|
+
n && (e.style = w.DOUBLE_QUOTED);
|
|
1818
1842
|
return;
|
|
1819
1843
|
}
|
|
1820
1844
|
let r = e.presenterOptions.lineWidth;
|
|
1821
1845
|
if (r === -1) {
|
|
1822
|
-
n && (e.style =
|
|
1846
|
+
n && (e.style = w.LITERAL_BLOCK);
|
|
1823
1847
|
return;
|
|
1824
1848
|
}
|
|
1825
1849
|
let i = Math.max(Math.min(r, 40), r - e.shiftOfContent), a = 0, o = !1;
|
|
@@ -1830,80 +1854,80 @@ function Yn(e) {
|
|
|
1830
1854
|
if (r.length > i && r[0] !== " " && / [^ \t]/.test(r) && (o = !0), n === -1) break;
|
|
1831
1855
|
a = n + 1;
|
|
1832
1856
|
}
|
|
1833
|
-
o ? e.style =
|
|
1857
|
+
o ? e.style = w.FOLDED_BLOCK : n && (e.style = w.LITERAL_BLOCK);
|
|
1834
1858
|
}
|
|
1835
|
-
function
|
|
1836
|
-
e.style ===
|
|
1859
|
+
function nr(e) {
|
|
1860
|
+
e.style === w.PLAIN && !Jn(e.allowedStylesMask, w.PLAIN) && (e.style = Xn(e));
|
|
1837
1861
|
}
|
|
1838
|
-
function
|
|
1839
|
-
|
|
1862
|
+
function rr(e) {
|
|
1863
|
+
Jn(e.allowedStylesMask, e.style) || (e.style = w.DOUBLE_QUOTED);
|
|
1840
1864
|
}
|
|
1841
1865
|
//#endregion
|
|
1842
1866
|
//#region src/ast/scalar_styler.ts
|
|
1843
|
-
function
|
|
1867
|
+
function X(e, t) {
|
|
1844
1868
|
return e | 1 << t;
|
|
1845
1869
|
}
|
|
1846
|
-
var
|
|
1847
|
-
function
|
|
1870
|
+
var ir = "[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]", ar = "[\\n\\r]", or = "\\uFEFF", sr = "[ \\t]", cr = `(?:(?!(?:${ar}|${or}))${ir})`, lr = `(?:(?!${sr})${cr})`, ur = "[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]", dr = "[-?:,\\[\\]{}#&*!|>'\"%@`]", fr = "[,\\[\\]{}]", pr = lr, mr = `(?:(?!${fr})${lr})`, hr = `(?:(?:(?!${dr})${lr})|[?:-](?=${pr}))`, gr = `(?:(?:(?!${dr})${lr})|[?:-](?=${mr}))`, _r = `(?:(?:(?![:#])${pr})|:(?=${pr}))#*`, vr = `(?:(?:(?![:#])${mr})|:(?=${mr}))#*`, yr = `(?:${sr}*${_r})*`, br = `(?:${sr}*${vr})*`, xr = `${hr}#*${yr}`, Sr = `${gr}#*${br}`, Cr = xr, wr = Sr, Tr = `\\n+${_r}${yr}`, Er = `\\n+${vr}${br}`, Dr = `${xr}(?:${Tr})*`, Or = `${Sr}(?:${Er})*`, kr = RegExp(`^(?:${Dr})$`, "u"), Ar = RegExp(`^(?:${Or})$`, "u"), jr = RegExp(`^(?:${Cr})$`, "u"), Mr = RegExp(`^(?:${wr})$`, "u"), Nr = RegExp(`^(?:${ur})*$`, "u"), Pr = RegExp(`^(?:${ur}|\\n)*$`, "u"), Fr = RegExp(`^(?:${cr}|\\n)*$`, "u"), Ir = /^(?:---|\.\.\.)(?=$|[ \t\n\r])/, Lr = /^(?:---|\.\.\.)(?=$|[ \t\n\r])/m;
|
|
1871
|
+
function Rr(e) {
|
|
1848
1872
|
let t = e.node.value;
|
|
1849
1873
|
if (t !== "") {
|
|
1850
|
-
if (!(e.isKey ? e.flowOnly ?
|
|
1874
|
+
if (!(e.isKey ? e.flowOnly ? Mr : jr : e.flowOnly ? Ar : kr).test(t) || e.shiftOfFirstLine === 0 && Ir.test(t)) return !1;
|
|
1851
1875
|
if (e.shiftOfContent === 0) {
|
|
1852
1876
|
let e = t.indexOf("\n");
|
|
1853
1877
|
if (e !== -1) {
|
|
1854
1878
|
let n = t.slice(e + 1);
|
|
1855
|
-
if (
|
|
1879
|
+
if (Lr.test(n)) return !1;
|
|
1856
1880
|
}
|
|
1857
1881
|
}
|
|
1858
1882
|
}
|
|
1859
1883
|
let n = e.presenterOptions.schema.resolveImplicitScalarTag(t).tag.tagName;
|
|
1860
1884
|
return !(!e.node.tagged && n !== e.node.tag || !e.node.tagged && t === "=" && n === e.presenterOptions.schema.defaultScalarTag.tagName);
|
|
1861
1885
|
}
|
|
1862
|
-
function
|
|
1886
|
+
function zr(e) {
|
|
1863
1887
|
let t = e.node.value;
|
|
1864
|
-
if (!(e.isKey ?
|
|
1888
|
+
if (!(e.isKey ? Nr : Pr).test(t) || /[ \t]\n|\n[ \t]/.test(t)) return !1;
|
|
1865
1889
|
if (!e.isKey && e.shiftOfContent === 0) {
|
|
1866
1890
|
let e = t.indexOf("\n");
|
|
1867
|
-
if (e !== -1 &&
|
|
1891
|
+
if (e !== -1 && Lr.test(t.slice(e + 1))) return !1;
|
|
1868
1892
|
}
|
|
1869
1893
|
return !0;
|
|
1870
1894
|
}
|
|
1871
|
-
function
|
|
1872
|
-
if (e.flowOnly || !
|
|
1895
|
+
function Br(e) {
|
|
1896
|
+
if (e.flowOnly || !Fr.test(e.node.value)) return !1;
|
|
1873
1897
|
let t = e.shiftOfContent - e.shiftOfParent;
|
|
1874
|
-
return !(t < 1 || t > 9 && /^\n* /.test(e.node.value) || e.shiftOfContent === 0 &&
|
|
1898
|
+
return !(t < 1 || t > 9 && /^\n* /.test(e.node.value) || e.shiftOfContent === 0 && Lr.test(e.node.value));
|
|
1875
1899
|
}
|
|
1876
|
-
function
|
|
1877
|
-
let t =
|
|
1878
|
-
|
|
1900
|
+
function Vr(e) {
|
|
1901
|
+
let t = X(0, w.DOUBLE_QUOTED);
|
|
1902
|
+
Rr(e) && (t = X(t, w.PLAIN)), zr(e) && (t = X(t, w.SINGLE_QUOTED)), Br(e) && (t = X(X(t, w.LITERAL_BLOCK), w.FOLDED_BLOCK)), e.allowedStylesMask = t;
|
|
1879
1903
|
}
|
|
1880
|
-
function
|
|
1904
|
+
function Hr(e) {
|
|
1881
1905
|
switch (e.style) {
|
|
1882
|
-
case
|
|
1883
|
-
case
|
|
1884
|
-
case
|
|
1885
|
-
case
|
|
1886
|
-
case
|
|
1906
|
+
case w.PLAIN: return Ur(e);
|
|
1907
|
+
case w.SINGLE_QUOTED: return Wr(e);
|
|
1908
|
+
case w.LITERAL_BLOCK: return Gr(e);
|
|
1909
|
+
case w.FOLDED_BLOCK: return Kr(e);
|
|
1910
|
+
case w.DOUBLE_QUOTED: return qr(e);
|
|
1887
1911
|
}
|
|
1888
1912
|
}
|
|
1889
|
-
function
|
|
1890
|
-
return
|
|
1913
|
+
function Ur(e) {
|
|
1914
|
+
return Jr(e.node.value, e.shiftOfContent);
|
|
1891
1915
|
}
|
|
1892
|
-
function
|
|
1893
|
-
return `'${
|
|
1916
|
+
function Wr(e) {
|
|
1917
|
+
return `'${Jr(e.node.value, e.shiftOfContent).replace(/'/g, "''")}'`;
|
|
1894
1918
|
}
|
|
1895
|
-
function
|
|
1919
|
+
function Gr(e) {
|
|
1896
1920
|
let t = e.node.value;
|
|
1897
|
-
return "|" +
|
|
1921
|
+
return "|" + Zr(t, e.shiftOfParent, e.shiftOfContent) + Qr(Yr(t, e.shiftOfContent));
|
|
1898
1922
|
}
|
|
1899
|
-
function
|
|
1923
|
+
function Kr(e) {
|
|
1900
1924
|
let t = e.node.value, n = e.presenterOptions.lineWidth, r = Infinity;
|
|
1901
|
-
return n !== -1 && (r = Math.max(Math.min(n, 40), n - e.shiftOfContent)), ">" +
|
|
1925
|
+
return n !== -1 && (r = Math.max(Math.min(n, 40), n - e.shiftOfContent)), ">" + Zr(t, e.shiftOfParent, e.shiftOfContent) + Qr(Yr(ti(t, r), e.shiftOfContent));
|
|
1902
1926
|
}
|
|
1903
|
-
function
|
|
1904
|
-
return `"${
|
|
1927
|
+
function qr(e) {
|
|
1928
|
+
return `"${ii(e.node.value)}"`;
|
|
1905
1929
|
}
|
|
1906
|
-
function
|
|
1930
|
+
function Jr(e, t) {
|
|
1907
1931
|
let n = e.indexOf("\n");
|
|
1908
1932
|
if (n === -1) return e;
|
|
1909
1933
|
let r = " ".repeat(t), i = e.slice(0, n), a = /(\n+)([^\n]*)/g;
|
|
@@ -1915,7 +1939,7 @@ function Hr(e, t) {
|
|
|
1915
1939
|
}
|
|
1916
1940
|
return i;
|
|
1917
1941
|
}
|
|
1918
|
-
function
|
|
1942
|
+
function Yr(e, t) {
|
|
1919
1943
|
let n = " ".repeat(t), r = 0, i = "", a = e.length;
|
|
1920
1944
|
for (; r < a;) {
|
|
1921
1945
|
let t, o = e.indexOf("\n", r);
|
|
@@ -1923,37 +1947,37 @@ function Ur(e, t) {
|
|
|
1923
1947
|
}
|
|
1924
1948
|
return i;
|
|
1925
1949
|
}
|
|
1926
|
-
function
|
|
1950
|
+
function Xr(e) {
|
|
1927
1951
|
return /^\n* /.test(e);
|
|
1928
1952
|
}
|
|
1929
|
-
function
|
|
1930
|
-
let r =
|
|
1953
|
+
function Zr(e, t, n) {
|
|
1954
|
+
let r = Xr(e) ? String(n - t) : "", i = e[e.length - 1] === "\n";
|
|
1931
1955
|
return `${r}${i && (e[e.length - 2] === "\n" || e === "\n") ? "+" : i ? "" : "-"}\n`;
|
|
1932
1956
|
}
|
|
1933
|
-
function
|
|
1957
|
+
function Qr(e) {
|
|
1934
1958
|
return e[e.length - 1] === "\n" ? e.slice(0, -1) : e;
|
|
1935
1959
|
}
|
|
1936
|
-
function
|
|
1960
|
+
function $r(e) {
|
|
1937
1961
|
return e === " " || e === " ";
|
|
1938
1962
|
}
|
|
1939
|
-
function
|
|
1940
|
-
if (e === "" ||
|
|
1963
|
+
function ei(e, t) {
|
|
1964
|
+
if (e === "" || $r(e[0])) return e;
|
|
1941
1965
|
let n = / [^ \t]/g, r, i = 0, a, o = 0, s = 0, c = "";
|
|
1942
1966
|
for (; r = n.exec(e);) s = r.index, s - i > t && (a = o > i ? o : s, c += `\n${e.slice(i, a)}`, i = a + 1), o = s;
|
|
1943
1967
|
return c += "\n", e.length - i > t && o > i ? c += `${e.slice(i, o)}\n${e.slice(o + 1)}` : c += e.slice(i), c.slice(1);
|
|
1944
1968
|
}
|
|
1945
|
-
function
|
|
1969
|
+
function ti(e, t) {
|
|
1946
1970
|
let n = /(\n+)([^\n]*)/g, r = e.indexOf("\n");
|
|
1947
1971
|
r === -1 && (r = e.length), n.lastIndex = r;
|
|
1948
|
-
let i =
|
|
1972
|
+
let i = ei(e.slice(0, r), t), a = e[0] === "\n" || $r(e[0]), o, s;
|
|
1949
1973
|
for (; s = n.exec(e);) {
|
|
1950
1974
|
let e = s[1], n = s[2];
|
|
1951
|
-
o = n !== "" &&
|
|
1975
|
+
o = n !== "" && $r(n[0]), i += e + (!a && !o && n !== "" ? "\n" : "") + ei(n, t), a = o;
|
|
1952
1976
|
}
|
|
1953
1977
|
return i;
|
|
1954
1978
|
}
|
|
1955
|
-
var
|
|
1956
|
-
function
|
|
1979
|
+
var ni = /["\\\x00-\x1F\x7F-\xA0\u2028\u2029\uD800-\uDFFF\uFEFF\uFFFE\uFFFF]/gu;
|
|
1980
|
+
function ri(e) {
|
|
1957
1981
|
switch (e) {
|
|
1958
1982
|
case "\0": return "\\0";
|
|
1959
1983
|
case "\x07": return "\\a";
|
|
@@ -1974,12 +1998,12 @@ function Zr(e) {
|
|
|
1974
1998
|
let t = e.charCodeAt(0), n = t.toString(16).toUpperCase();
|
|
1975
1999
|
return t <= 255 ? `\\x${"0".repeat(2 - n.length)}${n}` : `\\u${"0".repeat(4 - n.length)}${n}`;
|
|
1976
2000
|
}
|
|
1977
|
-
function
|
|
1978
|
-
return e.replace(
|
|
2001
|
+
function ii(e) {
|
|
2002
|
+
return e.replace(ni, ri);
|
|
1979
2003
|
}
|
|
1980
2004
|
//#endregion
|
|
1981
2005
|
//#region src/ast/presenter.ts
|
|
1982
|
-
var
|
|
2006
|
+
var Z = 10, ai = {
|
|
1983
2007
|
indent: 2,
|
|
1984
2008
|
seqNoIndent: !1,
|
|
1985
2009
|
seqInlineFirst: !0,
|
|
@@ -1990,23 +2014,23 @@ var $r = 10, ei = {
|
|
|
1990
2014
|
quoteFlowKeys: !1,
|
|
1991
2015
|
quoteStyle: "single",
|
|
1992
2016
|
forceQuotes: !1,
|
|
1993
|
-
scalarStyleRules: Object.keys(
|
|
2017
|
+
scalarStyleRules: Object.keys(Yn).map((e) => Reflect.get(Yn, e)),
|
|
1994
2018
|
tagBeforeAnchor: !1
|
|
1995
2019
|
};
|
|
1996
|
-
function
|
|
1997
|
-
return e.tagged ? e.tag :
|
|
2020
|
+
function oi(e) {
|
|
2021
|
+
return e.tagged ? e.tag : Mt(e.tag);
|
|
1998
2022
|
}
|
|
1999
|
-
function
|
|
2000
|
-
let t = b(b({},
|
|
2023
|
+
function si(e) {
|
|
2024
|
+
let t = b(b({}, ai), e);
|
|
2001
2025
|
return t.flowSkipColonSpace && (t.quoteFlowKeys = !0), b(b({}, t), {}, {
|
|
2002
2026
|
defaultScalarTagName: t.schema.defaultScalarTag.tagName,
|
|
2003
2027
|
openEnded: !1
|
|
2004
2028
|
});
|
|
2005
2029
|
}
|
|
2006
|
-
function
|
|
2030
|
+
function ci(e, t) {
|
|
2007
2031
|
return `\n${" ".repeat(e.indent * t)}`;
|
|
2008
2032
|
}
|
|
2009
|
-
function
|
|
2033
|
+
function li(e, t, n, r, i, a) {
|
|
2010
2034
|
return {
|
|
2011
2035
|
node: t,
|
|
2012
2036
|
parent: n,
|
|
@@ -2021,7 +2045,7 @@ function ii(e, t, n, r, i, a) {
|
|
|
2021
2045
|
style: t.style
|
|
2022
2046
|
};
|
|
2023
2047
|
}
|
|
2024
|
-
function
|
|
2048
|
+
function ui(e, t, n) {
|
|
2025
2049
|
let r = "";
|
|
2026
2050
|
for (let i = 0, a = n.items.length; i < a; i += 1) {
|
|
2027
2051
|
let a = Q(e, t, n.items[i], n, {}).text;
|
|
@@ -2030,7 +2054,7 @@ function ai(e, t, n) {
|
|
|
2030
2054
|
let i = e.flowBracketPadding && n.items.length > 0 ? " " : "";
|
|
2031
2055
|
return `[${i}${r}${i}]`;
|
|
2032
2056
|
}
|
|
2033
|
-
function
|
|
2057
|
+
function di(e, t, n, r) {
|
|
2034
2058
|
let i = "";
|
|
2035
2059
|
for (let a = 0, o = n.items.length; a < o; a += 1) {
|
|
2036
2060
|
let o = Q(e, t + 1, n.items[a], n, {
|
|
@@ -2038,11 +2062,11 @@ function oi(e, t, n, r) {
|
|
|
2038
2062
|
compact: e.seqInlineFirst,
|
|
2039
2063
|
isblockseq: !0
|
|
2040
2064
|
}).text;
|
|
2041
|
-
(!r || i !== "") && (i +=
|
|
2065
|
+
(!r || i !== "") && (i += ci(e, t)), o === "" || Z === o.charCodeAt(0) ? i += "-" : i += "- ", i += o;
|
|
2042
2066
|
}
|
|
2043
2067
|
return i;
|
|
2044
2068
|
}
|
|
2045
|
-
function
|
|
2069
|
+
function fi(e, t, n) {
|
|
2046
2070
|
let r = "";
|
|
2047
2071
|
for (let { key: i, value: a } of n.items) {
|
|
2048
2072
|
let o = "";
|
|
@@ -2053,32 +2077,32 @@ function si(e, t, n) {
|
|
|
2053
2077
|
let i = e.flowBracketPadding && r !== "" ? " " : "";
|
|
2054
2078
|
return `{${i}${r}${i}}`;
|
|
2055
2079
|
}
|
|
2056
|
-
function
|
|
2080
|
+
function pi(e, t, n, r) {
|
|
2057
2081
|
let i = "";
|
|
2058
2082
|
for (let a = 0, o = n.items.length; a < o; a += 1) {
|
|
2059
2083
|
let o = "";
|
|
2060
|
-
(!r || i !== "") && (o +=
|
|
2061
|
-
let { key: s, value: c } = n.items[a], l = (s.kind === "mapping" || s.kind === "sequence") && s.style ===
|
|
2084
|
+
(!r || i !== "") && (o += ci(e, t));
|
|
2085
|
+
let { key: s, value: c } = n.items[a], l = (s.kind === "mapping" || s.kind === "sequence") && s.style === T.BLOCK && s.items.length !== 0 || s.kind === "scalar" && (s.style === w.LITERAL_BLOCK || s.style === w.FOLDED_BLOCK), u = l ? Q(e, t + 1, s, n, {
|
|
2062
2086
|
block: !0,
|
|
2063
2087
|
compact: !0,
|
|
2064
|
-
isblockseq: !
|
|
2088
|
+
isblockseq: !mi(e, s, t + 1)
|
|
2065
2089
|
}) : Q(e, t + 1, s, n, {
|
|
2066
2090
|
block: !0,
|
|
2067
2091
|
compact: !0,
|
|
2068
2092
|
iskey: !0
|
|
2069
2093
|
}), d = u.text, f = s.kind === "scalar" && s.value.indexOf("\n") !== -1, p = d.length > 1024 && /^[\s\S]{1025}/u.test(d), m = l || f || p;
|
|
2070
|
-
m && (d &&
|
|
2094
|
+
m && (d && Z === d.charCodeAt(0) ? o += "?" : o += "? "), o += d, m && (o += ci(e, t));
|
|
2071
2095
|
let h = Q(e, t + 1, c, n, {
|
|
2072
2096
|
block: !0,
|
|
2073
2097
|
compact: m,
|
|
2074
|
-
isblockseq: m && !
|
|
2098
|
+
isblockseq: m && !mi(e, c, t + 1)
|
|
2075
2099
|
}).text, ee = s.kind === "scalar" && u.noBody && (s.tagged || s.anchor !== void 0), te = !m && (s.kind === "alias" || ee) ? " " : "";
|
|
2076
|
-
h === "" ||
|
|
2100
|
+
h === "" || Z === h.charCodeAt(0) ? o += `${te}:` : o += `${te}: `, o += h, i += o;
|
|
2077
2101
|
}
|
|
2078
2102
|
return i;
|
|
2079
2103
|
}
|
|
2080
|
-
function
|
|
2081
|
-
return t.kind === "alias"
|
|
2104
|
+
function mi(e, t, n) {
|
|
2105
|
+
return t.kind === "alias" || t.tagged || t.anchor !== void 0 || e.indent < 2 && n > 0;
|
|
2082
2106
|
}
|
|
2083
2107
|
function Q(e, t, n, r, i) {
|
|
2084
2108
|
var a;
|
|
@@ -2086,23 +2110,23 @@ function Q(e, t, n, r, i) {
|
|
|
2086
2110
|
text: `*${n.anchor}`,
|
|
2087
2111
|
noBody: !1
|
|
2088
2112
|
};
|
|
2089
|
-
let { block: o = !1, iskey: s = !1, isblockseq: c = !1 } = i, l = (a = i.compact)
|
|
2090
|
-
|
|
2091
|
-
let d, f = n.tagged, p = o && (n.kind === "mapping" || n.kind === "sequence") && n.style ===
|
|
2092
|
-
if (n.kind === "mapping") d = p ?
|
|
2093
|
-
else if (n.kind === "sequence") d = p ? e.seqNoIndent && !c && t > 0 ?
|
|
2113
|
+
let { block: o = !1, iskey: s = !1, isblockseq: c = !1 } = i, l = (a = i.compact) != null && a, u = n.anchor !== void 0;
|
|
2114
|
+
mi(e, n, t) && (l = !1);
|
|
2115
|
+
let d, f = n.tagged, p = o && (n.kind === "mapping" || n.kind === "sequence") && n.style === T.BLOCK && n.items.length !== 0;
|
|
2116
|
+
if (n.kind === "mapping") d = p ? pi(e, t, n, l) : fi(e, t, n);
|
|
2117
|
+
else if (n.kind === "sequence") d = p ? e.seqNoIndent && !c && t > 0 ? di(e, t - 1, n, l) : di(e, t, n, l) : ui(e, t, n);
|
|
2094
2118
|
else {
|
|
2095
|
-
let i =
|
|
2096
|
-
|
|
2119
|
+
let i = li(e, n, r, t, s, !o);
|
|
2120
|
+
Vr(i);
|
|
2097
2121
|
for (let t of e.scalarStyleRules) t(i);
|
|
2098
|
-
d =
|
|
2122
|
+
d = Hr(i), e.openEnded = (i.style === w.LITERAL_BLOCK || i.style === w.FOLDED_BLOCK) && (n.value === "\n" || n.value.endsWith("\n\n")), f = n.tagged || d === "" && i.flowOnly && (r == null ? void 0 : r.kind) === "sequence" && !u || i.style !== w.PLAIN && n.tag !== e.defaultScalarTagName;
|
|
2099
2123
|
}
|
|
2100
2124
|
(n.kind === "mapping" || n.kind === "sequence") && !p && (e.openEnded = !1), p && l && t > 0 && e.indent > 2 && (d = `${" ".repeat(e.indent - 2)}${d}`);
|
|
2101
2125
|
let m = d === "", h = d;
|
|
2102
2126
|
if (f || u) {
|
|
2103
|
-
let t = [], r = f ?
|
|
2127
|
+
let t = [], r = f ? oi(n) : null, i = u ? `&${n.anchor}` : null;
|
|
2104
2128
|
e.tagBeforeAnchor ? (r !== null && t.push(r), i !== null && t.push(i)) : (i !== null && t.push(i), r !== null && t.push(r));
|
|
2105
|
-
let a = d === "" || d.charCodeAt(0) ===
|
|
2129
|
+
let a = d === "" || d.charCodeAt(0) === Z ? "" : " ";
|
|
2106
2130
|
h = `${t.join(" ")}${a}${d}`;
|
|
2107
2131
|
}
|
|
2108
2132
|
return {
|
|
@@ -2110,10 +2134,10 @@ function Q(e, t, n, r, i) {
|
|
|
2110
2134
|
noBody: m
|
|
2111
2135
|
};
|
|
2112
2136
|
}
|
|
2113
|
-
function
|
|
2114
|
-
return (e.kind === "sequence" || e.kind === "mapping") && e.style ===
|
|
2137
|
+
function hi(e) {
|
|
2138
|
+
return (e.kind === "sequence" || e.kind === "mapping") && e.style === T.BLOCK && e.items.length !== 0 && !e.tagged && e.anchor === void 0;
|
|
2115
2139
|
}
|
|
2116
|
-
function
|
|
2140
|
+
function gi(e) {
|
|
2117
2141
|
let t = "";
|
|
2118
2142
|
for (let n of e.directives) {
|
|
2119
2143
|
if (n.kind === "yaml") {
|
|
@@ -2125,18 +2149,18 @@ function di(e) {
|
|
|
2125
2149
|
}
|
|
2126
2150
|
return t;
|
|
2127
2151
|
}
|
|
2128
|
-
function
|
|
2129
|
-
let n =
|
|
2152
|
+
function _i(e, t) {
|
|
2153
|
+
let n = si(t), r = "", i = !1;
|
|
2130
2154
|
for (let t = 0; t < e.length; t += 1) {
|
|
2131
2155
|
let a = e[t];
|
|
2132
2156
|
n.openEnded = !1;
|
|
2133
|
-
let o =
|
|
2157
|
+
let o = gi(a), s = o !== "", c = a.explicitStart || s || t > 0 && !i;
|
|
2134
2158
|
if (r += o, a.contents === null) c && (r += "---\n");
|
|
2135
2159
|
else if (c) {
|
|
2136
2160
|
let e = Q(n, 0, a.contents, null, {
|
|
2137
2161
|
block: !0,
|
|
2138
2162
|
compact: !0
|
|
2139
|
-
}).text, t = e === "" ? "" : s ||
|
|
2163
|
+
}).text, t = e === "" ? "" : s || hi(a.contents) ? "\n" : " ";
|
|
2140
2164
|
r += `---${t}${e}\n`;
|
|
2141
2165
|
} else r += Q(n, 0, a.contents, null, {
|
|
2142
2166
|
block: !0,
|
|
@@ -2148,73 +2172,73 @@ function fi(e, t) {
|
|
|
2148
2172
|
}
|
|
2149
2173
|
//#endregion
|
|
2150
2174
|
//#region src/dump.ts
|
|
2151
|
-
var
|
|
2152
|
-
schema:
|
|
2175
|
+
var vi = b(b({}, ai), {}, {
|
|
2176
|
+
schema: rt,
|
|
2153
2177
|
skipInvalid: !1,
|
|
2154
2178
|
noRefs: !1,
|
|
2155
2179
|
flowLevel: -1,
|
|
2156
2180
|
sortKeys: !1,
|
|
2157
2181
|
transform: () => {}
|
|
2158
2182
|
});
|
|
2159
|
-
function
|
|
2183
|
+
function yi(e, t) {
|
|
2160
2184
|
let n = String(e), r = String(t);
|
|
2161
2185
|
return n < r ? -1 : +(n > r);
|
|
2162
2186
|
}
|
|
2163
|
-
function
|
|
2164
|
-
let n = b(b({},
|
|
2187
|
+
function bi(e, t = {}) {
|
|
2188
|
+
let n = b(b({}, vi), t), r = Un(e, n.schema, {
|
|
2165
2189
|
noRefs: n.noRefs,
|
|
2166
2190
|
skipInvalid: n.skipInvalid
|
|
2167
2191
|
});
|
|
2168
|
-
if (n.flowLevel >= 0 &&
|
|
2169
|
-
if (!(t.depth < n.flowLevel)) return (e.kind === "sequence" || e.kind === "mapping") && (e.style =
|
|
2192
|
+
if (n.flowLevel >= 0 && qn(r, (e, t) => {
|
|
2193
|
+
if (!(t.depth < n.flowLevel)) return (e.kind === "sequence" || e.kind === "mapping") && (e.style = T.FLOW), Gn;
|
|
2170
2194
|
}), n.sortKeys) {
|
|
2171
|
-
let e = n.sortKeys === !0 ?
|
|
2172
|
-
|
|
2195
|
+
let e = n.sortKeys === !0 ? yi : n.sortKeys;
|
|
2196
|
+
qn(r, (t) => {
|
|
2173
2197
|
t.kind === "mapping" && t.items.sort((t, n) => e(t.key.kind === "scalar" ? t.key.value : "", n.key.kind === "scalar" ? n.key.value : ""));
|
|
2174
2198
|
});
|
|
2175
2199
|
}
|
|
2176
|
-
return n.transform(r),
|
|
2200
|
+
return n.transform(r), _i(r, b(b({}, He(n, Object.keys(ai))), {}, { schema: n.schema }));
|
|
2177
2201
|
}
|
|
2178
2202
|
//#endregion
|
|
2179
2203
|
//#region src/ast/from_events.ts
|
|
2180
2204
|
var $ = -1;
|
|
2181
|
-
function
|
|
2205
|
+
function xi(e) {
|
|
2182
2206
|
return "tagStart" in e && e.tagStart !== $ ? e.tagStart : "anchorStart" in e && e.anchorStart !== $ ? e.anchorStart : "valueStart" in e && e.valueStart !== $ ? e.valueStart : "start" in e ? e.start : 0;
|
|
2183
2207
|
}
|
|
2184
|
-
function
|
|
2208
|
+
function Si(e, t) {
|
|
2185
2209
|
return t.tagStart === $ ? "" : e.source.slice(t.tagStart, t.tagEnd);
|
|
2186
2210
|
}
|
|
2187
|
-
function
|
|
2211
|
+
function Ci(e, t) {
|
|
2188
2212
|
return t.anchorStart === $ ? void 0 : e.source.slice(t.anchorStart, t.anchorEnd);
|
|
2189
2213
|
}
|
|
2190
|
-
function
|
|
2191
|
-
let n =
|
|
2192
|
-
return r === "" ? i = t.style ===
|
|
2214
|
+
function wi(e, t) {
|
|
2215
|
+
let n = wt(e.source, t), r = Si(e, t), i, a = !1;
|
|
2216
|
+
return r === "" ? i = t.style === w.PLAIN ? e.schema.resolveImplicitScalarTag(n).tag.tagName : e.schema.defaultScalarTag.tagName : (a = !0, i = r), {
|
|
2193
2217
|
kind: "scalar",
|
|
2194
2218
|
tag: i,
|
|
2195
2219
|
tagged: a,
|
|
2196
2220
|
style: t.style,
|
|
2197
|
-
anchor:
|
|
2221
|
+
anchor: Ci(e, t),
|
|
2198
2222
|
value: n
|
|
2199
2223
|
};
|
|
2200
2224
|
}
|
|
2201
|
-
function
|
|
2202
|
-
let r =
|
|
2225
|
+
function Ti(e, t, n) {
|
|
2226
|
+
let r = Si(e, t), i, a = !1;
|
|
2203
2227
|
return r === "" ? i = n : (i = r, a = !0), {
|
|
2204
2228
|
tag: i,
|
|
2205
2229
|
tagged: a,
|
|
2206
2230
|
style: t.style,
|
|
2207
|
-
anchor:
|
|
2231
|
+
anchor: Ci(e, t)
|
|
2208
2232
|
};
|
|
2209
2233
|
}
|
|
2210
|
-
function
|
|
2234
|
+
function Ei(e, t) {
|
|
2211
2235
|
let n = e.frames[e.frames.length - 1];
|
|
2212
2236
|
n.kind === "document" ? n.doc.contents = t : n.kind === "sequence" ? n.node.items.push(t) : n.key ? (n.node.items.push({
|
|
2213
2237
|
key: n.key,
|
|
2214
2238
|
value: t
|
|
2215
2239
|
}), n.key = null) : n.key = t;
|
|
2216
2240
|
}
|
|
2217
|
-
function
|
|
2241
|
+
function Di(e, t) {
|
|
2218
2242
|
let n = {
|
|
2219
2243
|
source: t.source,
|
|
2220
2244
|
schema: t.schema,
|
|
@@ -2225,8 +2249,8 @@ function Si(e, t) {
|
|
|
2225
2249
|
};
|
|
2226
2250
|
for (; n.eventIndex < e.length;) {
|
|
2227
2251
|
let t = e[n.eventIndex++];
|
|
2228
|
-
switch (n.position =
|
|
2229
|
-
case
|
|
2252
|
+
switch (n.position = xi(t), t.type) {
|
|
2253
|
+
case C.DOCUMENT: {
|
|
2230
2254
|
let e = {
|
|
2231
2255
|
contents: null,
|
|
2232
2256
|
explicitStart: t.explicitStart,
|
|
@@ -2239,11 +2263,11 @@ function Si(e, t) {
|
|
|
2239
2263
|
});
|
|
2240
2264
|
break;
|
|
2241
2265
|
}
|
|
2242
|
-
case
|
|
2243
|
-
|
|
2266
|
+
case C.SCALAR:
|
|
2267
|
+
Ei(n, wi(n, t));
|
|
2244
2268
|
break;
|
|
2245
|
-
case
|
|
2246
|
-
let { tag: e, tagged: r, style: i, anchor: a } =
|
|
2269
|
+
case C.SEQUENCE: {
|
|
2270
|
+
let { tag: e, tagged: r, style: i, anchor: a } = Ti(n, t, "tag:yaml.org,2002:seq"), o = {
|
|
2247
2271
|
kind: "sequence",
|
|
2248
2272
|
tag: e,
|
|
2249
2273
|
tagged: r,
|
|
@@ -2257,8 +2281,8 @@ function Si(e, t) {
|
|
|
2257
2281
|
});
|
|
2258
2282
|
break;
|
|
2259
2283
|
}
|
|
2260
|
-
case
|
|
2261
|
-
let { tag: e, tagged: r, style: i, anchor: a } =
|
|
2284
|
+
case C.MAPPING: {
|
|
2285
|
+
let { tag: e, tagged: r, style: i, anchor: a } = Ti(n, t, "tag:yaml.org,2002:map"), o = {
|
|
2262
2286
|
kind: "mapping",
|
|
2263
2287
|
tag: e,
|
|
2264
2288
|
tagged: r,
|
|
@@ -2273,16 +2297,16 @@ function Si(e, t) {
|
|
|
2273
2297
|
});
|
|
2274
2298
|
break;
|
|
2275
2299
|
}
|
|
2276
|
-
case
|
|
2277
|
-
|
|
2300
|
+
case C.ALIAS:
|
|
2301
|
+
Ei(n, {
|
|
2278
2302
|
kind: "alias",
|
|
2279
2303
|
anchor: n.source.slice(t.anchorStart, t.anchorEnd)
|
|
2280
2304
|
});
|
|
2281
2305
|
break;
|
|
2282
|
-
case
|
|
2306
|
+
case C.POP: {
|
|
2283
2307
|
let e = n.frames.pop();
|
|
2284
2308
|
if (e.kind === "mapping" && e.key) throw Error("incomplete mapping pair in event stream");
|
|
2285
|
-
e.kind === "document" ? n.documents.push(e.doc) :
|
|
2309
|
+
e.kind === "document" ? n.documents.push(e.doc) : Ei(n, e.node);
|
|
2286
2310
|
break;
|
|
2287
2311
|
}
|
|
2288
2312
|
}
|
|
@@ -2291,8 +2315,8 @@ function Si(e, t) {
|
|
|
2291
2315
|
}
|
|
2292
2316
|
//#endregion
|
|
2293
2317
|
//#region src/index.ts
|
|
2294
|
-
var
|
|
2318
|
+
var Oi = C.DOCUMENT, ki = C.SEQUENCE, Ai = C.MAPPING, ji = C.SCALAR, Mi = C.ALIAS, Ni = C.POP, Pi = w.PLAIN, Fi = w.SINGLE_QUOTED, Ii = w.DOUBLE_QUOTED, Li = w.LITERAL_BLOCK, Ri = w.FOLDED_BLOCK, zi = T.BLOCK, Bi = T.FLOW, Vi = E.CLIP, Hi = E.STRIP, Ui = E.KEEP;
|
|
2295
2319
|
//#endregion
|
|
2296
|
-
export {
|
|
2320
|
+
export { Vi as CHOMPING_CLIP, Ui as CHOMPING_KEEP, E as CHOMPING_MODE, Hi as CHOMPING_STRIP, T as COLLECTION_STYLE, zi as COLLECTION_STYLE_BLOCK, Bi as COLLECTION_STYLE_FLOW, tt as CORE_SCHEMA, Yn as DEFAULT_SCALAR_STYLE_RULES, rt as DUMP_SCHEMA, Mi as EVENT_ALIAS, Oi as EVENT_DOCUMENT, C as EVENT_ID, Ai as EVENT_MAPPING, Ni as EVENT_POP, ji as EVENT_SCALAR, ki as EVENT_SEQUENCE, $e as FAILSAFE_SCHEMA, et as JSON_SCHEMA, e as NOT_RESOLVED, w as SCALAR_STYLE, Ii as SCALAR_STYLE_DOUBLE_QUOTED, Ri as SCALAR_STYLE_FOLDED_BLOCK, Li as SCALAR_STYLE_LITERAL_BLOCK, Pi as SCALAR_STYLE_PLAIN, Fi as SCALAR_STYLE_SINGLE_QUOTED, x as Schema, Wn as VISIT_BREAK, Gn as VISIT_SKIP, nt as YAML11_SCHEMA, S as YAMLException, Fe as binaryTag, f as boolCoreTag, h as boolJsonTag, ne as boolYaml11Tag, Kt as constructFromEvents, r as defineMappingTag, t as defineScalarTag, n as defineSequenceTag, bi as dump, Di as eventsToAst, be as floatCoreTag, Te as floatJsonTag, Ae as floatYaml11Tag, wt as getScalarValue, se as intCoreTag, fe as intJsonTag, g as intYaml11Tag, Un as jsToAst, ot as legacyMapTag, Bn as load, zn as loadAll, Ge as mapTag, je as mergeTag, o as nullCoreTag, s as nullJsonTag, l as nullYaml11Tag, Ue as omapTag, We as pairsTag, In as parseEvents, _i as present, it as realMapTag, Ve as seqTag, Ke as setTag, i as strTag, Be as timestampTag, qn as visit };
|
|
2297
2321
|
|
|
2298
2322
|
//# sourceMappingURL=js-yaml.esm.min.mjs.map
|