zudoku 0.40.1 → 0.41.1
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/dist/app/ZuploBuildConfig.d.ts +155 -0
- package/dist/app/ZuploBuildConfig.js +29 -0
- package/dist/app/ZuploBuildConfig.js.map +1 -0
- package/dist/app/env.d.ts +33 -0
- package/dist/app/env.js +29 -0
- package/dist/app/env.js.map +1 -0
- package/dist/app/main.js +7 -4
- package/dist/app/main.js.map +1 -1
- package/dist/cli/cli.js +12 -1
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/common/machine-id/lib.js +1 -0
- package/dist/cli/common/machine-id/lib.js.map +1 -1
- package/dist/config/loader.js +0 -3
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/common.d.ts +17 -11
- package/dist/config/validators/common.js +1 -1
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +7 -5
- package/dist/lib/authentication/providers/openid.d.ts +3 -1
- package/dist/lib/authentication/providers/openid.js +17 -11
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/components/BuildCheck.d.ts +4 -0
- package/dist/lib/components/BuildCheck.js +22 -0
- package/dist/lib/components/BuildCheck.js.map +1 -0
- package/dist/lib/components/Search.js +1 -1
- package/dist/lib/components/Search.js.map +1 -1
- package/dist/lib/components/Zudoku.js +1 -3
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/components/context/ViewportAnchorContext.js +8 -9
- package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +4 -0
- package/dist/lib/components/index.js +2 -0
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/PoweredByZudoku.js +2 -1
- package/dist/lib/components/navigation/PoweredByZudoku.js.map +1 -1
- package/dist/lib/components/navigation/ZuploLogo.d.ts +3 -0
- package/dist/lib/components/navigation/ZuploLogo.js +4 -0
- package/dist/lib/components/navigation/ZuploLogo.js.map +1 -0
- package/dist/lib/oas/parser/index.d.ts +1 -1
- package/dist/lib/oas/parser/index.js +3 -2
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.d.ts +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +6 -4
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/util/getRoutes.js +20 -13
- package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
- package/dist/lib/util/ensureArray.d.ts +1 -0
- package/dist/lib/util/ensureArray.js +2 -0
- package/dist/lib/util/ensureArray.js.map +1 -0
- package/dist/vite/api/SchemaManager.d.ts +36 -0
- package/dist/vite/api/SchemaManager.js +120 -0
- package/dist/vite/api/SchemaManager.js.map +1 -0
- package/dist/vite/api/SchemaManager.test.d.ts +1 -0
- package/dist/vite/api/SchemaManager.test.js +106 -0
- package/dist/vite/api/SchemaManager.test.js.map +1 -0
- package/dist/vite/config.js +5 -1
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-api.js +38 -110
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-sidebar.d.ts +3 -1
- package/dist/vite/plugin-sidebar.js +8 -2
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/zuplo/with-zuplo-processors.js +1 -1
- package/dist/zuplo/with-zuplo-processors.js.map +1 -1
- package/dist/zuplo/with-zuplo.d.ts +3 -0
- package/dist/zuplo/with-zuplo.js +6 -9
- package/dist/zuplo/with-zuplo.js.map +1 -1
- package/lib/{Markdown-C5h6bxbE.js → Markdown-DqDbGCj2.js} +314 -315
- package/lib/{Markdown-C5h6bxbE.js.map → Markdown-DqDbGCj2.js.map} +1 -1
- package/lib/{MdxPage-B66ht0D_.js → MdxPage-B7MyVLV5.js} +5 -5
- package/lib/{MdxPage-B66ht0D_.js.map → MdxPage-B7MyVLV5.js.map} +1 -1
- package/lib/{OasProvider-BKPF0Pbt.js → OasProvider-DY8kA-9x.js} +2 -2
- package/lib/{OasProvider-BKPF0Pbt.js.map → OasProvider-DY8kA-9x.js.map} +1 -1
- package/lib/{OperationList-0bhBU7ME.js → OperationList-BNneqYos.js} +798 -794
- package/lib/{OperationList-0bhBU7ME.js.map → OperationList-BNneqYos.js.map} +1 -1
- package/lib/{Pagination-Bt1czAiJ.js → Pagination-9TA5cwCh.js} +2 -2
- package/lib/{Pagination-Bt1czAiJ.js.map → Pagination-9TA5cwCh.js.map} +1 -1
- package/lib/{SchemaList-CsTIT1pi.js → SchemaList-CbFxph_p.js} +5 -5
- package/lib/{SchemaList-CsTIT1pi.js.map → SchemaList-CbFxph_p.js.map} +1 -1
- package/lib/{SchemaView-DCSWtnYr.js → SchemaView-DwlVvFfp.js} +2 -2
- package/lib/{SchemaView-DCSWtnYr.js.map → SchemaView-DwlVvFfp.js.map} +1 -1
- package/lib/{SlotletProvider-VUmTNmLZ.js → SlotletProvider-p4XaFFOh.js} +2 -2
- package/lib/{SlotletProvider-VUmTNmLZ.js.map → SlotletProvider-p4XaFFOh.js.map} +1 -1
- package/lib/{Toc-BK39DQvI.js → Toc-BVdRaIC0.js} +2 -2
- package/lib/{Toc-BK39DQvI.js.map → Toc-BVdRaIC0.js.map} +1 -1
- package/lib/{createServer-DLN7APz_.js → createServer-D_5UkLtY.js} +1459 -1485
- package/lib/createServer-D_5UkLtY.js.map +1 -0
- package/lib/{index-tpbiZmWp.js → index-BPmAnNGI.js} +686 -648
- package/lib/index-BPmAnNGI.js.map +1 -0
- package/lib/index-BpThvE5R.js +66 -0
- package/lib/index-BpThvE5R.js.map +1 -0
- package/lib/{index-Ba_X7EnR.js → index-pAogBEk7.js} +255 -249
- package/lib/{index-Ba_X7EnR.js.map → index-pAogBEk7.js.map} +1 -1
- package/lib/index-ueM1dihS.js +247 -0
- package/lib/index-ueM1dihS.js.map +1 -0
- package/lib/{index-DcHeSvkE.js → public-api-CrAQFYc4.js} +651 -684
- package/lib/public-api-CrAQFYc4.js.map +1 -0
- package/lib/zudoku.auth-openid.js +144 -138
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +23 -22
- package/lib/zudoku.plugin-api-catalog.js +2 -2
- package/lib/zudoku.plugin-api-keys.js +1 -1
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +1 -1
- package/package.json +2 -2
- package/src/app/ZuploBuildConfig.ts +33 -0
- package/src/app/env.ts +35 -0
- package/src/app/main.tsx +12 -1
- package/src/lib/authentication/providers/openid.tsx +23 -12
- package/src/lib/components/BuildCheck.tsx +60 -0
- package/src/lib/components/Search.tsx +1 -1
- package/src/lib/components/Zudoku.tsx +1 -3
- package/src/lib/components/context/ViewportAnchorContext.tsx +8 -15
- package/src/lib/components/index.ts +2 -0
- package/src/lib/components/navigation/PoweredByZudoku.tsx +8 -3
- package/src/lib/components/navigation/ZuploLogo.tsx +14 -0
- package/src/lib/oas/parser/index.ts +4 -2
- package/src/lib/plugins/openapi/OperationList.tsx +15 -3
- package/src/lib/plugins/openapi/util/getRoutes.tsx +21 -13
- package/src/lib/util/ensureArray.ts +3 -0
- package/client.d.ts +0 -8
- package/dist/lib/oas/parser/upgrade/index.d.ts +0 -9
- package/dist/lib/oas/parser/upgrade/index.js +0 -90
- package/dist/lib/oas/parser/upgrade/index.js.map +0 -1
- package/dist/zuplo/env.d.ts +0 -7
- package/dist/zuplo/env.js +0 -12
- package/dist/zuplo/env.js.map +0 -1
- package/lib/createServer-DLN7APz_.js.map +0 -1
- package/lib/index-DcHeSvkE.js.map +0 -1
- package/lib/index-tpbiZmWp.js.map +0 -1
- package/src/lib/oas/parser/upgrade/index.ts +0 -103
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ft = Symbol.for("yaml.alias"), it = Symbol.for("yaml.document"), G = Symbol.for("yaml.map"), Pt = Symbol.for("yaml.pair"), R = Symbol.for("yaml.scalar"), fe = Symbol.for("yaml.seq"), j = Symbol.for("yaml.node.type"), ue = (s) => !!s && typeof s == "object" && s[j] === ft, he = (s) => !!s && typeof s == "object" && s[j] === it, ke = (s) => !!s && typeof s == "object" && s[j] === G, T = (s) => !!s && typeof s == "object" && s[j] === Pt, I = (s) => !!s && typeof s == "object" && s[j] === R, Ne = (s) => !!s && typeof s == "object" && s[j] === fe;
|
|
2
2
|
function L(s) {
|
|
3
3
|
if (s && typeof s == "object")
|
|
4
4
|
switch (s[j]) {
|
|
5
5
|
case G:
|
|
6
|
-
case
|
|
6
|
+
case fe:
|
|
7
7
|
return !0;
|
|
8
8
|
}
|
|
9
9
|
return !1;
|
|
@@ -11,31 +11,31 @@ function L(s) {
|
|
|
11
11
|
function $(s) {
|
|
12
12
|
if (s && typeof s == "object")
|
|
13
13
|
switch (s[j]) {
|
|
14
|
-
case
|
|
14
|
+
case ft:
|
|
15
15
|
case G:
|
|
16
16
|
case R:
|
|
17
|
-
case
|
|
17
|
+
case fe:
|
|
18
18
|
return !0;
|
|
19
19
|
}
|
|
20
20
|
return !1;
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
function
|
|
24
|
-
const t =
|
|
25
|
-
|
|
22
|
+
const Ls = (s) => (I(s) || L(s)) && !!s.anchor, M = Symbol("break visit"), jt = Symbol("skip children"), F = Symbol("remove node");
|
|
23
|
+
function H(s, e) {
|
|
24
|
+
const t = Dt(e);
|
|
25
|
+
he(s) ? te(null, s.contents, t, Object.freeze([s])) === F && (s.contents = null) : te(null, s, t, Object.freeze([]));
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
const i =
|
|
27
|
+
H.BREAK = M;
|
|
28
|
+
H.SKIP = jt;
|
|
29
|
+
H.REMOVE = F;
|
|
30
|
+
function te(s, e, t, n) {
|
|
31
|
+
const i = qt(s, e, t, n);
|
|
32
32
|
if ($(i) || T(i))
|
|
33
|
-
return
|
|
33
|
+
return Ft(s, n, i), te(s, i, t, n);
|
|
34
34
|
if (typeof i != "symbol") {
|
|
35
35
|
if (L(e)) {
|
|
36
36
|
n = Object.freeze(n.concat(e));
|
|
37
37
|
for (let r = 0; r < e.items.length; ++r) {
|
|
38
|
-
const o =
|
|
38
|
+
const o = te(r, e.items[r], t, n);
|
|
39
39
|
if (typeof o == "number")
|
|
40
40
|
r = o - 1;
|
|
41
41
|
else {
|
|
@@ -46,11 +46,11 @@ function ie(s, e, t, n) {
|
|
|
46
46
|
}
|
|
47
47
|
} else if (T(e)) {
|
|
48
48
|
n = Object.freeze(n.concat(e));
|
|
49
|
-
const r =
|
|
49
|
+
const r = te("key", e.key, t, n);
|
|
50
50
|
if (r === M)
|
|
51
51
|
return M;
|
|
52
52
|
r === F && (e.key = null);
|
|
53
|
-
const o =
|
|
53
|
+
const o = te("value", e.value, t, n);
|
|
54
54
|
if (o === M)
|
|
55
55
|
return M;
|
|
56
56
|
o === F && (e.value = null);
|
|
@@ -58,22 +58,22 @@ function ie(s, e, t, n) {
|
|
|
58
58
|
}
|
|
59
59
|
return i;
|
|
60
60
|
}
|
|
61
|
-
async function
|
|
62
|
-
const t =
|
|
63
|
-
|
|
61
|
+
async function ut(s, e) {
|
|
62
|
+
const t = Dt(e);
|
|
63
|
+
he(s) ? await se(null, s.contents, t, Object.freeze([s])) === F && (s.contents = null) : await se(null, s, t, Object.freeze([]));
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
async function
|
|
69
|
-
const i = await
|
|
65
|
+
ut.BREAK = M;
|
|
66
|
+
ut.SKIP = jt;
|
|
67
|
+
ut.REMOVE = F;
|
|
68
|
+
async function se(s, e, t, n) {
|
|
69
|
+
const i = await qt(s, e, t, n);
|
|
70
70
|
if ($(i) || T(i))
|
|
71
|
-
return
|
|
71
|
+
return Ft(s, n, i), se(s, i, t, n);
|
|
72
72
|
if (typeof i != "symbol") {
|
|
73
73
|
if (L(e)) {
|
|
74
74
|
n = Object.freeze(n.concat(e));
|
|
75
75
|
for (let r = 0; r < e.items.length; ++r) {
|
|
76
|
-
const o = await
|
|
76
|
+
const o = await se(r, e.items[r], t, n);
|
|
77
77
|
if (typeof o == "number")
|
|
78
78
|
r = o - 1;
|
|
79
79
|
else {
|
|
@@ -84,11 +84,11 @@ async function re(s, e, t, n) {
|
|
|
84
84
|
}
|
|
85
85
|
} else if (T(e)) {
|
|
86
86
|
n = Object.freeze(n.concat(e));
|
|
87
|
-
const r = await
|
|
87
|
+
const r = await se("key", e.key, t, n);
|
|
88
88
|
if (r === M)
|
|
89
89
|
return M;
|
|
90
90
|
r === F && (e.key = null);
|
|
91
|
-
const o = await
|
|
91
|
+
const o = await se("value", e.value, t, n);
|
|
92
92
|
if (o === M)
|
|
93
93
|
return M;
|
|
94
94
|
o === F && (e.value = null);
|
|
@@ -96,7 +96,7 @@ async function re(s, e, t, n) {
|
|
|
96
96
|
}
|
|
97
97
|
return i;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function Dt(s) {
|
|
100
100
|
return typeof s == "object" && (s.Collection || s.Node || s.Value) ? Object.assign({
|
|
101
101
|
Alias: s.Node,
|
|
102
102
|
Map: s.Node,
|
|
@@ -111,42 +111,42 @@ function Rt(s) {
|
|
|
111
111
|
Seq: s.Collection
|
|
112
112
|
}, s) : s;
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function qt(s, e, t, n) {
|
|
115
115
|
var i, r, o, l, a;
|
|
116
116
|
if (typeof t == "function")
|
|
117
117
|
return t(s, e, n);
|
|
118
|
-
if (
|
|
118
|
+
if (ke(e))
|
|
119
119
|
return (i = t.Map) == null ? void 0 : i.call(t, s, e, n);
|
|
120
|
-
if (
|
|
120
|
+
if (Ne(e))
|
|
121
121
|
return (r = t.Seq) == null ? void 0 : r.call(t, s, e, n);
|
|
122
122
|
if (T(e))
|
|
123
123
|
return (o = t.Pair) == null ? void 0 : o.call(t, s, e, n);
|
|
124
|
-
if (
|
|
124
|
+
if (I(e))
|
|
125
125
|
return (l = t.Scalar) == null ? void 0 : l.call(t, s, e, n);
|
|
126
|
-
if (
|
|
126
|
+
if (ue(e))
|
|
127
127
|
return (a = t.Alias) == null ? void 0 : a.call(t, s, e, n);
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function Ft(s, e, t) {
|
|
130
130
|
const n = e[e.length - 1];
|
|
131
131
|
if (L(n))
|
|
132
132
|
n.items[s] = t;
|
|
133
133
|
else if (T(n))
|
|
134
134
|
s === "key" ? n.key = t : n.value = t;
|
|
135
|
-
else if (
|
|
135
|
+
else if (he(n))
|
|
136
136
|
n.contents = t;
|
|
137
137
|
else {
|
|
138
|
-
const i =
|
|
138
|
+
const i = ue(n) ? "alias" : "scalar";
|
|
139
139
|
throw new Error(`Cannot replace node with ${i} parent`);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
const
|
|
142
|
+
const $s = {
|
|
143
143
|
"!": "%21",
|
|
144
144
|
",": "%2C",
|
|
145
145
|
"[": "%5B",
|
|
146
146
|
"]": "%5D",
|
|
147
147
|
"{": "%7B",
|
|
148
148
|
"}": "%7D"
|
|
149
|
-
},
|
|
149
|
+
}, _s = (s) => s.replace(/[!,[\]{}]/g, (e) => $s[e]);
|
|
150
150
|
class B {
|
|
151
151
|
constructor(e, t) {
|
|
152
152
|
this.docStart = null, this.docEnd = !1, this.yaml = Object.assign({}, B.defaultYaml, e), this.tags = Object.assign({}, B.defaultTags, t);
|
|
@@ -236,7 +236,7 @@ class B {
|
|
|
236
236
|
tagString(e) {
|
|
237
237
|
for (const [t, n] of Object.entries(this.tags))
|
|
238
238
|
if (e.startsWith(n))
|
|
239
|
-
return t +
|
|
239
|
+
return t + _s(e.substring(n.length));
|
|
240
240
|
return e[0] === "!" ? e : `!<${e}>`;
|
|
241
241
|
}
|
|
242
242
|
toString(e) {
|
|
@@ -244,7 +244,7 @@ class B {
|
|
|
244
244
|
let i;
|
|
245
245
|
if (e && n.length > 0 && $(e.contents)) {
|
|
246
246
|
const r = {};
|
|
247
|
-
|
|
247
|
+
H(e.contents, (o, l) => {
|
|
248
248
|
$(l) && l.tag && (r[l.tag] = !0);
|
|
249
249
|
}), i = Object.keys(r);
|
|
250
250
|
} else
|
|
@@ -257,35 +257,35 @@ class B {
|
|
|
257
257
|
}
|
|
258
258
|
B.defaultYaml = { explicit: !1, version: "1.2" };
|
|
259
259
|
B.defaultTags = { "!!": "tag:yaml.org,2002:" };
|
|
260
|
-
function
|
|
260
|
+
function Rt(s) {
|
|
261
261
|
if (/[\x00-\x19\s,[\]{}]/.test(s)) {
|
|
262
262
|
const t = `Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;
|
|
263
263
|
throw new Error(t);
|
|
264
264
|
}
|
|
265
265
|
return !0;
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function Ut(s) {
|
|
268
268
|
const e = /* @__PURE__ */ new Set();
|
|
269
|
-
return
|
|
269
|
+
return H(s, {
|
|
270
270
|
Value(t, n) {
|
|
271
271
|
n.anchor && e.add(n.anchor);
|
|
272
272
|
}
|
|
273
273
|
}), e;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function Vt(s, e) {
|
|
276
276
|
for (let t = 1; ; ++t) {
|
|
277
277
|
const n = `${s}${t}`;
|
|
278
278
|
if (!e.has(n))
|
|
279
279
|
return n;
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function Cs(s, e) {
|
|
283
283
|
const t = [], n = /* @__PURE__ */ new Map();
|
|
284
284
|
let i = null;
|
|
285
285
|
return {
|
|
286
286
|
onAnchor: (r) => {
|
|
287
|
-
t.push(r), i || (i =
|
|
288
|
-
const o =
|
|
287
|
+
t.push(r), i || (i = Ut(s));
|
|
288
|
+
const o = Vt(e, i);
|
|
289
289
|
return i.add(o), o;
|
|
290
290
|
},
|
|
291
291
|
/**
|
|
@@ -296,7 +296,7 @@ function Ks(s, e) {
|
|
|
296
296
|
setAnchors: () => {
|
|
297
297
|
for (const r of t) {
|
|
298
298
|
const o = n.get(r);
|
|
299
|
-
if (typeof o == "object" && o.anchor && (
|
|
299
|
+
if (typeof o == "object" && o.anchor && (I(o.node) || L(o.node)))
|
|
300
300
|
o.node.anchor = o.anchor;
|
|
301
301
|
else {
|
|
302
302
|
const l = new Error("Failed to resolve repeated object (this should not happen)");
|
|
@@ -307,26 +307,26 @@ function Ks(s, e) {
|
|
|
307
307
|
sourceObjects: n
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function ne(s, e, t, n) {
|
|
311
311
|
if (n && typeof n == "object")
|
|
312
312
|
if (Array.isArray(n))
|
|
313
313
|
for (let i = 0, r = n.length; i < r; ++i) {
|
|
314
|
-
const o = n[i], l =
|
|
314
|
+
const o = n[i], l = ne(s, n, String(i), o);
|
|
315
315
|
l === void 0 ? delete n[i] : l !== o && (n[i] = l);
|
|
316
316
|
}
|
|
317
317
|
else if (n instanceof Map)
|
|
318
318
|
for (const i of Array.from(n.keys())) {
|
|
319
|
-
const r = n.get(i), o =
|
|
319
|
+
const r = n.get(i), o = ne(s, n, i, r);
|
|
320
320
|
o === void 0 ? n.delete(i) : o !== r && n.set(i, o);
|
|
321
321
|
}
|
|
322
322
|
else if (n instanceof Set)
|
|
323
323
|
for (const i of Array.from(n)) {
|
|
324
|
-
const r =
|
|
324
|
+
const r = ne(s, n, i, i);
|
|
325
325
|
r === void 0 ? n.delete(i) : r !== i && (n.delete(i), n.add(r));
|
|
326
326
|
}
|
|
327
327
|
else
|
|
328
328
|
for (const [i, r] of Object.entries(n)) {
|
|
329
|
-
const o =
|
|
329
|
+
const o = ne(s, n, i, r);
|
|
330
330
|
o === void 0 ? delete n[i] : o !== r && (n[i] = o);
|
|
331
331
|
}
|
|
332
332
|
return s.call(e, t, n);
|
|
@@ -335,7 +335,7 @@ function P(s, e, t) {
|
|
|
335
335
|
if (Array.isArray(s))
|
|
336
336
|
return s.map((n, i) => P(n, String(i), t));
|
|
337
337
|
if (s && typeof s.toJSON == "function") {
|
|
338
|
-
if (!t || !
|
|
338
|
+
if (!t || !Ls(s))
|
|
339
339
|
return s.toJSON(e, t);
|
|
340
340
|
const n = { aliasCount: 0, count: 1, res: void 0 };
|
|
341
341
|
t.anchors.set(s, n), t.onCreate = (r) => {
|
|
@@ -346,7 +346,7 @@ function P(s, e, t) {
|
|
|
346
346
|
}
|
|
347
347
|
return typeof s == "bigint" && !(t != null && t.keep) ? Number(s) : s;
|
|
348
348
|
}
|
|
349
|
-
class
|
|
349
|
+
class ht {
|
|
350
350
|
constructor(e) {
|
|
351
351
|
Object.defineProperty(this, j, { value: e });
|
|
352
352
|
}
|
|
@@ -357,7 +357,7 @@ class pt {
|
|
|
357
357
|
}
|
|
358
358
|
/** A plain JavaScript representation of this node. */
|
|
359
359
|
toJS(e, { mapAsMap: t, maxAliasCount: n, onAnchor: i, reviver: r } = {}) {
|
|
360
|
-
if (!
|
|
360
|
+
if (!he(e))
|
|
361
361
|
throw new TypeError("A document argument is required");
|
|
362
362
|
const o = {
|
|
363
363
|
anchors: /* @__PURE__ */ new Map(),
|
|
@@ -370,12 +370,12 @@ class pt {
|
|
|
370
370
|
if (typeof i == "function")
|
|
371
371
|
for (const { count: a, res: c } of o.anchors.values())
|
|
372
372
|
i(c, a);
|
|
373
|
-
return typeof r == "function" ?
|
|
373
|
+
return typeof r == "function" ? ne(r, { "": l }, "", l) : l;
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
-
class
|
|
376
|
+
class dt extends ht {
|
|
377
377
|
constructor(e) {
|
|
378
|
-
super(
|
|
378
|
+
super(ft), this.source = e, Object.defineProperty(this, "tag", {
|
|
379
379
|
set() {
|
|
380
380
|
throw new Error("Alias nodes cannot have tags");
|
|
381
381
|
}
|
|
@@ -387,10 +387,10 @@ class Re extends pt {
|
|
|
387
387
|
*/
|
|
388
388
|
resolve(e) {
|
|
389
389
|
let t;
|
|
390
|
-
return
|
|
390
|
+
return H(e, {
|
|
391
391
|
Node: (n, i) => {
|
|
392
392
|
if (i === this)
|
|
393
|
-
return
|
|
393
|
+
return H.BREAK;
|
|
394
394
|
i.anchor === this.source && (t = i);
|
|
395
395
|
}
|
|
396
396
|
}), t;
|
|
@@ -408,7 +408,7 @@ class Re extends pt {
|
|
|
408
408
|
const a = "This should not happen: Alias anchor was not resolved?";
|
|
409
409
|
throw new ReferenceError(a);
|
|
410
410
|
}
|
|
411
|
-
if (r >= 0 && (l.count += 1, l.aliasCount === 0 && (l.aliasCount =
|
|
411
|
+
if (r >= 0 && (l.count += 1, l.aliasCount === 0 && (l.aliasCount = Be(i, o, n)), l.count * l.aliasCount > r)) {
|
|
412
412
|
const a = "Excessive alias count indicates a resource exhaustion attack";
|
|
413
413
|
throw new ReferenceError(a);
|
|
414
414
|
}
|
|
@@ -417,7 +417,7 @@ class Re extends pt {
|
|
|
417
417
|
toString(e, t, n) {
|
|
418
418
|
const i = `*${this.source}`;
|
|
419
419
|
if (e) {
|
|
420
|
-
if (
|
|
420
|
+
if (Rt(this.source), e.options.verifyAliasOrder && !e.anchors.has(this.source)) {
|
|
421
421
|
const r = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
422
422
|
throw new Error(r);
|
|
423
423
|
}
|
|
@@ -427,25 +427,25 @@ class Re extends pt {
|
|
|
427
427
|
return i;
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
if (
|
|
430
|
+
function Be(s, e, t) {
|
|
431
|
+
if (ue(e)) {
|
|
432
432
|
const n = e.resolve(s), i = t && n && t.get(n);
|
|
433
433
|
return i ? i.count * i.aliasCount : 0;
|
|
434
434
|
} else if (L(e)) {
|
|
435
435
|
let n = 0;
|
|
436
436
|
for (const i of e.items) {
|
|
437
|
-
const r =
|
|
437
|
+
const r = Be(s, i, t);
|
|
438
438
|
r > n && (n = r);
|
|
439
439
|
}
|
|
440
440
|
return n;
|
|
441
441
|
} else if (T(e)) {
|
|
442
|
-
const n =
|
|
442
|
+
const n = Be(s, e.key, t), i = Be(s, e.value, t);
|
|
443
443
|
return Math.max(n, i);
|
|
444
444
|
}
|
|
445
445
|
return 1;
|
|
446
446
|
}
|
|
447
|
-
const
|
|
448
|
-
class A extends
|
|
447
|
+
const Jt = (s) => !s || typeof s != "function" && typeof s != "object";
|
|
448
|
+
class A extends ht {
|
|
449
449
|
constructor(e) {
|
|
450
450
|
super(R), this.value = e;
|
|
451
451
|
}
|
|
@@ -461,8 +461,8 @@ A.BLOCK_LITERAL = "BLOCK_LITERAL";
|
|
|
461
461
|
A.PLAIN = "PLAIN";
|
|
462
462
|
A.QUOTE_DOUBLE = "QUOTE_DOUBLE";
|
|
463
463
|
A.QUOTE_SINGLE = "QUOTE_SINGLE";
|
|
464
|
-
const
|
|
465
|
-
function
|
|
464
|
+
const Bs = "tag:yaml.org,2002:";
|
|
465
|
+
function vs(s, e, t) {
|
|
466
466
|
if (e) {
|
|
467
467
|
const n = t.filter((r) => r.tag === e), i = n.find((r) => !r.format) ?? n[0];
|
|
468
468
|
if (!i)
|
|
@@ -474,9 +474,9 @@ function js(s, e, t) {
|
|
|
474
474
|
return ((i = n.identify) == null ? void 0 : i.call(n, s)) && !n.format;
|
|
475
475
|
});
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function be(s, e, t) {
|
|
478
478
|
var f, d, h;
|
|
479
|
-
if (
|
|
479
|
+
if (he(s) && (s = s.contents), $(s))
|
|
480
480
|
return s;
|
|
481
481
|
if (T(s)) {
|
|
482
482
|
const y = (d = (f = t.schema[G]).createNode) == null ? void 0 : d.call(f, t.schema, null, t);
|
|
@@ -487,17 +487,17 @@ function ke(s, e, t) {
|
|
|
487
487
|
let a;
|
|
488
488
|
if (n && s && typeof s == "object") {
|
|
489
489
|
if (a = l.get(s), a)
|
|
490
|
-
return a.anchor || (a.anchor = i(s)), new
|
|
490
|
+
return a.anchor || (a.anchor = i(s)), new dt(a.anchor);
|
|
491
491
|
a = { anchor: null, node: null }, l.set(s, a);
|
|
492
492
|
}
|
|
493
|
-
e != null && e.startsWith("!!") && (e =
|
|
494
|
-
let c =
|
|
493
|
+
e != null && e.startsWith("!!") && (e = Bs + e.slice(2));
|
|
494
|
+
let c = vs(s, e, o.tags);
|
|
495
495
|
if (!c) {
|
|
496
496
|
if (s && typeof s.toJSON == "function" && (s = s.toJSON()), !s || typeof s != "object") {
|
|
497
497
|
const y = new A(s);
|
|
498
498
|
return a && (a.node = y), y;
|
|
499
499
|
}
|
|
500
|
-
c = s instanceof Map ? o[G] : Symbol.iterator in Object(s) ? o[
|
|
500
|
+
c = s instanceof Map ? o[G] : Symbol.iterator in Object(s) ? o[fe] : o[G];
|
|
501
501
|
}
|
|
502
502
|
r && (r(c), delete t.onTagObj);
|
|
503
503
|
const p = c != null && c.createNode ? c.createNode(t.schema, s, t) : typeof ((h = c == null ? void 0 : c.nodeClass) == null ? void 0 : h.from) == "function" ? c.nodeClass.from(t.schema, s, t) : new A(s);
|
|
@@ -513,7 +513,7 @@ function Pe(s, e, t) {
|
|
|
513
513
|
} else
|
|
514
514
|
n = /* @__PURE__ */ new Map([[r, n]]);
|
|
515
515
|
}
|
|
516
|
-
return
|
|
516
|
+
return be(n, void 0, {
|
|
517
517
|
aliasDuplicateObjects: !1,
|
|
518
518
|
keepUndefined: !1,
|
|
519
519
|
onAnchor: () => {
|
|
@@ -523,8 +523,8 @@ function Pe(s, e, t) {
|
|
|
523
523
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
524
524
|
});
|
|
525
525
|
}
|
|
526
|
-
const
|
|
527
|
-
class
|
|
526
|
+
const ye = (s) => s == null || typeof s == "object" && !!s[Symbol.iterator]().next().done;
|
|
527
|
+
class Yt extends ht {
|
|
528
528
|
constructor(e, t) {
|
|
529
529
|
super(e), Object.defineProperty(this, "schema", {
|
|
530
530
|
value: t,
|
|
@@ -548,7 +548,7 @@ class Wt extends pt {
|
|
|
548
548
|
* that already exists in the map.
|
|
549
549
|
*/
|
|
550
550
|
addIn(e, t) {
|
|
551
|
-
if (
|
|
551
|
+
if (ye(e))
|
|
552
552
|
this.add(t);
|
|
553
553
|
else {
|
|
554
554
|
const [n, ...i] = e, r = this.get(n, !0);
|
|
@@ -580,14 +580,14 @@ class Wt extends pt {
|
|
|
580
580
|
*/
|
|
581
581
|
getIn(e, t) {
|
|
582
582
|
const [n, ...i] = e, r = this.get(n, !0);
|
|
583
|
-
return i.length === 0 ? !t &&
|
|
583
|
+
return i.length === 0 ? !t && I(r) ? r.value : r : L(r) ? r.getIn(i, t) : void 0;
|
|
584
584
|
}
|
|
585
585
|
hasAllNullValues(e) {
|
|
586
586
|
return this.items.every((t) => {
|
|
587
587
|
if (!T(t))
|
|
588
588
|
return !1;
|
|
589
589
|
const n = t.value;
|
|
590
|
-
return n == null || e &&
|
|
590
|
+
return n == null || e && I(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag;
|
|
591
591
|
});
|
|
592
592
|
}
|
|
593
593
|
/**
|
|
@@ -619,15 +619,15 @@ class Wt extends pt {
|
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
|
-
const
|
|
622
|
+
const Ms = (s) => s.replace(/^(?!$)(?: $)?/gm, "#");
|
|
623
623
|
function U(s, e) {
|
|
624
624
|
return /^\n+$/.test(s) ? s.substring(1) : e ? s.replace(/^(?! *$)/gm, e) : s;
|
|
625
625
|
}
|
|
626
|
-
const
|
|
626
|
+
const Q = (s, e, t) => s.endsWith(`
|
|
627
627
|
`) ? U(t, e) : t.includes(`
|
|
628
628
|
`) ? `
|
|
629
|
-
` + U(t, e) : (s.endsWith(" ") ? "" : " ") + t,
|
|
630
|
-
function
|
|
629
|
+
` + U(t, e) : (s.endsWith(" ") ? "" : " ") + t, Gt = "flow", rt = "block", ve = "quoted";
|
|
630
|
+
function Fe(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentWidth: r = 20, onFold: o, onOverflow: l } = {}) {
|
|
631
631
|
if (!i || i < 0)
|
|
632
632
|
return s;
|
|
633
633
|
i < r && (r = 0);
|
|
@@ -638,9 +638,9 @@ function Ue(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
638
638
|
let f = i - e.length;
|
|
639
639
|
typeof n == "number" && (n > i - Math.max(2, r) ? c.push(0) : f = i - n);
|
|
640
640
|
let d, h, y = !1, u = -1, m = -1, b = -1;
|
|
641
|
-
t ===
|
|
641
|
+
t === rt && (u = It(s, u, e.length), u !== -1 && (f = u + a));
|
|
642
642
|
for (let N; N = s[u += 1]; ) {
|
|
643
|
-
if (t ===
|
|
643
|
+
if (t === ve && N === "\\") {
|
|
644
644
|
switch (m = u, s[u + 1]) {
|
|
645
645
|
case "x":
|
|
646
646
|
u += 3;
|
|
@@ -658,7 +658,7 @@ function Ue(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
658
658
|
}
|
|
659
659
|
if (N === `
|
|
660
660
|
`)
|
|
661
|
-
t ===
|
|
661
|
+
t === rt && (u = It(s, u, e.length)), f = u + e.length + a, d = void 0;
|
|
662
662
|
else {
|
|
663
663
|
if (N === " " && h && h !== " " && h !== `
|
|
664
664
|
` && h !== " ") {
|
|
@@ -669,7 +669,7 @@ function Ue(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
669
669
|
if (u >= f)
|
|
670
670
|
if (d)
|
|
671
671
|
c.push(d), f = d + a, d = void 0;
|
|
672
|
-
else if (t ===
|
|
672
|
+
else if (t === ve) {
|
|
673
673
|
for (; h === " " || h === " "; )
|
|
674
674
|
h = N, N = s[u += 1], y = !0;
|
|
675
675
|
const w = u > b + 1 ? u - 2 : m - 1;
|
|
@@ -688,12 +688,12 @@ function Ue(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
688
688
|
for (let N = 0; N < c.length; ++N) {
|
|
689
689
|
const w = c[N], k = c[N + 1] || s.length;
|
|
690
690
|
w === 0 ? S = `
|
|
691
|
-
${e}${s.slice(0, k)}` : (t ===
|
|
691
|
+
${e}${s.slice(0, k)}` : (t === ve && p[w] && (S += `${s[w]}\\`), S += `
|
|
692
692
|
${e}${s.slice(w + 1, k)}`);
|
|
693
693
|
}
|
|
694
694
|
return S;
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function It(s, e, t) {
|
|
697
697
|
let n = e, i = e + 1, r = s[i];
|
|
698
698
|
for (; r === " " || r === " "; )
|
|
699
699
|
if (e < i + t)
|
|
@@ -707,12 +707,12 @@ function $t(s, e, t) {
|
|
|
707
707
|
}
|
|
708
708
|
return n;
|
|
709
709
|
}
|
|
710
|
-
const
|
|
710
|
+
const Re = (s, e) => ({
|
|
711
711
|
indentAtStart: e ? s.indent.length : s.indentAtStart,
|
|
712
712
|
lineWidth: s.options.lineWidth,
|
|
713
713
|
minContentWidth: s.options.minContentWidth
|
|
714
|
-
}),
|
|
715
|
-
function
|
|
714
|
+
}), Ue = (s) => /^(%|---|\.\.\.)/m.test(s);
|
|
715
|
+
function Ks(s, e, t) {
|
|
716
716
|
if (!e || e < 0)
|
|
717
717
|
return !1;
|
|
718
718
|
const n = e - t, i = s.length;
|
|
@@ -728,11 +728,11 @@ function qs(s, e, t) {
|
|
|
728
728
|
}
|
|
729
729
|
return !0;
|
|
730
730
|
}
|
|
731
|
-
function
|
|
731
|
+
function ge(s, e) {
|
|
732
732
|
const t = JSON.stringify(s);
|
|
733
733
|
if (e.options.doubleQuotedAsJSON)
|
|
734
734
|
return t;
|
|
735
|
-
const { implicitKey: n } = e, i = e.options.doubleQuotedMinMultiLineLength, r = e.indent || (
|
|
735
|
+
const { implicitKey: n } = e, i = e.options.doubleQuotedMinMultiLineLength, r = e.indent || (Ue(s) ? " " : "");
|
|
736
736
|
let o = "", l = 0;
|
|
737
737
|
for (let a = 0, c = t[a]; c; c = t[++a])
|
|
738
738
|
if (c === " " && t[a + 1] === "\\" && t[a + 2] === "n" && (o += t.slice(l, a) + "\\ ", a += 1, l = a, c = "\\"), c === "\\")
|
|
@@ -787,41 +787,41 @@ function Se(s, e) {
|
|
|
787
787
|
default:
|
|
788
788
|
a += 1;
|
|
789
789
|
}
|
|
790
|
-
return o = l ? o + t.slice(l) : t, n ? o :
|
|
790
|
+
return o = l ? o + t.slice(l) : t, n ? o : Fe(o, r, ve, Re(e, !1));
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function ot(s, e) {
|
|
793
793
|
if (e.options.singleQuote === !1 || e.implicitKey && s.includes(`
|
|
794
794
|
`) || /[ \t]\n|\n[ \t]/.test(s))
|
|
795
|
-
return
|
|
796
|
-
const t = e.indent || (
|
|
795
|
+
return ge(s, e);
|
|
796
|
+
const t = e.indent || (Ue(s) ? " " : ""), n = "'" + s.replace(/'/g, "''").replace(/\n+/g, `$&
|
|
797
797
|
${t}`) + "'";
|
|
798
|
-
return e.implicitKey ? n :
|
|
798
|
+
return e.implicitKey ? n : Fe(n, t, Gt, Re(e, !1));
|
|
799
799
|
}
|
|
800
|
-
function
|
|
800
|
+
function ie(s, e) {
|
|
801
801
|
const { singleQuote: t } = e.options;
|
|
802
802
|
let n;
|
|
803
803
|
if (t === !1)
|
|
804
|
-
n =
|
|
804
|
+
n = ge;
|
|
805
805
|
else {
|
|
806
806
|
const i = s.includes('"'), r = s.includes("'");
|
|
807
|
-
i && !r ? n =
|
|
807
|
+
i && !r ? n = ot : r && !i ? n = ge : n = t ? ot : ge;
|
|
808
808
|
}
|
|
809
809
|
return n(s, e);
|
|
810
810
|
}
|
|
811
|
-
let
|
|
811
|
+
let lt;
|
|
812
812
|
try {
|
|
813
|
-
|
|
813
|
+
lt = new RegExp(`(^|(?<!
|
|
814
814
|
))
|
|
815
815
|
+(?!
|
|
816
816
|
|$)`, "g");
|
|
817
817
|
} catch {
|
|
818
|
-
|
|
818
|
+
lt = /\n+(?!\n|$)/g;
|
|
819
819
|
}
|
|
820
820
|
function Me({ comment: s, type: e, value: t }, n, i, r) {
|
|
821
821
|
const { blockQuote: o, commentString: l, lineWidth: a } = n.options;
|
|
822
822
|
if (!o || /\n[\t ]+$/.test(t) || /^\s*$/.test(t))
|
|
823
|
-
return
|
|
824
|
-
const c = n.indent || (n.forceBlockIndent ||
|
|
823
|
+
return ie(t, n);
|
|
824
|
+
const c = n.indent || (n.forceBlockIndent || Ue(t) ? " " : ""), p = o === "literal" ? !0 : o === "folded" || e === A.BLOCK_FOLDED ? !1 : e === A.BLOCK_LITERAL ? !0 : !Ks(t, a, c.length);
|
|
825
825
|
if (!t)
|
|
826
826
|
return p ? `|
|
|
827
827
|
` : `>
|
|
@@ -837,7 +837,7 @@ function Me({ comment: s, type: e, value: t }, n, i, r) {
|
|
|
837
837
|
const y = h.indexOf(`
|
|
838
838
|
`);
|
|
839
839
|
y === -1 ? f = "-" : t === h || y !== h.length - 1 ? (f = "+", r && r()) : f = "", h && (t = t.slice(0, -h.length), h[h.length - 1] === `
|
|
840
|
-
` && (h = h.slice(0, -1)), h = h.replace(
|
|
840
|
+
` && (h = h.slice(0, -1)), h = h.replace(lt, `$&${c}`));
|
|
841
841
|
let u = !1, m, b = -1;
|
|
842
842
|
for (m = 0; m < t.length; ++m) {
|
|
843
843
|
const k = t[m];
|
|
@@ -856,11 +856,11 @@ function Me({ comment: s, type: e, value: t }, n, i, r) {
|
|
|
856
856
|
const k = t.replace(/\n+/g, `
|
|
857
857
|
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${c}`);
|
|
858
858
|
let O = !1;
|
|
859
|
-
const
|
|
860
|
-
o !== "folded" && e !== A.BLOCK_FOLDED && (
|
|
859
|
+
const E = Re(n, !0);
|
|
860
|
+
o !== "folded" && e !== A.BLOCK_FOLDED && (E.onOverflow = () => {
|
|
861
861
|
O = !0;
|
|
862
862
|
});
|
|
863
|
-
const g =
|
|
863
|
+
const g = Fe(`${S}${k}${h}`, c, rt, E);
|
|
864
864
|
if (!O)
|
|
865
865
|
return `>${w}
|
|
866
866
|
${c}${g}`;
|
|
@@ -868,22 +868,22 @@ ${c}${g}`;
|
|
|
868
868
|
return t = t.replace(/\n+/g, `$&${c}`), `|${w}
|
|
869
869
|
${c}${S}${t}${h}`;
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function Ps(s, e, t, n) {
|
|
872
872
|
const { type: i, value: r } = s, { actualString: o, implicitKey: l, indent: a, indentStep: c, inFlow: p } = e;
|
|
873
873
|
if (l && r.includes(`
|
|
874
874
|
`) || p && /[[\]{},]/.test(r))
|
|
875
|
-
return
|
|
875
|
+
return ie(r, e);
|
|
876
876
|
if (!r || /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))
|
|
877
877
|
return l || p || !r.includes(`
|
|
878
|
-
`) ?
|
|
878
|
+
`) ? ie(r, e) : Me(s, e, t, n);
|
|
879
879
|
if (!l && !p && i !== A.PLAIN && r.includes(`
|
|
880
880
|
`))
|
|
881
881
|
return Me(s, e, t, n);
|
|
882
|
-
if (
|
|
882
|
+
if (Ue(r)) {
|
|
883
883
|
if (a === "")
|
|
884
884
|
return e.forceBlockIndent = !0, Me(s, e, t, n);
|
|
885
885
|
if (l && a === c)
|
|
886
|
-
return
|
|
886
|
+
return ie(r, e);
|
|
887
887
|
}
|
|
888
888
|
const f = r.replace(/\n+/g, `$&
|
|
889
889
|
${a}`);
|
|
@@ -893,11 +893,11 @@ ${a}`);
|
|
|
893
893
|
return u.default && u.tag !== "tag:yaml.org,2002:str" && ((m = u.test) == null ? void 0 : m.test(f));
|
|
894
894
|
}, { compat: h, tags: y } = e.doc.schema;
|
|
895
895
|
if (y.some(d) || h != null && h.some(d))
|
|
896
|
-
return
|
|
896
|
+
return ie(r, e);
|
|
897
897
|
}
|
|
898
|
-
return l ? f :
|
|
898
|
+
return l ? f : Fe(f, a, Gt, Re(e, !1));
|
|
899
899
|
}
|
|
900
|
-
function
|
|
900
|
+
function Oe(s, e, t, n) {
|
|
901
901
|
const { implicitKey: i, inFlow: r } = e, o = typeof s.value == "string" ? s : Object.assign({}, s, { value: String(s.value) });
|
|
902
902
|
let { type: l } = s;
|
|
903
903
|
l !== A.QUOTE_DOUBLE && /[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value) && (l = A.QUOTE_DOUBLE);
|
|
@@ -905,13 +905,13 @@ function Ae(s, e, t, n) {
|
|
|
905
905
|
switch (p) {
|
|
906
906
|
case A.BLOCK_FOLDED:
|
|
907
907
|
case A.BLOCK_LITERAL:
|
|
908
|
-
return i || r ?
|
|
908
|
+
return i || r ? ie(o.value, e) : Me(o, e, t, n);
|
|
909
909
|
case A.QUOTE_DOUBLE:
|
|
910
|
-
return
|
|
910
|
+
return ge(o.value, e);
|
|
911
911
|
case A.QUOTE_SINGLE:
|
|
912
|
-
return
|
|
912
|
+
return ot(o.value, e);
|
|
913
913
|
case A.PLAIN:
|
|
914
|
-
return
|
|
914
|
+
return Ps(o, e, t, n);
|
|
915
915
|
default:
|
|
916
916
|
return null;
|
|
917
917
|
}
|
|
@@ -924,10 +924,10 @@ function Ae(s, e, t, n) {
|
|
|
924
924
|
}
|
|
925
925
|
return c;
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function Qt(s, e) {
|
|
928
928
|
const t = Object.assign({
|
|
929
929
|
blockQuote: !0,
|
|
930
|
-
commentString:
|
|
930
|
+
commentString: Ms,
|
|
931
931
|
defaultKeyType: null,
|
|
932
932
|
defaultStringType: "PLAIN",
|
|
933
933
|
directives: null,
|
|
@@ -965,7 +965,7 @@ function Xt(s, e) {
|
|
|
965
965
|
options: t
|
|
966
966
|
};
|
|
967
967
|
}
|
|
968
|
-
function
|
|
968
|
+
function js(s, e) {
|
|
969
969
|
var i;
|
|
970
970
|
if (e.tag) {
|
|
971
971
|
const r = s.filter((o) => o.tag === e.tag);
|
|
@@ -973,7 +973,7 @@ function Rs(s, e) {
|
|
|
973
973
|
return r.find((o) => o.format === e.format) ?? r[0];
|
|
974
974
|
}
|
|
975
975
|
let t, n;
|
|
976
|
-
if (
|
|
976
|
+
if (I(e)) {
|
|
977
977
|
n = e.value;
|
|
978
978
|
let r = s.filter((o) => {
|
|
979
979
|
var l;
|
|
@@ -992,19 +992,19 @@ function Rs(s, e) {
|
|
|
992
992
|
}
|
|
993
993
|
return t;
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function Ds(s, e, { anchors: t, doc: n }) {
|
|
996
996
|
if (!n.directives)
|
|
997
997
|
return "";
|
|
998
|
-
const i = [], r = (
|
|
999
|
-
r &&
|
|
998
|
+
const i = [], r = (I(s) || L(s)) && s.anchor;
|
|
999
|
+
r && Rt(r) && (t.add(r), i.push(`&${r}`));
|
|
1000
1000
|
const o = s.tag ? s.tag : e.default ? null : e.tag;
|
|
1001
1001
|
return o && i.push(n.directives.tagString(o)), i.join(" ");
|
|
1002
1002
|
}
|
|
1003
|
-
function
|
|
1003
|
+
function ae(s, e, t, n) {
|
|
1004
1004
|
var a;
|
|
1005
1005
|
if (T(s))
|
|
1006
1006
|
return s.toString(e, t, n);
|
|
1007
|
-
if (
|
|
1007
|
+
if (ue(s)) {
|
|
1008
1008
|
if (e.doc.directives)
|
|
1009
1009
|
return s.toString(e);
|
|
1010
1010
|
if ((a = e.resolvedAliases) != null && a.has(s))
|
|
@@ -1013,31 +1013,31 @@ function fe(s, e, t, n) {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
let i;
|
|
1015
1015
|
const r = $(s) ? s : e.doc.createNode(s, { onTagObj: (c) => i = c });
|
|
1016
|
-
i || (i =
|
|
1017
|
-
const o =
|
|
1016
|
+
i || (i = js(e.doc.schema.tags, r));
|
|
1017
|
+
const o = Ds(r, i, e);
|
|
1018
1018
|
o.length > 0 && (e.indentAtStart = (e.indentAtStart ?? 0) + o.length + 1);
|
|
1019
|
-
const l = typeof i.stringify == "function" ? i.stringify(r, e, t, n) :
|
|
1020
|
-
return o ?
|
|
1019
|
+
const l = typeof i.stringify == "function" ? i.stringify(r, e, t, n) : I(r) ? Oe(r, e, t, n) : r.toString(e, t, n);
|
|
1020
|
+
return o ? I(r) || l[0] === "{" || l[0] === "[" ? `${o} ${l}` : `${o}
|
|
1021
1021
|
${e.indent}${l}` : l;
|
|
1022
1022
|
}
|
|
1023
|
-
function
|
|
1023
|
+
function qs({ key: s, value: e }, t, n, i) {
|
|
1024
1024
|
const { allNullValues: r, doc: o, indent: l, indentStep: a, options: { commentString: c, indentSeq: p, simpleKeys: f } } = t;
|
|
1025
1025
|
let d = $(s) && s.comment || null;
|
|
1026
1026
|
if (f) {
|
|
1027
1027
|
if (d)
|
|
1028
1028
|
throw new Error("With simple keys, key nodes cannot have comments");
|
|
1029
1029
|
if (L(s) || !$(s) && typeof s == "object") {
|
|
1030
|
-
const
|
|
1031
|
-
throw new Error(
|
|
1030
|
+
const E = "With simple keys, collection cannot be used as a key value";
|
|
1031
|
+
throw new Error(E);
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
1034
|
-
let h = !f && (!s || d && e == null && !t.inFlow || L(s) || (
|
|
1034
|
+
let h = !f && (!s || d && e == null && !t.inFlow || L(s) || (I(s) ? s.type === A.BLOCK_FOLDED || s.type === A.BLOCK_LITERAL : typeof s == "object"));
|
|
1035
1035
|
t = Object.assign({}, t, {
|
|
1036
1036
|
allNullValues: !1,
|
|
1037
1037
|
implicitKey: !h && (f || !r),
|
|
1038
1038
|
indent: l + a
|
|
1039
1039
|
});
|
|
1040
|
-
let y = !1, u = !1, m =
|
|
1040
|
+
let y = !1, u = !1, m = ae(s, t, () => y = !0, () => u = !0);
|
|
1041
1041
|
if (!h && !t.inFlow && m.length > 1024) {
|
|
1042
1042
|
if (f)
|
|
1043
1043
|
throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
|
|
@@ -1047,20 +1047,20 @@ function Vs({ key: s, value: e }, t, n, i) {
|
|
|
1047
1047
|
if (r || e == null)
|
|
1048
1048
|
return y && n && n(), m === "" ? "?" : h ? `? ${m}` : m;
|
|
1049
1049
|
} else if (r && !f || e == null && h)
|
|
1050
|
-
return m = `? ${m}`, d && !y ? m +=
|
|
1051
|
-
y && (d = null), h ? (d && (m +=
|
|
1052
|
-
${l}:`) : (m = `${m}:`, d && (m +=
|
|
1050
|
+
return m = `? ${m}`, d && !y ? m += Q(m, t.indent, c(d)) : u && i && i(), m;
|
|
1051
|
+
y && (d = null), h ? (d && (m += Q(m, t.indent, c(d))), m = `? ${m}
|
|
1052
|
+
${l}:`) : (m = `${m}:`, d && (m += Q(m, t.indent, c(d))));
|
|
1053
1053
|
let b, S, N;
|
|
1054
|
-
$(e) ? (b = !!e.spaceBefore, S = e.commentBefore, N = e.comment) : (b = !1, S = null, N = null, e && typeof e == "object" && (e = o.createNode(e))), t.implicitKey = !1, !h && !d &&
|
|
1054
|
+
$(e) ? (b = !!e.spaceBefore, S = e.commentBefore, N = e.comment) : (b = !1, S = null, N = null, e && typeof e == "object" && (e = o.createNode(e))), t.implicitKey = !1, !h && !d && I(e) && (t.indentAtStart = m.length + 1), u = !1, !p && a.length >= 2 && !t.inFlow && !h && Ne(e) && !e.flow && !e.tag && !e.anchor && (t.indent = t.indent.substring(2));
|
|
1055
1055
|
let w = !1;
|
|
1056
|
-
const k =
|
|
1056
|
+
const k = ae(e, t, () => w = !0, () => u = !0);
|
|
1057
1057
|
let O = " ";
|
|
1058
1058
|
if (d || b || S) {
|
|
1059
1059
|
if (O = b ? `
|
|
1060
1060
|
` : "", S) {
|
|
1061
|
-
const
|
|
1061
|
+
const E = c(S);
|
|
1062
1062
|
O += `
|
|
1063
|
-
${U(
|
|
1063
|
+
${U(E, t.indent)}`;
|
|
1064
1064
|
}
|
|
1065
1065
|
k === "" && !t.inFlow ? O === `
|
|
1066
1066
|
` && (O = `
|
|
@@ -1068,22 +1068,22 @@ ${U(I, t.indent)}`;
|
|
|
1068
1068
|
`) : O += `
|
|
1069
1069
|
${t.indent}`;
|
|
1070
1070
|
} else if (!h && L(e)) {
|
|
1071
|
-
const
|
|
1071
|
+
const E = k[0], g = k.indexOf(`
|
|
1072
1072
|
`), _ = g !== -1, J = t.inFlow ?? e.flow ?? e.items.length === 0;
|
|
1073
1073
|
if (_ || !J) {
|
|
1074
|
-
let
|
|
1075
|
-
if (_ && (
|
|
1074
|
+
let Z = !1;
|
|
1075
|
+
if (_ && (E === "&" || E === "!")) {
|
|
1076
1076
|
let C = k.indexOf(" ");
|
|
1077
|
-
|
|
1077
|
+
E === "&" && C !== -1 && C < g && k[C + 1] === "!" && (C = k.indexOf(" ", C + 1)), (C === -1 || g < C) && (Z = !0);
|
|
1078
1078
|
}
|
|
1079
|
-
|
|
1079
|
+
Z || (O = `
|
|
1080
1080
|
${t.indent}`);
|
|
1081
1081
|
}
|
|
1082
1082
|
} else (k === "" || k[0] === `
|
|
1083
1083
|
`) && (O = "");
|
|
1084
|
-
return m += O + k, t.inFlow ? w && n && n() : N && !w ? m +=
|
|
1084
|
+
return m += O + k, t.inFlow ? w && n && n() : N && !w ? m += Q(m, t.indent, c(N)) : u && i && i(), m;
|
|
1085
1085
|
}
|
|
1086
|
-
function
|
|
1086
|
+
function Wt(s, e) {
|
|
1087
1087
|
(s === "debug" || s === "warn") && console.warn(e);
|
|
1088
1088
|
}
|
|
1089
1089
|
const Te = "<<", V = {
|
|
@@ -1092,23 +1092,23 @@ const Te = "<<", V = {
|
|
|
1092
1092
|
tag: "tag:yaml.org,2002:merge",
|
|
1093
1093
|
test: /^<<$/,
|
|
1094
1094
|
resolve: () => Object.assign(new A(Symbol(Te)), {
|
|
1095
|
-
addToJSMap:
|
|
1095
|
+
addToJSMap: Ht
|
|
1096
1096
|
}),
|
|
1097
1097
|
stringify: () => Te
|
|
1098
|
-
},
|
|
1099
|
-
function
|
|
1100
|
-
if (t = s &&
|
|
1098
|
+
}, Fs = (s, e) => (V.identify(e) || I(e) && (!e.type || e.type === A.PLAIN) && V.identify(e.value)) && (s == null ? void 0 : s.doc.schema.tags.some((t) => t.tag === V.tag && t.default));
|
|
1099
|
+
function Ht(s, e, t) {
|
|
1100
|
+
if (t = s && ue(t) ? t.resolve(s.doc) : t, Ne(t))
|
|
1101
1101
|
for (const n of t.items)
|
|
1102
|
-
|
|
1102
|
+
ze(s, e, n);
|
|
1103
1103
|
else if (Array.isArray(t))
|
|
1104
1104
|
for (const n of t)
|
|
1105
|
-
|
|
1105
|
+
ze(s, e, n);
|
|
1106
1106
|
else
|
|
1107
|
-
|
|
1107
|
+
ze(s, e, t);
|
|
1108
1108
|
}
|
|
1109
|
-
function
|
|
1110
|
-
const n = s &&
|
|
1111
|
-
if (!
|
|
1109
|
+
function ze(s, e, t) {
|
|
1110
|
+
const n = s && ue(t) ? t.resolve(s.doc) : t;
|
|
1111
|
+
if (!ke(n))
|
|
1112
1112
|
throw new Error("Merge sources must be maps or map aliases");
|
|
1113
1113
|
const i = n.toJSON(null, s, Map);
|
|
1114
1114
|
for (const [r, o] of i)
|
|
@@ -1120,11 +1120,11 @@ function et(s, e, t) {
|
|
|
1120
1120
|
});
|
|
1121
1121
|
return e;
|
|
1122
1122
|
}
|
|
1123
|
-
function
|
|
1123
|
+
function Xt(s, e, { key: t, value: n }) {
|
|
1124
1124
|
if ($(t) && t.addToJSMap)
|
|
1125
1125
|
t.addToJSMap(s, e, n);
|
|
1126
|
-
else if (
|
|
1127
|
-
|
|
1126
|
+
else if (Fs(s, t))
|
|
1127
|
+
Ht(s, e, n);
|
|
1128
1128
|
else {
|
|
1129
1129
|
const i = P(t, "", s);
|
|
1130
1130
|
if (e instanceof Map)
|
|
@@ -1132,7 +1132,7 @@ function xt(s, e, { key: t, value: n }) {
|
|
|
1132
1132
|
else if (e instanceof Set)
|
|
1133
1133
|
e.add(i);
|
|
1134
1134
|
else {
|
|
1135
|
-
const r =
|
|
1135
|
+
const r = Rs(t, i, s), o = P(n, r, s);
|
|
1136
1136
|
r in e ? Object.defineProperty(e, r, {
|
|
1137
1137
|
value: o,
|
|
1138
1138
|
writable: !0,
|
|
@@ -1143,13 +1143,13 @@ function xt(s, e, { key: t, value: n }) {
|
|
|
1143
1143
|
}
|
|
1144
1144
|
return e;
|
|
1145
1145
|
}
|
|
1146
|
-
function
|
|
1146
|
+
function Rs(s, e, t) {
|
|
1147
1147
|
if (e === null)
|
|
1148
1148
|
return "";
|
|
1149
1149
|
if (typeof e != "object")
|
|
1150
1150
|
return String(e);
|
|
1151
1151
|
if ($(s) && (t != null && t.doc)) {
|
|
1152
|
-
const n =
|
|
1152
|
+
const n = Qt(t.doc, {});
|
|
1153
1153
|
n.anchors = /* @__PURE__ */ new Set();
|
|
1154
1154
|
for (const r of t.anchors.keys())
|
|
1155
1155
|
n.anchors.add(r.anchor);
|
|
@@ -1157,19 +1157,19 @@ function Ys(s, e, t) {
|
|
|
1157
1157
|
const i = s.toString(n);
|
|
1158
1158
|
if (!t.mapKeyWarned) {
|
|
1159
1159
|
let r = JSON.stringify(i);
|
|
1160
|
-
r.length > 40 && (r = r.substring(0, 36) + '..."'),
|
|
1160
|
+
r.length > 40 && (r = r.substring(0, 36) + '..."'), Wt(t.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`), t.mapKeyWarned = !0;
|
|
1161
1161
|
}
|
|
1162
1162
|
return i;
|
|
1163
1163
|
}
|
|
1164
1164
|
return JSON.stringify(e);
|
|
1165
1165
|
}
|
|
1166
|
-
function
|
|
1167
|
-
const n =
|
|
1166
|
+
function pt(s, e, t) {
|
|
1167
|
+
const n = be(s, void 0, t), i = be(e, void 0, t);
|
|
1168
1168
|
return new v(n, i);
|
|
1169
1169
|
}
|
|
1170
1170
|
class v {
|
|
1171
1171
|
constructor(e, t = null) {
|
|
1172
|
-
Object.defineProperty(this, j, { value:
|
|
1172
|
+
Object.defineProperty(this, j, { value: Pt }), this.key = e, this.value = t;
|
|
1173
1173
|
}
|
|
1174
1174
|
clone(e) {
|
|
1175
1175
|
let { key: t, value: n } = this;
|
|
@@ -1177,16 +1177,16 @@ class v {
|
|
|
1177
1177
|
}
|
|
1178
1178
|
toJSON(e, t) {
|
|
1179
1179
|
const n = t != null && t.mapAsMap ? /* @__PURE__ */ new Map() : {};
|
|
1180
|
-
return
|
|
1180
|
+
return Xt(t, n, this);
|
|
1181
1181
|
}
|
|
1182
1182
|
toString(e, t, n) {
|
|
1183
|
-
return e != null && e.doc ?
|
|
1183
|
+
return e != null && e.doc ? qs(this, e, t, n) : JSON.stringify(this);
|
|
1184
1184
|
}
|
|
1185
1185
|
}
|
|
1186
|
-
function
|
|
1187
|
-
return (e.inFlow ?? s.flow ?
|
|
1186
|
+
function zt(s, e, t) {
|
|
1187
|
+
return (e.inFlow ?? s.flow ? Vs : Us)(s, e, t);
|
|
1188
1188
|
}
|
|
1189
|
-
function
|
|
1189
|
+
function Us({ comment: s, items: e }, t, { blockItemPrefix: n, flowChars: i, itemIndent: r, onChompKeep: o, onComment: l }) {
|
|
1190
1190
|
const { indent: a, options: { commentString: c } } = t, p = Object.assign({}, t, { indent: r, type: null });
|
|
1191
1191
|
let f = !1;
|
|
1192
1192
|
const d = [];
|
|
@@ -1200,8 +1200,8 @@ function Gs({ comment: s, items: e }, t, { blockItemPrefix: n, flowChars: i, ite
|
|
|
1200
1200
|
S && (!f && S.spaceBefore && d.push(""), je(t, d, S.commentBefore, f));
|
|
1201
1201
|
}
|
|
1202
1202
|
f = !1;
|
|
1203
|
-
let b =
|
|
1204
|
-
m && (b +=
|
|
1203
|
+
let b = ae(u, p, () => m = null, () => f = !0);
|
|
1204
|
+
m && (b += Q(b, r, c(m))), f && m && (f = !1), d.push(n + b);
|
|
1205
1205
|
}
|
|
1206
1206
|
let h;
|
|
1207
1207
|
if (d.length === 0)
|
|
@@ -1218,7 +1218,7 @@ ${a}${u}` : `
|
|
|
1218
1218
|
return s ? (h += `
|
|
1219
1219
|
` + U(c(s), a), l && l()) : f && o && o(), h;
|
|
1220
1220
|
}
|
|
1221
|
-
function
|
|
1221
|
+
function Vs({ items: s }, e, { flowChars: t, itemIndent: n }) {
|
|
1222
1222
|
const { indent: i, indentStep: r, flowCollectionPadding: o, options: { commentString: l } } = e;
|
|
1223
1223
|
n += r;
|
|
1224
1224
|
const a = Object.assign({}, e, {
|
|
@@ -1240,8 +1240,8 @@ function Qs({ items: s }, e, { flowChars: t, itemIndent: n }) {
|
|
|
1240
1240
|
N ? (N.comment && (m = N.comment), N.commentBefore && (c = !0)) : u.value == null && (S != null && S.comment) && (m = S.comment);
|
|
1241
1241
|
}
|
|
1242
1242
|
m && (c = !0);
|
|
1243
|
-
let b =
|
|
1244
|
-
y < s.length - 1 && (b += ","), m && (b +=
|
|
1243
|
+
let b = ae(u, a, () => m = null);
|
|
1244
|
+
y < s.length - 1 && (b += ","), m && (b += Q(b, n, l(m))), !c && (f.length > p || b.includes(`
|
|
1245
1245
|
`)) && (c = !0), f.push(b), p = f.length;
|
|
1246
1246
|
}
|
|
1247
1247
|
const { start: d, end: h } = t;
|
|
@@ -1268,13 +1268,13 @@ function je({ indent: s, options: { commentString: e } }, t, n, i) {
|
|
|
1268
1268
|
t.push(r.trimStart());
|
|
1269
1269
|
}
|
|
1270
1270
|
}
|
|
1271
|
-
function
|
|
1272
|
-
const t =
|
|
1271
|
+
function W(s, e) {
|
|
1272
|
+
const t = I(e) ? e.value : e;
|
|
1273
1273
|
for (const n of s)
|
|
1274
|
-
if (T(n) && (n.key === e || n.key === t ||
|
|
1274
|
+
if (T(n) && (n.key === e || n.key === t || I(n.key) && n.key.value === t))
|
|
1275
1275
|
return n;
|
|
1276
1276
|
}
|
|
1277
|
-
class K extends
|
|
1277
|
+
class K extends Yt {
|
|
1278
1278
|
static get tagName() {
|
|
1279
1279
|
return "tag:yaml.org,2002:map";
|
|
1280
1280
|
}
|
|
@@ -1291,7 +1291,7 @@ class K extends Wt {
|
|
|
1291
1291
|
c = r.call(t, a, c);
|
|
1292
1292
|
else if (Array.isArray(r) && !r.includes(a))
|
|
1293
1293
|
return;
|
|
1294
|
-
(c !== void 0 || i) && o.items.push(
|
|
1294
|
+
(c !== void 0 || i) && o.items.push(pt(a, c, n));
|
|
1295
1295
|
};
|
|
1296
1296
|
if (t instanceof Map)
|
|
1297
1297
|
for (const [a, c] of t)
|
|
@@ -1311,11 +1311,11 @@ class K extends Wt {
|
|
|
1311
1311
|
var o;
|
|
1312
1312
|
let n;
|
|
1313
1313
|
T(e) ? n = e : !e || typeof e != "object" || !("key" in e) ? n = new v(e, e == null ? void 0 : e.value) : n = new v(e.key, e.value);
|
|
1314
|
-
const i =
|
|
1314
|
+
const i = W(this.items, n.key), r = (o = this.schema) == null ? void 0 : o.sortMapEntries;
|
|
1315
1315
|
if (i) {
|
|
1316
1316
|
if (!t)
|
|
1317
1317
|
throw new Error(`Key ${n.key} already set`);
|
|
1318
|
-
|
|
1318
|
+
I(i.value) && Jt(n.value) ? i.value.value = n.value : i.value = n.value;
|
|
1319
1319
|
} else if (r) {
|
|
1320
1320
|
const l = this.items.findIndex((a) => r(n, a) < 0);
|
|
1321
1321
|
l === -1 ? this.items.push(n) : this.items.splice(l, 0, n);
|
|
@@ -1323,15 +1323,15 @@ class K extends Wt {
|
|
|
1323
1323
|
this.items.push(n);
|
|
1324
1324
|
}
|
|
1325
1325
|
delete(e) {
|
|
1326
|
-
const t =
|
|
1326
|
+
const t = W(this.items, e);
|
|
1327
1327
|
return t ? this.items.splice(this.items.indexOf(t), 1).length > 0 : !1;
|
|
1328
1328
|
}
|
|
1329
1329
|
get(e, t) {
|
|
1330
|
-
const n =
|
|
1331
|
-
return (!t &&
|
|
1330
|
+
const n = W(this.items, e), i = n == null ? void 0 : n.value;
|
|
1331
|
+
return (!t && I(i) ? i.value : i) ?? void 0;
|
|
1332
1332
|
}
|
|
1333
1333
|
has(e) {
|
|
1334
|
-
return !!
|
|
1334
|
+
return !!W(this.items, e);
|
|
1335
1335
|
}
|
|
1336
1336
|
set(e, t) {
|
|
1337
1337
|
this.add(new v(e, t), !0);
|
|
@@ -1345,7 +1345,7 @@ class K extends Wt {
|
|
|
1345
1345
|
const i = n ? new n() : t != null && t.mapAsMap ? /* @__PURE__ */ new Map() : {};
|
|
1346
1346
|
t != null && t.onCreate && t.onCreate(i);
|
|
1347
1347
|
for (const r of this.items)
|
|
1348
|
-
|
|
1348
|
+
Xt(t, i, r);
|
|
1349
1349
|
return i;
|
|
1350
1350
|
}
|
|
1351
1351
|
toString(e, t, n) {
|
|
@@ -1354,7 +1354,7 @@ class K extends Wt {
|
|
|
1354
1354
|
for (const i of this.items)
|
|
1355
1355
|
if (!T(i))
|
|
1356
1356
|
throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);
|
|
1357
|
-
return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })),
|
|
1357
|
+
return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })), zt(this, e, {
|
|
1358
1358
|
blockItemPrefix: "",
|
|
1359
1359
|
flowChars: { start: "{", end: "}" },
|
|
1360
1360
|
itemIndent: e.indent || "",
|
|
@@ -1363,22 +1363,22 @@ class K extends Wt {
|
|
|
1363
1363
|
});
|
|
1364
1364
|
}
|
|
1365
1365
|
}
|
|
1366
|
-
const
|
|
1366
|
+
const de = {
|
|
1367
1367
|
collection: "map",
|
|
1368
1368
|
default: !0,
|
|
1369
1369
|
nodeClass: K,
|
|
1370
1370
|
tag: "tag:yaml.org,2002:map",
|
|
1371
1371
|
resolve(s, e) {
|
|
1372
|
-
return
|
|
1372
|
+
return ke(s) || e("Expected a mapping for this tag"), s;
|
|
1373
1373
|
},
|
|
1374
1374
|
createNode: (s, e, t) => K.from(s, e, t)
|
|
1375
1375
|
};
|
|
1376
|
-
class
|
|
1376
|
+
class X extends Yt {
|
|
1377
1377
|
static get tagName() {
|
|
1378
1378
|
return "tag:yaml.org,2002:seq";
|
|
1379
1379
|
}
|
|
1380
1380
|
constructor(e) {
|
|
1381
|
-
super(
|
|
1381
|
+
super(fe, e), this.items = [];
|
|
1382
1382
|
}
|
|
1383
1383
|
add(e) {
|
|
1384
1384
|
this.items.push(e);
|
|
@@ -1400,7 +1400,7 @@ class W extends Wt {
|
|
|
1400
1400
|
if (typeof n != "number")
|
|
1401
1401
|
return;
|
|
1402
1402
|
const i = this.items[n];
|
|
1403
|
-
return !t &&
|
|
1403
|
+
return !t && I(i) ? i.value : i;
|
|
1404
1404
|
}
|
|
1405
1405
|
/**
|
|
1406
1406
|
* Checks if the collection includes a value with the key `key`.
|
|
@@ -1424,7 +1424,7 @@ class W extends Wt {
|
|
|
1424
1424
|
if (typeof n != "number")
|
|
1425
1425
|
throw new Error(`Expected a valid index, not ${e}.`);
|
|
1426
1426
|
const i = this.items[n];
|
|
1427
|
-
|
|
1427
|
+
I(i) && Jt(t) ? i.value = t : this.items[n] = t;
|
|
1428
1428
|
}
|
|
1429
1429
|
toJSON(e, t) {
|
|
1430
1430
|
const n = [];
|
|
@@ -1435,7 +1435,7 @@ class W extends Wt {
|
|
|
1435
1435
|
return n;
|
|
1436
1436
|
}
|
|
1437
1437
|
toString(e, t, n) {
|
|
1438
|
-
return e ?
|
|
1438
|
+
return e ? zt(this, e, {
|
|
1439
1439
|
blockItemPrefix: "- ",
|
|
1440
1440
|
flowChars: { start: "[", end: "]" },
|
|
1441
1441
|
itemIndent: (e.indent || "") + " ",
|
|
@@ -1452,49 +1452,49 @@ class W extends Wt {
|
|
|
1452
1452
|
const a = t instanceof Set ? l : String(o++);
|
|
1453
1453
|
l = i.call(t, a, l);
|
|
1454
1454
|
}
|
|
1455
|
-
r.items.push(
|
|
1455
|
+
r.items.push(be(l, void 0, n));
|
|
1456
1456
|
}
|
|
1457
1457
|
}
|
|
1458
1458
|
return r;
|
|
1459
1459
|
}
|
|
1460
1460
|
}
|
|
1461
1461
|
function Le(s) {
|
|
1462
|
-
let e =
|
|
1462
|
+
let e = I(s) ? s.value : s;
|
|
1463
1463
|
return e && typeof e == "string" && (e = Number(e)), typeof e == "number" && Number.isInteger(e) && e >= 0 ? e : null;
|
|
1464
1464
|
}
|
|
1465
|
-
const
|
|
1465
|
+
const pe = {
|
|
1466
1466
|
collection: "seq",
|
|
1467
1467
|
default: !0,
|
|
1468
|
-
nodeClass:
|
|
1468
|
+
nodeClass: X,
|
|
1469
1469
|
tag: "tag:yaml.org,2002:seq",
|
|
1470
1470
|
resolve(s, e) {
|
|
1471
|
-
return
|
|
1471
|
+
return Ne(s) || e("Expected a sequence for this tag"), s;
|
|
1472
1472
|
},
|
|
1473
|
-
createNode: (s, e, t) =>
|
|
1474
|
-
},
|
|
1473
|
+
createNode: (s, e, t) => X.from(s, e, t)
|
|
1474
|
+
}, Ve = {
|
|
1475
1475
|
identify: (s) => typeof s == "string",
|
|
1476
1476
|
default: !0,
|
|
1477
1477
|
tag: "tag:yaml.org,2002:str",
|
|
1478
1478
|
resolve: (s) => s,
|
|
1479
1479
|
stringify(s, e, t, n) {
|
|
1480
|
-
return e = Object.assign({ actualString: !0 }, e),
|
|
1480
|
+
return e = Object.assign({ actualString: !0 }, e), Oe(s, e, t, n);
|
|
1481
1481
|
}
|
|
1482
|
-
},
|
|
1482
|
+
}, Je = {
|
|
1483
1483
|
identify: (s) => s == null,
|
|
1484
1484
|
createNode: () => new A(null),
|
|
1485
1485
|
default: !0,
|
|
1486
1486
|
tag: "tag:yaml.org,2002:null",
|
|
1487
1487
|
test: /^(?:~|[Nn]ull|NULL)?$/,
|
|
1488
1488
|
resolve: () => new A(null),
|
|
1489
|
-
stringify: ({ source: s }, e) => typeof s == "string" &&
|
|
1490
|
-
},
|
|
1489
|
+
stringify: ({ source: s }, e) => typeof s == "string" && Je.test.test(s) ? s : e.options.nullStr
|
|
1490
|
+
}, mt = {
|
|
1491
1491
|
identify: (s) => typeof s == "boolean",
|
|
1492
1492
|
default: !0,
|
|
1493
1493
|
tag: "tag:yaml.org,2002:bool",
|
|
1494
1494
|
test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
|
|
1495
1495
|
resolve: (s) => new A(s[0] === "t" || s[0] === "T"),
|
|
1496
1496
|
stringify({ source: s, value: e }, t) {
|
|
1497
|
-
if (s &&
|
|
1497
|
+
if (s && mt.test.test(s)) {
|
|
1498
1498
|
const n = s[0] === "t" || s[0] === "T";
|
|
1499
1499
|
if (e === n)
|
|
1500
1500
|
return s;
|
|
@@ -1518,14 +1518,14 @@ function q({ format: s, minFractionDigits: e, tag: t, value: n }) {
|
|
|
1518
1518
|
}
|
|
1519
1519
|
return r;
|
|
1520
1520
|
}
|
|
1521
|
-
const
|
|
1521
|
+
const Zt = {
|
|
1522
1522
|
identify: (s) => typeof s == "number",
|
|
1523
1523
|
default: !0,
|
|
1524
1524
|
tag: "tag:yaml.org,2002:float",
|
|
1525
1525
|
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
1526
1526
|
resolve: (s) => s.slice(-3).toLowerCase() === "nan" ? NaN : s[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
|
1527
1527
|
stringify: q
|
|
1528
|
-
},
|
|
1528
|
+
}, xt = {
|
|
1529
1529
|
identify: (s) => typeof s == "number",
|
|
1530
1530
|
default: !0,
|
|
1531
1531
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1536,7 +1536,7 @@ const ts = {
|
|
|
1536
1536
|
const e = Number(s.value);
|
|
1537
1537
|
return isFinite(e) ? e.toExponential() : q(s);
|
|
1538
1538
|
}
|
|
1539
|
-
},
|
|
1539
|
+
}, es = {
|
|
1540
1540
|
identify: (s) => typeof s == "number",
|
|
1541
1541
|
default: !0,
|
|
1542
1542
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1546,51 +1546,51 @@ const ts = {
|
|
|
1546
1546
|
return t !== -1 && s[s.length - 1] === "0" && (e.minFractionDigits = s.length - t - 1), e;
|
|
1547
1547
|
},
|
|
1548
1548
|
stringify: q
|
|
1549
|
-
},
|
|
1550
|
-
function
|
|
1549
|
+
}, Ye = (s) => typeof s == "bigint" || Number.isInteger(s), yt = (s, e, t, { intAsBigInt: n }) => n ? BigInt(s) : parseInt(s.substring(e), t);
|
|
1550
|
+
function ts(s, e, t) {
|
|
1551
1551
|
const { value: n } = s;
|
|
1552
|
-
return
|
|
1552
|
+
return Ye(n) && n >= 0 ? t + n.toString(e) : q(s);
|
|
1553
1553
|
}
|
|
1554
|
-
const
|
|
1555
|
-
identify: (s) =>
|
|
1554
|
+
const ss = {
|
|
1555
|
+
identify: (s) => Ye(s) && s >= 0,
|
|
1556
1556
|
default: !0,
|
|
1557
1557
|
tag: "tag:yaml.org,2002:int",
|
|
1558
1558
|
format: "OCT",
|
|
1559
1559
|
test: /^0o[0-7]+$/,
|
|
1560
|
-
resolve: (s, e, t) =>
|
|
1561
|
-
stringify: (s) =>
|
|
1562
|
-
},
|
|
1563
|
-
identify:
|
|
1560
|
+
resolve: (s, e, t) => yt(s, 2, 8, t),
|
|
1561
|
+
stringify: (s) => ts(s, 8, "0o")
|
|
1562
|
+
}, ns = {
|
|
1563
|
+
identify: Ye,
|
|
1564
1564
|
default: !0,
|
|
1565
1565
|
tag: "tag:yaml.org,2002:int",
|
|
1566
1566
|
test: /^[-+]?[0-9]+$/,
|
|
1567
|
-
resolve: (s, e, t) =>
|
|
1567
|
+
resolve: (s, e, t) => yt(s, 0, 10, t),
|
|
1568
1568
|
stringify: q
|
|
1569
|
-
},
|
|
1570
|
-
identify: (s) =>
|
|
1569
|
+
}, is = {
|
|
1570
|
+
identify: (s) => Ye(s) && s >= 0,
|
|
1571
1571
|
default: !0,
|
|
1572
1572
|
tag: "tag:yaml.org,2002:int",
|
|
1573
1573
|
format: "HEX",
|
|
1574
1574
|
test: /^0x[0-9a-fA-F]+$/,
|
|
1575
|
-
resolve: (s, e, t) =>
|
|
1576
|
-
stringify: (s) =>
|
|
1577
|
-
},
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
rs,
|
|
1584
|
-
os,
|
|
1585
|
-
ls,
|
|
1586
|
-
ts,
|
|
1575
|
+
resolve: (s, e, t) => yt(s, 2, 16, t),
|
|
1576
|
+
stringify: (s) => ts(s, 16, "0x")
|
|
1577
|
+
}, Js = [
|
|
1578
|
+
de,
|
|
1579
|
+
pe,
|
|
1580
|
+
Ve,
|
|
1581
|
+
Je,
|
|
1582
|
+
mt,
|
|
1587
1583
|
ss,
|
|
1588
|
-
ns
|
|
1584
|
+
ns,
|
|
1585
|
+
is,
|
|
1586
|
+
Zt,
|
|
1587
|
+
xt,
|
|
1588
|
+
es
|
|
1589
1589
|
];
|
|
1590
|
-
function
|
|
1590
|
+
function Tt(s) {
|
|
1591
1591
|
return typeof s == "bigint" || Number.isInteger(s);
|
|
1592
1592
|
}
|
|
1593
|
-
const $e = ({ value: s }) => JSON.stringify(s),
|
|
1593
|
+
const $e = ({ value: s }) => JSON.stringify(s), Ys = [
|
|
1594
1594
|
{
|
|
1595
1595
|
identify: (s) => typeof s == "string",
|
|
1596
1596
|
default: !0,
|
|
@@ -1616,12 +1616,12 @@ const $e = ({ value: s }) => JSON.stringify(s), Hs = [
|
|
|
1616
1616
|
stringify: $e
|
|
1617
1617
|
},
|
|
1618
1618
|
{
|
|
1619
|
-
identify:
|
|
1619
|
+
identify: Tt,
|
|
1620
1620
|
default: !0,
|
|
1621
1621
|
tag: "tag:yaml.org,2002:int",
|
|
1622
1622
|
test: /^-?(?:0|[1-9][0-9]*)$/,
|
|
1623
1623
|
resolve: (s, e, { intAsBigInt: t }) => t ? BigInt(s) : parseInt(s, 10),
|
|
1624
|
-
stringify: ({ value: s }) =>
|
|
1624
|
+
stringify: ({ value: s }) => Tt(s) ? s.toString() : JSON.stringify(s)
|
|
1625
1625
|
},
|
|
1626
1626
|
{
|
|
1627
1627
|
identify: (s) => typeof s == "number",
|
|
@@ -1631,14 +1631,14 @@ const $e = ({ value: s }) => JSON.stringify(s), Hs = [
|
|
|
1631
1631
|
resolve: (s) => parseFloat(s),
|
|
1632
1632
|
stringify: $e
|
|
1633
1633
|
}
|
|
1634
|
-
],
|
|
1634
|
+
], Gs = {
|
|
1635
1635
|
default: !0,
|
|
1636
1636
|
tag: "",
|
|
1637
1637
|
test: /^/,
|
|
1638
1638
|
resolve(s, e) {
|
|
1639
1639
|
return e(`Unresolved plain scalar ${JSON.stringify(s)}`), s;
|
|
1640
1640
|
}
|
|
1641
|
-
},
|
|
1641
|
+
}, Qs = [de, pe].concat(Ys, Gs), gt = {
|
|
1642
1642
|
identify: (s) => s instanceof Uint8Array,
|
|
1643
1643
|
// Buffer inherits from Uint8Array
|
|
1644
1644
|
default: !1,
|
|
@@ -1679,15 +1679,15 @@ const $e = ({ value: s }) => JSON.stringify(s), Hs = [
|
|
|
1679
1679
|
l = p.join(e === A.BLOCK_LITERAL ? `
|
|
1680
1680
|
` : " ");
|
|
1681
1681
|
}
|
|
1682
|
-
return
|
|
1682
|
+
return Oe({ comment: s, type: e, value: l }, n, i, r);
|
|
1683
1683
|
}
|
|
1684
1684
|
};
|
|
1685
|
-
function
|
|
1686
|
-
if (
|
|
1685
|
+
function rs(s, e) {
|
|
1686
|
+
if (Ne(s))
|
|
1687
1687
|
for (let t = 0; t < s.items.length; ++t) {
|
|
1688
1688
|
let n = s.items[t];
|
|
1689
1689
|
if (!T(n)) {
|
|
1690
|
-
if (
|
|
1690
|
+
if (ke(n)) {
|
|
1691
1691
|
n.items.length > 1 && e("Each pair must have its own sequence indicator");
|
|
1692
1692
|
const i = n.items[0] || new v(new A(null));
|
|
1693
1693
|
if (n.commentBefore && (i.key.commentBefore = i.key.commentBefore ? `${n.commentBefore}
|
|
@@ -1705,8 +1705,8 @@ ${r.comment}` : n.comment;
|
|
|
1705
1705
|
e("Expected a sequence for this tag");
|
|
1706
1706
|
return s;
|
|
1707
1707
|
}
|
|
1708
|
-
function
|
|
1709
|
-
const { replacer: n } = t, i = new
|
|
1708
|
+
function os(s, e, t) {
|
|
1709
|
+
const { replacer: n } = t, i = new X(s);
|
|
1710
1710
|
i.tag = "tag:yaml.org,2002:pairs";
|
|
1711
1711
|
let r = 0;
|
|
1712
1712
|
if (e && Symbol.iterator in Object(e))
|
|
@@ -1726,20 +1726,20 @@ function cs(s, e, t) {
|
|
|
1726
1726
|
throw new TypeError(`Expected tuple with one key, not ${c.length} keys`);
|
|
1727
1727
|
} else
|
|
1728
1728
|
l = o;
|
|
1729
|
-
i.items.push(
|
|
1729
|
+
i.items.push(pt(l, a, t));
|
|
1730
1730
|
}
|
|
1731
1731
|
return i;
|
|
1732
1732
|
}
|
|
1733
|
-
const
|
|
1733
|
+
const bt = {
|
|
1734
1734
|
collection: "seq",
|
|
1735
1735
|
default: !1,
|
|
1736
1736
|
tag: "tag:yaml.org,2002:pairs",
|
|
1737
|
-
resolve:
|
|
1738
|
-
createNode:
|
|
1737
|
+
resolve: rs,
|
|
1738
|
+
createNode: os
|
|
1739
1739
|
};
|
|
1740
|
-
class
|
|
1740
|
+
class oe extends X {
|
|
1741
1741
|
constructor() {
|
|
1742
|
-
super(), this.add = K.prototype.add.bind(this), this.delete = K.prototype.delete.bind(this), this.get = K.prototype.get.bind(this), this.has = K.prototype.has.bind(this), this.set = K.prototype.set.bind(this), this.tag =
|
|
1742
|
+
super(), this.add = K.prototype.add.bind(this), this.delete = K.prototype.delete.bind(this), this.get = K.prototype.get.bind(this), this.has = K.prototype.has.bind(this), this.set = K.prototype.set.bind(this), this.tag = oe.tag;
|
|
1743
1743
|
}
|
|
1744
1744
|
/**
|
|
1745
1745
|
* If `ctx` is given, the return type is actually `Map<unknown, unknown>`,
|
|
@@ -1759,50 +1759,50 @@ class ae extends W {
|
|
|
1759
1759
|
return n;
|
|
1760
1760
|
}
|
|
1761
1761
|
static from(e, t, n) {
|
|
1762
|
-
const i =
|
|
1762
|
+
const i = os(e, t, n), r = new this();
|
|
1763
1763
|
return r.items = i.items, r;
|
|
1764
1764
|
}
|
|
1765
1765
|
}
|
|
1766
|
-
|
|
1767
|
-
const
|
|
1766
|
+
oe.tag = "tag:yaml.org,2002:omap";
|
|
1767
|
+
const wt = {
|
|
1768
1768
|
collection: "seq",
|
|
1769
1769
|
identify: (s) => s instanceof Map,
|
|
1770
|
-
nodeClass:
|
|
1770
|
+
nodeClass: oe,
|
|
1771
1771
|
default: !1,
|
|
1772
1772
|
tag: "tag:yaml.org,2002:omap",
|
|
1773
1773
|
resolve(s, e) {
|
|
1774
|
-
const t =
|
|
1774
|
+
const t = rs(s, e), n = [];
|
|
1775
1775
|
for (const { key: i } of t.items)
|
|
1776
|
-
|
|
1777
|
-
return Object.assign(new
|
|
1776
|
+
I(i) && (n.includes(i.value) ? e(`Ordered maps must not include duplicate keys: ${i.value}`) : n.push(i.value));
|
|
1777
|
+
return Object.assign(new oe(), t);
|
|
1778
1778
|
},
|
|
1779
|
-
createNode: (s, e, t) =>
|
|
1779
|
+
createNode: (s, e, t) => oe.from(s, e, t)
|
|
1780
1780
|
};
|
|
1781
|
-
function
|
|
1782
|
-
return e && (s ?
|
|
1781
|
+
function ls({ value: s, source: e }, t) {
|
|
1782
|
+
return e && (s ? as : cs).test.test(e) ? e : s ? t.options.trueStr : t.options.falseStr;
|
|
1783
1783
|
}
|
|
1784
|
-
const
|
|
1784
|
+
const as = {
|
|
1785
1785
|
identify: (s) => s === !0,
|
|
1786
1786
|
default: !0,
|
|
1787
1787
|
tag: "tag:yaml.org,2002:bool",
|
|
1788
1788
|
test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
|
|
1789
1789
|
resolve: () => new A(!0),
|
|
1790
|
-
stringify:
|
|
1791
|
-
},
|
|
1790
|
+
stringify: ls
|
|
1791
|
+
}, cs = {
|
|
1792
1792
|
identify: (s) => s === !1,
|
|
1793
1793
|
default: !0,
|
|
1794
1794
|
tag: "tag:yaml.org,2002:bool",
|
|
1795
1795
|
test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
|
|
1796
1796
|
resolve: () => new A(!1),
|
|
1797
|
-
stringify:
|
|
1798
|
-
},
|
|
1797
|
+
stringify: ls
|
|
1798
|
+
}, Ws = {
|
|
1799
1799
|
identify: (s) => typeof s == "number",
|
|
1800
1800
|
default: !0,
|
|
1801
1801
|
tag: "tag:yaml.org,2002:float",
|
|
1802
1802
|
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
1803
1803
|
resolve: (s) => s.slice(-3).toLowerCase() === "nan" ? NaN : s[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
|
1804
1804
|
stringify: q
|
|
1805
|
-
},
|
|
1805
|
+
}, Hs = {
|
|
1806
1806
|
identify: (s) => typeof s == "number",
|
|
1807
1807
|
default: !0,
|
|
1808
1808
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1813,7 +1813,7 @@ const us = {
|
|
|
1813
1813
|
const e = Number(s.value);
|
|
1814
1814
|
return isFinite(e) ? e.toExponential() : q(s);
|
|
1815
1815
|
}
|
|
1816
|
-
},
|
|
1816
|
+
}, Xs = {
|
|
1817
1817
|
identify: (s) => typeof s == "number",
|
|
1818
1818
|
default: !0,
|
|
1819
1819
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1827,8 +1827,8 @@ const us = {
|
|
|
1827
1827
|
return e;
|
|
1828
1828
|
},
|
|
1829
1829
|
stringify: q
|
|
1830
|
-
},
|
|
1831
|
-
function
|
|
1830
|
+
}, Ae = (s) => typeof s == "bigint" || Number.isInteger(s);
|
|
1831
|
+
function Ge(s, e, t, { intAsBigInt: n }) {
|
|
1832
1832
|
const i = s[0];
|
|
1833
1833
|
if ((i === "-" || i === "+") && (e += 1), s = s.substring(e).replace(/_/g, ""), n) {
|
|
1834
1834
|
switch (t) {
|
|
@@ -1848,66 +1848,66 @@ function We(s, e, t, { intAsBigInt: n }) {
|
|
|
1848
1848
|
const r = parseInt(s, t);
|
|
1849
1849
|
return i === "-" ? -1 * r : r;
|
|
1850
1850
|
}
|
|
1851
|
-
function
|
|
1851
|
+
function St(s, e, t) {
|
|
1852
1852
|
const { value: n } = s;
|
|
1853
|
-
if (
|
|
1853
|
+
if (Ae(n)) {
|
|
1854
1854
|
const i = n.toString(e);
|
|
1855
1855
|
return n < 0 ? "-" + t + i.substr(1) : t + i;
|
|
1856
1856
|
}
|
|
1857
1857
|
return q(s);
|
|
1858
1858
|
}
|
|
1859
|
-
const
|
|
1860
|
-
identify:
|
|
1859
|
+
const zs = {
|
|
1860
|
+
identify: Ae,
|
|
1861
1861
|
default: !0,
|
|
1862
1862
|
tag: "tag:yaml.org,2002:int",
|
|
1863
1863
|
format: "BIN",
|
|
1864
1864
|
test: /^[-+]?0b[0-1_]+$/,
|
|
1865
|
-
resolve: (s, e, t) =>
|
|
1866
|
-
stringify: (s) =>
|
|
1867
|
-
},
|
|
1868
|
-
identify:
|
|
1865
|
+
resolve: (s, e, t) => Ge(s, 2, 2, t),
|
|
1866
|
+
stringify: (s) => St(s, 2, "0b")
|
|
1867
|
+
}, Zs = {
|
|
1868
|
+
identify: Ae,
|
|
1869
1869
|
default: !0,
|
|
1870
1870
|
tag: "tag:yaml.org,2002:int",
|
|
1871
1871
|
format: "OCT",
|
|
1872
1872
|
test: /^[-+]?0[0-7_]+$/,
|
|
1873
|
-
resolve: (s, e, t) =>
|
|
1874
|
-
stringify: (s) =>
|
|
1875
|
-
},
|
|
1876
|
-
identify:
|
|
1873
|
+
resolve: (s, e, t) => Ge(s, 1, 8, t),
|
|
1874
|
+
stringify: (s) => St(s, 8, "0")
|
|
1875
|
+
}, xs = {
|
|
1876
|
+
identify: Ae,
|
|
1877
1877
|
default: !0,
|
|
1878
1878
|
tag: "tag:yaml.org,2002:int",
|
|
1879
1879
|
test: /^[-+]?[0-9][0-9_]*$/,
|
|
1880
|
-
resolve: (s, e, t) =>
|
|
1880
|
+
resolve: (s, e, t) => Ge(s, 0, 10, t),
|
|
1881
1881
|
stringify: q
|
|
1882
|
-
},
|
|
1883
|
-
identify:
|
|
1882
|
+
}, en = {
|
|
1883
|
+
identify: Ae,
|
|
1884
1884
|
default: !0,
|
|
1885
1885
|
tag: "tag:yaml.org,2002:int",
|
|
1886
1886
|
format: "HEX",
|
|
1887
1887
|
test: /^[-+]?0x[0-9a-fA-F_]+$/,
|
|
1888
|
-
resolve: (s, e, t) =>
|
|
1889
|
-
stringify: (s) =>
|
|
1888
|
+
resolve: (s, e, t) => Ge(s, 2, 16, t),
|
|
1889
|
+
stringify: (s) => St(s, 16, "0x")
|
|
1890
1890
|
};
|
|
1891
|
-
class
|
|
1891
|
+
class le extends K {
|
|
1892
1892
|
constructor(e) {
|
|
1893
|
-
super(e), this.tag =
|
|
1893
|
+
super(e), this.tag = le.tag;
|
|
1894
1894
|
}
|
|
1895
1895
|
add(e) {
|
|
1896
1896
|
let t;
|
|
1897
|
-
T(e) ? t = e : e && typeof e == "object" && "key" in e && "value" in e && e.value === null ? t = new v(e.key, null) : t = new v(e, null),
|
|
1897
|
+
T(e) ? t = e : e && typeof e == "object" && "key" in e && "value" in e && e.value === null ? t = new v(e.key, null) : t = new v(e, null), W(this.items, t.key) || this.items.push(t);
|
|
1898
1898
|
}
|
|
1899
1899
|
/**
|
|
1900
1900
|
* If `keepPair` is `true`, returns the Pair matching `key`.
|
|
1901
1901
|
* Otherwise, returns the value of that Pair's key.
|
|
1902
1902
|
*/
|
|
1903
1903
|
get(e, t) {
|
|
1904
|
-
const n =
|
|
1905
|
-
return !t && T(n) ?
|
|
1904
|
+
const n = W(this.items, e);
|
|
1905
|
+
return !t && T(n) ? I(n.key) ? n.key.value : n.key : n;
|
|
1906
1906
|
}
|
|
1907
1907
|
set(e, t) {
|
|
1908
1908
|
if (typeof t != "boolean")
|
|
1909
1909
|
throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);
|
|
1910
|
-
const n =
|
|
1910
|
+
const n = W(this.items, e);
|
|
1911
1911
|
n && !t ? this.items.splice(this.items.indexOf(n), 1) : !n && t && this.items.push(new v(e));
|
|
1912
1912
|
}
|
|
1913
1913
|
toJSON(e, t) {
|
|
@@ -1924,33 +1924,33 @@ class ce extends K {
|
|
|
1924
1924
|
const { replacer: i } = n, r = new this(e);
|
|
1925
1925
|
if (t && Symbol.iterator in Object(t))
|
|
1926
1926
|
for (let o of t)
|
|
1927
|
-
typeof i == "function" && (o = i.call(t, o, o)), r.items.push(
|
|
1927
|
+
typeof i == "function" && (o = i.call(t, o, o)), r.items.push(pt(o, null, n));
|
|
1928
1928
|
return r;
|
|
1929
1929
|
}
|
|
1930
1930
|
}
|
|
1931
|
-
|
|
1932
|
-
const
|
|
1931
|
+
le.tag = "tag:yaml.org,2002:set";
|
|
1932
|
+
const kt = {
|
|
1933
1933
|
collection: "map",
|
|
1934
1934
|
identify: (s) => s instanceof Set,
|
|
1935
|
-
nodeClass:
|
|
1935
|
+
nodeClass: le,
|
|
1936
1936
|
default: !1,
|
|
1937
1937
|
tag: "tag:yaml.org,2002:set",
|
|
1938
|
-
createNode: (s, e, t) =>
|
|
1938
|
+
createNode: (s, e, t) => le.from(s, e, t),
|
|
1939
1939
|
resolve(s, e) {
|
|
1940
|
-
if (
|
|
1940
|
+
if (ke(s)) {
|
|
1941
1941
|
if (s.hasAllNullValues(!0))
|
|
1942
|
-
return Object.assign(new
|
|
1942
|
+
return Object.assign(new le(), s);
|
|
1943
1943
|
e("Set items must all have null values");
|
|
1944
1944
|
} else
|
|
1945
1945
|
e("Expected a mapping for this tag");
|
|
1946
1946
|
return s;
|
|
1947
1947
|
}
|
|
1948
1948
|
};
|
|
1949
|
-
function
|
|
1949
|
+
function Nt(s, e) {
|
|
1950
1950
|
const t = s[0], n = t === "-" || t === "+" ? s.substring(1) : s, i = (o) => e ? BigInt(o) : Number(o), r = n.replace(/_/g, "").split(":").reduce((o, l) => o * i(60) + i(l), i(0));
|
|
1951
1951
|
return t === "-" ? i(-1) * r : r;
|
|
1952
1952
|
}
|
|
1953
|
-
function
|
|
1953
|
+
function fs(s) {
|
|
1954
1954
|
let { value: e } = s, t = (o) => o;
|
|
1955
1955
|
if (typeof e == "bigint")
|
|
1956
1956
|
t = (o) => BigInt(o);
|
|
@@ -1961,23 +1961,23 @@ function ds(s) {
|
|
|
1961
1961
|
const i = t(60), r = [e % i];
|
|
1962
1962
|
return e < 60 ? r.unshift(0) : (e = (e - r[0]) / i, r.unshift(e % i), e >= 60 && (e = (e - r[0]) / i, r.unshift(e))), n + r.map((o) => String(o).padStart(2, "0")).join(":").replace(/000000\d*$/, "");
|
|
1963
1963
|
}
|
|
1964
|
-
const
|
|
1964
|
+
const us = {
|
|
1965
1965
|
identify: (s) => typeof s == "bigint" || Number.isInteger(s),
|
|
1966
1966
|
default: !0,
|
|
1967
1967
|
tag: "tag:yaml.org,2002:int",
|
|
1968
1968
|
format: "TIME",
|
|
1969
1969
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
|
|
1970
|
-
resolve: (s, e, { intAsBigInt: t }) =>
|
|
1971
|
-
stringify:
|
|
1972
|
-
},
|
|
1970
|
+
resolve: (s, e, { intAsBigInt: t }) => Nt(s, t),
|
|
1971
|
+
stringify: fs
|
|
1972
|
+
}, hs = {
|
|
1973
1973
|
identify: (s) => typeof s == "number",
|
|
1974
1974
|
default: !0,
|
|
1975
1975
|
tag: "tag:yaml.org,2002:float",
|
|
1976
1976
|
format: "TIME",
|
|
1977
1977
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
|
|
1978
|
-
resolve: (s) =>
|
|
1979
|
-
stringify:
|
|
1980
|
-
},
|
|
1978
|
+
resolve: (s) => Nt(s, !1),
|
|
1979
|
+
stringify: fs
|
|
1980
|
+
}, Qe = {
|
|
1981
1981
|
identify: (s) => s instanceof Date,
|
|
1982
1982
|
default: !0,
|
|
1983
1983
|
tag: "tag:yaml.org,2002:timestamp",
|
|
@@ -1986,76 +1986,76 @@ const ps = {
|
|
|
1986
1986
|
// assumed to be 00:00:00Z (start of day, UTC).
|
|
1987
1987
|
test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),
|
|
1988
1988
|
resolve(s) {
|
|
1989
|
-
const e = s.match(
|
|
1989
|
+
const e = s.match(Qe.test);
|
|
1990
1990
|
if (!e)
|
|
1991
1991
|
throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
|
|
1992
1992
|
const [, t, n, i, r, o, l] = e.map(Number), a = e[7] ? Number((e[7] + "00").substr(1, 3)) : 0;
|
|
1993
1993
|
let c = Date.UTC(t, n - 1, i, r || 0, o || 0, l || 0, a);
|
|
1994
1994
|
const p = e[8];
|
|
1995
1995
|
if (p && p !== "Z") {
|
|
1996
|
-
let f =
|
|
1996
|
+
let f = Nt(p, !1);
|
|
1997
1997
|
Math.abs(f) < 30 && (f *= 60), c -= 6e4 * f;
|
|
1998
1998
|
}
|
|
1999
1999
|
return new Date(c);
|
|
2000
2000
|
},
|
|
2001
2001
|
stringify: ({ value: s }) => (s == null ? void 0 : s.toISOString().replace(/(T00:00:00)?\.000Z$/, "")) ?? ""
|
|
2002
|
-
},
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
sn,
|
|
2011
|
-
nn,
|
|
2012
|
-
rn,
|
|
2002
|
+
}, Lt = [
|
|
2003
|
+
de,
|
|
2004
|
+
pe,
|
|
2005
|
+
Ve,
|
|
2006
|
+
Je,
|
|
2007
|
+
as,
|
|
2008
|
+
cs,
|
|
2009
|
+
zs,
|
|
2013
2010
|
Zs,
|
|
2014
2011
|
xs,
|
|
2015
2012
|
en,
|
|
2016
|
-
|
|
2013
|
+
Ws,
|
|
2014
|
+
Hs,
|
|
2015
|
+
Xs,
|
|
2016
|
+
gt,
|
|
2017
2017
|
V,
|
|
2018
|
-
St,
|
|
2019
2018
|
wt,
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
["
|
|
2027
|
-
["
|
|
2028
|
-
["
|
|
2029
|
-
["
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2019
|
+
bt,
|
|
2020
|
+
kt,
|
|
2021
|
+
us,
|
|
2022
|
+
hs,
|
|
2023
|
+
Qe
|
|
2024
|
+
], $t = /* @__PURE__ */ new Map([
|
|
2025
|
+
["core", Js],
|
|
2026
|
+
["failsafe", [de, pe, Ve]],
|
|
2027
|
+
["json", Qs],
|
|
2028
|
+
["yaml11", Lt],
|
|
2029
|
+
["yaml-1.1", Lt]
|
|
2030
|
+
]), _t = {
|
|
2031
|
+
binary: gt,
|
|
2032
|
+
bool: mt,
|
|
2033
|
+
float: es,
|
|
2034
|
+
floatExp: xt,
|
|
2035
|
+
floatNaN: Zt,
|
|
2036
|
+
floatTime: hs,
|
|
2037
|
+
int: ns,
|
|
2038
|
+
intHex: is,
|
|
2039
|
+
intOct: ss,
|
|
2040
|
+
intTime: us,
|
|
2041
|
+
map: de,
|
|
2042
2042
|
merge: V,
|
|
2043
|
-
null:
|
|
2044
|
-
omap:
|
|
2045
|
-
pairs:
|
|
2046
|
-
seq:
|
|
2047
|
-
set:
|
|
2048
|
-
timestamp:
|
|
2049
|
-
},
|
|
2050
|
-
"tag:yaml.org,2002:binary":
|
|
2043
|
+
null: Je,
|
|
2044
|
+
omap: wt,
|
|
2045
|
+
pairs: bt,
|
|
2046
|
+
seq: pe,
|
|
2047
|
+
set: kt,
|
|
2048
|
+
timestamp: Qe
|
|
2049
|
+
}, tn = {
|
|
2050
|
+
"tag:yaml.org,2002:binary": gt,
|
|
2051
2051
|
"tag:yaml.org,2002:merge": V,
|
|
2052
|
-
"tag:yaml.org,2002:omap":
|
|
2053
|
-
"tag:yaml.org,2002:pairs":
|
|
2054
|
-
"tag:yaml.org,2002:set":
|
|
2055
|
-
"tag:yaml.org,2002:timestamp":
|
|
2052
|
+
"tag:yaml.org,2002:omap": wt,
|
|
2053
|
+
"tag:yaml.org,2002:pairs": bt,
|
|
2054
|
+
"tag:yaml.org,2002:set": kt,
|
|
2055
|
+
"tag:yaml.org,2002:timestamp": Qe
|
|
2056
2056
|
};
|
|
2057
|
-
function
|
|
2058
|
-
const n =
|
|
2057
|
+
function Ze(s, e, t) {
|
|
2058
|
+
const n = $t.get(e);
|
|
2059
2059
|
if (n && !s)
|
|
2060
2060
|
return t && !n.includes(V) ? n.concat(V) : n.slice();
|
|
2061
2061
|
let i = n;
|
|
@@ -2063,7 +2063,7 @@ function tt(s, e, t) {
|
|
|
2063
2063
|
if (Array.isArray(s))
|
|
2064
2064
|
i = [];
|
|
2065
2065
|
else {
|
|
2066
|
-
const r = Array.from(
|
|
2066
|
+
const r = Array.from($t.keys()).filter((o) => o !== "yaml11").map((o) => JSON.stringify(o)).join(", ");
|
|
2067
2067
|
throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`);
|
|
2068
2068
|
}
|
|
2069
2069
|
if (Array.isArray(s))
|
|
@@ -2071,25 +2071,25 @@ function tt(s, e, t) {
|
|
|
2071
2071
|
i = i.concat(r);
|
|
2072
2072
|
else typeof s == "function" && (i = s(i.slice()));
|
|
2073
2073
|
return t && (i = i.concat(V)), i.reduce((r, o) => {
|
|
2074
|
-
const l = typeof o == "string" ?
|
|
2074
|
+
const l = typeof o == "string" ? _t[o] : o;
|
|
2075
2075
|
if (!l) {
|
|
2076
|
-
const a = JSON.stringify(o), c = Object.keys(
|
|
2076
|
+
const a = JSON.stringify(o), c = Object.keys(_t).map((p) => JSON.stringify(p)).join(", ");
|
|
2077
2077
|
throw new Error(`Unknown custom tag ${a}; use one of ${c}`);
|
|
2078
2078
|
}
|
|
2079
2079
|
return r.includes(l) || r.push(l), r;
|
|
2080
2080
|
}, []);
|
|
2081
2081
|
}
|
|
2082
|
-
const
|
|
2083
|
-
class
|
|
2082
|
+
const sn = (s, e) => s.key < e.key ? -1 : s.key > e.key ? 1 : 0;
|
|
2083
|
+
class Ot {
|
|
2084
2084
|
constructor({ compat: e, customTags: t, merge: n, resolveKnownTags: i, schema: r, sortMapEntries: o, toStringDefaults: l }) {
|
|
2085
|
-
this.compat = Array.isArray(e) ?
|
|
2085
|
+
this.compat = Array.isArray(e) ? Ze(e, "compat") : e ? Ze(null, e) : null, this.name = typeof r == "string" && r || "core", this.knownTags = i ? tn : {}, this.tags = Ze(t, this.name, n), this.toStringOptions = l ?? null, Object.defineProperty(this, G, { value: de }), Object.defineProperty(this, R, { value: Ve }), Object.defineProperty(this, fe, { value: pe }), this.sortMapEntries = typeof o == "function" ? o : o === !0 ? sn : null;
|
|
2086
2086
|
}
|
|
2087
2087
|
clone() {
|
|
2088
|
-
const e = Object.create(
|
|
2088
|
+
const e = Object.create(Ot.prototype, Object.getOwnPropertyDescriptors(this));
|
|
2089
2089
|
return e.tags = this.tags.slice(), e;
|
|
2090
2090
|
}
|
|
2091
2091
|
}
|
|
2092
|
-
function
|
|
2092
|
+
function nn(s, e) {
|
|
2093
2093
|
var a;
|
|
2094
2094
|
const t = [];
|
|
2095
2095
|
let n = e.directives === !0;
|
|
@@ -2098,7 +2098,7 @@ function an(s, e) {
|
|
|
2098
2098
|
c ? (t.push(c), n = !0) : s.directives.docStart && (n = !0);
|
|
2099
2099
|
}
|
|
2100
2100
|
n && t.push("---");
|
|
2101
|
-
const i =
|
|
2101
|
+
const i = Qt(s, e), { commentString: r } = i.options;
|
|
2102
2102
|
if (s.commentBefore) {
|
|
2103
2103
|
t.length !== 1 && t.unshift("");
|
|
2104
2104
|
const c = r(s.commentBefore);
|
|
@@ -2114,10 +2114,10 @@ function an(s, e) {
|
|
|
2114
2114
|
i.forceBlockIndent = !!s.comment, l = s.contents.comment;
|
|
2115
2115
|
}
|
|
2116
2116
|
const c = l ? void 0 : () => o = !0;
|
|
2117
|
-
let p =
|
|
2118
|
-
l && (p +=
|
|
2117
|
+
let p = ae(s.contents, i, () => l = null, c);
|
|
2118
|
+
l && (p += Q(p, "", r(l))), (p[0] === "|" || p[0] === ">") && t[t.length - 1] === "---" ? t[t.length - 1] = `--- ${p}` : t.push(p);
|
|
2119
2119
|
} else
|
|
2120
|
-
t.push(
|
|
2120
|
+
t.push(ae(s.contents, i));
|
|
2121
2121
|
if ((a = s.directives) != null && a.docEnd)
|
|
2122
2122
|
if (s.comment) {
|
|
2123
2123
|
const c = r(s.comment);
|
|
@@ -2133,9 +2133,9 @@ function an(s, e) {
|
|
|
2133
2133
|
`) + `
|
|
2134
2134
|
`;
|
|
2135
2135
|
}
|
|
2136
|
-
class
|
|
2136
|
+
class Ee {
|
|
2137
2137
|
constructor(e, t, n) {
|
|
2138
|
-
this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, j, { value:
|
|
2138
|
+
this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, j, { value: it });
|
|
2139
2139
|
let i = null;
|
|
2140
2140
|
typeof t == "function" || Array.isArray(t) ? i = t : n === void 0 && t && (n = t, t = void 0);
|
|
2141
2141
|
const r = Object.assign({
|
|
@@ -2158,18 +2158,18 @@ class ge {
|
|
|
2158
2158
|
* Custom Node values that inherit from `Object` still refer to their original instances.
|
|
2159
2159
|
*/
|
|
2160
2160
|
clone() {
|
|
2161
|
-
const e = Object.create(
|
|
2162
|
-
[j]: { value:
|
|
2161
|
+
const e = Object.create(Ee.prototype, {
|
|
2162
|
+
[j]: { value: it }
|
|
2163
2163
|
});
|
|
2164
2164
|
return e.commentBefore = this.commentBefore, e.comment = this.comment, e.errors = this.errors.slice(), e.warnings = this.warnings.slice(), e.options = Object.assign({}, this.options), this.directives && (e.directives = this.directives.clone()), e.schema = this.schema.clone(), e.contents = $(this.contents) ? this.contents.clone(e.schema) : this.contents, this.range && (e.range = this.range.slice()), e;
|
|
2165
2165
|
}
|
|
2166
2166
|
/** Adds a value to the document. */
|
|
2167
2167
|
add(e) {
|
|
2168
|
-
|
|
2168
|
+
x(this.contents) && this.contents.add(e);
|
|
2169
2169
|
}
|
|
2170
2170
|
/** Adds a value to the document. */
|
|
2171
2171
|
addIn(e, t) {
|
|
2172
|
-
|
|
2172
|
+
x(this.contents) && this.contents.addIn(e, t);
|
|
2173
2173
|
}
|
|
2174
2174
|
/**
|
|
2175
2175
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -2182,11 +2182,11 @@ class ge {
|
|
|
2182
2182
|
*/
|
|
2183
2183
|
createAlias(e, t) {
|
|
2184
2184
|
if (!e.anchor) {
|
|
2185
|
-
const n =
|
|
2185
|
+
const n = Ut(this);
|
|
2186
2186
|
e.anchor = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
2187
|
-
!t || n.has(t) ?
|
|
2187
|
+
!t || n.has(t) ? Vt(t || "a", n) : t;
|
|
2188
2188
|
}
|
|
2189
|
-
return new
|
|
2189
|
+
return new dt(e.anchor);
|
|
2190
2190
|
}
|
|
2191
2191
|
createNode(e, t, n) {
|
|
2192
2192
|
let i;
|
|
@@ -2196,7 +2196,7 @@ class ge {
|
|
|
2196
2196
|
const m = (S) => typeof S == "number" || S instanceof String || S instanceof Number, b = t.filter(m).map(String);
|
|
2197
2197
|
b.length > 0 && (t = t.concat(b)), i = t;
|
|
2198
2198
|
} else n === void 0 && t && (n = t, t = void 0);
|
|
2199
|
-
const { aliasDuplicateObjects: r, anchorPrefix: o, flow: l, keepUndefined: a, onTagObj: c, tag: p } = n ?? {}, { onAnchor: f, setAnchors: d, sourceObjects: h } =
|
|
2199
|
+
const { aliasDuplicateObjects: r, anchorPrefix: o, flow: l, keepUndefined: a, onTagObj: c, tag: p } = n ?? {}, { onAnchor: f, setAnchors: d, sourceObjects: h } = Cs(
|
|
2200
2200
|
this,
|
|
2201
2201
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
2202
2202
|
o || "a"
|
|
@@ -2208,7 +2208,7 @@ class ge {
|
|
|
2208
2208
|
replacer: i,
|
|
2209
2209
|
schema: this.schema,
|
|
2210
2210
|
sourceObjects: h
|
|
2211
|
-
}, u =
|
|
2211
|
+
}, u = be(e, p, y);
|
|
2212
2212
|
return l && L(u) && (u.flow = !0), d(), u;
|
|
2213
2213
|
}
|
|
2214
2214
|
/**
|
|
@@ -2224,14 +2224,14 @@ class ge {
|
|
|
2224
2224
|
* @returns `true` if the item was found and removed.
|
|
2225
2225
|
*/
|
|
2226
2226
|
delete(e) {
|
|
2227
|
-
return
|
|
2227
|
+
return x(this.contents) ? this.contents.delete(e) : !1;
|
|
2228
2228
|
}
|
|
2229
2229
|
/**
|
|
2230
2230
|
* Removes a value from the document.
|
|
2231
2231
|
* @returns `true` if the item was found and removed.
|
|
2232
2232
|
*/
|
|
2233
2233
|
deleteIn(e) {
|
|
2234
|
-
return
|
|
2234
|
+
return ye(e) ? this.contents == null ? !1 : (this.contents = null, !0) : x(this.contents) ? this.contents.deleteIn(e) : !1;
|
|
2235
2235
|
}
|
|
2236
2236
|
/**
|
|
2237
2237
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -2247,7 +2247,7 @@ class ge {
|
|
|
2247
2247
|
* `true` (collections are always returned intact).
|
|
2248
2248
|
*/
|
|
2249
2249
|
getIn(e, t) {
|
|
2250
|
-
return
|
|
2250
|
+
return ye(e) ? !t && I(this.contents) ? this.contents.value : this.contents : L(this.contents) ? this.contents.getIn(e, t) : void 0;
|
|
2251
2251
|
}
|
|
2252
2252
|
/**
|
|
2253
2253
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -2259,21 +2259,21 @@ class ge {
|
|
|
2259
2259
|
* Checks if the document includes a value at `path`.
|
|
2260
2260
|
*/
|
|
2261
2261
|
hasIn(e) {
|
|
2262
|
-
return
|
|
2262
|
+
return ye(e) ? this.contents !== void 0 : L(this.contents) ? this.contents.hasIn(e) : !1;
|
|
2263
2263
|
}
|
|
2264
2264
|
/**
|
|
2265
2265
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
2266
2266
|
* boolean to add/remove the item from the set.
|
|
2267
2267
|
*/
|
|
2268
2268
|
set(e, t) {
|
|
2269
|
-
this.contents == null ? this.contents = Pe(this.schema, [e], t) :
|
|
2269
|
+
this.contents == null ? this.contents = Pe(this.schema, [e], t) : x(this.contents) && this.contents.set(e, t);
|
|
2270
2270
|
}
|
|
2271
2271
|
/**
|
|
2272
2272
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
2273
2273
|
* boolean to add/remove the item from the set.
|
|
2274
2274
|
*/
|
|
2275
2275
|
setIn(e, t) {
|
|
2276
|
-
|
|
2276
|
+
ye(e) ? this.contents = t : this.contents == null ? this.contents = Pe(this.schema, Array.from(e), t) : x(this.contents) && this.contents.setIn(e, t);
|
|
2277
2277
|
}
|
|
2278
2278
|
/**
|
|
2279
2279
|
* Change the YAML version and schema used by the document.
|
|
@@ -2304,7 +2304,7 @@ class ge {
|
|
|
2304
2304
|
if (t.schema instanceof Object)
|
|
2305
2305
|
this.schema = t.schema;
|
|
2306
2306
|
else if (n)
|
|
2307
|
-
this.schema = new
|
|
2307
|
+
this.schema = new Ot(Object.assign(n, t));
|
|
2308
2308
|
else
|
|
2309
2309
|
throw new Error("With a null YAML version, the { schema: Schema } option is required");
|
|
2310
2310
|
}
|
|
@@ -2321,7 +2321,7 @@ class ge {
|
|
|
2321
2321
|
if (typeof r == "function")
|
|
2322
2322
|
for (const { count: c, res: p } of l.anchors.values())
|
|
2323
2323
|
r(p, c);
|
|
2324
|
-
return typeof o == "function" ?
|
|
2324
|
+
return typeof o == "function" ? ne(o, { "": a }, "", a) : a;
|
|
2325
2325
|
}
|
|
2326
2326
|
/**
|
|
2327
2327
|
* A JSON representation of the document `contents`.
|
|
@@ -2340,25 +2340,25 @@ class ge {
|
|
|
2340
2340
|
const t = JSON.stringify(e.indent);
|
|
2341
2341
|
throw new Error(`"indent" option must be a positive integer, not ${t}`);
|
|
2342
2342
|
}
|
|
2343
|
-
return
|
|
2343
|
+
return nn(this, e);
|
|
2344
2344
|
}
|
|
2345
2345
|
}
|
|
2346
|
-
function
|
|
2346
|
+
function x(s) {
|
|
2347
2347
|
if (L(s))
|
|
2348
2348
|
return !0;
|
|
2349
2349
|
throw new Error("Expected a YAML collection as document contents");
|
|
2350
2350
|
}
|
|
2351
|
-
class
|
|
2351
|
+
class ds extends Error {
|
|
2352
2352
|
constructor(e, t, n, i) {
|
|
2353
2353
|
super(), this.name = e, this.code = n, this.message = i, this.pos = t;
|
|
2354
2354
|
}
|
|
2355
2355
|
}
|
|
2356
|
-
class
|
|
2356
|
+
class re extends ds {
|
|
2357
2357
|
constructor(e, t, n) {
|
|
2358
2358
|
super("YAMLParseError", e, t, n);
|
|
2359
2359
|
}
|
|
2360
2360
|
}
|
|
2361
|
-
class
|
|
2361
|
+
class rn extends ds {
|
|
2362
2362
|
constructor(e, t, n) {
|
|
2363
2363
|
super("YAMLWarning", e, t, n);
|
|
2364
2364
|
}
|
|
@@ -2391,7 +2391,7 @@ ${c}
|
|
|
2391
2391
|
`;
|
|
2392
2392
|
}
|
|
2393
2393
|
};
|
|
2394
|
-
function
|
|
2394
|
+
function ce(s, { flow: e, indicator: t, next: n, offset: i, onError: r, parentIndent: o, startOnNewline: l }) {
|
|
2395
2395
|
let a = !1, c = l, p = l, f = "", d = "", h = !1, y = !1, u = null, m = null, b = null, S = null, N = null, w = null, k = null;
|
|
2396
2396
|
for (const g of s)
|
|
2397
2397
|
switch (y && (g.type !== "space" && g.type !== "newline" && g.type !== "comma" && r(g.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), y = !1), u && (c && g.type !== "comment" && g.type !== "newline" && r(u, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), u = null), g.type) {
|
|
@@ -2426,7 +2426,7 @@ function ue(s, { flow: e, indicator: t, next: n, offset: i, onError: r, parentIn
|
|
|
2426
2426
|
default:
|
|
2427
2427
|
r(g, "UNEXPECTED_TOKEN", `Unexpected ${g.type} token`), c = !1, p = !1;
|
|
2428
2428
|
}
|
|
2429
|
-
const O = s[s.length - 1],
|
|
2429
|
+
const O = s[s.length - 1], E = O ? O.offset + O.source.length : i;
|
|
2430
2430
|
return y && n && n.type !== "space" && n.type !== "newline" && n.type !== "comma" && (n.type !== "scalar" || n.source !== "") && r(n.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), u && (c && u.indent <= o || (n == null ? void 0 : n.type) === "block-map" || (n == null ? void 0 : n.type) === "block-seq") && r(u, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), {
|
|
2431
2431
|
comma: N,
|
|
2432
2432
|
found: w,
|
|
@@ -2436,11 +2436,11 @@ function ue(s, { flow: e, indicator: t, next: n, offset: i, onError: r, parentIn
|
|
|
2436
2436
|
anchor: m,
|
|
2437
2437
|
tag: b,
|
|
2438
2438
|
newlineAfterProp: S,
|
|
2439
|
-
end:
|
|
2440
|
-
start: k ??
|
|
2439
|
+
end: E,
|
|
2440
|
+
start: k ?? E
|
|
2441
2441
|
};
|
|
2442
2442
|
}
|
|
2443
|
-
function
|
|
2443
|
+
function we(s) {
|
|
2444
2444
|
if (!s)
|
|
2445
2445
|
return null;
|
|
2446
2446
|
switch (s.type) {
|
|
@@ -2467,7 +2467,7 @@ function Ne(s) {
|
|
|
2467
2467
|
if (t.type === "newline")
|
|
2468
2468
|
return !0;
|
|
2469
2469
|
}
|
|
2470
|
-
if (
|
|
2470
|
+
if (we(e.key) || we(e.value))
|
|
2471
2471
|
return !0;
|
|
2472
2472
|
}
|
|
2473
2473
|
return !1;
|
|
@@ -2475,27 +2475,27 @@ function Ne(s) {
|
|
|
2475
2475
|
return !0;
|
|
2476
2476
|
}
|
|
2477
2477
|
}
|
|
2478
|
-
function
|
|
2478
|
+
function at(s, e, t) {
|
|
2479
2479
|
if ((e == null ? void 0 : e.type) === "flow-collection") {
|
|
2480
2480
|
const n = e.end[0];
|
|
2481
|
-
n.indent === s && (n.source === "]" || n.source === "}") &&
|
|
2481
|
+
n.indent === s && (n.source === "]" || n.source === "}") && we(e) && t(n, "BAD_INDENT", "Flow end indicator should be more indented than parent", !0);
|
|
2482
2482
|
}
|
|
2483
2483
|
}
|
|
2484
|
-
function
|
|
2484
|
+
function ps(s, e, t) {
|
|
2485
2485
|
const { uniqueKeys: n } = s.options;
|
|
2486
2486
|
if (n === !1)
|
|
2487
2487
|
return !1;
|
|
2488
|
-
const i = typeof n == "function" ? n : (r, o) => r === o ||
|
|
2488
|
+
const i = typeof n == "function" ? n : (r, o) => r === o || I(r) && I(o) && r.value === o.value;
|
|
2489
2489
|
return e.some((r) => i(r.key, t));
|
|
2490
2490
|
}
|
|
2491
|
-
const
|
|
2492
|
-
function
|
|
2491
|
+
const Ct = "All mapping items must start at the same column";
|
|
2492
|
+
function on({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
2493
2493
|
var p;
|
|
2494
2494
|
const o = (r == null ? void 0 : r.nodeClass) ?? K, l = new o(t.schema);
|
|
2495
2495
|
t.atRoot && (t.atRoot = !1);
|
|
2496
2496
|
let a = n.offset, c = null;
|
|
2497
2497
|
for (const f of n.items) {
|
|
2498
|
-
const { start: d, key: h, sep: y, value: u } = f, m =
|
|
2498
|
+
const { start: d, key: h, sep: y, value: u } = f, m = ce(d, {
|
|
2499
2499
|
indicator: "explicit-key-ind",
|
|
2500
2500
|
next: h ?? (y == null ? void 0 : y[0]),
|
|
2501
2501
|
offset: a,
|
|
@@ -2504,17 +2504,17 @@ function cn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2504
2504
|
startOnNewline: !0
|
|
2505
2505
|
}), b = !m.found;
|
|
2506
2506
|
if (b) {
|
|
2507
|
-
if (h && (h.type === "block-seq" ? i(a, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in h && h.indent !== n.indent && i(a, "BAD_INDENT",
|
|
2507
|
+
if (h && (h.type === "block-seq" ? i(a, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in h && h.indent !== n.indent && i(a, "BAD_INDENT", Ct)), !m.anchor && !m.tag && !y) {
|
|
2508
2508
|
c = m.end, m.comment && (l.comment ? l.comment += `
|
|
2509
2509
|
` + m.comment : l.comment = m.comment);
|
|
2510
2510
|
continue;
|
|
2511
2511
|
}
|
|
2512
|
-
(m.newlineAfterProp ||
|
|
2513
|
-
} else ((p = m.found) == null ? void 0 : p.indent) !== n.indent && i(a, "BAD_INDENT",
|
|
2512
|
+
(m.newlineAfterProp || we(h)) && i(h ?? d[d.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
|
2513
|
+
} else ((p = m.found) == null ? void 0 : p.indent) !== n.indent && i(a, "BAD_INDENT", Ct);
|
|
2514
2514
|
t.atKey = !0;
|
|
2515
2515
|
const S = m.end, N = h ? s(t, h, m, i) : e(t, S, d, null, m, i);
|
|
2516
|
-
t.schema.compat &&
|
|
2517
|
-
const w =
|
|
2516
|
+
t.schema.compat && at(n.indent, h, i), t.atKey = !1, ps(t, l.items, N) && i(S, "DUPLICATE_KEY", "Map keys must be unique");
|
|
2517
|
+
const w = ce(y ?? [], {
|
|
2518
2518
|
indicator: "map-value-ind",
|
|
2519
2519
|
next: u,
|
|
2520
2520
|
offset: N.range[2],
|
|
@@ -2525,7 +2525,7 @@ function cn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2525
2525
|
if (a = w.end, w.found) {
|
|
2526
2526
|
b && ((u == null ? void 0 : u.type) === "block-map" && !w.hasNewline && i(a, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"), t.options.strict && m.start < w.found.offset - 1024 && i(N.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));
|
|
2527
2527
|
const k = u ? s(t, u, w, i) : e(t, a, y, null, w, i);
|
|
2528
|
-
t.schema.compat &&
|
|
2528
|
+
t.schema.compat && at(n.indent, u, i), a = k.range[2];
|
|
2529
2529
|
const O = new v(N, k);
|
|
2530
2530
|
t.options.keepSourceTokens && (O.srcToken = f), l.items.push(O);
|
|
2531
2531
|
} else {
|
|
@@ -2537,12 +2537,12 @@ function cn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2537
2537
|
}
|
|
2538
2538
|
return c && c < a && i(c, "IMPOSSIBLE", "Map comment with trailing content"), l.range = [n.offset, a, c ?? a], l;
|
|
2539
2539
|
}
|
|
2540
|
-
function
|
|
2541
|
-
const o = (r == null ? void 0 : r.nodeClass) ??
|
|
2540
|
+
function ln({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
2541
|
+
const o = (r == null ? void 0 : r.nodeClass) ?? X, l = new o(t.schema);
|
|
2542
2542
|
t.atRoot && (t.atRoot = !1), t.atKey && (t.atKey = !1);
|
|
2543
2543
|
let a = n.offset, c = null;
|
|
2544
2544
|
for (const { start: p, value: f } of n.items) {
|
|
2545
|
-
const d =
|
|
2545
|
+
const d = ce(p, {
|
|
2546
2546
|
indicator: "seq-item-ind",
|
|
2547
2547
|
next: f,
|
|
2548
2548
|
offset: a,
|
|
@@ -2558,7 +2558,7 @@ function fn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2558
2558
|
continue;
|
|
2559
2559
|
}
|
|
2560
2560
|
const h = f ? s(t, f, d, i) : e(t, d.end, p, null, d, i);
|
|
2561
|
-
t.schema.compat &&
|
|
2561
|
+
t.schema.compat && at(n.indent, f, i), a = h.range[2], l.items.push(h);
|
|
2562
2562
|
}
|
|
2563
2563
|
return l.range = [n.offset, a, c ?? a], l;
|
|
2564
2564
|
}
|
|
@@ -2589,15 +2589,15 @@ function Ie(s, e, t, n) {
|
|
|
2589
2589
|
}
|
|
2590
2590
|
return { comment: i, offset: e };
|
|
2591
2591
|
}
|
|
2592
|
-
const
|
|
2593
|
-
function
|
|
2594
|
-
const o = n.start.source === "{", l = o ? "flow map" : "flow sequence", a = (r == null ? void 0 : r.nodeClass) ?? (o ? K :
|
|
2592
|
+
const xe = "Block collections are not allowed within flow collections", et = (s) => s && (s.type === "block-map" || s.type === "block-seq");
|
|
2593
|
+
function an({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
2594
|
+
const o = n.start.source === "{", l = o ? "flow map" : "flow sequence", a = (r == null ? void 0 : r.nodeClass) ?? (o ? K : X), c = new a(t.schema);
|
|
2595
2595
|
c.flow = !0;
|
|
2596
2596
|
const p = t.atRoot;
|
|
2597
2597
|
p && (t.atRoot = !1), t.atKey && (t.atKey = !1);
|
|
2598
2598
|
let f = n.offset + n.start.source.length;
|
|
2599
2599
|
for (let m = 0; m < n.items.length; ++m) {
|
|
2600
|
-
const b = n.items[m], { start: S, key: N, sep: w, value: k } = b, O =
|
|
2600
|
+
const b = n.items[m], { start: S, key: N, sep: w, value: k } = b, O = ce(S, {
|
|
2601
2601
|
flow: l,
|
|
2602
2602
|
indicator: "explicit-key-ind",
|
|
2603
2603
|
next: N ?? (w == null ? void 0 : w[0]),
|
|
@@ -2612,7 +2612,7 @@ function un({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2612
2612
|
` + O.comment : c.comment = O.comment), f = O.end;
|
|
2613
2613
|
continue;
|
|
2614
2614
|
}
|
|
2615
|
-
!o && t.options.strict &&
|
|
2615
|
+
!o && t.options.strict && we(N) && i(
|
|
2616
2616
|
N,
|
|
2617
2617
|
// checked by containsNewline()
|
|
2618
2618
|
"MULTILINE_IMPLICIT_KEY",
|
|
@@ -2622,32 +2622,32 @@ function un({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2622
2622
|
if (m === 0)
|
|
2623
2623
|
O.comma && i(O.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${l}`);
|
|
2624
2624
|
else if (O.comma || i(O.start, "MISSING_CHAR", `Missing , between ${l} items`), O.comment) {
|
|
2625
|
-
let
|
|
2625
|
+
let E = "";
|
|
2626
2626
|
e: for (const g of S)
|
|
2627
2627
|
switch (g.type) {
|
|
2628
2628
|
case "comma":
|
|
2629
2629
|
case "space":
|
|
2630
2630
|
break;
|
|
2631
2631
|
case "comment":
|
|
2632
|
-
|
|
2632
|
+
E = g.source.substring(1);
|
|
2633
2633
|
break e;
|
|
2634
2634
|
default:
|
|
2635
2635
|
break e;
|
|
2636
2636
|
}
|
|
2637
|
-
if (
|
|
2637
|
+
if (E) {
|
|
2638
2638
|
let g = c.items[c.items.length - 1];
|
|
2639
2639
|
T(g) && (g = g.value ?? g.key), g.comment ? g.comment += `
|
|
2640
|
-
` +
|
|
2640
|
+
` + E : g.comment = E, O.comment = O.comment.substring(E.length + 1);
|
|
2641
2641
|
}
|
|
2642
2642
|
}
|
|
2643
2643
|
if (!o && !w && !O.found) {
|
|
2644
|
-
const
|
|
2645
|
-
c.items.push(
|
|
2644
|
+
const E = k ? s(t, k, O, i) : e(t, O.end, w, null, O, i);
|
|
2645
|
+
c.items.push(E), f = E.range[2], et(k) && i(E.range, "BLOCK_IN_FLOW", xe);
|
|
2646
2646
|
} else {
|
|
2647
2647
|
t.atKey = !0;
|
|
2648
|
-
const
|
|
2649
|
-
|
|
2650
|
-
const _ =
|
|
2648
|
+
const E = O.end, g = N ? s(t, N, O, i) : e(t, E, S, null, O, i);
|
|
2649
|
+
et(N) && i(g.range, "BLOCK_IN_FLOW", xe), t.atKey = !1;
|
|
2650
|
+
const _ = ce(w ?? [], {
|
|
2651
2651
|
flow: l,
|
|
2652
2652
|
indicator: "map-value-ind",
|
|
2653
2653
|
next: k,
|
|
@@ -2671,17 +2671,17 @@ function un({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2671
2671
|
}
|
|
2672
2672
|
} else k && ("source" in k && k.source && k.source[0] === ":" ? i(k, "MISSING_CHAR", `Missing space after : in ${l}`) : i(_.start, "MISSING_CHAR", `Missing , or : between ${l} items`));
|
|
2673
2673
|
const J = k ? s(t, k, _, i) : _.found ? e(t, _.end, w, null, _, i) : null;
|
|
2674
|
-
J ?
|
|
2674
|
+
J ? et(k) && i(J.range, "BLOCK_IN_FLOW", xe) : _.comment && (g.comment ? g.comment += `
|
|
2675
2675
|
` + _.comment : g.comment = _.comment);
|
|
2676
|
-
const
|
|
2677
|
-
if (t.options.keepSourceTokens && (
|
|
2676
|
+
const Z = new v(g, J);
|
|
2677
|
+
if (t.options.keepSourceTokens && (Z.srcToken = b), o) {
|
|
2678
2678
|
const C = c;
|
|
2679
|
-
|
|
2679
|
+
ps(t, C.items, g) && i(E, "DUPLICATE_KEY", "Map keys must be unique"), C.items.push(Z);
|
|
2680
2680
|
} else {
|
|
2681
2681
|
const C = new K(t.schema);
|
|
2682
|
-
C.flow = !0, C.items.push(
|
|
2683
|
-
const
|
|
2684
|
-
C.range = [g.range[0],
|
|
2682
|
+
C.flow = !0, C.items.push(Z);
|
|
2683
|
+
const Et = (J ?? g).range;
|
|
2684
|
+
C.range = [g.range[0], Et[1], Et[2]], c.items.push(C);
|
|
2685
2685
|
}
|
|
2686
2686
|
f = J ? J.range[2] : _.end;
|
|
2687
2687
|
}
|
|
@@ -2702,11 +2702,11 @@ function un({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2702
2702
|
c.range = [n.offset, u, u];
|
|
2703
2703
|
return c;
|
|
2704
2704
|
}
|
|
2705
|
-
function
|
|
2706
|
-
const o = t.type === "block-map" ?
|
|
2705
|
+
function tt(s, e, t, n, i, r) {
|
|
2706
|
+
const o = t.type === "block-map" ? on(s, e, t, n, r) : t.type === "block-seq" ? ln(s, e, t, n, r) : an(s, e, t, n, r), l = o.constructor;
|
|
2707
2707
|
return i === "!" || i === l.tagName ? (o.tag = l.tagName, o) : (i && (o.tag = i), o);
|
|
2708
2708
|
}
|
|
2709
|
-
function
|
|
2709
|
+
function cn(s, e, t, n, i) {
|
|
2710
2710
|
var d;
|
|
2711
2711
|
const r = n.tag, o = r ? e.directives.tagName(r.source, (h) => i(r, "TAG_RESOLVE_FAILED", h)) : null;
|
|
2712
2712
|
if (t.type === "block-seq") {
|
|
@@ -2714,24 +2714,24 @@ function hn(s, e, t, n, i) {
|
|
|
2714
2714
|
u && (!y || y.offset < u.offset) && i(u, "MISSING_CHAR", "Missing newline after block sequence props");
|
|
2715
2715
|
}
|
|
2716
2716
|
const l = t.type === "block-map" ? "map" : t.type === "block-seq" ? "seq" : t.start.source === "{" ? "map" : "seq";
|
|
2717
|
-
if (!r || !o || o === "!" || o === K.tagName && l === "map" || o ===
|
|
2718
|
-
return
|
|
2717
|
+
if (!r || !o || o === "!" || o === K.tagName && l === "map" || o === X.tagName && l === "seq")
|
|
2718
|
+
return tt(s, e, t, i, o);
|
|
2719
2719
|
let a = e.schema.tags.find((h) => h.tag === o && h.collection === l);
|
|
2720
2720
|
if (!a) {
|
|
2721
2721
|
const h = e.schema.knownTags[o];
|
|
2722
2722
|
if (h && h.collection === l)
|
|
2723
2723
|
e.schema.tags.push(Object.assign({}, h, { default: !1 })), a = h;
|
|
2724
2724
|
else
|
|
2725
|
-
return h ? i(r, "BAD_COLLECTION_TYPE", `${h.tag} used for ${l} collection, but expects ${h.collection ?? "scalar"}`, !0) : i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0),
|
|
2725
|
+
return h ? i(r, "BAD_COLLECTION_TYPE", `${h.tag} used for ${l} collection, but expects ${h.collection ?? "scalar"}`, !0) : i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0), tt(s, e, t, i, o);
|
|
2726
2726
|
}
|
|
2727
|
-
const c =
|
|
2727
|
+
const c = tt(s, e, t, i, o, a), p = ((d = a.resolve) == null ? void 0 : d.call(a, c, (h) => i(r, "TAG_RESOLVE_FAILED", h), e.options)) ?? c, f = $(p) ? p : new A(p);
|
|
2728
2728
|
return f.range = c.range, f.tag = o, a != null && a.format && (f.format = a.format), f;
|
|
2729
2729
|
}
|
|
2730
|
-
function
|
|
2731
|
-
const n = e.offset, i =
|
|
2730
|
+
function ms(s, e, t) {
|
|
2731
|
+
const n = e.offset, i = fn(e, s.options.strict, t);
|
|
2732
2732
|
if (!i)
|
|
2733
2733
|
return { value: "", type: null, comment: "", range: [n, n, n] };
|
|
2734
|
-
const r = i.mode === ">" ? A.BLOCK_FOLDED : A.BLOCK_LITERAL, o = e.source ?
|
|
2734
|
+
const r = i.mode === ">" ? A.BLOCK_FOLDED : A.BLOCK_LITERAL, o = e.source ? un(e.source) : [];
|
|
2735
2735
|
let l = o.length;
|
|
2736
2736
|
for (let u = o.length - 1; u >= 0; --u) {
|
|
2737
2737
|
const m = o[u][1];
|
|
@@ -2800,7 +2800,7 @@ function bs(s, e, t) {
|
|
|
2800
2800
|
const y = n + i.length + e.source.length;
|
|
2801
2801
|
return { value: f, type: r, comment: i.comment, range: [n, y, y] };
|
|
2802
2802
|
}
|
|
2803
|
-
function
|
|
2803
|
+
function fn({ offset: s, props: e }, t, n) {
|
|
2804
2804
|
if (e[0].type !== "block-scalar-header")
|
|
2805
2805
|
return n(e[0], "IMPOSSIBLE", "Block scalar header not found"), null;
|
|
2806
2806
|
const { source: i } = e[0], r = i[0];
|
|
@@ -2842,25 +2842,25 @@ function dn({ offset: s, props: e }, t, n) {
|
|
|
2842
2842
|
}
|
|
2843
2843
|
return { mode: r, indent: o, chomp: l, comment: p, length: f };
|
|
2844
2844
|
}
|
|
2845
|
-
function
|
|
2845
|
+
function un(s) {
|
|
2846
2846
|
const e = s.split(/\n( *)/), t = e[0], n = t.match(/^( *)/), r = [n != null && n[1] ? [n[1], t.slice(n[1].length)] : ["", t]];
|
|
2847
2847
|
for (let o = 1; o < e.length; o += 2)
|
|
2848
2848
|
r.push([e[o], e[o + 1]]);
|
|
2849
2849
|
return r;
|
|
2850
2850
|
}
|
|
2851
|
-
function
|
|
2851
|
+
function ys(s, e, t) {
|
|
2852
2852
|
const { offset: n, type: i, source: r, end: o } = s;
|
|
2853
2853
|
let l, a;
|
|
2854
2854
|
const c = (d, h, y) => t(n + d, h, y);
|
|
2855
2855
|
switch (i) {
|
|
2856
2856
|
case "scalar":
|
|
2857
|
-
l = A.PLAIN, a =
|
|
2857
|
+
l = A.PLAIN, a = hn(r, c);
|
|
2858
2858
|
break;
|
|
2859
2859
|
case "single-quoted-scalar":
|
|
2860
|
-
l = A.QUOTE_SINGLE, a =
|
|
2860
|
+
l = A.QUOTE_SINGLE, a = dn(r, c);
|
|
2861
2861
|
break;
|
|
2862
2862
|
case "double-quoted-scalar":
|
|
2863
|
-
l = A.QUOTE_DOUBLE, a =
|
|
2863
|
+
l = A.QUOTE_DOUBLE, a = pn(r, c);
|
|
2864
2864
|
break;
|
|
2865
2865
|
/* istanbul ignore next should not happen */
|
|
2866
2866
|
default:
|
|
@@ -2879,7 +2879,7 @@ function ws(s, e, t) {
|
|
|
2879
2879
|
range: [n, p, f.offset]
|
|
2880
2880
|
};
|
|
2881
2881
|
}
|
|
2882
|
-
function
|
|
2882
|
+
function hn(s, e) {
|
|
2883
2883
|
let t = "";
|
|
2884
2884
|
switch (s[0]) {
|
|
2885
2885
|
/* istanbul ignore next should not happen */
|
|
@@ -2903,12 +2903,12 @@ function mn(s, e) {
|
|
|
2903
2903
|
break;
|
|
2904
2904
|
}
|
|
2905
2905
|
}
|
|
2906
|
-
return t && e(0, "BAD_SCALAR_START", `Plain value cannot start with ${t}`),
|
|
2906
|
+
return t && e(0, "BAD_SCALAR_START", `Plain value cannot start with ${t}`), gs(s);
|
|
2907
2907
|
}
|
|
2908
|
-
function
|
|
2909
|
-
return (s[s.length - 1] !== "'" || s.length === 1) && e(s.length, "MISSING_CHAR", "Missing closing 'quote"),
|
|
2908
|
+
function dn(s, e) {
|
|
2909
|
+
return (s[s.length - 1] !== "'" || s.length === 1) && e(s.length, "MISSING_CHAR", "Missing closing 'quote"), gs(s.slice(1, -1)).replace(/''/g, "'");
|
|
2910
2910
|
}
|
|
2911
|
-
function
|
|
2911
|
+
function gs(s) {
|
|
2912
2912
|
let e, t;
|
|
2913
2913
|
try {
|
|
2914
2914
|
e = new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
@@ -2928,7 +2928,7 @@ function Ss(s) {
|
|
|
2928
2928
|
const l = /[ \t]*(.*)/sy;
|
|
2929
2929
|
return l.lastIndex = o, n = l.exec(s), i + r + ((n == null ? void 0 : n[1]) ?? "");
|
|
2930
2930
|
}
|
|
2931
|
-
function
|
|
2931
|
+
function pn(s, e) {
|
|
2932
2932
|
let t = "";
|
|
2933
2933
|
for (let n = 1; n < s.length - 1; ++n) {
|
|
2934
2934
|
const i = s[n];
|
|
@@ -2936,11 +2936,11 @@ function gn(s, e) {
|
|
|
2936
2936
|
`))
|
|
2937
2937
|
if (i === `
|
|
2938
2938
|
`) {
|
|
2939
|
-
const { fold: r, offset: o } =
|
|
2939
|
+
const { fold: r, offset: o } = mn(s, n);
|
|
2940
2940
|
t += r, n = o;
|
|
2941
2941
|
} else if (i === "\\") {
|
|
2942
2942
|
let r = s[++n];
|
|
2943
|
-
const o =
|
|
2943
|
+
const o = yn[r];
|
|
2944
2944
|
if (o)
|
|
2945
2945
|
t += o;
|
|
2946
2946
|
else if (r === `
|
|
@@ -2953,7 +2953,7 @@ function gn(s, e) {
|
|
|
2953
2953
|
r = s[++n + 1];
|
|
2954
2954
|
else if (r === "x" || r === "u" || r === "U") {
|
|
2955
2955
|
const l = { x: 2, u: 4, U: 8 }[r];
|
|
2956
|
-
t +=
|
|
2956
|
+
t += gn(s, n + 1, l, e), n += l;
|
|
2957
2957
|
} else {
|
|
2958
2958
|
const l = s.substr(n - 1, 2);
|
|
2959
2959
|
e(n - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${l}`), t += l;
|
|
@@ -2971,7 +2971,7 @@ function gn(s, e) {
|
|
|
2971
2971
|
}
|
|
2972
2972
|
return (s[s.length - 1] !== '"' || s.length === 1) && e(s.length, "MISSING_CHAR", 'Missing closing "quote'), t;
|
|
2973
2973
|
}
|
|
2974
|
-
function
|
|
2974
|
+
function mn(s, e) {
|
|
2975
2975
|
let t = "", n = s[e + 1];
|
|
2976
2976
|
for (; (n === " " || n === " " || n === `
|
|
2977
2977
|
` || n === "\r") && !(n === "\r" && s[e + 2] !== `
|
|
@@ -2981,7 +2981,7 @@ function bn(s, e) {
|
|
|
2981
2981
|
`), e += 1, n = s[e + 1];
|
|
2982
2982
|
return t || (t = " "), { fold: t, offset: e };
|
|
2983
2983
|
}
|
|
2984
|
-
const
|
|
2984
|
+
const yn = {
|
|
2985
2985
|
0: "\0",
|
|
2986
2986
|
// null character
|
|
2987
2987
|
a: "\x07",
|
|
@@ -3015,7 +3015,7 @@ const wn = {
|
|
|
3015
3015
|
"\\": "\\",
|
|
3016
3016
|
" ": " "
|
|
3017
3017
|
};
|
|
3018
|
-
function
|
|
3018
|
+
function gn(s, e, t, n) {
|
|
3019
3019
|
const i = s.substr(e, t), o = i.length === t && /^[0-9a-fA-F]+$/.test(i) ? parseInt(i, 16) : NaN;
|
|
3020
3020
|
if (isNaN(o)) {
|
|
3021
3021
|
const l = s.substr(e - 2, t + 2);
|
|
@@ -3023,21 +3023,21 @@ function Sn(s, e, t, n) {
|
|
|
3023
3023
|
}
|
|
3024
3024
|
return String.fromCodePoint(o);
|
|
3025
3025
|
}
|
|
3026
|
-
function
|
|
3027
|
-
const { value: i, type: r, comment: o, range: l } = e.type === "block-scalar" ?
|
|
3026
|
+
function bs(s, e, t, n) {
|
|
3027
|
+
const { value: i, type: r, comment: o, range: l } = e.type === "block-scalar" ? ms(s, e, n) : ys(e, s.options.strict, n), a = t ? s.directives.tagName(t.source, (f) => n(t, "TAG_RESOLVE_FAILED", f)) : null;
|
|
3028
3028
|
let c;
|
|
3029
|
-
s.options.stringKeys && s.atKey ? c = s.schema[R] : a ? c =
|
|
3029
|
+
s.options.stringKeys && s.atKey ? c = s.schema[R] : a ? c = bn(s.schema, i, a, t, n) : e.type === "scalar" ? c = wn(s, i, e, n) : c = s.schema[R];
|
|
3030
3030
|
let p;
|
|
3031
3031
|
try {
|
|
3032
3032
|
const f = c.resolve(i, (d) => n(t ?? e, "TAG_RESOLVE_FAILED", d), s.options);
|
|
3033
|
-
p =
|
|
3033
|
+
p = I(f) ? f : new A(f);
|
|
3034
3034
|
} catch (f) {
|
|
3035
3035
|
const d = f instanceof Error ? f.message : String(f);
|
|
3036
3036
|
n(t ?? e, "TAG_RESOLVE_FAILED", d), p = new A(i);
|
|
3037
3037
|
}
|
|
3038
3038
|
return p.range = l, p.source = i, r && (p.type = r), a && (p.tag = a), c.format && (p.format = c.format), o && (p.comment = o), p;
|
|
3039
3039
|
}
|
|
3040
|
-
function
|
|
3040
|
+
function bn(s, e, t, n, i) {
|
|
3041
3041
|
var l;
|
|
3042
3042
|
if (t === "!")
|
|
3043
3043
|
return s[R];
|
|
@@ -3054,7 +3054,7 @@ function kn(s, e, t, n, i) {
|
|
|
3054
3054
|
const o = s.knownTags[t];
|
|
3055
3055
|
return o && !o.collection ? (s.tags.push(Object.assign({}, o, { default: !1, test: void 0 })), o) : (i(n, "TAG_RESOLVE_FAILED", `Unresolved tag: ${t}`, t !== "tag:yaml.org,2002:str"), s[R]);
|
|
3056
3056
|
}
|
|
3057
|
-
function
|
|
3057
|
+
function wn({ atKey: s, directives: e, schema: t }, n, i, r) {
|
|
3058
3058
|
const o = t.tags.find((l) => {
|
|
3059
3059
|
var a;
|
|
3060
3060
|
return (l.default === !0 || s && l.default === "key") && ((a = l.test) == null ? void 0 : a.test(n));
|
|
@@ -3071,7 +3071,7 @@ function Nn({ atKey: s, directives: e, schema: t }, n, i, r) {
|
|
|
3071
3071
|
}
|
|
3072
3072
|
return o;
|
|
3073
3073
|
}
|
|
3074
|
-
function
|
|
3074
|
+
function Sn(s, e, t) {
|
|
3075
3075
|
if (e) {
|
|
3076
3076
|
t === null && (t = e.length);
|
|
3077
3077
|
for (let n = t - 1; n >= 0; --n) {
|
|
@@ -3090,55 +3090,55 @@ function On(s, e, t) {
|
|
|
3090
3090
|
}
|
|
3091
3091
|
return s;
|
|
3092
3092
|
}
|
|
3093
|
-
const
|
|
3094
|
-
function
|
|
3093
|
+
const kn = { composeNode: ws, composeEmptyNode: At };
|
|
3094
|
+
function ws(s, e, t, n) {
|
|
3095
3095
|
const i = s.atKey, { spaceBefore: r, comment: o, anchor: l, tag: a } = t;
|
|
3096
3096
|
let c, p = !0;
|
|
3097
3097
|
switch (e.type) {
|
|
3098
3098
|
case "alias":
|
|
3099
|
-
c =
|
|
3099
|
+
c = Nn(s, e, n), (l || a) && n(e, "ALIAS_PROPS", "An alias node must not specify any properties");
|
|
3100
3100
|
break;
|
|
3101
3101
|
case "scalar":
|
|
3102
3102
|
case "single-quoted-scalar":
|
|
3103
3103
|
case "double-quoted-scalar":
|
|
3104
3104
|
case "block-scalar":
|
|
3105
|
-
c =
|
|
3105
|
+
c = bs(s, e, a, n), l && (c.anchor = l.source.substring(1));
|
|
3106
3106
|
break;
|
|
3107
3107
|
case "block-map":
|
|
3108
3108
|
case "block-seq":
|
|
3109
3109
|
case "flow-collection":
|
|
3110
|
-
c =
|
|
3110
|
+
c = cn(kn, s, e, t, n), l && (c.anchor = l.source.substring(1));
|
|
3111
3111
|
break;
|
|
3112
3112
|
default: {
|
|
3113
3113
|
const f = e.type === "error" ? e.message : `Unsupported token (type: ${e.type})`;
|
|
3114
|
-
n(e, "UNEXPECTED_TOKEN", f), c =
|
|
3114
|
+
n(e, "UNEXPECTED_TOKEN", f), c = At(s, e.offset, void 0, null, t, n), p = !1;
|
|
3115
3115
|
}
|
|
3116
3116
|
}
|
|
3117
|
-
return l && c.anchor === "" && n(l, "BAD_ALIAS", "Anchor cannot be an empty string"), i && s.options.stringKeys && (!
|
|
3117
|
+
return l && c.anchor === "" && n(l, "BAD_ALIAS", "Anchor cannot be an empty string"), i && s.options.stringKeys && (!I(c) || typeof c.value != "string" || c.tag && c.tag !== "tag:yaml.org,2002:str") && n(a ?? e, "NON_STRING_KEY", "With stringKeys, all keys must be strings"), r && (c.spaceBefore = !0), o && (e.type === "scalar" && e.source === "" ? c.comment = o : c.commentBefore = o), s.options.keepSourceTokens && p && (c.srcToken = e), c;
|
|
3118
3118
|
}
|
|
3119
|
-
function
|
|
3119
|
+
function At(s, e, t, n, { spaceBefore: i, comment: r, anchor: o, tag: l, end: a }, c) {
|
|
3120
3120
|
const p = {
|
|
3121
3121
|
type: "scalar",
|
|
3122
|
-
offset:
|
|
3122
|
+
offset: Sn(e, t, n),
|
|
3123
3123
|
indent: -1,
|
|
3124
3124
|
source: ""
|
|
3125
|
-
}, f =
|
|
3125
|
+
}, f = bs(s, p, l, c);
|
|
3126
3126
|
return o && (f.anchor = o.source.substring(1), f.anchor === "" && c(o, "BAD_ALIAS", "Anchor cannot be an empty string")), i && (f.spaceBefore = !0), r && (f.comment = r, f.range[2] = a), f;
|
|
3127
3127
|
}
|
|
3128
|
-
function
|
|
3129
|
-
const r = new
|
|
3128
|
+
function Nn({ options: s }, { offset: e, source: t, end: n }, i) {
|
|
3129
|
+
const r = new dt(t.substring(1));
|
|
3130
3130
|
r.source === "" && i(e, "BAD_ALIAS", "Alias cannot be an empty string"), r.source.endsWith(":") && i(e + t.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", !0);
|
|
3131
3131
|
const o = e + t.length, l = Ie(n, o, s.strict, i);
|
|
3132
3132
|
return r.range = [e, o, l.offset], l.comment && (r.comment = l.comment), r;
|
|
3133
3133
|
}
|
|
3134
|
-
function
|
|
3135
|
-
const l = Object.assign({ _directives: e }, s), a = new
|
|
3134
|
+
function On(s, e, { offset: t, start: n, value: i, end: r }, o) {
|
|
3135
|
+
const l = Object.assign({ _directives: e }, s), a = new Ee(void 0, l), c = {
|
|
3136
3136
|
atKey: !1,
|
|
3137
3137
|
atRoot: !0,
|
|
3138
3138
|
directives: a.directives,
|
|
3139
3139
|
options: a.options,
|
|
3140
3140
|
schema: a.schema
|
|
3141
|
-
}, p =
|
|
3141
|
+
}, p = ce(n, {
|
|
3142
3142
|
indicator: "doc-start",
|
|
3143
3143
|
next: i ?? (r == null ? void 0 : r[0]),
|
|
3144
3144
|
offset: t,
|
|
@@ -3146,11 +3146,11 @@ function In(s, e, { offset: t, start: n, value: i, end: r }, o) {
|
|
|
3146
3146
|
parentIndent: 0,
|
|
3147
3147
|
startOnNewline: !0
|
|
3148
3148
|
});
|
|
3149
|
-
p.found && (a.directives.docStart = !0, i && (i.type === "block-map" || i.type === "block-seq") && !p.hasNewline && o(p.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), a.contents = i ?
|
|
3149
|
+
p.found && (a.directives.docStart = !0, i && (i.type === "block-map" || i.type === "block-seq") && !p.hasNewline && o(p.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), a.contents = i ? ws(c, i, p, o) : At(c, p.end, n, null, p, o);
|
|
3150
3150
|
const f = a.contents.range[2], d = Ie(r, f, !1, o);
|
|
3151
3151
|
return d.comment && (a.comment = d.comment), a.range = [t, f, d.offset], a;
|
|
3152
3152
|
}
|
|
3153
|
-
function
|
|
3153
|
+
function me(s) {
|
|
3154
3154
|
if (typeof s == "number")
|
|
3155
3155
|
return [s, s + 1];
|
|
3156
3156
|
if (Array.isArray(s))
|
|
@@ -3158,7 +3158,7 @@ function be(s) {
|
|
|
3158
3158
|
const { offset: e, source: t } = s;
|
|
3159
3159
|
return [e, e + (typeof t == "string" ? t.length : 1)];
|
|
3160
3160
|
}
|
|
3161
|
-
function
|
|
3161
|
+
function Bt(s) {
|
|
3162
3162
|
var i;
|
|
3163
3163
|
let e = "", t = !1, n = !1;
|
|
3164
3164
|
for (let r = 0; r < s.length; ++r) {
|
|
@@ -3179,15 +3179,15 @@ function Kt(s) {
|
|
|
3179
3179
|
}
|
|
3180
3180
|
return { comment: e, afterEmptyLine: n };
|
|
3181
3181
|
}
|
|
3182
|
-
class
|
|
3182
|
+
class Ss {
|
|
3183
3183
|
constructor(e = {}) {
|
|
3184
3184
|
this.doc = null, this.atDirectives = !1, this.prelude = [], this.errors = [], this.warnings = [], this.onError = (t, n, i, r) => {
|
|
3185
|
-
const o =
|
|
3186
|
-
r ? this.warnings.push(new
|
|
3185
|
+
const o = me(t);
|
|
3186
|
+
r ? this.warnings.push(new rn(o, n, i)) : this.errors.push(new re(o, n, i));
|
|
3187
3187
|
}, this.directives = new B({ version: e.version || "1.2" }), this.options = e;
|
|
3188
3188
|
}
|
|
3189
3189
|
decorate(e, t) {
|
|
3190
|
-
const { comment: n, afterEmptyLine: i } =
|
|
3190
|
+
const { comment: n, afterEmptyLine: i } = Bt(this.prelude);
|
|
3191
3191
|
if (n) {
|
|
3192
3192
|
const r = e.contents;
|
|
3193
3193
|
if (t)
|
|
@@ -3216,7 +3216,7 @@ ${o}` : n;
|
|
|
3216
3216
|
*/
|
|
3217
3217
|
streamInfo() {
|
|
3218
3218
|
return {
|
|
3219
|
-
comment:
|
|
3219
|
+
comment: Bt(this.prelude).comment,
|
|
3220
3220
|
directives: this.directives,
|
|
3221
3221
|
errors: this.errors,
|
|
3222
3222
|
warnings: this.warnings
|
|
@@ -3238,12 +3238,12 @@ ${o}` : n;
|
|
|
3238
3238
|
switch (e.type) {
|
|
3239
3239
|
case "directive":
|
|
3240
3240
|
this.directives.add(e.source, (t, n, i) => {
|
|
3241
|
-
const r =
|
|
3241
|
+
const r = me(e);
|
|
3242
3242
|
r[0] += t, this.onError(r, "BAD_DIRECTIVE", n, i);
|
|
3243
3243
|
}), this.prelude.push(e.source), this.atDirectives = !0;
|
|
3244
3244
|
break;
|
|
3245
3245
|
case "document": {
|
|
3246
|
-
const t =
|
|
3246
|
+
const t = On(this.options, this.directives, e, this.onError);
|
|
3247
3247
|
this.atDirectives && !t.directives.docStart && this.onError(e, "MISSING_CHAR", "Missing directives-end/doc-start indicator line"), this.decorate(t, !1), this.doc && (yield this.doc), this.doc = t, this.atDirectives = !1;
|
|
3248
3248
|
break;
|
|
3249
3249
|
}
|
|
@@ -3255,14 +3255,14 @@ ${o}` : n;
|
|
|
3255
3255
|
this.prelude.push(e.source);
|
|
3256
3256
|
break;
|
|
3257
3257
|
case "error": {
|
|
3258
|
-
const t = e.source ? `${e.message}: ${JSON.stringify(e.source)}` : e.message, n = new
|
|
3258
|
+
const t = e.source ? `${e.message}: ${JSON.stringify(e.source)}` : e.message, n = new re(me(e), "UNEXPECTED_TOKEN", t);
|
|
3259
3259
|
this.atDirectives || !this.doc ? this.errors.push(n) : this.doc.errors.push(n);
|
|
3260
3260
|
break;
|
|
3261
3261
|
}
|
|
3262
3262
|
case "doc-end": {
|
|
3263
3263
|
if (!this.doc) {
|
|
3264
3264
|
const n = "Unexpected doc-end without preceding document";
|
|
3265
|
-
this.errors.push(new
|
|
3265
|
+
this.errors.push(new re(me(e), "UNEXPECTED_TOKEN", n));
|
|
3266
3266
|
break;
|
|
3267
3267
|
}
|
|
3268
3268
|
this.doc.directives.docEnd = !0;
|
|
@@ -3276,7 +3276,7 @@ ${t.comment}` : t.comment;
|
|
|
3276
3276
|
break;
|
|
3277
3277
|
}
|
|
3278
3278
|
default:
|
|
3279
|
-
this.errors.push(new
|
|
3279
|
+
this.errors.push(new re(me(e), "UNEXPECTED_TOKEN", `Unsupported token ${e.type}`));
|
|
3280
3280
|
}
|
|
3281
3281
|
}
|
|
3282
3282
|
/**
|
|
@@ -3289,33 +3289,33 @@ ${t.comment}` : t.comment;
|
|
|
3289
3289
|
if (this.doc)
|
|
3290
3290
|
this.decorate(this.doc, !0), yield this.doc, this.doc = null;
|
|
3291
3291
|
else if (e) {
|
|
3292
|
-
const n = Object.assign({ _directives: this.directives }, this.options), i = new
|
|
3292
|
+
const n = Object.assign({ _directives: this.directives }, this.options), i = new Ee(void 0, n);
|
|
3293
3293
|
this.atDirectives && this.onError(t, "MISSING_CHAR", "Missing directives-end indicator line"), i.range = [0, t, t], this.decorate(i, !1), yield i;
|
|
3294
3294
|
}
|
|
3295
3295
|
}
|
|
3296
3296
|
}
|
|
3297
|
-
function
|
|
3297
|
+
function An(s, e = !0, t) {
|
|
3298
3298
|
if (s) {
|
|
3299
3299
|
const n = (i, r, o) => {
|
|
3300
3300
|
const l = typeof i == "number" ? i : Array.isArray(i) ? i[0] : i.offset;
|
|
3301
3301
|
if (t)
|
|
3302
3302
|
t(l, r, o);
|
|
3303
3303
|
else
|
|
3304
|
-
throw new
|
|
3304
|
+
throw new re([l, l + 1], r, o);
|
|
3305
3305
|
};
|
|
3306
3306
|
switch (s.type) {
|
|
3307
3307
|
case "scalar":
|
|
3308
3308
|
case "single-quoted-scalar":
|
|
3309
3309
|
case "double-quoted-scalar":
|
|
3310
|
-
return
|
|
3310
|
+
return ys(s, e, n);
|
|
3311
3311
|
case "block-scalar":
|
|
3312
|
-
return
|
|
3312
|
+
return ms({ options: { strict: e } }, s, n);
|
|
3313
3313
|
}
|
|
3314
3314
|
}
|
|
3315
3315
|
return null;
|
|
3316
3316
|
}
|
|
3317
|
-
function
|
|
3318
|
-
const { implicitKey: t = !1, indent: n, inFlow: i = !1, offset: r = -1, type: o = "PLAIN" } = e, l =
|
|
3317
|
+
function En(s, e) {
|
|
3318
|
+
const { implicitKey: t = !1, indent: n, inFlow: i = !1, offset: r = -1, type: o = "PLAIN" } = e, l = Oe({ type: o, value: s }, {
|
|
3319
3319
|
implicitKey: t,
|
|
3320
3320
|
indent: n > 0 ? " ".repeat(n) : "",
|
|
3321
3321
|
inFlow: i,
|
|
@@ -3332,7 +3332,7 @@ function Ln(s, e) {
|
|
|
3332
3332
|
`, d = [
|
|
3333
3333
|
{ type: "block-scalar-header", offset: r, indent: n, source: p }
|
|
3334
3334
|
];
|
|
3335
|
-
return
|
|
3335
|
+
return ks(d, a) || d.push({ type: "newline", offset: -1, indent: n, source: `
|
|
3336
3336
|
` }), { type: "block-scalar", offset: r, indent: n, props: d, source: f };
|
|
3337
3337
|
}
|
|
3338
3338
|
case '"':
|
|
@@ -3343,7 +3343,7 @@ function Ln(s, e) {
|
|
|
3343
3343
|
return { type: "scalar", offset: r, indent: n, source: l, end: a };
|
|
3344
3344
|
}
|
|
3345
3345
|
}
|
|
3346
|
-
function
|
|
3346
|
+
function In(s, e, t = {}) {
|
|
3347
3347
|
let { afterKey: n = !1, implicitKey: i = !1, inFlow: r = !1, type: o } = t, l = "indent" in s ? s.indent : null;
|
|
3348
3348
|
if (n && typeof l == "number" && (l += 2), !o)
|
|
3349
3349
|
switch (s.type) {
|
|
@@ -3363,7 +3363,7 @@ function $n(s, e, t = {}) {
|
|
|
3363
3363
|
default:
|
|
3364
3364
|
o = "PLAIN";
|
|
3365
3365
|
}
|
|
3366
|
-
const a =
|
|
3366
|
+
const a = Oe({ type: o, value: e }, {
|
|
3367
3367
|
implicitKey: i || l === null,
|
|
3368
3368
|
indent: l !== null && l > 0 ? " ".repeat(l) : "",
|
|
3369
3369
|
inFlow: r,
|
|
@@ -3372,19 +3372,19 @@ function $n(s, e, t = {}) {
|
|
|
3372
3372
|
switch (a[0]) {
|
|
3373
3373
|
case "|":
|
|
3374
3374
|
case ">":
|
|
3375
|
-
|
|
3375
|
+
Tn(s, a);
|
|
3376
3376
|
break;
|
|
3377
3377
|
case '"':
|
|
3378
|
-
|
|
3378
|
+
st(s, a, "double-quoted-scalar");
|
|
3379
3379
|
break;
|
|
3380
3380
|
case "'":
|
|
3381
|
-
|
|
3381
|
+
st(s, a, "single-quoted-scalar");
|
|
3382
3382
|
break;
|
|
3383
3383
|
default:
|
|
3384
|
-
|
|
3384
|
+
st(s, a, "scalar");
|
|
3385
3385
|
}
|
|
3386
3386
|
}
|
|
3387
|
-
function
|
|
3387
|
+
function Tn(s, e) {
|
|
3388
3388
|
const t = e.indexOf(`
|
|
3389
3389
|
`), n = e.substring(0, t), i = e.substring(t + 1) + `
|
|
3390
3390
|
`;
|
|
@@ -3397,14 +3397,14 @@ function _n(s, e) {
|
|
|
3397
3397
|
const { offset: r } = s, o = "indent" in s ? s.indent : -1, l = [
|
|
3398
3398
|
{ type: "block-scalar-header", offset: r, indent: o, source: n }
|
|
3399
3399
|
];
|
|
3400
|
-
|
|
3400
|
+
ks(l, "end" in s ? s.end : void 0) || l.push({ type: "newline", offset: -1, indent: o, source: `
|
|
3401
3401
|
` });
|
|
3402
3402
|
for (const a of Object.keys(s))
|
|
3403
3403
|
a !== "type" && a !== "offset" && delete s[a];
|
|
3404
3404
|
Object.assign(s, { type: "block-scalar", indent: o, props: l, source: i });
|
|
3405
3405
|
}
|
|
3406
3406
|
}
|
|
3407
|
-
function
|
|
3407
|
+
function ks(s, e) {
|
|
3408
3408
|
if (e)
|
|
3409
3409
|
for (const t of e)
|
|
3410
3410
|
switch (t.type) {
|
|
@@ -3417,7 +3417,7 @@ function Os(s, e) {
|
|
|
3417
3417
|
}
|
|
3418
3418
|
return !1;
|
|
3419
3419
|
}
|
|
3420
|
-
function
|
|
3420
|
+
function st(s, e, t) {
|
|
3421
3421
|
switch (s.type) {
|
|
3422
3422
|
case "scalar":
|
|
3423
3423
|
case "double-quoted-scalar":
|
|
@@ -3448,7 +3448,7 @@ function rt(s, e, t) {
|
|
|
3448
3448
|
}
|
|
3449
3449
|
}
|
|
3450
3450
|
}
|
|
3451
|
-
const
|
|
3451
|
+
const Ln = (s) => "type" in s ? qe(s) : Ke(s);
|
|
3452
3452
|
function qe(s) {
|
|
3453
3453
|
switch (s.type) {
|
|
3454
3454
|
case "block-scalar": {
|
|
@@ -3497,14 +3497,14 @@ function Ke({ start: s, key: e, sep: t, value: n }) {
|
|
|
3497
3497
|
i += r.source;
|
|
3498
3498
|
return n && (i += qe(n)), i;
|
|
3499
3499
|
}
|
|
3500
|
-
const
|
|
3501
|
-
function
|
|
3502
|
-
"type" in s && s.type === "document" && (s = { start: s.start, value: s.value }),
|
|
3500
|
+
const ct = Symbol("break visit"), $n = Symbol("skip children"), Ns = Symbol("remove item");
|
|
3501
|
+
function z(s, e) {
|
|
3502
|
+
"type" in s && s.type === "document" && (s = { start: s.start, value: s.value }), Os(Object.freeze([]), s, e);
|
|
3503
3503
|
}
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3504
|
+
z.BREAK = ct;
|
|
3505
|
+
z.SKIP = $n;
|
|
3506
|
+
z.REMOVE = Ns;
|
|
3507
|
+
z.itemAtPath = (s, e) => {
|
|
3508
3508
|
let t = s;
|
|
3509
3509
|
for (const [n, i] of e) {
|
|
3510
3510
|
const r = t == null ? void 0 : t[n];
|
|
@@ -3515,13 +3515,13 @@ Z.itemAtPath = (s, e) => {
|
|
|
3515
3515
|
}
|
|
3516
3516
|
return t;
|
|
3517
3517
|
};
|
|
3518
|
-
|
|
3519
|
-
const t =
|
|
3518
|
+
z.parentCollection = (s, e) => {
|
|
3519
|
+
const t = z.itemAtPath(s, e.slice(0, -1)), n = e[e.length - 1][0], i = t == null ? void 0 : t[n];
|
|
3520
3520
|
if (i && "items" in i)
|
|
3521
3521
|
return i;
|
|
3522
3522
|
throw new Error("Parent collection not found");
|
|
3523
3523
|
};
|
|
3524
|
-
function
|
|
3524
|
+
function Os(s, e, t) {
|
|
3525
3525
|
let n = t(e, s);
|
|
3526
3526
|
if (typeof n == "symbol")
|
|
3527
3527
|
return n;
|
|
@@ -3529,13 +3529,13 @@ function Es(s, e, t) {
|
|
|
3529
3529
|
const r = e[i];
|
|
3530
3530
|
if (r && "items" in r) {
|
|
3531
3531
|
for (let o = 0; o < r.items.length; ++o) {
|
|
3532
|
-
const l =
|
|
3532
|
+
const l = Os(Object.freeze(s.concat([[i, o]])), r.items[o], t);
|
|
3533
3533
|
if (typeof l == "number")
|
|
3534
3534
|
o = l - 1;
|
|
3535
3535
|
else {
|
|
3536
|
-
if (l ===
|
|
3537
|
-
return
|
|
3538
|
-
l ===
|
|
3536
|
+
if (l === ct)
|
|
3537
|
+
return ct;
|
|
3538
|
+
l === Ns && (r.items.splice(o, 1), o -= 1);
|
|
3539
3539
|
}
|
|
3540
3540
|
}
|
|
3541
3541
|
typeof n == "function" && i === "key" && (n = n(e, s));
|
|
@@ -3543,30 +3543,30 @@ function Es(s, e, t) {
|
|
|
3543
3543
|
}
|
|
3544
3544
|
return typeof n == "function" ? n(e, s) : n;
|
|
3545
3545
|
}
|
|
3546
|
-
const
|
|
3547
|
-
function
|
|
3546
|
+
const We = "\uFEFF", He = "", Xe = "", Se = "", _n = (s) => !!s && "items" in s, Cn = (s) => !!s && (s.type === "scalar" || s.type === "single-quoted-scalar" || s.type === "double-quoted-scalar" || s.type === "block-scalar");
|
|
3547
|
+
function Bn(s) {
|
|
3548
3548
|
switch (s) {
|
|
3549
|
-
case
|
|
3549
|
+
case We:
|
|
3550
3550
|
return "<BOM>";
|
|
3551
|
-
case
|
|
3551
|
+
case He:
|
|
3552
3552
|
return "<DOC>";
|
|
3553
|
-
case
|
|
3553
|
+
case Xe:
|
|
3554
3554
|
return "<FLOW_END>";
|
|
3555
|
-
case
|
|
3555
|
+
case Se:
|
|
3556
3556
|
return "<SCALAR>";
|
|
3557
3557
|
default:
|
|
3558
3558
|
return JSON.stringify(s);
|
|
3559
3559
|
}
|
|
3560
3560
|
}
|
|
3561
|
-
function
|
|
3561
|
+
function As(s) {
|
|
3562
3562
|
switch (s) {
|
|
3563
|
-
case
|
|
3563
|
+
case We:
|
|
3564
3564
|
return "byte-order-mark";
|
|
3565
|
-
case
|
|
3565
|
+
case He:
|
|
3566
3566
|
return "doc-mode";
|
|
3567
|
-
case
|
|
3567
|
+
case Xe:
|
|
3568
3568
|
return "flow-error-end";
|
|
3569
|
-
case
|
|
3569
|
+
case Se:
|
|
3570
3570
|
return "scalar";
|
|
3571
3571
|
case "---":
|
|
3572
3572
|
return "doc-start";
|
|
@@ -3619,21 +3619,21 @@ function Is(s) {
|
|
|
3619
3619
|
}
|
|
3620
3620
|
return null;
|
|
3621
3621
|
}
|
|
3622
|
-
const
|
|
3622
|
+
const Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3623
3623
|
__proto__: null,
|
|
3624
|
-
BOM:
|
|
3625
|
-
DOCUMENT:
|
|
3626
|
-
FLOW_END:
|
|
3627
|
-
SCALAR:
|
|
3628
|
-
createScalarToken:
|
|
3629
|
-
isCollection:
|
|
3630
|
-
isScalar:
|
|
3631
|
-
prettyToken:
|
|
3632
|
-
resolveAsScalar:
|
|
3633
|
-
setScalarValue:
|
|
3634
|
-
stringify:
|
|
3635
|
-
tokenType:
|
|
3636
|
-
visit:
|
|
3624
|
+
BOM: We,
|
|
3625
|
+
DOCUMENT: He,
|
|
3626
|
+
FLOW_END: Xe,
|
|
3627
|
+
SCALAR: Se,
|
|
3628
|
+
createScalarToken: En,
|
|
3629
|
+
isCollection: _n,
|
|
3630
|
+
isScalar: Cn,
|
|
3631
|
+
prettyToken: Bn,
|
|
3632
|
+
resolveAsScalar: An,
|
|
3633
|
+
setScalarValue: In,
|
|
3634
|
+
stringify: Ln,
|
|
3635
|
+
tokenType: As,
|
|
3636
|
+
visit: z
|
|
3637
3637
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3638
3638
|
function D(s) {
|
|
3639
3639
|
switch (s) {
|
|
@@ -3648,9 +3648,9 @@ function D(s) {
|
|
|
3648
3648
|
return !1;
|
|
3649
3649
|
}
|
|
3650
3650
|
}
|
|
3651
|
-
const
|
|
3652
|
-
\r `),
|
|
3653
|
-
class
|
|
3651
|
+
const vt = new Set("0123456789ABCDEFabcdef"), vn = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), _e = new Set(",[]{}"), Mn = new Set(` ,[]{}
|
|
3652
|
+
\r `), nt = (s) => !s || Mn.has(s);
|
|
3653
|
+
class Kn {
|
|
3654
3654
|
constructor() {
|
|
3655
3655
|
this.atEnd = !1, this.blockScalarIndent = -1, this.blockScalarKeep = !1, this.buffer = "", this.flowKey = !1, this.flowLevel = 0, this.indentNext = 0, this.indentValue = 0, this.lineEndPos = null, this.next = null, this.pos = 0;
|
|
3656
3656
|
}
|
|
@@ -3742,7 +3742,7 @@ class Ts {
|
|
|
3742
3742
|
let e = this.getLine();
|
|
3743
3743
|
if (e === null)
|
|
3744
3744
|
return this.setNext("stream");
|
|
3745
|
-
if (e[0] ===
|
|
3745
|
+
if (e[0] === We && (yield* this.pushCount(1), e = e.substring(1)), e[0] === "%") {
|
|
3746
3746
|
let t = e.length, n = e.indexOf("#");
|
|
3747
3747
|
for (; n !== -1; ) {
|
|
3748
3748
|
const r = e[n - 1];
|
|
@@ -3766,7 +3766,7 @@ class Ts {
|
|
|
3766
3766
|
const t = yield* this.pushSpaces(!0);
|
|
3767
3767
|
return yield* this.pushCount(e.length - t), yield* this.pushNewline(), "stream";
|
|
3768
3768
|
}
|
|
3769
|
-
return yield
|
|
3769
|
+
return yield He, yield* this.parseLineStart();
|
|
3770
3770
|
}
|
|
3771
3771
|
*parseLineStart() {
|
|
3772
3772
|
const e = this.charAt(0);
|
|
@@ -3810,7 +3810,7 @@ class Ts {
|
|
|
3810
3810
|
case "]":
|
|
3811
3811
|
return yield* this.pushCount(1), "doc";
|
|
3812
3812
|
case "*":
|
|
3813
|
-
return yield* this.pushUntil(
|
|
3813
|
+
return yield* this.pushUntil(nt), "doc";
|
|
3814
3814
|
case '"':
|
|
3815
3815
|
case "'":
|
|
3816
3816
|
return yield* this.parseQuotedScalar();
|
|
@@ -3830,7 +3830,7 @@ class Ts {
|
|
|
3830
3830
|
if (i === null)
|
|
3831
3831
|
return this.setNext("flow");
|
|
3832
3832
|
if ((n !== -1 && n < this.indentNext && i[0] !== "#" || n === 0 && (i.startsWith("---") || i.startsWith("...")) && D(i[3])) && !(n === this.indentNext - 1 && this.flowLevel === 1 && (i[0] === "]" || i[0] === "}")))
|
|
3833
|
-
return this.flowLevel = 0, yield
|
|
3833
|
+
return this.flowLevel = 0, yield Xe, yield* this.parseLineStart();
|
|
3834
3834
|
let r = 0;
|
|
3835
3835
|
for (; i[r] === ","; )
|
|
3836
3836
|
r += yield* this.pushCount(1), r += yield* this.pushSpaces(!0), this.flowKey = !1;
|
|
@@ -3846,7 +3846,7 @@ class Ts {
|
|
|
3846
3846
|
case "]":
|
|
3847
3847
|
return yield* this.pushCount(1), this.flowKey = !0, this.flowLevel -= 1, this.flowLevel ? "flow" : "doc";
|
|
3848
3848
|
case "*":
|
|
3849
|
-
return yield* this.pushUntil(
|
|
3849
|
+
return yield* this.pushUntil(nt), "flow";
|
|
3850
3850
|
case '"':
|
|
3851
3851
|
case "'":
|
|
3852
3852
|
return this.flowKey = !0, yield* this.parseQuotedScalar();
|
|
@@ -3970,7 +3970,7 @@ class Ts {
|
|
|
3970
3970
|
else
|
|
3971
3971
|
break;
|
|
3972
3972
|
} while (!0);
|
|
3973
|
-
return yield
|
|
3973
|
+
return yield Se, yield* this.pushToIndex(e + 1, !0), yield* this.parseLineStart();
|
|
3974
3974
|
}
|
|
3975
3975
|
*parsePlainScalar() {
|
|
3976
3976
|
const e = this.flowLevel > 0;
|
|
@@ -3999,7 +3999,7 @@ class Ts {
|
|
|
3999
3999
|
break;
|
|
4000
4000
|
t = n;
|
|
4001
4001
|
}
|
|
4002
|
-
return !i && !this.atEnd ? this.setNext("plain-scalar") : (yield
|
|
4002
|
+
return !i && !this.atEnd ? this.setNext("plain-scalar") : (yield Se, yield* this.pushToIndex(t + 1, !0), e ? "flow" : "doc");
|
|
4003
4003
|
}
|
|
4004
4004
|
*pushCount(e) {
|
|
4005
4005
|
return e > 0 ? (yield this.buffer.substr(this.pos, e), this.pos += e, e) : 0;
|
|
@@ -4013,7 +4013,7 @@ class Ts {
|
|
|
4013
4013
|
case "!":
|
|
4014
4014
|
return (yield* this.pushTag()) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
|
|
4015
4015
|
case "&":
|
|
4016
|
-
return (yield* this.pushUntil(
|
|
4016
|
+
return (yield* this.pushUntil(nt)) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
|
|
4017
4017
|
case "-":
|
|
4018
4018
|
// this is an error
|
|
4019
4019
|
case "?":
|
|
@@ -4035,9 +4035,9 @@ class Ts {
|
|
|
4035
4035
|
} else {
|
|
4036
4036
|
let e = this.pos + 1, t = this.buffer[e];
|
|
4037
4037
|
for (; t; )
|
|
4038
|
-
if (
|
|
4038
|
+
if (vn.has(t))
|
|
4039
4039
|
t = this.buffer[++e];
|
|
4040
|
-
else if (t === "%" &&
|
|
4040
|
+
else if (t === "%" && vt.has(this.buffer[e + 1]) && vt.has(this.buffer[e + 2]))
|
|
4041
4041
|
t = this.buffer[e += 3];
|
|
4042
4042
|
else
|
|
4043
4043
|
break;
|
|
@@ -4065,7 +4065,7 @@ class Ts {
|
|
|
4065
4065
|
return yield* this.pushToIndex(t, !1);
|
|
4066
4066
|
}
|
|
4067
4067
|
}
|
|
4068
|
-
class
|
|
4068
|
+
class Pn {
|
|
4069
4069
|
constructor() {
|
|
4070
4070
|
this.lineStarts = [], this.addNewLine = (e) => this.lineStarts.push(e), this.linePos = (e) => {
|
|
4071
4071
|
let t = 0, n = this.lineStarts.length;
|
|
@@ -4088,7 +4088,7 @@ function Y(s, e) {
|
|
|
4088
4088
|
return !0;
|
|
4089
4089
|
return !1;
|
|
4090
4090
|
}
|
|
4091
|
-
function
|
|
4091
|
+
function Mt(s) {
|
|
4092
4092
|
for (let e = 0; e < s.length; ++e)
|
|
4093
4093
|
switch (s[e].type) {
|
|
4094
4094
|
case "space":
|
|
@@ -4100,7 +4100,7 @@ function jt(s) {
|
|
|
4100
4100
|
}
|
|
4101
4101
|
return -1;
|
|
4102
4102
|
}
|
|
4103
|
-
function
|
|
4103
|
+
function Es(s) {
|
|
4104
4104
|
switch (s == null ? void 0 : s.type) {
|
|
4105
4105
|
case "alias":
|
|
4106
4106
|
case "scalar":
|
|
@@ -4127,7 +4127,7 @@ function Ce(s) {
|
|
|
4127
4127
|
return [];
|
|
4128
4128
|
}
|
|
4129
4129
|
}
|
|
4130
|
-
function
|
|
4130
|
+
function ee(s) {
|
|
4131
4131
|
var t;
|
|
4132
4132
|
if (s.length === 0)
|
|
4133
4133
|
return [];
|
|
@@ -4145,18 +4145,18 @@ function ne(s) {
|
|
|
4145
4145
|
;
|
|
4146
4146
|
return s.splice(e, s.length);
|
|
4147
4147
|
}
|
|
4148
|
-
function
|
|
4148
|
+
function Kt(s) {
|
|
4149
4149
|
if (s.start.type === "flow-seq-start")
|
|
4150
4150
|
for (const e of s.items)
|
|
4151
|
-
e.sep && !e.value && !Y(e.start, "explicit-key-ind") && !Y(e.sep, "map-value-ind") && (e.key && (e.value = e.key), delete e.key,
|
|
4151
|
+
e.sep && !e.value && !Y(e.start, "explicit-key-ind") && !Y(e.sep, "map-value-ind") && (e.key && (e.value = e.key), delete e.key, Es(e.value) ? e.value.end ? Array.prototype.push.apply(e.value.end, e.sep) : e.value.end = e.sep : Array.prototype.push.apply(e.start, e.sep), delete e.sep);
|
|
4152
4152
|
}
|
|
4153
|
-
class
|
|
4153
|
+
class Is {
|
|
4154
4154
|
/**
|
|
4155
4155
|
* @param onNewLine - If defined, called separately with the start position of
|
|
4156
4156
|
* each new line (in `parse()`, including the start of input).
|
|
4157
4157
|
*/
|
|
4158
4158
|
constructor(e) {
|
|
4159
|
-
this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new
|
|
4159
|
+
this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new Kn(), this.onNewLine = e;
|
|
4160
4160
|
}
|
|
4161
4161
|
/**
|
|
4162
4162
|
* Parse `source` as a YAML stream.
|
|
@@ -4180,7 +4180,7 @@ class Tt {
|
|
|
4180
4180
|
this.atScalar = !1, yield* this.step(), this.offset += e.length;
|
|
4181
4181
|
return;
|
|
4182
4182
|
}
|
|
4183
|
-
const t =
|
|
4183
|
+
const t = As(e);
|
|
4184
4184
|
if (t)
|
|
4185
4185
|
if (t === "scalar")
|
|
4186
4186
|
this.atNewLine = !1, this.atScalar = !0, this.type = "scalar";
|
|
@@ -4269,7 +4269,7 @@ class Tt {
|
|
|
4269
4269
|
yield t;
|
|
4270
4270
|
else {
|
|
4271
4271
|
const n = this.peek(1);
|
|
4272
|
-
switch (t.type === "block-scalar" ? t.indent = "indent" in n ? n.indent : 0 : t.type === "flow-collection" && n.type === "document" && (t.indent = 0), t.type === "flow-collection" &&
|
|
4272
|
+
switch (t.type === "block-scalar" ? t.indent = "indent" in n ? n.indent : 0 : t.type === "flow-collection" && n.type === "document" && (t.indent = 0), t.type === "flow-collection" && Kt(t), n.type) {
|
|
4273
4273
|
case "document":
|
|
4274
4274
|
n.value = t;
|
|
4275
4275
|
break;
|
|
@@ -4305,7 +4305,7 @@ class Tt {
|
|
|
4305
4305
|
}
|
|
4306
4306
|
if ((n.type === "document" || n.type === "block-map" || n.type === "block-seq") && (t.type === "block-map" || t.type === "block-seq")) {
|
|
4307
4307
|
const i = t.items[t.items.length - 1];
|
|
4308
|
-
i && !i.sep && !i.value && i.start.length > 0 &&
|
|
4308
|
+
i && !i.sep && !i.value && i.start.length > 0 && Mt(i.start) === -1 && (t.indent === 0 || i.start.every((r) => r.type !== "comment" || r.indent < t.indent)) && (n.type === "document" ? n.end = i.start : n.items.push({ start: i.start }), t.items.splice(-1, 1));
|
|
4309
4309
|
}
|
|
4310
4310
|
}
|
|
4311
4311
|
}
|
|
@@ -4343,7 +4343,7 @@ class Tt {
|
|
|
4343
4343
|
return yield* this.lineEnd(e);
|
|
4344
4344
|
switch (this.type) {
|
|
4345
4345
|
case "doc-start": {
|
|
4346
|
-
|
|
4346
|
+
Mt(e.start) !== -1 ? (yield* this.pop(), yield* this.step()) : e.start.push(this.sourceToken);
|
|
4347
4347
|
return;
|
|
4348
4348
|
}
|
|
4349
4349
|
case "anchor":
|
|
@@ -4364,7 +4364,7 @@ class Tt {
|
|
|
4364
4364
|
}
|
|
4365
4365
|
*scalar(e) {
|
|
4366
4366
|
if (this.type === "map-value-ind") {
|
|
4367
|
-
const t = Ce(this.peek(2)), n =
|
|
4367
|
+
const t = Ce(this.peek(2)), n = ee(t);
|
|
4368
4368
|
let i;
|
|
4369
4369
|
e.end ? (i = e.end, i.push(this.sourceToken), delete e.end) : i = [this.sourceToken];
|
|
4370
4370
|
const r = {
|
|
@@ -4474,8 +4474,8 @@ class Tt {
|
|
|
4474
4474
|
indent: this.indent,
|
|
4475
4475
|
items: [{ start: o, key: null, sep: [this.sourceToken] }]
|
|
4476
4476
|
});
|
|
4477
|
-
else if (
|
|
4478
|
-
const l =
|
|
4477
|
+
else if (Es(t.key) && !Y(t.sep, "newline")) {
|
|
4478
|
+
const l = ee(t.start), a = t.key, c = t.sep;
|
|
4479
4479
|
c.push(this.sourceToken), delete t.key, delete t.sep, this.stack.push({
|
|
4480
4480
|
type: "block-map",
|
|
4481
4481
|
offset: this.offset,
|
|
@@ -4486,7 +4486,7 @@ class Tt {
|
|
|
4486
4486
|
else if (Y(t.start, "newline"))
|
|
4487
4487
|
Object.assign(t, { key: null, sep: [this.sourceToken] });
|
|
4488
4488
|
else {
|
|
4489
|
-
const l =
|
|
4489
|
+
const l = ee(t.start);
|
|
4490
4490
|
this.stack.push({
|
|
4491
4491
|
type: "block-map",
|
|
4492
4492
|
offset: this.offset,
|
|
@@ -4623,8 +4623,8 @@ class Tt {
|
|
|
4623
4623
|
if (n.type === "block-map" && (this.type === "map-value-ind" && n.indent === e.indent || this.type === "newline" && !n.items[n.items.length - 1].sep))
|
|
4624
4624
|
yield* this.pop(), yield* this.step();
|
|
4625
4625
|
else if (this.type === "map-value-ind" && n.type !== "flow-collection") {
|
|
4626
|
-
const i = Ce(n), r =
|
|
4627
|
-
|
|
4626
|
+
const i = Ce(n), r = ee(i);
|
|
4627
|
+
Kt(e);
|
|
4628
4628
|
const o = e.end.splice(1, e.end.length);
|
|
4629
4629
|
o.push(this.sourceToken);
|
|
4630
4630
|
const l = {
|
|
@@ -4687,7 +4687,7 @@ class Tt {
|
|
|
4687
4687
|
};
|
|
4688
4688
|
case "explicit-key-ind": {
|
|
4689
4689
|
this.onKeyLine = !0;
|
|
4690
|
-
const t = Ce(e), n =
|
|
4690
|
+
const t = Ce(e), n = ee(t);
|
|
4691
4691
|
return n.push(this.sourceToken), {
|
|
4692
4692
|
type: "block-map",
|
|
4693
4693
|
offset: this.offset,
|
|
@@ -4697,7 +4697,7 @@ class Tt {
|
|
|
4697
4697
|
}
|
|
4698
4698
|
case "map-value-ind": {
|
|
4699
4699
|
this.onKeyLine = !0;
|
|
4700
|
-
const t = Ce(e), n =
|
|
4700
|
+
const t = Ce(e), n = ee(t);
|
|
4701
4701
|
return {
|
|
4702
4702
|
type: "block-map",
|
|
4703
4703
|
offset: this.offset,
|
|
@@ -4734,25 +4734,25 @@ class Tt {
|
|
|
4734
4734
|
}
|
|
4735
4735
|
}
|
|
4736
4736
|
}
|
|
4737
|
-
function
|
|
4737
|
+
function Ts(s) {
|
|
4738
4738
|
const e = s.prettyErrors !== !1;
|
|
4739
|
-
return { lineCounter: s.lineCounter || e && new
|
|
4739
|
+
return { lineCounter: s.lineCounter || e && new Pn() || null, prettyErrors: e };
|
|
4740
4740
|
}
|
|
4741
4741
|
function qn(s, e = {}) {
|
|
4742
|
-
const { lineCounter: t, prettyErrors: n } =
|
|
4742
|
+
const { lineCounter: t, prettyErrors: n } = Ts(e), i = new Is(t == null ? void 0 : t.addNewLine), r = new Ss(e), o = Array.from(r.compose(i.parse(s)));
|
|
4743
4743
|
if (n && t)
|
|
4744
4744
|
for (const l of o)
|
|
4745
4745
|
l.errors.forEach(De(s, t)), l.warnings.forEach(De(s, t));
|
|
4746
4746
|
return o.length > 0 ? o : Object.assign([], { empty: !0 }, r.streamInfo());
|
|
4747
4747
|
}
|
|
4748
|
-
function
|
|
4749
|
-
const { lineCounter: t, prettyErrors: n } =
|
|
4748
|
+
function jn(s, e = {}) {
|
|
4749
|
+
const { lineCounter: t, prettyErrors: n } = Ts(e), i = new Is(t == null ? void 0 : t.addNewLine), r = new Ss(e);
|
|
4750
4750
|
let o = null;
|
|
4751
4751
|
for (const l of r.compose(i.parse(s), !0, s.length))
|
|
4752
4752
|
if (!o)
|
|
4753
4753
|
o = l;
|
|
4754
4754
|
else if (o.options.logLevel !== "silent") {
|
|
4755
|
-
o.errors.push(new
|
|
4755
|
+
o.errors.push(new re(l.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
|
|
4756
4756
|
break;
|
|
4757
4757
|
}
|
|
4758
4758
|
return n && t && (o.errors.forEach(De(s, t)), o.warnings.forEach(De(s, t))), o;
|
|
@@ -4760,10 +4760,10 @@ function Cs(s, e = {}) {
|
|
|
4760
4760
|
function Fn(s, e, t) {
|
|
4761
4761
|
let n;
|
|
4762
4762
|
typeof e == "function" ? n = e : t === void 0 && e && typeof e == "object" && (t = e);
|
|
4763
|
-
const i =
|
|
4763
|
+
const i = jn(s, t);
|
|
4764
4764
|
if (!i)
|
|
4765
4765
|
return null;
|
|
4766
|
-
if (i.warnings.forEach((r) =>
|
|
4766
|
+
if (i.warnings.forEach((r) => Wt(i.options.logLevel, r)), i.errors.length > 0) {
|
|
4767
4767
|
if (i.options.logLevel !== "silent")
|
|
4768
4768
|
throw i.errors[0];
|
|
4769
4769
|
i.errors = [];
|
|
@@ -4781,70 +4781,37 @@ function Rn(s, e, t) {
|
|
|
4781
4781
|
if (!i)
|
|
4782
4782
|
return;
|
|
4783
4783
|
}
|
|
4784
|
-
return
|
|
4784
|
+
return he(s) && !n ? s.toString(t) : new Ee(s, n, t).toString(t);
|
|
4785
4785
|
}
|
|
4786
|
-
const Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4787
|
-
__proto__: null,
|
|
4788
|
-
Alias: Re,
|
|
4789
|
-
CST: Pn,
|
|
4790
|
-
Composer: It,
|
|
4791
|
-
Document: ge,
|
|
4792
|
-
Lexer: Ts,
|
|
4793
|
-
LineCounter: Ls,
|
|
4794
|
-
Pair: v,
|
|
4795
|
-
Parser: Tt,
|
|
4796
|
-
Scalar: A,
|
|
4797
|
-
Schema: Xe,
|
|
4798
|
-
YAMLError: At,
|
|
4799
|
-
YAMLMap: K,
|
|
4800
|
-
YAMLParseError: z,
|
|
4801
|
-
YAMLSeq: W,
|
|
4802
|
-
YAMLWarning: ys,
|
|
4803
|
-
isAlias: x,
|
|
4804
|
-
isCollection: L,
|
|
4805
|
-
isDocument: ee,
|
|
4806
|
-
isMap: de,
|
|
4807
|
-
isNode: $,
|
|
4808
|
-
isPair: T,
|
|
4809
|
-
isScalar: E,
|
|
4810
|
-
isSeq: pe,
|
|
4811
|
-
parse: Fn,
|
|
4812
|
-
parseAllDocuments: qn,
|
|
4813
|
-
parseDocument: Cs,
|
|
4814
|
-
stringify: Rn,
|
|
4815
|
-
visit: Q,
|
|
4816
|
-
visitAsync: Fe
|
|
4817
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
4818
4786
|
export {
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
K as
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
Fe as visitAsync
|
|
4787
|
+
dt as A,
|
|
4788
|
+
Ss as C,
|
|
4789
|
+
Ee as D,
|
|
4790
|
+
Kn as L,
|
|
4791
|
+
v as P,
|
|
4792
|
+
A as S,
|
|
4793
|
+
ds as Y,
|
|
4794
|
+
Pn as a,
|
|
4795
|
+
Is as b,
|
|
4796
|
+
Dn as c,
|
|
4797
|
+
Ot as d,
|
|
4798
|
+
K as e,
|
|
4799
|
+
re as f,
|
|
4800
|
+
X as g,
|
|
4801
|
+
rn as h,
|
|
4802
|
+
ue as i,
|
|
4803
|
+
L as j,
|
|
4804
|
+
he as k,
|
|
4805
|
+
ke as l,
|
|
4806
|
+
$ as m,
|
|
4807
|
+
T as n,
|
|
4808
|
+
I as o,
|
|
4809
|
+
Ne as p,
|
|
4810
|
+
Fn as q,
|
|
4811
|
+
qn as r,
|
|
4812
|
+
jn as s,
|
|
4813
|
+
Rn as t,
|
|
4814
|
+
ut as u,
|
|
4815
|
+
H as v
|
|
4849
4816
|
};
|
|
4850
|
-
//# sourceMappingURL=
|
|
4817
|
+
//# sourceMappingURL=public-api-CrAQFYc4.js.map
|