@depup/js-yaml 5.2.1-depup.9
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/LICENSE +21 -0
- package/README.md +31 -0
- package/bin/js-yaml.mjs +107 -0
- package/changes.json +10 -0
- package/dist/browser/js-yaml.esm.min.mjs +2209 -0
- package/dist/browser/js-yaml.esm.min.mjs.map +1 -0
- package/dist/browser/js-yaml.umd.min.js +33 -0
- package/dist/browser/js-yaml.umd.min.js.map +1 -0
- package/dist/js-yaml.cjs.js +3242 -0
- package/dist/js-yaml.cjs.js.map +1 -0
- package/dist/js-yaml.d.ts +382 -0
- package/dist/js-yaml.mjs +3136 -0
- package/dist/js-yaml.mjs.map +1 -0
- package/package.json +111 -0
|
@@ -0,0 +1,2209 @@
|
|
|
1
|
+
/*! js-yaml 5.2.1 https://github.com/nodeca/js-yaml @license MIT */
|
|
2
|
+
//#region src/tag.ts
|
|
3
|
+
var e = Symbol("NOT_RESOLVED"), t = Symbol("MERGE_KEY");
|
|
4
|
+
function n(e, t) {
|
|
5
|
+
var n, r, i, a, o, s;
|
|
6
|
+
return {
|
|
7
|
+
tagName: e,
|
|
8
|
+
nodeKind: "scalar",
|
|
9
|
+
implicit: (n = t.implicit) == null ? !1 : n,
|
|
10
|
+
matchByTagPrefix: (r = t.matchByTagPrefix) == null ? !1 : r,
|
|
11
|
+
implicitFirstChars: (i = t.implicitFirstChars) == null ? null : i,
|
|
12
|
+
resolve: t.resolve,
|
|
13
|
+
identify: (a = t.identify) == null ? null : a,
|
|
14
|
+
represent: (o = t.represent) == null ? ((e) => String(e)) : o,
|
|
15
|
+
representTagName: (s = t.representTagName) == null ? null : s
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function r(e, t) {
|
|
19
|
+
var n, r, i, a, o;
|
|
20
|
+
let s = t.finalize === void 0;
|
|
21
|
+
return {
|
|
22
|
+
tagName: e,
|
|
23
|
+
nodeKind: "sequence",
|
|
24
|
+
implicit: !1,
|
|
25
|
+
matchByTagPrefix: (n = t.matchByTagPrefix) == null ? !1 : n,
|
|
26
|
+
create: t.create,
|
|
27
|
+
addItem: t.addItem,
|
|
28
|
+
finalize: (r = t.finalize) == null ? ((e) => e) : r,
|
|
29
|
+
carrierIsResult: s,
|
|
30
|
+
identify: (i = t.identify) == null ? null : i,
|
|
31
|
+
represent: (a = t.represent) == null ? ((e) => e) : a,
|
|
32
|
+
representTagName: (o = t.representTagName) == null ? null : o
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function i(e, t) {
|
|
36
|
+
var n, r, i, a, o;
|
|
37
|
+
let s = t.finalize === void 0;
|
|
38
|
+
return {
|
|
39
|
+
tagName: e,
|
|
40
|
+
nodeKind: "mapping",
|
|
41
|
+
implicit: !1,
|
|
42
|
+
matchByTagPrefix: (n = t.matchByTagPrefix) == null ? !1 : n,
|
|
43
|
+
create: t.create,
|
|
44
|
+
addPair: t.addPair,
|
|
45
|
+
has: t.has,
|
|
46
|
+
keys: t.keys,
|
|
47
|
+
get: t.get,
|
|
48
|
+
finalize: (r = t.finalize) == null ? ((e) => e) : r,
|
|
49
|
+
carrierIsResult: s,
|
|
50
|
+
identify: (i = t.identify) == null ? null : i,
|
|
51
|
+
represent: (a = t.represent) == null ? ((e) => e) : a,
|
|
52
|
+
representTagName: (o = t.representTagName) == null ? null : o
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/tag/scalar/str.ts
|
|
57
|
+
var a = n("tag:yaml.org,2002:str", {
|
|
58
|
+
resolve: (e) => e,
|
|
59
|
+
identify: (e) => typeof e == "string"
|
|
60
|
+
}), o = [
|
|
61
|
+
"",
|
|
62
|
+
"~",
|
|
63
|
+
"null",
|
|
64
|
+
"Null",
|
|
65
|
+
"NULL"
|
|
66
|
+
], s = n("tag:yaml.org,2002:null", {
|
|
67
|
+
implicit: !0,
|
|
68
|
+
implicitFirstChars: [
|
|
69
|
+
"",
|
|
70
|
+
"~",
|
|
71
|
+
"n",
|
|
72
|
+
"N"
|
|
73
|
+
],
|
|
74
|
+
resolve: (t) => o.indexOf(t) === -1 ? e : null,
|
|
75
|
+
identify: (e) => e === null,
|
|
76
|
+
represent: () => "null"
|
|
77
|
+
}), c = n("tag:yaml.org,2002:null", {
|
|
78
|
+
implicit: !0,
|
|
79
|
+
implicitFirstChars: ["n"],
|
|
80
|
+
resolve: (t, n) => t === "null" || n && t === "" ? null : e,
|
|
81
|
+
identify: (e) => e === null,
|
|
82
|
+
represent: () => "null"
|
|
83
|
+
}), l = [
|
|
84
|
+
"",
|
|
85
|
+
"~",
|
|
86
|
+
"null",
|
|
87
|
+
"Null",
|
|
88
|
+
"NULL"
|
|
89
|
+
], u = n("tag:yaml.org,2002:null", {
|
|
90
|
+
implicit: !0,
|
|
91
|
+
implicitFirstChars: [
|
|
92
|
+
"",
|
|
93
|
+
"~",
|
|
94
|
+
"n",
|
|
95
|
+
"N"
|
|
96
|
+
],
|
|
97
|
+
resolve: (t) => l.indexOf(t) === -1 ? e : null,
|
|
98
|
+
identify: (e) => e === null,
|
|
99
|
+
represent: () => "null"
|
|
100
|
+
}), d = [
|
|
101
|
+
"true",
|
|
102
|
+
"True",
|
|
103
|
+
"TRUE"
|
|
104
|
+
], f = [
|
|
105
|
+
"false",
|
|
106
|
+
"False",
|
|
107
|
+
"FALSE"
|
|
108
|
+
], p = n("tag:yaml.org,2002:bool", {
|
|
109
|
+
implicit: !0,
|
|
110
|
+
implicitFirstChars: [
|
|
111
|
+
"t",
|
|
112
|
+
"T",
|
|
113
|
+
"f",
|
|
114
|
+
"F"
|
|
115
|
+
],
|
|
116
|
+
resolve: (t) => d.indexOf(t) === -1 ? f.indexOf(t) === -1 ? e : !1 : !0,
|
|
117
|
+
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
118
|
+
represent: (e) => e ? "true" : "false"
|
|
119
|
+
}), m = ["true"], h = ["false"], ee = n("tag:yaml.org,2002:bool", {
|
|
120
|
+
implicit: !0,
|
|
121
|
+
implicitFirstChars: ["t", "f"],
|
|
122
|
+
resolve: (t) => m.indexOf(t) === -1 ? h.indexOf(t) === -1 ? e : !1 : !0,
|
|
123
|
+
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
124
|
+
represent: (e) => e ? "true" : "false"
|
|
125
|
+
}), te = [
|
|
126
|
+
"true",
|
|
127
|
+
"True",
|
|
128
|
+
"TRUE",
|
|
129
|
+
"y",
|
|
130
|
+
"Y",
|
|
131
|
+
"yes",
|
|
132
|
+
"Yes",
|
|
133
|
+
"YES",
|
|
134
|
+
"on",
|
|
135
|
+
"On",
|
|
136
|
+
"ON"
|
|
137
|
+
], ne = [
|
|
138
|
+
"false",
|
|
139
|
+
"False",
|
|
140
|
+
"FALSE",
|
|
141
|
+
"n",
|
|
142
|
+
"N",
|
|
143
|
+
"no",
|
|
144
|
+
"No",
|
|
145
|
+
"NO",
|
|
146
|
+
"off",
|
|
147
|
+
"Off",
|
|
148
|
+
"OFF"
|
|
149
|
+
], re = n("tag:yaml.org,2002:bool", {
|
|
150
|
+
implicit: !0,
|
|
151
|
+
implicitFirstChars: [
|
|
152
|
+
"y",
|
|
153
|
+
"Y",
|
|
154
|
+
"n",
|
|
155
|
+
"N",
|
|
156
|
+
"t",
|
|
157
|
+
"T",
|
|
158
|
+
"f",
|
|
159
|
+
"F",
|
|
160
|
+
"o",
|
|
161
|
+
"O"
|
|
162
|
+
],
|
|
163
|
+
resolve: (t) => te.indexOf(t) === -1 ? ne.indexOf(t) === -1 ? e : !1 : !0,
|
|
164
|
+
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
165
|
+
represent: (e) => e ? "true" : "false"
|
|
166
|
+
}), ie = /* @__PURE__ */ RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"), ae = /* @__PURE__ */ RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
|
|
167
|
+
function oe(e) {
|
|
168
|
+
let t = e, n = 1;
|
|
169
|
+
return (t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b") ? n * parseInt(t.slice(2), 2) : t.startsWith("0o") ? n * parseInt(t.slice(2), 8) : t.startsWith("0x") ? n * parseInt(t.slice(2), 16) : n * parseInt(t, 10);
|
|
170
|
+
}
|
|
171
|
+
function se(t, n) {
|
|
172
|
+
if (n) {
|
|
173
|
+
if (!ae.test(t)) return e;
|
|
174
|
+
} else if (!ie.test(t)) return e;
|
|
175
|
+
let r = oe(t);
|
|
176
|
+
return Number.isFinite(r) ? r : e;
|
|
177
|
+
}
|
|
178
|
+
var ce = n("tag:yaml.org,2002:int", {
|
|
179
|
+
implicit: !0,
|
|
180
|
+
implicitFirstChars: [
|
|
181
|
+
"-",
|
|
182
|
+
"+",
|
|
183
|
+
..."0123456789"
|
|
184
|
+
],
|
|
185
|
+
resolve: se,
|
|
186
|
+
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
|
|
187
|
+
represent: (e) => e.toString(10)
|
|
188
|
+
}), le = /* @__PURE__ */ RegExp("^-?(?:0|[1-9][0-9]*)$"), ue = /* @__PURE__ */ RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
|
|
189
|
+
function de(e) {
|
|
190
|
+
let t = e, n = 1;
|
|
191
|
+
return (t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b") ? n * parseInt(t.slice(2), 2) : t.startsWith("0o") ? n * parseInt(t.slice(2), 8) : t.startsWith("0x") ? n * parseInt(t.slice(2), 16) : n * parseInt(t, 10);
|
|
192
|
+
}
|
|
193
|
+
function fe(t, n) {
|
|
194
|
+
if (n) {
|
|
195
|
+
if (!ue.test(t)) return e;
|
|
196
|
+
} else if (!le.test(t)) return e;
|
|
197
|
+
let r = de(t);
|
|
198
|
+
return Number.isFinite(r) ? r : e;
|
|
199
|
+
}
|
|
200
|
+
var pe = n("tag:yaml.org,2002:int", {
|
|
201
|
+
implicit: !0,
|
|
202
|
+
implicitFirstChars: ["-", ..."0123456789"],
|
|
203
|
+
resolve: fe,
|
|
204
|
+
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
|
|
205
|
+
represent: (e) => e.toString(10)
|
|
206
|
+
}), me = /* @__PURE__ */ RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");
|
|
207
|
+
function he(e) {
|
|
208
|
+
let t = e.replace(/_/g, ""), n = 1;
|
|
209
|
+
if ((t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b")) return n * parseInt(t.slice(2), 2);
|
|
210
|
+
if (t.startsWith("0x")) return n * parseInt(t.slice(2), 16);
|
|
211
|
+
if (t.includes(":")) {
|
|
212
|
+
let e = 0;
|
|
213
|
+
for (let n of t.split(":")) e = e * 60 + Number(n);
|
|
214
|
+
return n * e;
|
|
215
|
+
}
|
|
216
|
+
return t !== "0" && t[0] === "0" ? n * parseInt(t, 8) : n * parseInt(t, 10);
|
|
217
|
+
}
|
|
218
|
+
function ge(t) {
|
|
219
|
+
if (!me.test(t)) return e;
|
|
220
|
+
let n = he(t);
|
|
221
|
+
return Number.isFinite(n) ? n : e;
|
|
222
|
+
}
|
|
223
|
+
var _e = n("tag:yaml.org,2002:int", {
|
|
224
|
+
implicit: !0,
|
|
225
|
+
implicitFirstChars: [
|
|
226
|
+
"-",
|
|
227
|
+
"+",
|
|
228
|
+
..."0123456789"
|
|
229
|
+
],
|
|
230
|
+
resolve: ge,
|
|
231
|
+
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
|
|
232
|
+
represent: (e) => e.toString(10)
|
|
233
|
+
}), ve = /* @__PURE__ */ RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"), ye = /* @__PURE__ */ RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
234
|
+
function be(t) {
|
|
235
|
+
if (!ve.test(t)) return e;
|
|
236
|
+
let n = t.toLowerCase(), r = n[0] === "-" ? -1 : 1;
|
|
237
|
+
if ("+-".includes(n[0]) && (n = n.slice(1)), n === ".inf") return r === 1 ? Infinity : -Infinity;
|
|
238
|
+
if (n === ".nan") return NaN;
|
|
239
|
+
let i = r * parseFloat(n);
|
|
240
|
+
return Number.isFinite(i) || ye.test(t) ? i : e;
|
|
241
|
+
}
|
|
242
|
+
function xe(e) {
|
|
243
|
+
if (isNaN(e)) return ".nan";
|
|
244
|
+
if (e === Infinity) return ".inf";
|
|
245
|
+
if (e === -Infinity) return "-.inf";
|
|
246
|
+
if (Object.is(e, -0)) return "-0.0";
|
|
247
|
+
let t = e.toString(10);
|
|
248
|
+
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
249
|
+
}
|
|
250
|
+
var Se = n("tag:yaml.org,2002:float", {
|
|
251
|
+
implicit: !0,
|
|
252
|
+
implicitFirstChars: [
|
|
253
|
+
"-",
|
|
254
|
+
"+",
|
|
255
|
+
".",
|
|
256
|
+
..."0123456789"
|
|
257
|
+
],
|
|
258
|
+
resolve: be,
|
|
259
|
+
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
260
|
+
represent: xe
|
|
261
|
+
}), Ce = /* @__PURE__ */ RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"), we = /* @__PURE__ */ RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
262
|
+
function Te(t, n) {
|
|
263
|
+
if (n) {
|
|
264
|
+
if (!we.test(t)) return e;
|
|
265
|
+
let n = t.toLowerCase(), r = n[0] === "-" ? -1 : 1;
|
|
266
|
+
if ("+-".includes(n[0]) && (n = n.slice(1)), n === ".inf") return r === 1 ? Infinity : -Infinity;
|
|
267
|
+
if (n === ".nan") return NaN;
|
|
268
|
+
let i = r * parseFloat(n);
|
|
269
|
+
return Number.isFinite(i) ? i : e;
|
|
270
|
+
}
|
|
271
|
+
if (!Ce.test(t)) return e;
|
|
272
|
+
let r = Number(t);
|
|
273
|
+
return Number.isFinite(r) ? r : e;
|
|
274
|
+
}
|
|
275
|
+
function Ee(e) {
|
|
276
|
+
if (isNaN(e)) return ".nan";
|
|
277
|
+
if (e === Infinity) return ".inf";
|
|
278
|
+
if (e === -Infinity) return "-.inf";
|
|
279
|
+
if (Object.is(e, -0)) return "-0.0";
|
|
280
|
+
let t = e.toString(10);
|
|
281
|
+
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
282
|
+
}
|
|
283
|
+
var De = n("tag:yaml.org,2002:float", {
|
|
284
|
+
implicit: !0,
|
|
285
|
+
implicitFirstChars: ["-", ..."0123456789"],
|
|
286
|
+
resolve: Te,
|
|
287
|
+
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
288
|
+
represent: Ee
|
|
289
|
+
}), Oe = /* @__PURE__ */ RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"), ke = /* @__PURE__ */ RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
290
|
+
function Ae(t) {
|
|
291
|
+
if (!Oe.test(t)) return e;
|
|
292
|
+
let n = t.toLowerCase().replace(/_/g, ""), r = n[0] === "-" ? -1 : 1;
|
|
293
|
+
if ("+-".includes(n[0]) && (n = n.slice(1)), n === ".inf") return r === 1 ? Infinity : -Infinity;
|
|
294
|
+
if (n === ".nan") return NaN;
|
|
295
|
+
let i = 0;
|
|
296
|
+
if (n.includes(":")) {
|
|
297
|
+
for (let e of n.split(":")) i = i * 60 + Number(e);
|
|
298
|
+
i *= r;
|
|
299
|
+
} else i = r * parseFloat(n);
|
|
300
|
+
return Number.isFinite(i) || ke.test(t) ? i : e;
|
|
301
|
+
}
|
|
302
|
+
function je(e) {
|
|
303
|
+
if (isNaN(e)) return ".nan";
|
|
304
|
+
if (e === Infinity) return ".inf";
|
|
305
|
+
if (e === -Infinity) return "-.inf";
|
|
306
|
+
if (Object.is(e, -0)) return "-0.0";
|
|
307
|
+
let t = e.toString(10);
|
|
308
|
+
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
309
|
+
}
|
|
310
|
+
var Me = n("tag:yaml.org,2002:float", {
|
|
311
|
+
implicit: !0,
|
|
312
|
+
implicitFirstChars: [
|
|
313
|
+
"-",
|
|
314
|
+
"+",
|
|
315
|
+
".",
|
|
316
|
+
..."0123456789"
|
|
317
|
+
],
|
|
318
|
+
resolve: Ae,
|
|
319
|
+
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
320
|
+
represent: je
|
|
321
|
+
}), Ne = n("tag:yaml.org,2002:merge", {
|
|
322
|
+
implicit: !0,
|
|
323
|
+
implicitFirstChars: ["<"],
|
|
324
|
+
resolve: (n, r) => n === "<<" || r && n === "" ? t : e
|
|
325
|
+
}), Pe = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
326
|
+
function Fe(t) {
|
|
327
|
+
let n = t.replace(/\s/g, "");
|
|
328
|
+
if (n.length % 4 != 0 || !Pe.test(n)) return e;
|
|
329
|
+
let r = atob(n), i = new Uint8Array(r.length);
|
|
330
|
+
for (let e = 0; e < r.length; e++) i[e] = r.charCodeAt(e);
|
|
331
|
+
return i;
|
|
332
|
+
}
|
|
333
|
+
function Ie(e) {
|
|
334
|
+
let t = "";
|
|
335
|
+
for (let n = 0; n < e.length; n++) t += String.fromCharCode(e[n]);
|
|
336
|
+
return btoa(t);
|
|
337
|
+
}
|
|
338
|
+
var Le = n("tag:yaml.org,2002:binary", {
|
|
339
|
+
resolve: Fe,
|
|
340
|
+
identify: (e) => Object.prototype.toString.call(e) === "[object Uint8Array]",
|
|
341
|
+
represent: Ie
|
|
342
|
+
}), Re = /* @__PURE__ */ RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"), ze = /* @__PURE__ */ RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
|
|
343
|
+
function Be(t) {
|
|
344
|
+
let n = Re.exec(t);
|
|
345
|
+
if (n === null && (n = ze.exec(t)), n === null) return e;
|
|
346
|
+
let r = +n[1], i = n[2] - 1, a = +n[3];
|
|
347
|
+
if (!n[4]) {
|
|
348
|
+
let t = new Date(Date.UTC(r, i, a));
|
|
349
|
+
return t.getUTCFullYear() !== r || t.getUTCMonth() !== i || t.getUTCDate() !== a ? e : t;
|
|
350
|
+
}
|
|
351
|
+
let o = +n[4], s = +n[5], c = +n[6], l = 0;
|
|
352
|
+
if (o > 23 || s > 59 || c > 59) return e;
|
|
353
|
+
if (n[7]) {
|
|
354
|
+
let e = n[7].slice(0, 3);
|
|
355
|
+
for (; e.length < 3;) e += "0";
|
|
356
|
+
l = +e;
|
|
357
|
+
}
|
|
358
|
+
let u = new Date(Date.UTC(r, i, a, o, s, c, l));
|
|
359
|
+
if (u.getUTCFullYear() !== r || u.getUTCMonth() !== i || u.getUTCDate() !== a) return e;
|
|
360
|
+
if (n[9]) {
|
|
361
|
+
let t = +n[10], r = +(n[11] || 0);
|
|
362
|
+
if (t > 23 || r > 59) return e;
|
|
363
|
+
let i = (t * 60 + r) * 6e4;
|
|
364
|
+
u.setTime(u.getTime() - (n[9] === "-" ? -i : i));
|
|
365
|
+
}
|
|
366
|
+
return u;
|
|
367
|
+
}
|
|
368
|
+
var Ve = n("tag:yaml.org,2002:timestamp", {
|
|
369
|
+
implicit: !0,
|
|
370
|
+
implicitFirstChars: [..."0123456789"],
|
|
371
|
+
resolve: Be,
|
|
372
|
+
identify: (e) => e instanceof Date,
|
|
373
|
+
represent: (e) => e.toISOString()
|
|
374
|
+
}), He = r("tag:yaml.org,2002:seq", {
|
|
375
|
+
create: () => [],
|
|
376
|
+
addItem: (e, t) => {
|
|
377
|
+
e.push(t);
|
|
378
|
+
},
|
|
379
|
+
identify: Array.isArray
|
|
380
|
+
});
|
|
381
|
+
//#endregion
|
|
382
|
+
//#region src/common/object.ts
|
|
383
|
+
function Ue(e) {
|
|
384
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return !1;
|
|
385
|
+
let t = Object.getPrototypeOf(e);
|
|
386
|
+
return t === null || t === Object.prototype;
|
|
387
|
+
}
|
|
388
|
+
function We(e, t) {
|
|
389
|
+
let n = {};
|
|
390
|
+
for (let r of t) e[r] !== void 0 && (n[r] = e[r]);
|
|
391
|
+
return n;
|
|
392
|
+
}
|
|
393
|
+
//#endregion
|
|
394
|
+
//#region src/tag/sequence/omap.ts
|
|
395
|
+
var Ge = r("tag:yaml.org,2002:omap", {
|
|
396
|
+
create: () => ({
|
|
397
|
+
list: [],
|
|
398
|
+
seen: /* @__PURE__ */ new Set()
|
|
399
|
+
}),
|
|
400
|
+
addItem: (e, t) => {
|
|
401
|
+
let n;
|
|
402
|
+
if (t instanceof Map) {
|
|
403
|
+
if (t.size !== 1) return "cannot resolve an ordered map item";
|
|
404
|
+
n = t.keys().next().value;
|
|
405
|
+
} else if (Ue(t)) {
|
|
406
|
+
let e = Object.keys(t);
|
|
407
|
+
if (e.length !== 1) return "cannot resolve an ordered map item";
|
|
408
|
+
n = e[0];
|
|
409
|
+
} else return "cannot resolve an ordered map item";
|
|
410
|
+
return e.seen.has(n) ? "duplicate key in ordered map" : (e.seen.add(n), e.list.push(t), "");
|
|
411
|
+
},
|
|
412
|
+
finalize: (e) => e.list
|
|
413
|
+
}), Ke = r("tag:yaml.org,2002:pairs", {
|
|
414
|
+
create: () => [],
|
|
415
|
+
addItem: (e, t) => {
|
|
416
|
+
if (t instanceof Map) return t.size === 1 ? (e.push(t.entries().next().value), "") : "cannot resolve a pairs item";
|
|
417
|
+
if (Object.prototype.toString.call(t) !== "[object Object]") return "cannot resolve a pairs item";
|
|
418
|
+
let n = t, r = Object.keys(n);
|
|
419
|
+
return r.length === 1 ? (e.push([r[0], n[r[0]]]), "") : "cannot resolve a pairs item";
|
|
420
|
+
}
|
|
421
|
+
}), qe = i("tag:yaml.org,2002:map", {
|
|
422
|
+
create: () => ({}),
|
|
423
|
+
identify: Ue,
|
|
424
|
+
represent: (e) => {
|
|
425
|
+
let t = /* @__PURE__ */ new Map();
|
|
426
|
+
for (let n of Object.keys(e)) t.set(n, e[n]);
|
|
427
|
+
return t;
|
|
428
|
+
},
|
|
429
|
+
addPair: (e, t, n) => {
|
|
430
|
+
if (typeof t == "object" && t) return "object-based map does not support complex keys";
|
|
431
|
+
let r = String(t);
|
|
432
|
+
return r === "__proto__" ? Object.defineProperty(e, r, {
|
|
433
|
+
value: n,
|
|
434
|
+
enumerable: !0,
|
|
435
|
+
configurable: !0,
|
|
436
|
+
writable: !0
|
|
437
|
+
}) : e[r] = n, "";
|
|
438
|
+
},
|
|
439
|
+
has: (e, t) => typeof t == "object" && t ? !1 : Object.prototype.hasOwnProperty.call(e, String(t)),
|
|
440
|
+
keys: (e) => Object.keys(e),
|
|
441
|
+
get: (e, t) => e[String(t)]
|
|
442
|
+
}), Je = i("tag:yaml.org,2002:set", {
|
|
443
|
+
create: () => /* @__PURE__ */ new Set(),
|
|
444
|
+
identify: (e) => e instanceof Set,
|
|
445
|
+
represent: (e) => {
|
|
446
|
+
let t = /* @__PURE__ */ new Map();
|
|
447
|
+
for (let n of e) t.set(n, null);
|
|
448
|
+
return t;
|
|
449
|
+
},
|
|
450
|
+
addPair: (e, t, n) => n === null ? (e.add(t), "") : "cannot resolve a set item",
|
|
451
|
+
has: (e, t) => e.has(t),
|
|
452
|
+
keys: (e) => e.keys(),
|
|
453
|
+
get: () => null
|
|
454
|
+
});
|
|
455
|
+
//#endregion
|
|
456
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
|
|
457
|
+
function g(e) {
|
|
458
|
+
"@babel/helpers - typeof";
|
|
459
|
+
return g = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
460
|
+
return typeof e;
|
|
461
|
+
} : function(e) {
|
|
462
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
463
|
+
}, g(e);
|
|
464
|
+
}
|
|
465
|
+
//#endregion
|
|
466
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
|
|
467
|
+
function Ye(e, t) {
|
|
468
|
+
if (g(e) != "object" || !e) return e;
|
|
469
|
+
var n = e[Symbol.toPrimitive];
|
|
470
|
+
if (n !== void 0) {
|
|
471
|
+
var r = n.call(e, t || "default");
|
|
472
|
+
if (g(r) != "object") return r;
|
|
473
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
474
|
+
}
|
|
475
|
+
return (t === "string" ? String : Number)(e);
|
|
476
|
+
}
|
|
477
|
+
//#endregion
|
|
478
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
|
|
479
|
+
function Xe(e) {
|
|
480
|
+
var t = Ye(e, "string");
|
|
481
|
+
return g(t) == "symbol" ? t : t + "";
|
|
482
|
+
}
|
|
483
|
+
//#endregion
|
|
484
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
|
|
485
|
+
function _(e, t, n) {
|
|
486
|
+
return (t = Xe(t)) in e ? Object.defineProperty(e, t, {
|
|
487
|
+
value: n,
|
|
488
|
+
enumerable: !0,
|
|
489
|
+
configurable: !0,
|
|
490
|
+
writable: !0
|
|
491
|
+
}) : e[t] = n, e;
|
|
492
|
+
}
|
|
493
|
+
//#endregion
|
|
494
|
+
//#region src/schema.ts
|
|
495
|
+
function Ze() {
|
|
496
|
+
return {
|
|
497
|
+
scalar: {},
|
|
498
|
+
sequence: {},
|
|
499
|
+
mapping: {}
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
function Qe() {
|
|
503
|
+
return {
|
|
504
|
+
scalar: [],
|
|
505
|
+
sequence: [],
|
|
506
|
+
mapping: []
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
function $e(e) {
|
|
510
|
+
let t = [];
|
|
511
|
+
for (let n of e) {
|
|
512
|
+
let e = t.length;
|
|
513
|
+
for (let r = 0; r < t.length; r++) {
|
|
514
|
+
let i = t[r];
|
|
515
|
+
if (i.nodeKind === n.nodeKind && i.tagName === n.tagName && i.matchByTagPrefix === n.matchByTagPrefix) {
|
|
516
|
+
e = r;
|
|
517
|
+
break;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
t[e] = n;
|
|
521
|
+
}
|
|
522
|
+
return t;
|
|
523
|
+
}
|
|
524
|
+
var v = class e {
|
|
525
|
+
constructor(e) {
|
|
526
|
+
_(this, "tags", void 0), _(this, "implicitScalarTags", void 0), _(this, "implicitScalarByFirstChar", void 0), _(this, "implicitScalarAnyFirstChar", void 0), _(this, "defaultScalarTag", void 0), _(this, "defaultSequenceTag", void 0), _(this, "defaultMappingTag", void 0), _(this, "exact", void 0), _(this, "prefix", void 0);
|
|
527
|
+
let t = $e(e), n = [], r = Ze(), i = Qe();
|
|
528
|
+
for (let e of t) {
|
|
529
|
+
if (e.nodeKind === "scalar" && e.implicit) {
|
|
530
|
+
if (e.matchByTagPrefix) throw Error("Implicit scalar tags cannot match by tag prefix");
|
|
531
|
+
n.push(e);
|
|
532
|
+
}
|
|
533
|
+
switch (e.nodeKind) {
|
|
534
|
+
case "scalar":
|
|
535
|
+
e.matchByTagPrefix ? i.scalar.push(e) : r.scalar[e.tagName] = e;
|
|
536
|
+
break;
|
|
537
|
+
case "sequence":
|
|
538
|
+
e.matchByTagPrefix ? i.sequence.push(e) : r.sequence[e.tagName] = e;
|
|
539
|
+
break;
|
|
540
|
+
case "mapping":
|
|
541
|
+
e.matchByTagPrefix ? i.mapping.push(e) : r.mapping[e.tagName] = e;
|
|
542
|
+
break;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
let a = n.filter((e) => e.implicitFirstChars === null), o = /* @__PURE__ */ new Set();
|
|
546
|
+
for (let e of n) if (e.implicitFirstChars !== null) for (let t of e.implicitFirstChars) o.add(t);
|
|
547
|
+
let s = /* @__PURE__ */ new Map();
|
|
548
|
+
for (let e of o) s.set(e, n.filter((t) => t.implicitFirstChars === null || t.implicitFirstChars.indexOf(e) !== -1));
|
|
549
|
+
let c = r.scalar["tag:yaml.org,2002:str"];
|
|
550
|
+
if (!c) throw Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");
|
|
551
|
+
this.tags = t, this.implicitScalarTags = n, this.implicitScalarByFirstChar = s, this.implicitScalarAnyFirstChar = a, this.defaultScalarTag = c, this.defaultSequenceTag = r.sequence["tag:yaml.org,2002:seq"], this.defaultMappingTag = r.mapping["tag:yaml.org,2002:map"], this.exact = r, this.prefix = i;
|
|
552
|
+
}
|
|
553
|
+
withTags(...t) {
|
|
554
|
+
let n = [];
|
|
555
|
+
for (let e of t) n = n.concat(e);
|
|
556
|
+
return new e([...this.tags, ...n]);
|
|
557
|
+
}
|
|
558
|
+
}, et = new v([
|
|
559
|
+
a,
|
|
560
|
+
He,
|
|
561
|
+
qe
|
|
562
|
+
]), tt = new v([
|
|
563
|
+
...et.tags,
|
|
564
|
+
c,
|
|
565
|
+
ee,
|
|
566
|
+
pe,
|
|
567
|
+
De
|
|
568
|
+
]), nt = new v([
|
|
569
|
+
...et.tags,
|
|
570
|
+
s,
|
|
571
|
+
p,
|
|
572
|
+
ce,
|
|
573
|
+
Se
|
|
574
|
+
]), rt = new v([
|
|
575
|
+
...et.tags,
|
|
576
|
+
u,
|
|
577
|
+
re,
|
|
578
|
+
_e,
|
|
579
|
+
Me,
|
|
580
|
+
Ve,
|
|
581
|
+
Ne,
|
|
582
|
+
Le,
|
|
583
|
+
Ge,
|
|
584
|
+
Ke,
|
|
585
|
+
Je
|
|
586
|
+
]), it = i("tag:yaml.org,2002:map", {
|
|
587
|
+
create: () => /* @__PURE__ */ new Map(),
|
|
588
|
+
addPair: (e, t, n) => (e.set(t, n), ""),
|
|
589
|
+
has: (e, t) => e.has(t),
|
|
590
|
+
keys: (e) => e.keys(),
|
|
591
|
+
get: (e, t) => e.get(t),
|
|
592
|
+
identify: (e) => e instanceof Map || Ue(e),
|
|
593
|
+
represent: (e) => {
|
|
594
|
+
if (e instanceof Map) return e;
|
|
595
|
+
let t = /* @__PURE__ */ new Map(), n = e;
|
|
596
|
+
for (let e of Object.keys(n)) t.set(e, n[e]);
|
|
597
|
+
return t;
|
|
598
|
+
}
|
|
599
|
+
});
|
|
600
|
+
//#endregion
|
|
601
|
+
//#region src/tag/mapping/legacy_map.ts
|
|
602
|
+
function at(e) {
|
|
603
|
+
if (Array.isArray(e)) {
|
|
604
|
+
let t = Array.prototype.slice.call(e);
|
|
605
|
+
for (let e = 0; e < t.length; e++) {
|
|
606
|
+
if (Array.isArray(t[e])) return null;
|
|
607
|
+
typeof t[e] == "object" && Object.prototype.toString.call(t[e]) === "[object Object]" && (t[e] = "[object Object]");
|
|
608
|
+
}
|
|
609
|
+
return String(t);
|
|
610
|
+
}
|
|
611
|
+
return typeof e == "object" && Object.prototype.toString.call(e) === "[object Object]" ? "[object Object]" : String(e);
|
|
612
|
+
}
|
|
613
|
+
var ot = i("tag:yaml.org,2002:map", {
|
|
614
|
+
create: () => ({}),
|
|
615
|
+
identify: Ue,
|
|
616
|
+
represent: (e) => {
|
|
617
|
+
let t = /* @__PURE__ */ new Map();
|
|
618
|
+
for (let n of Object.keys(e)) t.set(n, e[n]);
|
|
619
|
+
return t;
|
|
620
|
+
},
|
|
621
|
+
addPair: (e, t, n) => {
|
|
622
|
+
let r = at(t);
|
|
623
|
+
return r === null ? "nested arrays are not supported inside keys" : (r === "__proto__" ? Object.defineProperty(e, r, {
|
|
624
|
+
value: n,
|
|
625
|
+
enumerable: !0,
|
|
626
|
+
configurable: !0,
|
|
627
|
+
writable: !0
|
|
628
|
+
}) : e[r] = n, "");
|
|
629
|
+
},
|
|
630
|
+
has: (e, t) => {
|
|
631
|
+
let n = at(t);
|
|
632
|
+
return n !== null && Object.prototype.hasOwnProperty.call(e, n);
|
|
633
|
+
},
|
|
634
|
+
keys: (e) => Object.keys(e),
|
|
635
|
+
get: (e, t) => e[String(t)]
|
|
636
|
+
});
|
|
637
|
+
//#endregion
|
|
638
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/objectSpread2.js
|
|
639
|
+
function st(e, t) {
|
|
640
|
+
var n = Object.keys(e);
|
|
641
|
+
if (Object.getOwnPropertySymbols) {
|
|
642
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
643
|
+
t && (r = r.filter(function(t) {
|
|
644
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
645
|
+
})), n.push.apply(n, r);
|
|
646
|
+
}
|
|
647
|
+
return n;
|
|
648
|
+
}
|
|
649
|
+
function y(e) {
|
|
650
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
651
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
652
|
+
t % 2 ? st(Object(n), !0).forEach(function(t) {
|
|
653
|
+
_(e, t, n[t]);
|
|
654
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : st(Object(n)).forEach(function(t) {
|
|
655
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
return e;
|
|
659
|
+
}
|
|
660
|
+
//#endregion
|
|
661
|
+
//#region src/common/snippet.ts
|
|
662
|
+
var ct = {
|
|
663
|
+
maxLength: 79,
|
|
664
|
+
indent: 1,
|
|
665
|
+
linesBefore: 3,
|
|
666
|
+
linesAfter: 2
|
|
667
|
+
};
|
|
668
|
+
function lt(e, t, n, r, i) {
|
|
669
|
+
let a = "", o = "", s = Math.floor(i / 2) - 1;
|
|
670
|
+
return r - t > s && (a = " ... ", t = r - s + a.length), n - r > s && (o = " ...", n = r + s - o.length), {
|
|
671
|
+
str: a + e.slice(t, n).replace(/\t/g, "→") + o,
|
|
672
|
+
pos: r - t + a.length
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
function ut(e, t) {
|
|
676
|
+
return " ".repeat(Math.max(t - e.length, 0)) + e;
|
|
677
|
+
}
|
|
678
|
+
function dt(e, t) {
|
|
679
|
+
if (!e.buffer) return null;
|
|
680
|
+
let n = y(y({}, ct), t), r = /\r?\n|\r|\0/g, i = [0], a = [], o, s = -1;
|
|
681
|
+
for (; o = r.exec(e.buffer);) a.push(o.index), i.push(o.index + o[0].length), e.position <= o.index && s < 0 && (s = i.length - 2);
|
|
682
|
+
s < 0 && (s = i.length - 1);
|
|
683
|
+
let c = "", l = Math.min(e.line + n.linesAfter, a.length).toString().length, u = n.maxLength - (n.indent + l + 3);
|
|
684
|
+
for (let t = 1; t <= n.linesBefore && !(s - t < 0); t++) {
|
|
685
|
+
let r = lt(e.buffer, i[s - t], a[s - t], e.position - (i[s] - i[s - t]), u);
|
|
686
|
+
c = `${" ".repeat(n.indent)}${ut((e.line - t + 1).toString(), l)} | ${r.str}\n${c}`;
|
|
687
|
+
}
|
|
688
|
+
let d = lt(e.buffer, i[s], a[s], e.position, u);
|
|
689
|
+
c += `${" ".repeat(n.indent)}${ut((e.line + 1).toString(), l)} | ${d.str}\n`, c += `${"-".repeat(n.indent + l + 3 + d.pos)}^\n`;
|
|
690
|
+
for (let t = 1; t <= n.linesAfter && !(s + t >= a.length); t++) {
|
|
691
|
+
let r = lt(e.buffer, i[s + t], a[s + t], e.position - (i[s] - i[s + t]), u);
|
|
692
|
+
c += `${" ".repeat(n.indent)}${ut((e.line + t + 1).toString(), l)} | ${r.str}\n`;
|
|
693
|
+
}
|
|
694
|
+
return c.replace(/\n$/, "");
|
|
695
|
+
}
|
|
696
|
+
//#endregion
|
|
697
|
+
//#region src/common/exception.ts
|
|
698
|
+
function ft(e, t) {
|
|
699
|
+
let n = "";
|
|
700
|
+
return e.mark ? (e.mark.name && (n += `in "${e.mark.name}" `), n += `(${e.mark.line + 1}:${e.mark.column + 1})`, !t && e.mark.snippet && (n += `\n\n${e.mark.snippet}`), `${e.reason} ${n}`) : e.reason;
|
|
701
|
+
}
|
|
702
|
+
var b = class extends Error {
|
|
703
|
+
constructor(e, t) {
|
|
704
|
+
super(), _(this, "reason", void 0), _(this, "mark", void 0), this.name = "YAMLException", this.reason = e, this.mark = t, this.message = ft(this, !1), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
|
|
705
|
+
}
|
|
706
|
+
toString(e) {
|
|
707
|
+
return `${this.name}: ${ft(this, e)}`;
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
function pt(e, t, n, r = "") {
|
|
711
|
+
let i = 0, a = 0;
|
|
712
|
+
for (let n = 0; n < t; n++) {
|
|
713
|
+
let t = e.charCodeAt(n);
|
|
714
|
+
t === 10 ? (i++, a = n + 1) : t === 13 && (i++, e.charCodeAt(n + 1) === 10 && n++, a = n + 1);
|
|
715
|
+
}
|
|
716
|
+
let o = {
|
|
717
|
+
name: r,
|
|
718
|
+
buffer: e,
|
|
719
|
+
position: t,
|
|
720
|
+
line: i,
|
|
721
|
+
column: t - a
|
|
722
|
+
};
|
|
723
|
+
throw o.snippet = dt(o), new b(n, o);
|
|
724
|
+
}
|
|
725
|
+
//#endregion
|
|
726
|
+
//#region src/parser/events.ts
|
|
727
|
+
var mt = 1, ht = 2, gt = 3, _t = 4, vt = 5, yt = 6, bt = 1, xt = 2, St = 3, Ct = 4, wt = 5, Tt = 1, Et = 2, Dt = 1, Ot = 2, kt = 3, At = -1;
|
|
728
|
+
function jt(e) {
|
|
729
|
+
switch (e) {
|
|
730
|
+
case 48: return "\0";
|
|
731
|
+
case 97: return "\x07";
|
|
732
|
+
case 98: return "\b";
|
|
733
|
+
case 116: return " ";
|
|
734
|
+
case 9: return " ";
|
|
735
|
+
case 110: return "\n";
|
|
736
|
+
case 118: return "\v";
|
|
737
|
+
case 102: return "\f";
|
|
738
|
+
case 114: return "\r";
|
|
739
|
+
case 101: return "\x1B";
|
|
740
|
+
case 32: return " ";
|
|
741
|
+
case 34: return "\"";
|
|
742
|
+
case 47: return "/";
|
|
743
|
+
case 92: return "\\";
|
|
744
|
+
case 78: return "
";
|
|
745
|
+
case 95: return "\xA0";
|
|
746
|
+
case 76: return "\u2028";
|
|
747
|
+
case 80: return "\u2029";
|
|
748
|
+
default: return "";
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
var Mt = Array(256), Nt = Array(256);
|
|
752
|
+
for (let e = 0; e < 256; e++) Mt[e] = +!!jt(e), Nt[e] = jt(e);
|
|
753
|
+
function Pt(e) {
|
|
754
|
+
return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode((e - 65536 >> 10) + 55296, (e - 65536 & 1023) + 56320);
|
|
755
|
+
}
|
|
756
|
+
function Ft(e) {
|
|
757
|
+
return e >= 48 && e <= 57 ? e - 48 : (e | 32) - 97 + 10;
|
|
758
|
+
}
|
|
759
|
+
function It(e) {
|
|
760
|
+
return e === 120 ? 2 : e === 117 ? 4 : 8;
|
|
761
|
+
}
|
|
762
|
+
function Lt(e, t, n) {
|
|
763
|
+
let r = 0;
|
|
764
|
+
for (; t < n;) {
|
|
765
|
+
let n = e.charCodeAt(t);
|
|
766
|
+
if (n === 10) r++, t++;
|
|
767
|
+
else if (n === 13) r++, t++, e.charCodeAt(t) === 10 && t++;
|
|
768
|
+
else if (n === 32 || n === 9) t++;
|
|
769
|
+
else break;
|
|
770
|
+
}
|
|
771
|
+
return {
|
|
772
|
+
position: t,
|
|
773
|
+
breaks: r
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
function Rt(e) {
|
|
777
|
+
return e === 1 ? " " : "\n".repeat(e - 1);
|
|
778
|
+
}
|
|
779
|
+
function zt(e, t, n) {
|
|
780
|
+
let r = "", i = t, a = t, o = t;
|
|
781
|
+
for (; i < n;) {
|
|
782
|
+
let t = e.charCodeAt(i);
|
|
783
|
+
if (t === 10 || t === 13) {
|
|
784
|
+
r += e.slice(a, o);
|
|
785
|
+
let t = Lt(e, i, n);
|
|
786
|
+
r += Rt(t.breaks), i = a = o = t.position;
|
|
787
|
+
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
788
|
+
}
|
|
789
|
+
return r + e.slice(a, o);
|
|
790
|
+
}
|
|
791
|
+
function Bt(e, t, n) {
|
|
792
|
+
let r = "", i = t, a = t, o = t;
|
|
793
|
+
for (; i < n;) {
|
|
794
|
+
let t = e.charCodeAt(i);
|
|
795
|
+
if (t === 39) r += e.slice(a, i) + "'", i += 2, a = o = i;
|
|
796
|
+
else if (t === 10 || t === 13) {
|
|
797
|
+
r += e.slice(a, o);
|
|
798
|
+
let t = Lt(e, i, n);
|
|
799
|
+
r += Rt(t.breaks), i = a = o = t.position;
|
|
800
|
+
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
801
|
+
}
|
|
802
|
+
return r + e.slice(a, n);
|
|
803
|
+
}
|
|
804
|
+
function Vt(e, t, n) {
|
|
805
|
+
let r = "", i = t, a = t, o = t;
|
|
806
|
+
for (; i < n;) {
|
|
807
|
+
let t = e.charCodeAt(i);
|
|
808
|
+
if (t === 92) {
|
|
809
|
+
r += e.slice(a, i), i++;
|
|
810
|
+
let t = e.charCodeAt(i);
|
|
811
|
+
if (t === 10 || t === 13) i = Lt(e, i, n).position;
|
|
812
|
+
else if (t < 256 && Mt[t]) r += Nt[t], i++;
|
|
813
|
+
else {
|
|
814
|
+
let n = It(t), a = 0;
|
|
815
|
+
for (; n > 0; n--) {
|
|
816
|
+
i++;
|
|
817
|
+
let t = Ft(e.charCodeAt(i));
|
|
818
|
+
a = (a << 4) + t;
|
|
819
|
+
}
|
|
820
|
+
r += Pt(a), i++;
|
|
821
|
+
}
|
|
822
|
+
a = o = i;
|
|
823
|
+
} else if (t === 10 || t === 13) {
|
|
824
|
+
r += e.slice(a, o);
|
|
825
|
+
let t = Lt(e, i, n);
|
|
826
|
+
r += Rt(t.breaks), i = a = o = t.position;
|
|
827
|
+
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
828
|
+
}
|
|
829
|
+
return r + e.slice(a, n);
|
|
830
|
+
}
|
|
831
|
+
function Ht(e, t, n, r, i, a) {
|
|
832
|
+
let o = r < 0 ? 0 : r, s = e.slice(t, n).replace(/\r\n?/g, "\n"), c = s === "" ? [] : (s.endsWith("\n") ? s.slice(0, -1) : s).split("\n"), l = "", u = !1, d = 0, f = !1;
|
|
833
|
+
for (let e of c) {
|
|
834
|
+
let t = 0;
|
|
835
|
+
for (; t < o && e.charCodeAt(t) === 32;) t++;
|
|
836
|
+
if (r < 0 || t >= e.length) {
|
|
837
|
+
d++;
|
|
838
|
+
continue;
|
|
839
|
+
}
|
|
840
|
+
let n = e.slice(o), i = n.charCodeAt(0);
|
|
841
|
+
a ? i === 32 || i === 9 ? (f = !0, l += "\n".repeat(u ? 1 + d : d)) : f ? (f = !1, l += "\n".repeat(d + 1)) : d === 0 ? u && (l += " ") : l += "\n".repeat(d) : l += "\n".repeat(u ? 1 + d : d), l += n, u = !0, d = 0;
|
|
842
|
+
}
|
|
843
|
+
return i === 3 ? l += "\n".repeat(u ? 1 + d : d) : i !== 2 && u && (l += "\n"), l;
|
|
844
|
+
}
|
|
845
|
+
function Ut(e, t) {
|
|
846
|
+
if (t.valueStart === At) return "";
|
|
847
|
+
let { valueStart: n, valueEnd: r } = t;
|
|
848
|
+
if (t.fast) return e.slice(n, r);
|
|
849
|
+
switch (t.style) {
|
|
850
|
+
case 2: return Bt(e, n, r);
|
|
851
|
+
case 3: return Vt(e, n, r);
|
|
852
|
+
case 4: return Ht(e, n, r, t.indent, t.chomping, !1);
|
|
853
|
+
case 5: return Ht(e, n, r, t.indent, t.chomping, !0);
|
|
854
|
+
default: return zt(e, n, r);
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
//#endregion
|
|
858
|
+
//#region src/common/tagname.ts
|
|
859
|
+
var Wt = {
|
|
860
|
+
"!": "!",
|
|
861
|
+
"!!": "tag:yaml.org,2002:"
|
|
862
|
+
};
|
|
863
|
+
function Gt(e) {
|
|
864
|
+
return encodeURI(e).replace(/!/g, "%21");
|
|
865
|
+
}
|
|
866
|
+
function Kt(e, t) {
|
|
867
|
+
var n, r;
|
|
868
|
+
if (e.startsWith("!<") && e.endsWith(">")) return decodeURIComponent(e.slice(2, -1));
|
|
869
|
+
let i = e.indexOf("!", 1), a = i === -1 ? "!" : e.slice(0, i + 1), o = (n = (r = t == null ? void 0 : t[a]) == null ? Wt[a] : r) == null ? a : n;
|
|
870
|
+
return decodeURIComponent(o) + decodeURIComponent(e.slice(a.length));
|
|
871
|
+
}
|
|
872
|
+
function qt(e) {
|
|
873
|
+
let t = e;
|
|
874
|
+
return t.charCodeAt(0) === 33 ? (t = t.slice(1), `!${Gt(t)}`) : t.slice(0, 18) === "tag:yaml.org,2002:" ? `!!${Gt(t.slice(18))}` : `!<${Gt(t)}>`;
|
|
875
|
+
}
|
|
876
|
+
//#endregion
|
|
877
|
+
//#region src/parser/constructor.ts
|
|
878
|
+
var x = -1, Jt = {
|
|
879
|
+
filename: "",
|
|
880
|
+
schema: nt,
|
|
881
|
+
json: !1,
|
|
882
|
+
maxTotalMergeKeys: 1e4,
|
|
883
|
+
maxAliases: -1
|
|
884
|
+
};
|
|
885
|
+
function Yt(e) {
|
|
886
|
+
return "tagStart" in e && e.tagStart !== x ? e.tagStart : "anchorStart" in e && e.anchorStart !== x ? e.anchorStart : "valueStart" in e && e.valueStart !== x ? e.valueStart : "start" in e ? e.start : 0;
|
|
887
|
+
}
|
|
888
|
+
function S(e, t) {
|
|
889
|
+
pt(e.source, e.position, t, e.filename);
|
|
890
|
+
}
|
|
891
|
+
function Xt(e, t, n, r) {
|
|
892
|
+
try {
|
|
893
|
+
return n.finalize(r);
|
|
894
|
+
} catch (n) {
|
|
895
|
+
if (n instanceof b) throw n;
|
|
896
|
+
pt(e.source, t, n instanceof Error ? n.message : String(n), e.filename);
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
function Zt(e, t, n) {
|
|
900
|
+
let r = e[n];
|
|
901
|
+
if (r) return r;
|
|
902
|
+
for (let e of t) if (n.startsWith(e.tagName)) return e;
|
|
903
|
+
}
|
|
904
|
+
function Qt(e, t, n, r, i) {
|
|
905
|
+
let a = Zt(t, n, r);
|
|
906
|
+
if (a) return a;
|
|
907
|
+
S(e, `unknown ${i} tag !<${r}>`);
|
|
908
|
+
}
|
|
909
|
+
function $t(t, n) {
|
|
910
|
+
let r = Ut(t.source, n), i = n.tagStart === x ? "" : t.source.slice(n.tagStart, n.tagEnd), a = t.schema.defaultScalarTag;
|
|
911
|
+
if (i !== "") {
|
|
912
|
+
var o;
|
|
913
|
+
if (i === "!") return {
|
|
914
|
+
value: r,
|
|
915
|
+
tag: a
|
|
916
|
+
};
|
|
917
|
+
let n = Kt(i, t.tagHandlers), s = Zt(t.schema.exact.scalar, t.schema.prefix.scalar, n);
|
|
918
|
+
if (s) {
|
|
919
|
+
let i = s.resolve(r, !0, n);
|
|
920
|
+
return i === e && S(t, `cannot resolve a node with !<${n}> explicit tag`), {
|
|
921
|
+
value: i,
|
|
922
|
+
tag: s
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
let c = (o = Zt(t.schema.exact.mapping, t.schema.prefix.mapping, n)) == null ? Zt(t.schema.exact.sequence, t.schema.prefix.sequence, n) : o;
|
|
926
|
+
if (c) {
|
|
927
|
+
r !== "" && S(t, `cannot resolve a node with !<${n}> explicit tag`);
|
|
928
|
+
let e = c.create(n);
|
|
929
|
+
return {
|
|
930
|
+
value: c.carrierIsResult ? e : Xt(t, t.position, c, e),
|
|
931
|
+
tag: c
|
|
932
|
+
};
|
|
933
|
+
}
|
|
934
|
+
S(t, `unknown scalar tag !<${n}>`);
|
|
935
|
+
}
|
|
936
|
+
if (n.style === 1) {
|
|
937
|
+
var s;
|
|
938
|
+
let n = (s = t.schema.implicitScalarByFirstChar.get(r.charAt(0))) == null ? t.schema.implicitScalarAnyFirstChar : s;
|
|
939
|
+
for (let t of n) {
|
|
940
|
+
let n = t.resolve(r, !1, t.tagName);
|
|
941
|
+
if (n !== e) return {
|
|
942
|
+
value: n,
|
|
943
|
+
tag: t
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
return {
|
|
948
|
+
value: a.resolve(r, !1, a.tagName),
|
|
949
|
+
tag: a
|
|
950
|
+
};
|
|
951
|
+
}
|
|
952
|
+
function en(e, t, n, r, i, a) {
|
|
953
|
+
let o = t.tagStart === x ? "" : e.source.slice(t.tagStart, t.tagEnd), s = o === "" || o === "!" ? i : Kt(o, e.tagHandlers);
|
|
954
|
+
return {
|
|
955
|
+
tagName: s,
|
|
956
|
+
tag: Qt(e, n, r, s, a)
|
|
957
|
+
};
|
|
958
|
+
}
|
|
959
|
+
function tn(e) {
|
|
960
|
+
return e.nodeKind === "mapping";
|
|
961
|
+
}
|
|
962
|
+
function nn(e, t, n, r) {
|
|
963
|
+
for (let a of r.keys(n)) {
|
|
964
|
+
var i;
|
|
965
|
+
if (e.maxTotalMergeKeys !== -1 && ++e.totalMergeKeys > e.maxTotalMergeKeys && S(e, `merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`), t.tag.has(t.value, a)) continue;
|
|
966
|
+
let o = t.tag.addPair(t.value, a, r.get(n, a));
|
|
967
|
+
o && S(e, o), ((i = t.overridable) == null ? t.overridable = /* @__PURE__ */ new Set() : i).add(a);
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
function rn(e, t, n, r) {
|
|
971
|
+
if (e.position = t.keyPosition, tn(r)) nn(e, t, n, r);
|
|
972
|
+
else if (r.nodeKind === "sequence" && Array.isArray(n)) for (let r of n) nn(e, t, r, t.tag);
|
|
973
|
+
else S(e, "cannot merge mappings; the provided source object is unacceptable");
|
|
974
|
+
}
|
|
975
|
+
function an(e, n, r, i, a) {
|
|
976
|
+
var o, s;
|
|
977
|
+
if (e.position = n.keyPosition, r === t) {
|
|
978
|
+
rn(e, n, i, a);
|
|
979
|
+
return;
|
|
980
|
+
}
|
|
981
|
+
!e.json && n.tag.has(n.value, r) && !((o = n.overridable) != null && o.has(r)) && S(e, "duplicated mapping key");
|
|
982
|
+
let c = n.tag.addPair(n.value, r, i);
|
|
983
|
+
c && S(e, c), (s = n.overridable) == null || s.delete(r);
|
|
984
|
+
}
|
|
985
|
+
function on(e, t, n) {
|
|
986
|
+
let r = e.frames[e.frames.length - 1];
|
|
987
|
+
if (r.kind === "document") r.value = t, r.hasValue = !0;
|
|
988
|
+
else if (r.kind === "sequence") {
|
|
989
|
+
r.merge && (tn(n) || S(e, "cannot merge mappings; the provided source object is unacceptable"));
|
|
990
|
+
let i = r.tag.addItem(r.value, t, r.index++);
|
|
991
|
+
i && S(e, i);
|
|
992
|
+
} else if (r.hasKey) {
|
|
993
|
+
let i = r.key;
|
|
994
|
+
r.key = void 0, r.hasKey = !1, an(e, r, i, t, n);
|
|
995
|
+
} else r.key = t, r.keyPosition = e.position, r.hasKey = !0;
|
|
996
|
+
}
|
|
997
|
+
function sn(e, t, n, r, i) {
|
|
998
|
+
if (t.anchorStart !== x) {
|
|
999
|
+
let a = {
|
|
1000
|
+
value: n,
|
|
1001
|
+
tag: r,
|
|
1002
|
+
isValueFinal: i
|
|
1003
|
+
};
|
|
1004
|
+
return e.anchors.set(e.source.slice(t.anchorStart, t.anchorEnd), a), a;
|
|
1005
|
+
}
|
|
1006
|
+
return null;
|
|
1007
|
+
}
|
|
1008
|
+
function cn(e, n) {
|
|
1009
|
+
let r = y(y(y({}, Jt), n), {}, {
|
|
1010
|
+
events: e,
|
|
1011
|
+
documents: [],
|
|
1012
|
+
eventIndex: 0,
|
|
1013
|
+
position: 0,
|
|
1014
|
+
frames: [],
|
|
1015
|
+
anchors: /* @__PURE__ */ new Map(),
|
|
1016
|
+
tagHandlers: Object.create(null),
|
|
1017
|
+
totalMergeKeys: 0,
|
|
1018
|
+
aliasCount: 0
|
|
1019
|
+
});
|
|
1020
|
+
for (; r.eventIndex < r.events.length;) {
|
|
1021
|
+
let e = r.events[r.eventIndex++];
|
|
1022
|
+
switch (r.position = Yt(e), e.type) {
|
|
1023
|
+
case 1:
|
|
1024
|
+
r.anchors = /* @__PURE__ */ new Map(), r.aliasCount = 0, r.tagHandlers = Object.create(null);
|
|
1025
|
+
for (let t of e.directives) t.kind === "tag" && (r.tagHandlers[t.handle] = t.prefix);
|
|
1026
|
+
r.frames.push({
|
|
1027
|
+
kind: "document",
|
|
1028
|
+
position: r.position,
|
|
1029
|
+
value: void 0,
|
|
1030
|
+
hasValue: !1
|
|
1031
|
+
});
|
|
1032
|
+
break;
|
|
1033
|
+
case 4: {
|
|
1034
|
+
let { value: t, tag: n } = $t(r, e);
|
|
1035
|
+
sn(r, e, t, n, !0), on(r, t, n);
|
|
1036
|
+
break;
|
|
1037
|
+
}
|
|
1038
|
+
case 2: {
|
|
1039
|
+
let n = en(r, e, r.schema.exact.sequence, r.schema.prefix.sequence, "tag:yaml.org,2002:seq", "sequence"), i = n.tag.create(n.tagName), a = sn(r, e, i, n.tag, n.tag.carrierIsResult), o = r.frames[r.frames.length - 1], s = o !== void 0 && o.kind === "mapping" && o.hasKey && o.key === t;
|
|
1040
|
+
r.frames.push({
|
|
1041
|
+
kind: "sequence",
|
|
1042
|
+
position: r.position,
|
|
1043
|
+
value: i,
|
|
1044
|
+
tag: n.tag,
|
|
1045
|
+
anchor: a,
|
|
1046
|
+
index: 0,
|
|
1047
|
+
merge: s
|
|
1048
|
+
});
|
|
1049
|
+
break;
|
|
1050
|
+
}
|
|
1051
|
+
case 3: {
|
|
1052
|
+
let t = en(r, e, r.schema.exact.mapping, r.schema.prefix.mapping, "tag:yaml.org,2002:map", "mapping"), n = t.tag.create(t.tagName), i = sn(r, e, n, t.tag, t.tag.carrierIsResult);
|
|
1053
|
+
r.frames.push({
|
|
1054
|
+
kind: "mapping",
|
|
1055
|
+
position: r.position,
|
|
1056
|
+
value: n,
|
|
1057
|
+
tag: t.tag,
|
|
1058
|
+
anchor: i,
|
|
1059
|
+
key: void 0,
|
|
1060
|
+
keyPosition: r.position,
|
|
1061
|
+
hasKey: !1,
|
|
1062
|
+
overridable: null
|
|
1063
|
+
});
|
|
1064
|
+
break;
|
|
1065
|
+
}
|
|
1066
|
+
case 5: {
|
|
1067
|
+
r.maxAliases !== -1 && ++r.aliasCount > r.maxAliases && S(r, `aliases exceeded maxAliases (${r.maxAliases})`);
|
|
1068
|
+
let t = r.source.slice(e.anchorStart, e.anchorEnd), n = r.anchors.get(t);
|
|
1069
|
+
n || S(r, `unidentified alias "${t}"`), n.isValueFinal || S(r, `recursive alias "${t}" is not supported for tag ${n.tag.tagName} because it uses finalize()`), on(r, n.value, n.tag);
|
|
1070
|
+
break;
|
|
1071
|
+
}
|
|
1072
|
+
case 6: {
|
|
1073
|
+
let e = r.frames.pop();
|
|
1074
|
+
if (e.kind === "document") r.documents.push(e.value);
|
|
1075
|
+
else {
|
|
1076
|
+
let t = e.tag.carrierIsResult ? e.value : Xt(r, e.position, e.tag, e.value);
|
|
1077
|
+
e.anchor && (e.anchor.value = t, e.anchor.isValueFinal = !0), on(r, t, e.tag);
|
|
1078
|
+
}
|
|
1079
|
+
break;
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
return r.documents;
|
|
1084
|
+
}
|
|
1085
|
+
//#endregion
|
|
1086
|
+
//#region src/parser/parser.ts
|
|
1087
|
+
var C = -1, ln = Object.prototype.hasOwnProperty, w = 1, un = 2, dn = 3, fn = 4, pn = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, mn = /[,\[\]{}]/, hn = /^(?:!|!!|![0-9A-Za-z-]+!)$/, gn = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`, _n = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`, vn = RegExp(`^(?:${gn})*$`), yn = RegExp(`^(?:${_n})+$`), bn = RegExp(`^(?:!(?:${gn})*|${_n}(?:${gn})*)$`), xn = {
|
|
1088
|
+
filename: "",
|
|
1089
|
+
maxDepth: 100
|
|
1090
|
+
};
|
|
1091
|
+
function Sn(e, t, n) {
|
|
1092
|
+
e.events.push({
|
|
1093
|
+
type: 1,
|
|
1094
|
+
explicitStart: t,
|
|
1095
|
+
explicitEnd: n,
|
|
1096
|
+
directives: e.directives
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1099
|
+
function Cn(e, t, n, r, i, a, o) {
|
|
1100
|
+
e.events.push({
|
|
1101
|
+
type: 2,
|
|
1102
|
+
start: t,
|
|
1103
|
+
anchorStart: n,
|
|
1104
|
+
anchorEnd: r,
|
|
1105
|
+
tagStart: i,
|
|
1106
|
+
tagEnd: a,
|
|
1107
|
+
style: o
|
|
1108
|
+
});
|
|
1109
|
+
}
|
|
1110
|
+
function T(e, t, n, r, i, a, o) {
|
|
1111
|
+
e.events.push({
|
|
1112
|
+
type: 3,
|
|
1113
|
+
start: t,
|
|
1114
|
+
anchorStart: n,
|
|
1115
|
+
anchorEnd: r,
|
|
1116
|
+
tagStart: i,
|
|
1117
|
+
tagEnd: a,
|
|
1118
|
+
style: o
|
|
1119
|
+
});
|
|
1120
|
+
}
|
|
1121
|
+
function E(e, t, n, r, i, a, o, s, c = 1, l = -1, u = !1) {
|
|
1122
|
+
e.events.push({
|
|
1123
|
+
type: 4,
|
|
1124
|
+
valueStart: t,
|
|
1125
|
+
valueEnd: n,
|
|
1126
|
+
anchorStart: r,
|
|
1127
|
+
anchorEnd: i,
|
|
1128
|
+
tagStart: a,
|
|
1129
|
+
tagEnd: o,
|
|
1130
|
+
style: s,
|
|
1131
|
+
chomping: c,
|
|
1132
|
+
indent: l,
|
|
1133
|
+
fast: u
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
function wn(e, t, n) {
|
|
1137
|
+
e.events.push({
|
|
1138
|
+
type: 5,
|
|
1139
|
+
anchorStart: t,
|
|
1140
|
+
anchorEnd: n
|
|
1141
|
+
});
|
|
1142
|
+
}
|
|
1143
|
+
function D(e) {
|
|
1144
|
+
e.events.push({ type: 6 });
|
|
1145
|
+
}
|
|
1146
|
+
function O(e) {
|
|
1147
|
+
E(e, C, C, C, C, C, C, 1);
|
|
1148
|
+
}
|
|
1149
|
+
function Tn() {
|
|
1150
|
+
return {
|
|
1151
|
+
anchorStart: C,
|
|
1152
|
+
anchorEnd: C,
|
|
1153
|
+
tagStart: C,
|
|
1154
|
+
tagEnd: C
|
|
1155
|
+
};
|
|
1156
|
+
}
|
|
1157
|
+
function k(e) {
|
|
1158
|
+
return {
|
|
1159
|
+
position: e.position,
|
|
1160
|
+
line: e.line,
|
|
1161
|
+
lineStart: e.lineStart,
|
|
1162
|
+
lineIndent: e.lineIndent,
|
|
1163
|
+
firstTabInLine: e.firstTabInLine,
|
|
1164
|
+
eventsLength: e.events.length
|
|
1165
|
+
};
|
|
1166
|
+
}
|
|
1167
|
+
function A(e, t) {
|
|
1168
|
+
e.position = t.position, e.line = t.line, e.lineStart = t.lineStart, e.lineIndent = t.lineIndent, e.firstTabInLine = t.firstTabInLine, e.events.length = t.eventsLength;
|
|
1169
|
+
}
|
|
1170
|
+
function j(e, t) {
|
|
1171
|
+
pt(e.input.slice(0, e.length), e.position, t, e.filename);
|
|
1172
|
+
}
|
|
1173
|
+
function M(e) {
|
|
1174
|
+
return e === 10 || e === 13;
|
|
1175
|
+
}
|
|
1176
|
+
function N(e) {
|
|
1177
|
+
return e === 9 || e === 32;
|
|
1178
|
+
}
|
|
1179
|
+
function P(e) {
|
|
1180
|
+
return N(e) || M(e);
|
|
1181
|
+
}
|
|
1182
|
+
function F(e) {
|
|
1183
|
+
return e === 0 || P(e);
|
|
1184
|
+
}
|
|
1185
|
+
function I(e) {
|
|
1186
|
+
return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
|
|
1187
|
+
}
|
|
1188
|
+
function En(e) {
|
|
1189
|
+
return e >= 48 && e <= 57 ? e - 48 : -1;
|
|
1190
|
+
}
|
|
1191
|
+
function Dn(e) {
|
|
1192
|
+
if (e >= 48 && e <= 57) return e - 48;
|
|
1193
|
+
let t = e | 32;
|
|
1194
|
+
return t >= 97 && t <= 102 ? t - 97 + 10 : -1;
|
|
1195
|
+
}
|
|
1196
|
+
function On(e) {
|
|
1197
|
+
return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
|
|
1198
|
+
}
|
|
1199
|
+
function kn(e) {
|
|
1200
|
+
return e === 48 || e === 97 || e === 98 || e === 116 || e === 9 || e === 110 || e === 118 || e === 102 || e === 114 || e === 101 || e === 32 || e === 34 || e === 47 || e === 92 || e === 78 || e === 95 || e === 76 || e === 80;
|
|
1201
|
+
}
|
|
1202
|
+
function An(e) {
|
|
1203
|
+
e.input.charCodeAt(e.position) === 10 ? e.position++ : (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++), e.line++, e.lineStart = e.position, e.lineIndent = 0, e.firstTabInLine = -1;
|
|
1204
|
+
}
|
|
1205
|
+
function L(e, t) {
|
|
1206
|
+
let n = 0, r = e.input.charCodeAt(e.position), i = e.position === e.lineStart || P(e.input.charCodeAt(e.position - 1));
|
|
1207
|
+
for (; r !== 0;) {
|
|
1208
|
+
for (; N(r);) i = !0, r === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), r = e.input.charCodeAt(++e.position);
|
|
1209
|
+
if (t && i && r === 35) do
|
|
1210
|
+
r = e.input.charCodeAt(++e.position);
|
|
1211
|
+
while (!M(r) && r !== 0);
|
|
1212
|
+
if (!M(r)) break;
|
|
1213
|
+
for (An(e), n++, i = !0, r = e.input.charCodeAt(e.position); r === 32;) e.lineIndent++, r = e.input.charCodeAt(++e.position);
|
|
1214
|
+
}
|
|
1215
|
+
return n;
|
|
1216
|
+
}
|
|
1217
|
+
function R(e, t = e.position) {
|
|
1218
|
+
let n = e.input.charCodeAt(t);
|
|
1219
|
+
if ((n === 45 || n === 46) && n === e.input.charCodeAt(t + 1) && n === e.input.charCodeAt(t + 2)) {
|
|
1220
|
+
let n = e.input.charCodeAt(t + 3);
|
|
1221
|
+
return n === 0 || P(n);
|
|
1222
|
+
}
|
|
1223
|
+
return !1;
|
|
1224
|
+
}
|
|
1225
|
+
function jn(e) {
|
|
1226
|
+
let t = e.input.charCodeAt(e.position);
|
|
1227
|
+
for (; t !== 0 && !M(t);) t = e.input.charCodeAt(++e.position);
|
|
1228
|
+
}
|
|
1229
|
+
function Mn(e, t, n) {
|
|
1230
|
+
pn.test(e.input.slice(t, n)) && j(e, "the stream contains non-printable characters");
|
|
1231
|
+
}
|
|
1232
|
+
function Nn(e, t, n) {
|
|
1233
|
+
if (e.input.charCodeAt(e.position) !== 33) return !1;
|
|
1234
|
+
t.tagStart !== C && j(e, "duplication of a tag property");
|
|
1235
|
+
let r = e.position, i = !1, a = !1, o = "!", s = e.input.charCodeAt(++e.position);
|
|
1236
|
+
s === 60 ? (i = !0, s = e.input.charCodeAt(++e.position)) : s === 33 && (a = !0, o = "!!", s = e.input.charCodeAt(++e.position));
|
|
1237
|
+
let c = e.position, l;
|
|
1238
|
+
if (i) {
|
|
1239
|
+
for (; s !== 0 && s !== 62;) s = e.input.charCodeAt(++e.position);
|
|
1240
|
+
s !== 62 && j(e, "unexpected end of the stream within a verbatim tag"), l = e.input.slice(c, e.position), e.position++;
|
|
1241
|
+
} else {
|
|
1242
|
+
for (; s !== 0 && !P(s) && !(n && I(s));) s === 33 && (a ? j(e, "tag suffix cannot contain exclamation marks") : (o = e.input.slice(c - 1, e.position + 1), hn.test(o) || j(e, "named tag handle cannot contain such characters"), a = !0, c = e.position + 1)), s = e.input.charCodeAt(++e.position);
|
|
1243
|
+
l = e.input.slice(c, e.position), mn.test(l) && j(e, "tag suffix cannot contain flow indicator characters");
|
|
1244
|
+
}
|
|
1245
|
+
return l && !(i ? vn.test(l) : yn.test(l)) && j(e, `tag name cannot contain such characters: ${l}`), !i && o !== "!" && o !== "!!" && !ln.call(e.tagHandlers, o) && j(e, `undeclared tag handle "${o}"`), t.tagStart = r, t.tagEnd = e.position, !0;
|
|
1246
|
+
}
|
|
1247
|
+
function Pn(e, t) {
|
|
1248
|
+
if (e.input.charCodeAt(e.position) !== 38) return !1;
|
|
1249
|
+
t.anchorStart !== C && j(e, "duplication of an anchor property"), e.position++;
|
|
1250
|
+
let n = e.position;
|
|
1251
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !P(e.input.charCodeAt(e.position)) && !I(e.input.charCodeAt(e.position));) e.position++;
|
|
1252
|
+
return e.position === n && j(e, "name of an anchor node must contain at least one character"), t.anchorStart = n, t.anchorEnd = e.position, !0;
|
|
1253
|
+
}
|
|
1254
|
+
function Fn(e, t) {
|
|
1255
|
+
if (e.input.charCodeAt(e.position) !== 42) return !1;
|
|
1256
|
+
(t.anchorStart !== C || t.tagStart !== C) && j(e, "alias node should not have any properties"), e.position++;
|
|
1257
|
+
let n = e.position;
|
|
1258
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !P(e.input.charCodeAt(e.position)) && !I(e.input.charCodeAt(e.position));) e.position++;
|
|
1259
|
+
return e.position === n && j(e, "name of an alias node must contain at least one character"), wn(e, n, e.position), !0;
|
|
1260
|
+
}
|
|
1261
|
+
function In(e, t) {
|
|
1262
|
+
L(e, !1), e.lineIndent < t && j(e, "deficient indentation");
|
|
1263
|
+
}
|
|
1264
|
+
function Ln(e, t, n) {
|
|
1265
|
+
if (e.input.charCodeAt(e.position) !== 39) return !1;
|
|
1266
|
+
e.position++;
|
|
1267
|
+
let r = e.position, i = !0;
|
|
1268
|
+
for (; e.input.charCodeAt(e.position) !== 0;) {
|
|
1269
|
+
let a = e.input.charCodeAt(e.position);
|
|
1270
|
+
if (a === 39) {
|
|
1271
|
+
if (e.input.charCodeAt(e.position + 1) === 39) {
|
|
1272
|
+
i = !1, e.position += 2;
|
|
1273
|
+
continue;
|
|
1274
|
+
}
|
|
1275
|
+
let t = e.position;
|
|
1276
|
+
return e.position++, E(e, r, t, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2, 1, -1, i), !0;
|
|
1277
|
+
}
|
|
1278
|
+
M(a) ? (i = !1, In(e, t)) : e.position === e.lineStart && R(e) ? j(e, "unexpected end of the document within a single quoted scalar") : a !== 9 && a < 32 ? j(e, "expected valid JSON character") : e.position++;
|
|
1279
|
+
}
|
|
1280
|
+
j(e, "unexpected end of the stream within a single quoted scalar");
|
|
1281
|
+
}
|
|
1282
|
+
function Rn(e, t, n) {
|
|
1283
|
+
if (e.input.charCodeAt(e.position) !== 34) return !1;
|
|
1284
|
+
e.position++;
|
|
1285
|
+
let r = e.position, i = !0;
|
|
1286
|
+
for (; e.input.charCodeAt(e.position) !== 0;) {
|
|
1287
|
+
let a = e.input.charCodeAt(e.position);
|
|
1288
|
+
if (a === 34) {
|
|
1289
|
+
let t = e.position;
|
|
1290
|
+
return e.position++, E(e, r, t, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 3, 1, -1, i), !0;
|
|
1291
|
+
}
|
|
1292
|
+
if (a === 92) {
|
|
1293
|
+
i = !1;
|
|
1294
|
+
let n = e.input.charCodeAt(++e.position);
|
|
1295
|
+
if (M(n)) In(e, t);
|
|
1296
|
+
else if (kn(n)) e.position++;
|
|
1297
|
+
else {
|
|
1298
|
+
let t = On(n);
|
|
1299
|
+
for (t === 0 && j(e, "unknown escape sequence"); t-- > 0;) e.position++, Dn(e.input.charCodeAt(e.position)) < 0 && j(e, "expected hexadecimal character");
|
|
1300
|
+
e.position++;
|
|
1301
|
+
}
|
|
1302
|
+
} else M(a) ? (i = !1, In(e, t)) : e.position === e.lineStart && R(e) ? j(e, "unexpected end of the document within a double quoted scalar") : a !== 9 && a < 32 ? j(e, "expected valid JSON character") : e.position++;
|
|
1303
|
+
}
|
|
1304
|
+
j(e, "unexpected end of the stream within a double quoted scalar");
|
|
1305
|
+
}
|
|
1306
|
+
function zn(e, t, n) {
|
|
1307
|
+
let r = e.input.charCodeAt(e.position), i = 1, a = -1, o = !1;
|
|
1308
|
+
if (r !== 124 && r !== 62) return !1;
|
|
1309
|
+
let s = r === 124 ? 4 : 5;
|
|
1310
|
+
for (e.position++; e.input.charCodeAt(e.position) !== 0;) {
|
|
1311
|
+
let n = e.input.charCodeAt(e.position), r = En(n);
|
|
1312
|
+
if (n === 43 || n === 45) i !== 1 && j(e, "repeat of a chomping mode identifier"), i = n === 43 ? 3 : 2, e.position++;
|
|
1313
|
+
else if (r >= 0) r === 0 && j(e, "bad explicit indentation width of a block scalar; it cannot be less than one"), o && j(e, "repeat of an indentation width identifier"), a = t + r - 1, o = !0, e.position++;
|
|
1314
|
+
else break;
|
|
1315
|
+
}
|
|
1316
|
+
let c = !1;
|
|
1317
|
+
for (; N(e.input.charCodeAt(e.position));) c = !0, e.position++;
|
|
1318
|
+
c && e.input.charCodeAt(e.position) === 35 && jn(e), M(e.input.charCodeAt(e.position)) ? An(e) : e.input.charCodeAt(e.position) !== 0 && j(e, "a line break is expected");
|
|
1319
|
+
let l = o ? a : -1, u = 0, d = e.position, f = e.position;
|
|
1320
|
+
for (; e.input.charCodeAt(e.position) !== 0;) {
|
|
1321
|
+
let n = e.position, r = 0;
|
|
1322
|
+
for (; e.input.charCodeAt(n + r) === 32;) r++;
|
|
1323
|
+
let i = e.input.charCodeAt(n + r);
|
|
1324
|
+
if (i === 0) {
|
|
1325
|
+
l >= 0 ? r > l && (f = n + r) : r > 0 && (f = n + r);
|
|
1326
|
+
break;
|
|
1327
|
+
}
|
|
1328
|
+
if (n === e.lineStart && R(e, n)) break;
|
|
1329
|
+
if (!o && l === -1 && M(i) && (u = Math.max(u, r)), !o && l === -1 && !M(i) && (i === 9 && r < t && (e.position = n + r, j(e, "tab characters must not be used in indentation")), r < u && (e.position = n + r, j(e, "bad indentation of a mapping entry"))), l === -1 && i !== 0 && !M(i) && r < t) {
|
|
1330
|
+
e.lineIndent = r, e.position = n + r;
|
|
1331
|
+
break;
|
|
1332
|
+
}
|
|
1333
|
+
!o && i !== 0 && !M(i) && l === -1 && (l = r);
|
|
1334
|
+
let a = l === -1 ? t + 1 : l;
|
|
1335
|
+
if (i !== 0 && !M(i) && r < a) {
|
|
1336
|
+
e.lineIndent = r, e.position = n + r;
|
|
1337
|
+
break;
|
|
1338
|
+
}
|
|
1339
|
+
jn(e), f = e.position, M(e.input.charCodeAt(e.position)) && (An(e), f = e.position);
|
|
1340
|
+
}
|
|
1341
|
+
return Mn(e, d, f), E(e, d, f, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, s, i, l), !0;
|
|
1342
|
+
}
|
|
1343
|
+
function Bn(e, t) {
|
|
1344
|
+
let n = e.input.charCodeAt(e.position), r = t === w;
|
|
1345
|
+
if (n === 0 || P(n) || n === 35 || n === 38 || n === 42 || n === 33 || n === 124 || n === 62 || n === 39 || n === 34 || n === 37 || n === 64 || n === 96 || r && I(n)) return !1;
|
|
1346
|
+
if (n === 63 || n === 45) {
|
|
1347
|
+
let t = e.input.charCodeAt(e.position + 1);
|
|
1348
|
+
if (F(t) || r && I(t)) return !1;
|
|
1349
|
+
}
|
|
1350
|
+
return !0;
|
|
1351
|
+
}
|
|
1352
|
+
function Vn(e, t, n, r) {
|
|
1353
|
+
if (!Bn(e, n)) return !1;
|
|
1354
|
+
let i = e.position, a = e.position, o = e.input.charCodeAt(e.position), s = n === w, c = !1;
|
|
1355
|
+
for (; o !== 0 && !(e.position === e.lineStart && R(e));) {
|
|
1356
|
+
if (o === 58) {
|
|
1357
|
+
let t = e.input.charCodeAt(e.position + 1);
|
|
1358
|
+
if (F(t) || s && I(t)) break;
|
|
1359
|
+
} else if (o === 35) {
|
|
1360
|
+
if (P(e.input.charCodeAt(e.position - 1))) break;
|
|
1361
|
+
} else if (s && I(o)) break;
|
|
1362
|
+
else if (M(o)) {
|
|
1363
|
+
let n = e.position, r = e.line, i = e.lineStart, a = e.lineIndent;
|
|
1364
|
+
if (L(e, !1), e.lineIndent >= t) {
|
|
1365
|
+
c = !0, o = e.input.charCodeAt(e.position);
|
|
1366
|
+
continue;
|
|
1367
|
+
}
|
|
1368
|
+
e.position = n, e.line = r, e.lineStart = i, e.lineIndent = a;
|
|
1369
|
+
break;
|
|
1370
|
+
}
|
|
1371
|
+
N(o) || (a = e.position + 1), o = e.input.charCodeAt(++e.position);
|
|
1372
|
+
}
|
|
1373
|
+
return a === i ? !1 : (Mn(e, i, a), E(e, i, a, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1, 1, -1, !c), !0);
|
|
1374
|
+
}
|
|
1375
|
+
function z(e, t) {
|
|
1376
|
+
let n = e.line;
|
|
1377
|
+
L(e, !0), (e.line > n && e.lineIndent < t || e.firstTabInLine !== -1 && e.lineIndent < t) && j(e, "deficient indentation");
|
|
1378
|
+
}
|
|
1379
|
+
function Hn(e, t, n) {
|
|
1380
|
+
let r = e.input.charCodeAt(e.position), i = r === 123, a = e.position, o = !0;
|
|
1381
|
+
if (r !== 91 && r !== 123) return !1;
|
|
1382
|
+
let s = i ? 125 : 93;
|
|
1383
|
+
for (i ? T(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2) : Cn(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2), e.position++; e.input.charCodeAt(e.position) !== 0;) {
|
|
1384
|
+
z(e, t);
|
|
1385
|
+
let n = e.input.charCodeAt(e.position);
|
|
1386
|
+
if (n === s) return e.position++, D(e), !0;
|
|
1387
|
+
o ? n === 44 && j(e, "expected the node content, but found ','") : j(e, "missed comma between flow collection entries");
|
|
1388
|
+
let r = !1, a = !1;
|
|
1389
|
+
n === 63 && P(e.input.charCodeAt(e.position + 1)) && (r = a = !0, e.position += 1, z(e, t));
|
|
1390
|
+
let c = e.line, l = k(e), u = B(e, t, w, !1, !0);
|
|
1391
|
+
z(e, t), n = e.input.charCodeAt(e.position), (i || a || e.line === c) && n === 58 ? (r = !0, e.position++, z(e, t), i ? u || O(e) : (A(e, l), T(e, l.position, C, C, C, C, 2), B(e, t, w, !1, !0) || O(e), z(e, t), e.position++, z(e, t)), B(e, t, w, !1, !0) || O(e), z(e, t), i || D(e)) : i && r ? (u || O(e), O(e)) : i ? O(e) : r && (A(e, l), T(e, l.position, C, C, C, C, 2), B(e, t, w, !1, !0), O(e), D(e)), n = e.input.charCodeAt(e.position), n === 44 ? (o = !0, e.position++) : o = !1;
|
|
1392
|
+
}
|
|
1393
|
+
j(e, "unexpected end of the stream within a flow collection");
|
|
1394
|
+
}
|
|
1395
|
+
function Un(e, t, n) {
|
|
1396
|
+
if (e.firstTabInLine !== -1 || e.input.charCodeAt(e.position) !== 45 || !F(e.input.charCodeAt(e.position + 1))) return !1;
|
|
1397
|
+
for (Cn(e, e.position, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 1); e.input.charCodeAt(e.position) === 45 && F(e.input.charCodeAt(e.position + 1));) {
|
|
1398
|
+
e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, j(e, "tab characters must not be used in indentation"));
|
|
1399
|
+
let n = e.line;
|
|
1400
|
+
e.position++;
|
|
1401
|
+
let r = L(e, !0) > 0;
|
|
1402
|
+
if (e.firstTabInLine !== -1 && e.input.charCodeAt(e.position) === 45 && F(e.input.charCodeAt(e.position + 1)) && j(e, "bad indentation of a sequence entry"), r && e.lineIndent <= t ? O(e) : B(e, t, dn, !1, !0), L(e, !0), e.lineIndent < t || e.position >= e.length) break;
|
|
1403
|
+
e.lineIndent > t && j(e, "bad indentation of a sequence entry"), e.line === n && e.input.charCodeAt(e.position) === 45 && F(e.input.charCodeAt(e.position + 1)) && j(e, "bad indentation of a sequence entry");
|
|
1404
|
+
}
|
|
1405
|
+
return D(e), !0;
|
|
1406
|
+
}
|
|
1407
|
+
function Wn(e, t, n, r) {
|
|
1408
|
+
let i = !1, a = !1, o = !1, s = !1;
|
|
1409
|
+
if (e.firstTabInLine !== -1) return !1;
|
|
1410
|
+
let c = e.input.charCodeAt(e.position);
|
|
1411
|
+
for (; c !== 0;) {
|
|
1412
|
+
!i && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, j(e, "tab characters must not be used in indentation"));
|
|
1413
|
+
let l = e.input.charCodeAt(e.position + 1), u = e.line;
|
|
1414
|
+
if ((c === 63 || c === 58) && F(l)) o || (T(e, e.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1), o = !0), c === 63 ? (i && O(e), a = !0, i = !0) : i ? i = !1 : (O(e), a = !0, i = !1), e.position += 1, s = !0;
|
|
1415
|
+
else {
|
|
1416
|
+
i && (O(e), i = !1);
|
|
1417
|
+
let t = k(e);
|
|
1418
|
+
if (!B(e, n, un, !1, !0)) break;
|
|
1419
|
+
if (e.line === u) {
|
|
1420
|
+
for (c = e.input.charCodeAt(e.position); N(c);) c = e.input.charCodeAt(++e.position);
|
|
1421
|
+
if (c === 58) {
|
|
1422
|
+
if (c = e.input.charCodeAt(++e.position), F(c) || j(e, "a whitespace character is expected after the key-value separator within a block mapping"), !o) {
|
|
1423
|
+
for (A(e, t), T(e, t.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1), o = !0, B(e, n, un, !1, !0), c = e.input.charCodeAt(e.position); N(c);) c = e.input.charCodeAt(++e.position);
|
|
1424
|
+
e.position++;
|
|
1425
|
+
}
|
|
1426
|
+
a = !0, i = !1, s = !1;
|
|
1427
|
+
} else if (a) j(e, "expected ':' after a mapping key");
|
|
1428
|
+
else return r.anchorStart !== C || r.tagStart !== C ? (A(e, t), !1) : !0;
|
|
1429
|
+
} else if (a) j(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
1430
|
+
else return r.anchorStart !== C || r.tagStart !== C ? (A(e, t), !1) : !0;
|
|
1431
|
+
}
|
|
1432
|
+
if (B(e, t, fn, !0, s) && (s = !1), i || s && (O(e), s = !1), L(e, !0), c = e.input.charCodeAt(e.position), (e.line === u || e.lineIndent > t) && c !== 0) j(e, "bad indentation of a mapping entry");
|
|
1433
|
+
else if (e.lineIndent < t) break;
|
|
1434
|
+
}
|
|
1435
|
+
return a ? (i && O(e), o && D(e), !0) : !1;
|
|
1436
|
+
}
|
|
1437
|
+
function B(e, t, n, r, i, a = !0) {
|
|
1438
|
+
e.depth >= e.maxDepth && j(e, `nesting exceeded maxDepth (${e.maxDepth})`), e.depth++;
|
|
1439
|
+
let o = 1, s = !1, c = !1, l = null, u = Tn(), d = n === fn || n === dn, f = d, p = d;
|
|
1440
|
+
if (r && L(e, !0) && (s = !0, o = e.lineIndent > t ? 1 : e.lineIndent === t ? 0 : -1), e.position === e.lineStart && R(e)) return e.depth--, !1;
|
|
1441
|
+
if (o === 1) for (;;) {
|
|
1442
|
+
let r = e.input.charCodeAt(e.position), i = k(e);
|
|
1443
|
+
if (s && o !== 1 && (r === 33 || r === 38)) break;
|
|
1444
|
+
if (s && p && (u.tagStart !== C || u.anchorStart !== C) && (r === 33 || r === 38)) {
|
|
1445
|
+
var m;
|
|
1446
|
+
let n = k(e), r = t + 1;
|
|
1447
|
+
if (Wn(e, e.position - e.lineStart, r, u) && ((m = e.events[n.eventsLength]) == null ? void 0 : m.type) === 3) return e.depth--, !0;
|
|
1448
|
+
A(e, n);
|
|
1449
|
+
}
|
|
1450
|
+
if (s && (r === 33 && u.tagStart !== C || r === 38 && u.anchorStart !== C) || !Nn(e, u, n === w) && !Pn(e, u)) break;
|
|
1451
|
+
l === null && (l = i), L(e, !0) ? (s = !0, f = p, o = e.lineIndent > t ? 1 : e.lineIndent === t ? 0 : -1) : f = !1;
|
|
1452
|
+
}
|
|
1453
|
+
if (f && (f = s || i), o === 1 || n === fn) {
|
|
1454
|
+
let r = n === w || n === un ? t : t + 1, i = e.position - e.lineStart;
|
|
1455
|
+
if (o === 1) if (f && (Un(e, i, u) || Wn(e, i, r, u)) || Hn(e, r, u)) c = !0;
|
|
1456
|
+
else {
|
|
1457
|
+
let t = e.input.charCodeAt(e.position);
|
|
1458
|
+
if (l !== null && a && p && !f && t !== 124 && t !== 62) {
|
|
1459
|
+
var h;
|
|
1460
|
+
let t = k(e), n = l.position - l.lineStart;
|
|
1461
|
+
A(e, l), Wn(e, n, r, Tn()) && ((h = e.events[t.eventsLength]) == null ? void 0 : h.type) === 3 ? c = !0 : A(e, t);
|
|
1462
|
+
}
|
|
1463
|
+
!c && (d && zn(e, r, u) || Ln(e, r, u) || Rn(e, r, u) || Fn(e, u) || Vn(e, r, n, u)) && (c = !0);
|
|
1464
|
+
}
|
|
1465
|
+
else o === 0 && (c = f && Un(e, i, u));
|
|
1466
|
+
}
|
|
1467
|
+
return d = d && !c, !c && (u.anchorStart !== C || u.tagStart !== C || d) && (E(e, C, C, u.anchorStart, u.anchorEnd, u.tagStart, u.tagEnd, 1), c = !0), e.depth--, c || u.anchorStart !== C || u.tagStart !== C;
|
|
1468
|
+
}
|
|
1469
|
+
function Gn(e) {
|
|
1470
|
+
if (e.lineIndent > 0 || e.input.charCodeAt(e.position) !== 37) return !1;
|
|
1471
|
+
e.position++;
|
|
1472
|
+
let t = e.position;
|
|
1473
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !P(e.input.charCodeAt(e.position));) e.position++;
|
|
1474
|
+
let n = e.input.slice(t, e.position), r = [];
|
|
1475
|
+
for (n.length === 0 && j(e, "directive name must not be less than one character in length"); e.input.charCodeAt(e.position) !== 0 && !M(e.input.charCodeAt(e.position));) {
|
|
1476
|
+
for (; N(e.input.charCodeAt(e.position));) e.position++;
|
|
1477
|
+
if (e.input.charCodeAt(e.position) === 35 || M(e.input.charCodeAt(e.position)) || e.input.charCodeAt(e.position) === 0) break;
|
|
1478
|
+
let t = e.position;
|
|
1479
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !P(e.input.charCodeAt(e.position));) e.position++;
|
|
1480
|
+
r.push(e.input.slice(t, e.position));
|
|
1481
|
+
}
|
|
1482
|
+
if (M(e.input.charCodeAt(e.position)) && An(e), n === "YAML") {
|
|
1483
|
+
e.directives.some((e) => e.kind === "yaml") && j(e, "duplication of %YAML directive"), r.length !== 1 && j(e, "YAML directive accepts exactly one argument");
|
|
1484
|
+
let t = /^([0-9]+)\.([0-9]+)$/.exec(r[0]);
|
|
1485
|
+
t === null && j(e, "ill-formed argument of the YAML directive"), parseInt(t[1], 10) !== 1 && j(e, "unacceptable YAML version of the document"), e.directives.push({
|
|
1486
|
+
kind: "yaml",
|
|
1487
|
+
version: r[0]
|
|
1488
|
+
});
|
|
1489
|
+
} else if (n === "TAG") {
|
|
1490
|
+
r.length !== 2 && j(e, "TAG directive accepts exactly two arguments");
|
|
1491
|
+
let [t, n] = r;
|
|
1492
|
+
hn.test(t) || j(e, "ill-formed tag handle (first argument) of the TAG directive"), ln.call(e.tagHandlers, t) && j(e, `there is a previously declared suffix for "${t}" tag handle`), bn.test(n) || j(e, "ill-formed tag prefix (second argument) of the TAG directive"), e.tagHandlers[t] = n, e.directives.push({
|
|
1493
|
+
kind: "tag",
|
|
1494
|
+
handle: t,
|
|
1495
|
+
prefix: n
|
|
1496
|
+
});
|
|
1497
|
+
}
|
|
1498
|
+
return !0;
|
|
1499
|
+
}
|
|
1500
|
+
function Kn(e) {
|
|
1501
|
+
e.directives = [], e.tagHandlers = Object.create(null);
|
|
1502
|
+
let t = !1;
|
|
1503
|
+
for (L(e, !0); Gn(e);) t = !0, L(e, !0);
|
|
1504
|
+
let n = !1, r = !1, i = !0;
|
|
1505
|
+
if (e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 && F(e.input.charCodeAt(e.position + 3))) {
|
|
1506
|
+
n = !0;
|
|
1507
|
+
let t = e.line;
|
|
1508
|
+
e.position += 3, L(e, !0), i = e.line > t;
|
|
1509
|
+
} else t && j(e, "directives end mark is expected");
|
|
1510
|
+
let a = e.events.length;
|
|
1511
|
+
if (!n && e.position === e.lineStart && e.input.charCodeAt(e.position) === 46 && R(e)) {
|
|
1512
|
+
e.position += 3, L(e, !0);
|
|
1513
|
+
return;
|
|
1514
|
+
}
|
|
1515
|
+
if (Sn(e, n, !1), B(e, e.lineIndent - 1, fn, !1, i, i) || O(e), L(e, !0), e.position === e.lineStart && R(e) && (r = e.input.charCodeAt(e.position) === 46, r)) {
|
|
1516
|
+
let t = e.line;
|
|
1517
|
+
e.position += 3, L(e, !0), e.line === t && e.position < e.length && j(e, "end of the stream or a document separator is expected");
|
|
1518
|
+
}
|
|
1519
|
+
let o = e.events[a];
|
|
1520
|
+
(o == null ? void 0 : o.type) === 1 && (o.explicitEnd = r), D(e), !r && e.position < e.length && !(e.position === e.lineStart && R(e)) && j(e, "end of the stream or a document separator is expected");
|
|
1521
|
+
}
|
|
1522
|
+
function qn(e, t) {
|
|
1523
|
+
let n = e.length, r = y(y(y({}, xn), t), {}, {
|
|
1524
|
+
input: `${e}\0`,
|
|
1525
|
+
length: n,
|
|
1526
|
+
position: 0,
|
|
1527
|
+
line: 0,
|
|
1528
|
+
lineStart: 0,
|
|
1529
|
+
lineIndent: 0,
|
|
1530
|
+
firstTabInLine: -1,
|
|
1531
|
+
depth: 0,
|
|
1532
|
+
directives: [],
|
|
1533
|
+
tagHandlers: Object.create(null),
|
|
1534
|
+
events: []
|
|
1535
|
+
}), i = e.indexOf("\0");
|
|
1536
|
+
for (i !== -1 && pt(e, i, "null byte is not allowed in input", r.filename), r.input.charCodeAt(r.position) === 65279 && r.position++; r.position < r.length && (L(r, !0), !(r.position >= r.length));) {
|
|
1537
|
+
let e = r.position;
|
|
1538
|
+
Kn(r), r.position === e && j(r, "can not read a document");
|
|
1539
|
+
}
|
|
1540
|
+
return r.events;
|
|
1541
|
+
}
|
|
1542
|
+
//#endregion
|
|
1543
|
+
//#region src/load.ts
|
|
1544
|
+
var Jn = y(y({}, xn), Jt);
|
|
1545
|
+
function Yn(e, t = {}) {
|
|
1546
|
+
let n = y(y({}, Jn), t), r = String(e), i = Object.keys(xn), a = Object.keys(Jt);
|
|
1547
|
+
return cn(qn(r, We(n, i)), y(y({}, We(n, a)), {}, { source: r }));
|
|
1548
|
+
}
|
|
1549
|
+
function Xn(e, t, n) {
|
|
1550
|
+
let r = null;
|
|
1551
|
+
typeof t == "function" ? r = t : typeof t == "object" && t && (n = t);
|
|
1552
|
+
let i = Yn(e, n);
|
|
1553
|
+
if (r === null) return i;
|
|
1554
|
+
for (let e of i) r(e);
|
|
1555
|
+
}
|
|
1556
|
+
function Zn(e, t) {
|
|
1557
|
+
let n = Yn(e, t);
|
|
1558
|
+
if (n.length === 0) throw new b("expected a document, but the input is empty");
|
|
1559
|
+
if (n.length === 1) return n[0];
|
|
1560
|
+
throw new b("expected a single document in the stream, but found more");
|
|
1561
|
+
}
|
|
1562
|
+
//#endregion
|
|
1563
|
+
//#region src/ast/nodes.ts
|
|
1564
|
+
var V = class {
|
|
1565
|
+
constructor() {
|
|
1566
|
+
_(this, "tagged", !1), _(this, "flow", !1), _(this, "singleQuoted", !1), _(this, "doubleQuoted", !1), _(this, "literal", !1), _(this, "folded", !1);
|
|
1567
|
+
}
|
|
1568
|
+
}, H = Symbol("INVALID");
|
|
1569
|
+
function Qn(e) {
|
|
1570
|
+
let t = new Set([
|
|
1571
|
+
e.defaultScalarTag,
|
|
1572
|
+
e.defaultSequenceTag,
|
|
1573
|
+
e.defaultMappingTag
|
|
1574
|
+
].filter((e) => e !== void 0)), n = e.implicitScalarTags, r = e.tags.filter((e) => !(e.nodeKind === "scalar" && e.implicit) && !t.has(e)), i = e.tags.filter((e) => t.has(e));
|
|
1575
|
+
return [
|
|
1576
|
+
...n.map((e) => ({
|
|
1577
|
+
tag: e,
|
|
1578
|
+
implicitTag: !0
|
|
1579
|
+
})),
|
|
1580
|
+
...r.map((e) => ({
|
|
1581
|
+
tag: e,
|
|
1582
|
+
implicitTag: !1
|
|
1583
|
+
})),
|
|
1584
|
+
...i.map((e) => ({
|
|
1585
|
+
tag: e,
|
|
1586
|
+
implicitTag: !0
|
|
1587
|
+
}))
|
|
1588
|
+
];
|
|
1589
|
+
}
|
|
1590
|
+
function $n(e, t) {
|
|
1591
|
+
for (let n = 0, r = e.representTypes.length; n < r; n += 1) {
|
|
1592
|
+
let { tag: r, implicitTag: i } = e.representTypes[n];
|
|
1593
|
+
if (r.identify && r.identify(t)) {
|
|
1594
|
+
let e;
|
|
1595
|
+
return e = r.matchByTagPrefix && r.representTagName ? r.representTagName(t) : r.tagName, {
|
|
1596
|
+
tag: r,
|
|
1597
|
+
tagName: e,
|
|
1598
|
+
implicitTag: i
|
|
1599
|
+
};
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
return null;
|
|
1603
|
+
}
|
|
1604
|
+
function U(e, t) {
|
|
1605
|
+
if (!e.noRefs && typeof t == "object" && t) {
|
|
1606
|
+
let n = e.refs.get(t);
|
|
1607
|
+
if (n) return n.anchor === void 0 && (n.anchor = `ref_${e.refCounter++}`), {
|
|
1608
|
+
kind: "alias",
|
|
1609
|
+
tag: "",
|
|
1610
|
+
style: new V(),
|
|
1611
|
+
anchor: n.anchor
|
|
1612
|
+
};
|
|
1613
|
+
}
|
|
1614
|
+
let n = $n(e, t);
|
|
1615
|
+
if (!n) {
|
|
1616
|
+
if (t === void 0 || e.skipInvalid) return H;
|
|
1617
|
+
throw new b(`unacceptable kind of an object to dump ${Object.prototype.toString.call(t)}`);
|
|
1618
|
+
}
|
|
1619
|
+
let { tag: r, tagName: i, implicitTag: a } = n, o = a ? i : qt(i);
|
|
1620
|
+
if (r.nodeKind === "scalar") {
|
|
1621
|
+
let e = new V();
|
|
1622
|
+
return e.tagged = !a, {
|
|
1623
|
+
kind: "scalar",
|
|
1624
|
+
tag: o,
|
|
1625
|
+
style: e,
|
|
1626
|
+
value: r.represent(t)
|
|
1627
|
+
};
|
|
1628
|
+
}
|
|
1629
|
+
if (r.nodeKind === "sequence") {
|
|
1630
|
+
let n = r.represent(t), i = new V();
|
|
1631
|
+
i.tagged = !a;
|
|
1632
|
+
let s = {
|
|
1633
|
+
kind: "sequence",
|
|
1634
|
+
tag: o,
|
|
1635
|
+
style: i,
|
|
1636
|
+
items: []
|
|
1637
|
+
};
|
|
1638
|
+
e.noRefs || e.refs.set(t, s);
|
|
1639
|
+
for (let t = 0, r = n.length; t < r; t += 1) {
|
|
1640
|
+
let r = U(e, n[t]);
|
|
1641
|
+
r === H && n[t] === void 0 && (r = U(e, null)), r !== H && s.items.push(r);
|
|
1642
|
+
}
|
|
1643
|
+
return s;
|
|
1644
|
+
}
|
|
1645
|
+
let s = r.represent(t), c = new V();
|
|
1646
|
+
c.tagged = !a;
|
|
1647
|
+
let l = {
|
|
1648
|
+
kind: "mapping",
|
|
1649
|
+
tag: o,
|
|
1650
|
+
style: c,
|
|
1651
|
+
items: []
|
|
1652
|
+
};
|
|
1653
|
+
e.noRefs || e.refs.set(t, l);
|
|
1654
|
+
for (let [t, n] of s) {
|
|
1655
|
+
let r = U(e, t);
|
|
1656
|
+
if (r === H) continue;
|
|
1657
|
+
let i = U(e, n);
|
|
1658
|
+
i !== H && l.items.push({
|
|
1659
|
+
key: r,
|
|
1660
|
+
value: i
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1663
|
+
return l;
|
|
1664
|
+
}
|
|
1665
|
+
function er(e, t, n = {}) {
|
|
1666
|
+
var r, i;
|
|
1667
|
+
let a = U({
|
|
1668
|
+
representTypes: Qn(t),
|
|
1669
|
+
noRefs: (r = n.noRefs) == null ? !1 : r,
|
|
1670
|
+
skipInvalid: (i = n.skipInvalid) == null ? !1 : i,
|
|
1671
|
+
refs: /* @__PURE__ */ new Map(),
|
|
1672
|
+
refCounter: 0
|
|
1673
|
+
}, e);
|
|
1674
|
+
return [{
|
|
1675
|
+
contents: a === H ? null : a,
|
|
1676
|
+
directives: []
|
|
1677
|
+
}];
|
|
1678
|
+
}
|
|
1679
|
+
//#endregion
|
|
1680
|
+
//#region src/ast/visit.ts
|
|
1681
|
+
var tr = Symbol("visit:break"), nr = Symbol("visit:skip");
|
|
1682
|
+
function rr(e, t, n) {
|
|
1683
|
+
let r = t(e, n);
|
|
1684
|
+
if (r === tr) return !0;
|
|
1685
|
+
if (r === nr) return !1;
|
|
1686
|
+
let i = n.depth + 1;
|
|
1687
|
+
switch (e.kind) {
|
|
1688
|
+
case "sequence":
|
|
1689
|
+
for (let n of e.items) if (rr(n, t, {
|
|
1690
|
+
depth: i,
|
|
1691
|
+
parent: e,
|
|
1692
|
+
isKey: !1
|
|
1693
|
+
})) return !0;
|
|
1694
|
+
break;
|
|
1695
|
+
case "mapping":
|
|
1696
|
+
for (let { key: n, value: r } of e.items) if (rr(n, t, {
|
|
1697
|
+
depth: i,
|
|
1698
|
+
parent: e,
|
|
1699
|
+
isKey: !0
|
|
1700
|
+
}) || rr(r, t, {
|
|
1701
|
+
depth: i,
|
|
1702
|
+
parent: e,
|
|
1703
|
+
isKey: !1
|
|
1704
|
+
})) return !0;
|
|
1705
|
+
break;
|
|
1706
|
+
}
|
|
1707
|
+
return !1;
|
|
1708
|
+
}
|
|
1709
|
+
function ir(e, t) {
|
|
1710
|
+
for (let n of e) if (n.contents && rr(n.contents, t, {
|
|
1711
|
+
depth: 0,
|
|
1712
|
+
parent: null,
|
|
1713
|
+
isKey: !1
|
|
1714
|
+
})) return;
|
|
1715
|
+
}
|
|
1716
|
+
//#endregion
|
|
1717
|
+
//#region src/ast/presenter.ts
|
|
1718
|
+
var ar = 65279, or = 9, W = 10, sr = 13, cr = 32, lr = 33, ur = 34, dr = 35, fr = 37, pr = 38, mr = 39, hr = 42, gr = 44, _r = 45, G = 58, vr = 61, yr = 62, br = 63, xr = 64, Sr = 91, Cr = 93, wr = 96, Tr = 123, Er = 124, Dr = 125, K = {};
|
|
1719
|
+
K[0] = "\\0", K[7] = "\\a", K[8] = "\\b", K[9] = "\\t", K[10] = "\\n", K[11] = "\\v", K[12] = "\\f", K[13] = "\\r", K[27] = "\\e", K[34] = "\\\"", K[92] = "\\\\", K[133] = "\\N", K[160] = "\\_", K[8232] = "\\L", K[8233] = "\\P";
|
|
1720
|
+
var Or = {
|
|
1721
|
+
indent: 2,
|
|
1722
|
+
seqNoIndent: !1,
|
|
1723
|
+
seqInlineFirst: !0,
|
|
1724
|
+
sortKeys: !1,
|
|
1725
|
+
lineWidth: 80,
|
|
1726
|
+
flowBracketPadding: !1,
|
|
1727
|
+
flowSkipCommaSpace: !1,
|
|
1728
|
+
flowSkipColonSpace: !1,
|
|
1729
|
+
quoteFlowKeys: !1,
|
|
1730
|
+
quoteStyle: "single",
|
|
1731
|
+
forceQuotes: !1,
|
|
1732
|
+
tagBeforeAnchor: !1
|
|
1733
|
+
};
|
|
1734
|
+
function kr(e) {
|
|
1735
|
+
return e.style.tagged ? e.tag : qt(e.tag);
|
|
1736
|
+
}
|
|
1737
|
+
function Ar(e) {
|
|
1738
|
+
let t = y(y({}, Or), e);
|
|
1739
|
+
return y(y({}, t), {}, {
|
|
1740
|
+
defaultScalarTagName: t.schema.defaultScalarTag.tagName,
|
|
1741
|
+
implicitResolvers: t.schema.implicitScalarTags
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
function jr(e) {
|
|
1745
|
+
let t = e.toString(16).toUpperCase(), n = e <= 255 ? "x" : "u", r = e <= 255 ? 2 : 4;
|
|
1746
|
+
return `\\${n}${"0".repeat(r - t.length)}${t}`;
|
|
1747
|
+
}
|
|
1748
|
+
function Mr(e, t) {
|
|
1749
|
+
let n = " ".repeat(t), r = 0, i = "", a = e.length;
|
|
1750
|
+
for (; r < a;) {
|
|
1751
|
+
let t, o = e.indexOf("\n", r);
|
|
1752
|
+
o === -1 ? (t = e.slice(r), r = a) : (t = e.slice(r, o + 1), r = o + 1), t.length && t !== "\n" && (i += n), i += t;
|
|
1753
|
+
}
|
|
1754
|
+
return i;
|
|
1755
|
+
}
|
|
1756
|
+
function Nr(e, t) {
|
|
1757
|
+
return `\n${" ".repeat(e.indent * t)}`;
|
|
1758
|
+
}
|
|
1759
|
+
function Pr(e, t) {
|
|
1760
|
+
let n = e.indent * Math.max(1, t);
|
|
1761
|
+
return {
|
|
1762
|
+
indent: n,
|
|
1763
|
+
blockIndent: t === 0 ? e.indent + 1 : e.indent,
|
|
1764
|
+
lineWidth: e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - n)
|
|
1765
|
+
};
|
|
1766
|
+
}
|
|
1767
|
+
function Fr(t, n) {
|
|
1768
|
+
for (let r = 0, i = t.implicitResolvers.length; r < i; r += 1) {
|
|
1769
|
+
let i = t.implicitResolvers[r];
|
|
1770
|
+
if (i.resolve(n, !1, i.tagName) !== e) return i.tagName;
|
|
1771
|
+
}
|
|
1772
|
+
return t.defaultScalarTagName;
|
|
1773
|
+
}
|
|
1774
|
+
function q(e) {
|
|
1775
|
+
return e === cr || e === or;
|
|
1776
|
+
}
|
|
1777
|
+
function Ir(e) {
|
|
1778
|
+
let t = e.charCodeAt(0);
|
|
1779
|
+
if (t !== _r && t !== 46 || e.charCodeAt(1) !== t || e.charCodeAt(2) !== t) return !1;
|
|
1780
|
+
if (e.length === 3) return !0;
|
|
1781
|
+
let n = e.charCodeAt(3);
|
|
1782
|
+
return q(n) || n === sr || n === W;
|
|
1783
|
+
}
|
|
1784
|
+
function J(e) {
|
|
1785
|
+
return e >= 32 && e <= 126 || e >= 161 && e <= 55295 && e !== 8232 && e !== 8233 || e >= 57344 && e <= 65533 && e !== ar || e >= 65536 && e <= 1114111;
|
|
1786
|
+
}
|
|
1787
|
+
function Lr(e) {
|
|
1788
|
+
return J(e) && e !== ar && e !== sr && e !== W;
|
|
1789
|
+
}
|
|
1790
|
+
function Rr(e, t, n) {
|
|
1791
|
+
let r = Lr(e), i = r && !q(e);
|
|
1792
|
+
return (n ? r : r && e !== gr && e !== Sr && e !== Cr && e !== Tr && e !== Dr) && e !== dr && !(t === G && !i) || Lr(t) && !q(t) && e === dr || t === G && i;
|
|
1793
|
+
}
|
|
1794
|
+
function zr(e) {
|
|
1795
|
+
return J(e) && e !== ar && !q(e) && e !== _r && e !== br && e !== G && e !== gr && e !== Sr && e !== Cr && e !== Tr && e !== Dr && e !== dr && e !== pr && e !== hr && e !== lr && e !== Er && e !== vr && e !== yr && e !== mr && e !== ur && e !== fr && e !== xr && e !== wr;
|
|
1796
|
+
}
|
|
1797
|
+
function Br(e, t) {
|
|
1798
|
+
let n = Y(e, 0);
|
|
1799
|
+
if (zr(n)) return !0;
|
|
1800
|
+
if (e.length > 1 && (n === _r || n === br || n === G)) {
|
|
1801
|
+
let r = Y(e, 1);
|
|
1802
|
+
return !q(r) && Rr(r, n, t);
|
|
1803
|
+
}
|
|
1804
|
+
return !1;
|
|
1805
|
+
}
|
|
1806
|
+
function Vr(e) {
|
|
1807
|
+
return !q(e) && e !== G;
|
|
1808
|
+
}
|
|
1809
|
+
function Y(e, t) {
|
|
1810
|
+
let n = e.charCodeAt(t), r;
|
|
1811
|
+
return n >= 55296 && n <= 56319 && t + 1 < e.length && (r = e.charCodeAt(t + 1), r >= 56320 && r <= 57343) ? (n - 55296) * 1024 + r - 56320 + 65536 : n;
|
|
1812
|
+
}
|
|
1813
|
+
function Hr(e) {
|
|
1814
|
+
return /^\n* /.test(e);
|
|
1815
|
+
}
|
|
1816
|
+
var X = 1, Z = 2, Ur = 3, Wr = 4, Q = 5;
|
|
1817
|
+
function Gr(e, t, n, r, i, a) {
|
|
1818
|
+
let { blockIndent: o, lineWidth: s } = n, c, l = 0, u = -1, d = !1, f = !1, p = s !== -1, m = -1, h = !Ir(t) && Br(t, a) && Vr(Y(t, t.length - 1));
|
|
1819
|
+
if (r || i) for (c = 0; c < t.length; l >= 65536 ? c += 2 : c++) {
|
|
1820
|
+
if (l = Y(t, c), !J(l)) return Q;
|
|
1821
|
+
h = h && Rr(l, u, a), u = l;
|
|
1822
|
+
}
|
|
1823
|
+
else {
|
|
1824
|
+
for (c = 0; c < t.length; l >= 65536 ? c += 2 : c++) {
|
|
1825
|
+
if (l = Y(t, c), l === W) d = !0, p && (f = f || c - m - 1 > s && t[m + 1] !== " ", m = c);
|
|
1826
|
+
else if (!J(l)) return Q;
|
|
1827
|
+
h = h && Rr(l, u, a), u = l;
|
|
1828
|
+
}
|
|
1829
|
+
f = f || p && c - m - 1 > s && t[m + 1] !== " ";
|
|
1830
|
+
}
|
|
1831
|
+
return !d && !f ? h && !i ? X : e.quoteStyle === "double" ? Q : Z : o > 9 && Hr(t) ? Q : f ? Wr : Ur;
|
|
1832
|
+
}
|
|
1833
|
+
function Kr(e, t, n) {
|
|
1834
|
+
let { indent: r, blockIndent: i, lineWidth: a } = n;
|
|
1835
|
+
switch (t) {
|
|
1836
|
+
case X: return Yr(e, r);
|
|
1837
|
+
case Z: return `'${Yr(e, r).replace(/'/g, "''")}'`;
|
|
1838
|
+
case Ur: return "|" + Jr(e, i) + Xr(Mr(e, r));
|
|
1839
|
+
case Wr: return ">" + Jr(e, i) + Xr(Mr(Zr(e, a), r));
|
|
1840
|
+
case Q: return `"${$r(e)}"`;
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
function qr(e, t, n, r, i) {
|
|
1844
|
+
let a = r || !i;
|
|
1845
|
+
if (t.style.singleQuoted) return Z;
|
|
1846
|
+
if (t.style.doubleQuoted) return Q;
|
|
1847
|
+
if (!a) {
|
|
1848
|
+
if (t.style.literal) return Ur;
|
|
1849
|
+
if (t.style.folded) return Wr;
|
|
1850
|
+
}
|
|
1851
|
+
let o = t.value;
|
|
1852
|
+
if (o.length === 0) return t.style.tagged || Fr(e, o) === t.tag ? X : e.quoteStyle === "double" ? Q : Z;
|
|
1853
|
+
let s = Gr(e, o, n, a, e.forceQuotes && !r, i);
|
|
1854
|
+
return s === X && !t.style.tagged && Fr(e, o) !== t.tag ? e.quoteStyle === "double" ? Q : Z : s;
|
|
1855
|
+
}
|
|
1856
|
+
function Jr(e, t) {
|
|
1857
|
+
let n = Hr(e) ? String(t) : "", r = e[e.length - 1] === "\n";
|
|
1858
|
+
return `${n}${r && (e[e.length - 2] === "\n" || e === "\n") ? "+" : r ? "" : "-"}\n`;
|
|
1859
|
+
}
|
|
1860
|
+
function Yr(e, t) {
|
|
1861
|
+
let n = e.indexOf("\n");
|
|
1862
|
+
if (n === -1) return e;
|
|
1863
|
+
let r = " ".repeat(t), i = e.slice(0, n), a = /(\n+)([^\n]*)/g;
|
|
1864
|
+
a.lastIndex = n;
|
|
1865
|
+
let o;
|
|
1866
|
+
for (; o = a.exec(e);) {
|
|
1867
|
+
let e = o[1].length, t = o[2];
|
|
1868
|
+
i += "\n".repeat(e + 1) + r + t;
|
|
1869
|
+
}
|
|
1870
|
+
return i;
|
|
1871
|
+
}
|
|
1872
|
+
function Xr(e) {
|
|
1873
|
+
return e[e.length - 1] === "\n" ? e.slice(0, -1) : e;
|
|
1874
|
+
}
|
|
1875
|
+
function Zr(e, t) {
|
|
1876
|
+
let n = /(\n+)([^\n]*)/g, r = e.indexOf("\n");
|
|
1877
|
+
r === -1 && (r = e.length), n.lastIndex = r;
|
|
1878
|
+
let i = Qr(e.slice(0, r), t), a = e[0] === "\n" || e[0] === " ", o, s;
|
|
1879
|
+
for (; s = n.exec(e);) {
|
|
1880
|
+
let e = s[1], n = s[2];
|
|
1881
|
+
o = n[0] === " ", i += e + (!a && !o && n !== "" ? "\n" : "") + Qr(n, t), a = o;
|
|
1882
|
+
}
|
|
1883
|
+
return i;
|
|
1884
|
+
}
|
|
1885
|
+
function Qr(e, t) {
|
|
1886
|
+
if (e === "" || e[0] === " ") return e;
|
|
1887
|
+
let n = / [^ ]/g, r, i = 0, a, o = 0, s = 0, c = "";
|
|
1888
|
+
for (; r = n.exec(e);) s = r.index, s - i > t && (a = o > i ? o : s, c += `\n${e.slice(i, a)}`, i = a + 1), o = s;
|
|
1889
|
+
return c += "\n", e.length - i > t && o > i ? c += `${e.slice(i, o)}\n${e.slice(o + 1)}` : c += e.slice(i), c.slice(1);
|
|
1890
|
+
}
|
|
1891
|
+
function $r(e) {
|
|
1892
|
+
let t = "", n = 0;
|
|
1893
|
+
for (let r = 0; r < e.length; n >= 65536 ? r += 2 : r++) {
|
|
1894
|
+
n = Y(e, r);
|
|
1895
|
+
let i = K[n];
|
|
1896
|
+
if (i) {
|
|
1897
|
+
t += i;
|
|
1898
|
+
continue;
|
|
1899
|
+
}
|
|
1900
|
+
if (J(n)) {
|
|
1901
|
+
t += e[r], n >= 65536 && (t += e[r + 1]);
|
|
1902
|
+
continue;
|
|
1903
|
+
}
|
|
1904
|
+
t += jr(n);
|
|
1905
|
+
}
|
|
1906
|
+
return t;
|
|
1907
|
+
}
|
|
1908
|
+
function ei(e, t, n) {
|
|
1909
|
+
let r = "";
|
|
1910
|
+
for (let i = 0, a = n.items.length; i < a; i += 1) {
|
|
1911
|
+
let a = $(e, t, n.items[i], {});
|
|
1912
|
+
r !== "" && (r += `,${e.flowSkipCommaSpace ? "" : " "}`), r += a;
|
|
1913
|
+
}
|
|
1914
|
+
let i = e.flowBracketPadding && r !== "" ? " " : "";
|
|
1915
|
+
return `[${i}${r}${i}]`;
|
|
1916
|
+
}
|
|
1917
|
+
function ti(e, t, n, r) {
|
|
1918
|
+
let i = "";
|
|
1919
|
+
for (let a = 0, o = n.items.length; a < o; a += 1) {
|
|
1920
|
+
let o = $(e, t + 1, n.items[a], {
|
|
1921
|
+
block: !0,
|
|
1922
|
+
compact: e.seqInlineFirst,
|
|
1923
|
+
isblockseq: !0
|
|
1924
|
+
});
|
|
1925
|
+
(!r || i !== "") && (i += Nr(e, t)), o === "" || W === o.charCodeAt(0) ? i += "-" : i += "- ", i += o;
|
|
1926
|
+
}
|
|
1927
|
+
return i;
|
|
1928
|
+
}
|
|
1929
|
+
function ni(e, t, n) {
|
|
1930
|
+
let r = "", i = ii(e, n.items);
|
|
1931
|
+
for (let { key: n, value: a } of i) {
|
|
1932
|
+
let i = "";
|
|
1933
|
+
r !== "" && (i += `,${e.flowSkipCommaSpace ? "" : " "}`);
|
|
1934
|
+
let o = $(e, t, n, { iskey: !0 }), s = o.length > 1024;
|
|
1935
|
+
s ? i += "? " : e.quoteFlowKeys && (i += "\"");
|
|
1936
|
+
let c = $(e, t, a, {}), l = e.flowSkipColonSpace || c === "" ? "" : " ";
|
|
1937
|
+
i += `${o}${e.quoteFlowKeys && !s ? "\"" : ""}:${l}${c}`, r += i;
|
|
1938
|
+
}
|
|
1939
|
+
let a = e.flowBracketPadding && r !== "" ? " " : "";
|
|
1940
|
+
return `{${a}${r}${a}}`;
|
|
1941
|
+
}
|
|
1942
|
+
function ri(e) {
|
|
1943
|
+
return e.kind === "scalar" ? e.value : e;
|
|
1944
|
+
}
|
|
1945
|
+
function ii(e, t) {
|
|
1946
|
+
if (!e.sortKeys) return t;
|
|
1947
|
+
let n = t.slice();
|
|
1948
|
+
if (e.sortKeys === !0) n.sort((e, t) => {
|
|
1949
|
+
let n = ri(e.key), r = ri(t.key);
|
|
1950
|
+
return n < r ? -1 : +(n > r);
|
|
1951
|
+
});
|
|
1952
|
+
else {
|
|
1953
|
+
let t = e.sortKeys;
|
|
1954
|
+
n.sort((e, n) => t(ri(e.key), ri(n.key)));
|
|
1955
|
+
}
|
|
1956
|
+
return n;
|
|
1957
|
+
}
|
|
1958
|
+
function ai(e, t, n, r) {
|
|
1959
|
+
let i = "", a = ii(e, n.items);
|
|
1960
|
+
for (let n = 0, o = a.length; n < o; n += 1) {
|
|
1961
|
+
let o = "";
|
|
1962
|
+
(!r || i !== "") && (o += Nr(e, t));
|
|
1963
|
+
let { key: s, value: c } = a[n], l = (s.kind === "mapping" || s.kind === "sequence") && !s.style.flow && s.items.length !== 0 || s.kind === "scalar" && (s.style.literal || s.style.folded), u = l ? $(e, t + 1, s, {
|
|
1964
|
+
block: !0,
|
|
1965
|
+
compact: !0,
|
|
1966
|
+
isblockseq: !oi(e, s, t + 1)
|
|
1967
|
+
}) : $(e, t + 1, s, {
|
|
1968
|
+
block: !0,
|
|
1969
|
+
compact: !0,
|
|
1970
|
+
iskey: !0
|
|
1971
|
+
}), d = s.kind === "scalar" && s.value.indexOf("\n") !== -1, f = l || d || u.length > 1024;
|
|
1972
|
+
f && (u && W === u.charCodeAt(0) ? o += "?" : o += "? "), o += u, f && (o += Nr(e, t));
|
|
1973
|
+
let p = $(e, t + 1, c, {
|
|
1974
|
+
block: !0,
|
|
1975
|
+
compact: f,
|
|
1976
|
+
isblockseq: f && !oi(e, c, t + 1)
|
|
1977
|
+
}), m = s.kind === "scalar" && s.value === "" && u !== "" && u.charCodeAt(u.length - 1) !== mr && u.charCodeAt(u.length - 1) !== ur, h = !f && (s.kind === "alias" || m) ? " " : "";
|
|
1978
|
+
p === "" || W === p.charCodeAt(0) ? o += `${h}:` : o += `${h}: `, o += p, i += o;
|
|
1979
|
+
}
|
|
1980
|
+
return i;
|
|
1981
|
+
}
|
|
1982
|
+
function oi(e, t, n) {
|
|
1983
|
+
return t.style.tagged || t.anchor !== void 0 || e.indent < 2 && n > 0;
|
|
1984
|
+
}
|
|
1985
|
+
function $(e, t, n, r) {
|
|
1986
|
+
var i;
|
|
1987
|
+
if (n.kind === "alias") return `*${n.anchor}`;
|
|
1988
|
+
let { block: a = !1, iskey: o = !1, isblockseq: s = !1 } = r, c = (i = r.compact) == null ? !1 : i, l = n.anchor !== void 0;
|
|
1989
|
+
oi(e, n, t) && (c = !1);
|
|
1990
|
+
let u, d = n.style.tagged, f = a && (n.kind === "mapping" || n.kind === "sequence") && !n.style.flow && n.items.length !== 0;
|
|
1991
|
+
if (n.kind === "mapping") u = f ? ai(e, t, n, c) : ni(e, t, n);
|
|
1992
|
+
else if (n.kind === "sequence") u = f ? e.seqNoIndent && !s && t > 0 ? ti(e, t - 1, n, c) : ti(e, t, n, c) : ei(e, t, n);
|
|
1993
|
+
else {
|
|
1994
|
+
let r = Pr(e, t), i = qr(e, n, r, o, a);
|
|
1995
|
+
u = Kr(n.value, i, r), d = n.style.tagged || i !== X && n.tag !== e.defaultScalarTagName;
|
|
1996
|
+
}
|
|
1997
|
+
if (f && c && t > 0 && e.indent > 2 && (u = `${" ".repeat(e.indent - 2)}${u}`), d || l) {
|
|
1998
|
+
let t = [], r = d ? kr(n) : null, i = l ? `&${n.anchor}` : null;
|
|
1999
|
+
e.tagBeforeAnchor ? (r !== null && t.push(r), i !== null && t.push(i)) : (i !== null && t.push(i), r !== null && t.push(r));
|
|
2000
|
+
let a = u === "" || u.charCodeAt(0) === W ? "" : " ";
|
|
2001
|
+
u = `${t.join(" ")}${a}${u}`;
|
|
2002
|
+
}
|
|
2003
|
+
return u;
|
|
2004
|
+
}
|
|
2005
|
+
function si(e) {
|
|
2006
|
+
return (e.kind === "sequence" || e.kind === "mapping") && !e.style.flow && e.items.length !== 0 && !e.style.tagged && e.anchor === void 0;
|
|
2007
|
+
}
|
|
2008
|
+
function ci(e) {
|
|
2009
|
+
let t = e;
|
|
2010
|
+
for (; (t.kind === "sequence" || t.kind === "mapping") && !t.style.flow && t.items.length !== 0;) t = t.kind === "sequence" ? t.items[t.items.length - 1] : t.items[t.items.length - 1].value;
|
|
2011
|
+
if (t.kind !== "scalar" || !(t.style.literal || t.style.folded)) return !1;
|
|
2012
|
+
let { value: n } = t;
|
|
2013
|
+
return n.endsWith("\n\n") || n === "\n";
|
|
2014
|
+
}
|
|
2015
|
+
function li(e) {
|
|
2016
|
+
let t = "";
|
|
2017
|
+
for (let n of e.directives) {
|
|
2018
|
+
if (n.kind === "yaml") {
|
|
2019
|
+
t += `%YAML ${n.version}\n`;
|
|
2020
|
+
continue;
|
|
2021
|
+
}
|
|
2022
|
+
let { handle: e, prefix: r } = n;
|
|
2023
|
+
t += `%TAG ${e} ${r}\n`;
|
|
2024
|
+
}
|
|
2025
|
+
return t;
|
|
2026
|
+
}
|
|
2027
|
+
function ui(e, t) {
|
|
2028
|
+
let n = Ar(t), r = "", i = !1;
|
|
2029
|
+
for (let t = 0; t < e.length; t += 1) {
|
|
2030
|
+
let a = e[t], o = li(a), s = o !== "", c = a.explicitStart || s || t > 0 && !i;
|
|
2031
|
+
if (r += o, a.contents === null) c && (r += "---\n");
|
|
2032
|
+
else if (c) {
|
|
2033
|
+
let e = $(n, 0, a.contents, {
|
|
2034
|
+
block: !0,
|
|
2035
|
+
compact: !0
|
|
2036
|
+
}), t = e === "" ? "" : s || si(a.contents) ? "\n" : " ";
|
|
2037
|
+
r += `---${t}${e}\n`;
|
|
2038
|
+
} else r += $(n, 0, a.contents, {
|
|
2039
|
+
block: !0,
|
|
2040
|
+
compact: !0
|
|
2041
|
+
}) + "\n";
|
|
2042
|
+
i = a.explicitEnd || a.contents !== null && ci(a.contents), i && (r += "...\n");
|
|
2043
|
+
}
|
|
2044
|
+
return r;
|
|
2045
|
+
}
|
|
2046
|
+
//#endregion
|
|
2047
|
+
//#region src/dump.ts
|
|
2048
|
+
var di = rt.withTags(y(y({}, _e), {}, { resolve: (t, n, r) => {
|
|
2049
|
+
let i = _e.resolve(t, n, r);
|
|
2050
|
+
return i === e ? ce.resolve(t, n, r) : i;
|
|
2051
|
+
} }), y(y({}, Me), {}, { resolve: (t, n, r) => {
|
|
2052
|
+
let i = Me.resolve(t, n, r);
|
|
2053
|
+
return i === e ? Se.resolve(t, n, r) : i;
|
|
2054
|
+
} })), fi = y(y({}, Or), {}, {
|
|
2055
|
+
schema: di,
|
|
2056
|
+
skipInvalid: !1,
|
|
2057
|
+
noRefs: !1,
|
|
2058
|
+
flowLevel: -1,
|
|
2059
|
+
transform: () => {}
|
|
2060
|
+
});
|
|
2061
|
+
function pi(e, t = {}) {
|
|
2062
|
+
let n = y(y({}, fi), t), r = er(e, n.schema, {
|
|
2063
|
+
noRefs: n.noRefs,
|
|
2064
|
+
skipInvalid: n.skipInvalid
|
|
2065
|
+
});
|
|
2066
|
+
return n.flowLevel >= 0 && ir(r, (e, t) => {
|
|
2067
|
+
if (!(t.depth < n.flowLevel)) return e.style.flow = !0, nr;
|
|
2068
|
+
}), n.transform(r), ui(r, y(y({}, We(n, Object.keys(Or))), {}, { schema: n.schema }));
|
|
2069
|
+
}
|
|
2070
|
+
//#endregion
|
|
2071
|
+
//#region src/ast/from_events.ts
|
|
2072
|
+
var mi = -1;
|
|
2073
|
+
function hi(e) {
|
|
2074
|
+
return "tagStart" in e && e.tagStart !== mi ? e.tagStart : "anchorStart" in e && e.anchorStart !== mi ? e.anchorStart : "valueStart" in e && e.valueStart !== mi ? e.valueStart : "start" in e ? e.start : 0;
|
|
2075
|
+
}
|
|
2076
|
+
function gi(e, t) {
|
|
2077
|
+
return t.tagStart === mi ? "" : e.source.slice(t.tagStart, t.tagEnd);
|
|
2078
|
+
}
|
|
2079
|
+
function _i(e, t) {
|
|
2080
|
+
return t.anchorStart === mi ? void 0 : e.source.slice(t.anchorStart, t.anchorEnd);
|
|
2081
|
+
}
|
|
2082
|
+
function vi(t, n) {
|
|
2083
|
+
var r;
|
|
2084
|
+
let { schema: i } = t, a = (r = i.implicitScalarByFirstChar.get(n.charAt(0))) == null ? i.implicitScalarAnyFirstChar : r;
|
|
2085
|
+
for (let t of a) if (t.resolve(n, !1, t.tagName) !== e) return t.tagName;
|
|
2086
|
+
return i.defaultScalarTag.tagName;
|
|
2087
|
+
}
|
|
2088
|
+
function yi(e, t) {
|
|
2089
|
+
let n = Ut(e.source, t), r = gi(e, t), i = new V();
|
|
2090
|
+
switch (t.style) {
|
|
2091
|
+
case 2:
|
|
2092
|
+
i.singleQuoted = !0;
|
|
2093
|
+
break;
|
|
2094
|
+
case 3:
|
|
2095
|
+
i.doubleQuoted = !0;
|
|
2096
|
+
break;
|
|
2097
|
+
case 4:
|
|
2098
|
+
i.literal = !0;
|
|
2099
|
+
break;
|
|
2100
|
+
case 5:
|
|
2101
|
+
i.folded = !0;
|
|
2102
|
+
break;
|
|
2103
|
+
}
|
|
2104
|
+
let a;
|
|
2105
|
+
return r === "" ? a = t.style === 1 ? vi(e, n) : e.schema.defaultScalarTag.tagName : (i.tagged = !0, a = r), {
|
|
2106
|
+
kind: "scalar",
|
|
2107
|
+
tag: a,
|
|
2108
|
+
style: i,
|
|
2109
|
+
anchor: _i(e, t),
|
|
2110
|
+
value: n
|
|
2111
|
+
};
|
|
2112
|
+
}
|
|
2113
|
+
function bi(e, t, n) {
|
|
2114
|
+
let r = gi(e, t), i = new V();
|
|
2115
|
+
t.style === 2 && (i.flow = !0);
|
|
2116
|
+
let a;
|
|
2117
|
+
return r === "" ? a = n : (a = r, i.tagged = !0), {
|
|
2118
|
+
tag: a,
|
|
2119
|
+
style: i,
|
|
2120
|
+
anchor: _i(e, t)
|
|
2121
|
+
};
|
|
2122
|
+
}
|
|
2123
|
+
function xi(e, t) {
|
|
2124
|
+
let n = e.frames[e.frames.length - 1];
|
|
2125
|
+
n.kind === "document" ? n.doc.contents = t : n.kind === "sequence" ? n.node.items.push(t) : n.key ? (n.node.items.push({
|
|
2126
|
+
key: n.key,
|
|
2127
|
+
value: t
|
|
2128
|
+
}), n.key = null) : n.key = t;
|
|
2129
|
+
}
|
|
2130
|
+
function Si(e, t) {
|
|
2131
|
+
let n = {
|
|
2132
|
+
source: t.source,
|
|
2133
|
+
schema: t.schema,
|
|
2134
|
+
eventIndex: 0,
|
|
2135
|
+
position: 0,
|
|
2136
|
+
frames: [],
|
|
2137
|
+
documents: []
|
|
2138
|
+
};
|
|
2139
|
+
for (; n.eventIndex < e.length;) {
|
|
2140
|
+
let t = e[n.eventIndex++];
|
|
2141
|
+
switch (n.position = hi(t), t.type) {
|
|
2142
|
+
case 1: {
|
|
2143
|
+
let e = {
|
|
2144
|
+
contents: null,
|
|
2145
|
+
explicitStart: t.explicitStart,
|
|
2146
|
+
explicitEnd: t.explicitEnd,
|
|
2147
|
+
directives: t.directives
|
|
2148
|
+
};
|
|
2149
|
+
n.frames.push({
|
|
2150
|
+
kind: "document",
|
|
2151
|
+
doc: e
|
|
2152
|
+
});
|
|
2153
|
+
break;
|
|
2154
|
+
}
|
|
2155
|
+
case 4:
|
|
2156
|
+
xi(n, yi(n, t));
|
|
2157
|
+
break;
|
|
2158
|
+
case 2: {
|
|
2159
|
+
let { tag: e, style: r, anchor: i } = bi(n, t, "tag:yaml.org,2002:seq"), a = {
|
|
2160
|
+
kind: "sequence",
|
|
2161
|
+
tag: e,
|
|
2162
|
+
style: r,
|
|
2163
|
+
anchor: i,
|
|
2164
|
+
items: []
|
|
2165
|
+
};
|
|
2166
|
+
n.frames.push({
|
|
2167
|
+
kind: "sequence",
|
|
2168
|
+
node: a
|
|
2169
|
+
});
|
|
2170
|
+
break;
|
|
2171
|
+
}
|
|
2172
|
+
case 3: {
|
|
2173
|
+
let { tag: e, style: r, anchor: i } = bi(n, t, "tag:yaml.org,2002:map"), a = {
|
|
2174
|
+
kind: "mapping",
|
|
2175
|
+
tag: e,
|
|
2176
|
+
style: r,
|
|
2177
|
+
anchor: i,
|
|
2178
|
+
items: []
|
|
2179
|
+
};
|
|
2180
|
+
n.frames.push({
|
|
2181
|
+
kind: "mapping",
|
|
2182
|
+
node: a,
|
|
2183
|
+
key: null
|
|
2184
|
+
});
|
|
2185
|
+
break;
|
|
2186
|
+
}
|
|
2187
|
+
case 5: {
|
|
2188
|
+
let e = n.source.slice(t.anchorStart, t.anchorEnd);
|
|
2189
|
+
xi(n, {
|
|
2190
|
+
kind: "alias",
|
|
2191
|
+
tag: "",
|
|
2192
|
+
style: new V(),
|
|
2193
|
+
anchor: e
|
|
2194
|
+
});
|
|
2195
|
+
break;
|
|
2196
|
+
}
|
|
2197
|
+
case 6: {
|
|
2198
|
+
let e = n.frames.pop();
|
|
2199
|
+
e.kind === "document" ? n.documents.push(e.doc) : xi(n, e.node);
|
|
2200
|
+
break;
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
return n.documents;
|
|
2205
|
+
}
|
|
2206
|
+
//#endregion
|
|
2207
|
+
export { Dt as CHOMPING_CLIP, kt as CHOMPING_KEEP, Ot as CHOMPING_STRIP, Tt as COLLECTION_STYLE_BLOCK, Et as COLLECTION_STYLE_FLOW, nt as CORE_SCHEMA, vt as EVENT_ALIAS, mt as EVENT_DOCUMENT, gt as EVENT_MAPPING, yt as EVENT_POP, _t as EVENT_SCALAR, ht as EVENT_SEQUENCE, et as FAILSAFE_SCHEMA, tt as JSON_SCHEMA, t as MERGE_KEY, e as NOT_RESOLVED, St as SCALAR_STYLE_DOUBLE_QUOTED, wt as SCALAR_STYLE_FOLDED_BLOCK, Ct as SCALAR_STYLE_LITERAL_BLOCK, bt as SCALAR_STYLE_PLAIN, xt as SCALAR_STYLE_SINGLE_QUOTED, v as Schema, V as Style, tr as VISIT_BREAK, nr as VISIT_SKIP, rt as YAML11_SCHEMA, b as YAMLException, Le as binaryTag, p as boolCoreTag, ee as boolJsonTag, re as boolYaml11Tag, cn as constructFromEvents, i as defineMappingTag, n as defineScalarTag, r as defineSequenceTag, pi as dump, Si as eventsToAst, Se as floatCoreTag, De as floatJsonTag, Me as floatYaml11Tag, Ut as getScalarValue, ce as intCoreTag, pe as intJsonTag, _e as intYaml11Tag, er as jsToAst, ot as legacyMapTag, Zn as load, Xn as loadAll, qe as mapTag, Ne as mergeTag, s as nullCoreTag, c as nullJsonTag, u as nullYaml11Tag, Ge as omapTag, Ke as pairsTag, qn as parseEvents, ui as present, it as realMapTag, He as seqTag, Je as setTag, a as strTag, Ve as timestampTag, ir as visit };
|
|
2208
|
+
|
|
2209
|
+
//# sourceMappingURL=js-yaml.esm.min.mjs.map
|