@depup/js-yaml 5.4.2-depup.9 → 5.4.3-depup.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/changes.json +1 -1
- package/dist/browser/js-yaml.esm.min.mjs +486 -483
- package/dist/browser/js-yaml.esm.min.mjs.map +1 -1
- package/dist/browser/js-yaml.umd.min.js +4 -4
- package/dist/browser/js-yaml.umd.min.js.map +1 -1
- package/dist/js-yaml.cjs.js +11 -8
- package/dist/js-yaml.cjs.js.map +1 -1
- package/dist/js-yaml.mjs +11 -8
- package/dist/js-yaml.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! js-yaml 5.4.
|
|
1
|
+
/*! js-yaml 5.4.3 https://github.com/nodeca/js-yaml @license MIT */
|
|
2
2
|
//#region src/tag.ts
|
|
3
3
|
var e = Symbol("NOT_RESOLVED");
|
|
4
4
|
function t(e, t) {
|
|
@@ -220,7 +220,7 @@ function he(t) {
|
|
|
220
220
|
let n = me(t);
|
|
221
221
|
return Number.isFinite(n) ? n : e;
|
|
222
222
|
}
|
|
223
|
-
var
|
|
223
|
+
var ge = t("tag:yaml.org,2002:int", {
|
|
224
224
|
implicit: !0,
|
|
225
225
|
implicitFirstChars: [
|
|
226
226
|
"-",
|
|
@@ -230,16 +230,16 @@ var g = t("tag:yaml.org,2002:int", {
|
|
|
230
230
|
resolve: he,
|
|
231
231
|
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
|
|
232
232
|
represent: (e) => e.toString(10)
|
|
233
|
-
}),
|
|
234
|
-
function
|
|
235
|
-
if (!
|
|
233
|
+
}), _e = /* @__PURE__ */ RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"), ve = /* @__PURE__ */ RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
234
|
+
function ye(t) {
|
|
235
|
+
if (!_e.test(t)) return e;
|
|
236
236
|
let n = t.toLowerCase(), r = n[0] === "-" ? -1 : 1;
|
|
237
237
|
if ("+-".includes(n[0]) && (n = n.slice(1)), n === ".inf") return r === 1 ? Infinity : -Infinity;
|
|
238
238
|
if (n === ".nan") return NaN;
|
|
239
239
|
let i = r * parseFloat(n);
|
|
240
|
-
return Number.isFinite(i) ||
|
|
240
|
+
return Number.isFinite(i) || ve.test(t) ? i : e;
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function be(e) {
|
|
243
243
|
if (isNaN(e)) return ".nan";
|
|
244
244
|
if (e === Infinity) return ".inf";
|
|
245
245
|
if (e === -Infinity) return "-.inf";
|
|
@@ -247,7 +247,7 @@ function ye(e) {
|
|
|
247
247
|
let t = e.toString(10);
|
|
248
248
|
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
249
249
|
}
|
|
250
|
-
var
|
|
250
|
+
var xe = t("tag:yaml.org,2002:float", {
|
|
251
251
|
implicit: !0,
|
|
252
252
|
implicitFirstChars: [
|
|
253
253
|
"-",
|
|
@@ -255,24 +255,24 @@ var be = t("tag:yaml.org,2002:float", {
|
|
|
255
255
|
".",
|
|
256
256
|
..."0123456789"
|
|
257
257
|
],
|
|
258
|
-
resolve:
|
|
258
|
+
resolve: ye,
|
|
259
259
|
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
260
|
-
represent:
|
|
261
|
-
}),
|
|
262
|
-
function
|
|
260
|
+
represent: be
|
|
261
|
+
}), Se = /* @__PURE__ */ RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"), Ce = /* @__PURE__ */ RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
262
|
+
function we(t, n) {
|
|
263
263
|
if (n) {
|
|
264
|
-
if (!
|
|
264
|
+
if (!Ce.test(t)) return e;
|
|
265
265
|
let n = t.toLowerCase(), r = n[0] === "-" ? -1 : 1;
|
|
266
266
|
if ("+-".includes(n[0]) && (n = n.slice(1)), n === ".inf") return r === 1 ? Infinity : -Infinity;
|
|
267
267
|
if (n === ".nan") return NaN;
|
|
268
268
|
let i = r * parseFloat(n);
|
|
269
269
|
return Number.isFinite(i) ? i : e;
|
|
270
270
|
}
|
|
271
|
-
if (!
|
|
271
|
+
if (!Se.test(t)) return e;
|
|
272
272
|
let r = Number(t);
|
|
273
273
|
return Number.isFinite(r) ? r : e;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function Te(e) {
|
|
276
276
|
if (isNaN(e)) return ".nan";
|
|
277
277
|
if (e === Infinity) return ".inf";
|
|
278
278
|
if (e === -Infinity) return "-.inf";
|
|
@@ -280,15 +280,15 @@ function we(e) {
|
|
|
280
280
|
let t = e.toString(10);
|
|
281
281
|
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
282
282
|
}
|
|
283
|
-
var
|
|
283
|
+
var Ee = t("tag:yaml.org,2002:float", {
|
|
284
284
|
implicit: !0,
|
|
285
285
|
implicitFirstChars: ["-", ..."0123456789"],
|
|
286
|
-
resolve:
|
|
286
|
+
resolve: we,
|
|
287
287
|
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
288
|
-
represent:
|
|
289
|
-
}),
|
|
290
|
-
function
|
|
291
|
-
if (!
|
|
288
|
+
represent: Te
|
|
289
|
+
}), De = /* @__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))$"), Oe = /* @__PURE__ */ RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
290
|
+
function ke(t) {
|
|
291
|
+
if (!De.test(t)) return e;
|
|
292
292
|
let n = t.toLowerCase().replace(/_/g, ""), r = n[0] === "-" ? -1 : 1;
|
|
293
293
|
if ("+-".includes(n[0]) && (n = n.slice(1)), n === ".inf") return r === 1 ? Infinity : -Infinity;
|
|
294
294
|
if (n === ".nan") return NaN;
|
|
@@ -297,9 +297,9 @@ function Oe(t) {
|
|
|
297
297
|
for (let e of n.split(":")) i = i * 60 + Number(e);
|
|
298
298
|
i *= r;
|
|
299
299
|
} else i = r * parseFloat(n);
|
|
300
|
-
return Number.isFinite(i) ||
|
|
300
|
+
return Number.isFinite(i) || Oe.test(t) ? i : e;
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function Ae(e) {
|
|
303
303
|
if (isNaN(e)) return ".nan";
|
|
304
304
|
if (e === Infinity) return ".inf";
|
|
305
305
|
if (e === -Infinity) return "-.inf";
|
|
@@ -307,7 +307,7 @@ function ke(e) {
|
|
|
307
307
|
let t = e.toString(10);
|
|
308
308
|
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
309
309
|
}
|
|
310
|
-
var
|
|
310
|
+
var g = t("tag:yaml.org,2002:float", {
|
|
311
311
|
implicit: !0,
|
|
312
312
|
implicitFirstChars: [
|
|
313
313
|
"-",
|
|
@@ -315,42 +315,42 @@ var _ = t("tag:yaml.org,2002:float", {
|
|
|
315
315
|
".",
|
|
316
316
|
..."0123456789"
|
|
317
317
|
],
|
|
318
|
-
resolve:
|
|
318
|
+
resolve: ke,
|
|
319
319
|
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
320
|
-
represent:
|
|
321
|
-
}),
|
|
320
|
+
represent: Ae
|
|
321
|
+
}), je = t("tag:yaml.org,2002:merge", {
|
|
322
322
|
implicit: !0,
|
|
323
323
|
implicitFirstChars: ["<"],
|
|
324
324
|
resolve: (t, n) => t === "<<" || n && t === "" ? "<<" : e,
|
|
325
325
|
identify: () => !1
|
|
326
|
-
}),
|
|
327
|
-
function
|
|
326
|
+
}), Me = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
327
|
+
function Ne(t) {
|
|
328
328
|
let n = t.replace(/\s/g, "");
|
|
329
|
-
if (n.length % 4 != 0 || !
|
|
329
|
+
if (n.length % 4 != 0 || !Me.test(n)) return e;
|
|
330
330
|
let r = atob(n), i = new Uint8Array(r.length);
|
|
331
331
|
for (let e = 0; e < r.length; e++) i[e] = r.charCodeAt(e);
|
|
332
332
|
return i;
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function Pe(e) {
|
|
335
335
|
let t = "";
|
|
336
336
|
for (let n = 0; n < e.length; n++) t += String.fromCharCode(e[n]);
|
|
337
337
|
return btoa(t);
|
|
338
338
|
}
|
|
339
|
-
var
|
|
340
|
-
resolve:
|
|
339
|
+
var Fe = t("tag:yaml.org,2002:binary", {
|
|
340
|
+
resolve: Ne,
|
|
341
341
|
identify: (e) => Object.prototype.toString.call(e) === "[object Uint8Array]",
|
|
342
|
-
represent:
|
|
343
|
-
}),
|
|
344
|
-
function
|
|
342
|
+
represent: Pe
|
|
343
|
+
}), Ie = /* @__PURE__ */ RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"), Le = /* @__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]))?))?$");
|
|
344
|
+
function Re(e, t, n, r = 0, i = 0, a = 0, o = 0) {
|
|
345
345
|
let s = new Date(Date.UTC(e, t, n, r, i, a, o));
|
|
346
346
|
return s.setUTCFullYear(e, t, n), s;
|
|
347
347
|
}
|
|
348
|
-
function
|
|
349
|
-
let n =
|
|
350
|
-
if (n === null && (n =
|
|
348
|
+
function ze(t) {
|
|
349
|
+
let n = Ie.exec(t);
|
|
350
|
+
if (n === null && (n = Le.exec(t)), n === null) return e;
|
|
351
351
|
let r = +n[1], i = n[2] - 1, a = +n[3];
|
|
352
352
|
if (!n[4]) {
|
|
353
|
-
let t =
|
|
353
|
+
let t = Re(r, i, a);
|
|
354
354
|
return t.getUTCFullYear() !== r || t.getUTCMonth() !== i || t.getUTCDate() !== a ? e : t;
|
|
355
355
|
}
|
|
356
356
|
let o = +n[4], s = +n[5], c = +n[6], l = 0;
|
|
@@ -360,7 +360,7 @@ function Re(t) {
|
|
|
360
360
|
for (; e.length < 3;) e += "0";
|
|
361
361
|
l = +e;
|
|
362
362
|
}
|
|
363
|
-
let u =
|
|
363
|
+
let u = Re(r, i, a, o, s, c, l);
|
|
364
364
|
if (u.getUTCFullYear() !== r || u.getUTCMonth() !== i || u.getUTCDate() !== a) return e;
|
|
365
365
|
if (n[9]) {
|
|
366
366
|
let t = +n[10], r = +(n[11] || 0);
|
|
@@ -370,13 +370,13 @@ function Re(t) {
|
|
|
370
370
|
}
|
|
371
371
|
return u;
|
|
372
372
|
}
|
|
373
|
-
var
|
|
373
|
+
var Be = t("tag:yaml.org,2002:timestamp", {
|
|
374
374
|
implicit: !0,
|
|
375
375
|
implicitFirstChars: [..."0123456789"],
|
|
376
|
-
resolve:
|
|
376
|
+
resolve: ze,
|
|
377
377
|
identify: (e) => e instanceof Date,
|
|
378
378
|
represent: (e) => e.toISOString()
|
|
379
|
-
}),
|
|
379
|
+
}), Ve = n("tag:yaml.org,2002:seq", {
|
|
380
380
|
create: () => [],
|
|
381
381
|
addItem: (e, t) => {
|
|
382
382
|
e.push(t);
|
|
@@ -385,19 +385,19 @@ var ze = t("tag:yaml.org,2002:timestamp", {
|
|
|
385
385
|
});
|
|
386
386
|
//#endregion
|
|
387
387
|
//#region src/common/object.ts
|
|
388
|
-
function
|
|
388
|
+
function _(e) {
|
|
389
389
|
if (typeof e != "object" || !e || Array.isArray(e)) return !1;
|
|
390
390
|
let t = Object.getPrototypeOf(e);
|
|
391
391
|
return t === null || t === Object.prototype;
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function He(e, t) {
|
|
394
394
|
let n = {};
|
|
395
395
|
for (let r of t) e[r] !== void 0 && (n[r] = e[r]);
|
|
396
396
|
return n;
|
|
397
397
|
}
|
|
398
398
|
//#endregion
|
|
399
399
|
//#region src/tag/sequence/omap.ts
|
|
400
|
-
var
|
|
400
|
+
var Ue = n("tag:yaml.org,2002:omap", {
|
|
401
401
|
create: () => ({
|
|
402
402
|
list: [],
|
|
403
403
|
seen: /* @__PURE__ */ new Set()
|
|
@@ -407,7 +407,7 @@ var He = n("tag:yaml.org,2002:omap", {
|
|
|
407
407
|
if (t instanceof Map) {
|
|
408
408
|
if (t.size !== 1) return "cannot resolve an ordered map item";
|
|
409
409
|
n = t.keys().next().value;
|
|
410
|
-
} else if (
|
|
410
|
+
} else if (_(t)) {
|
|
411
411
|
let e = Object.keys(t);
|
|
412
412
|
if (e.length !== 1) return "cannot resolve an ordered map item";
|
|
413
413
|
n = e[0];
|
|
@@ -416,7 +416,7 @@ var He = n("tag:yaml.org,2002:omap", {
|
|
|
416
416
|
},
|
|
417
417
|
finalize: (e) => e.list,
|
|
418
418
|
identify: () => !1
|
|
419
|
-
}),
|
|
419
|
+
}), We = n("tag:yaml.org,2002:pairs", {
|
|
420
420
|
create: () => [],
|
|
421
421
|
addItem: (e, t) => {
|
|
422
422
|
if (t instanceof Map) return t.size === 1 ? (e.push(t.entries().next().value), "") : "cannot resolve a pairs item";
|
|
@@ -425,9 +425,9 @@ var He = n("tag:yaml.org,2002:omap", {
|
|
|
425
425
|
return r.length === 1 ? (e.push([r[0], n[r[0]]]), "") : "cannot resolve a pairs item";
|
|
426
426
|
},
|
|
427
427
|
identify: () => !1
|
|
428
|
-
}),
|
|
428
|
+
}), Ge = r("tag:yaml.org,2002:map", {
|
|
429
429
|
create: () => ({}),
|
|
430
|
-
identify:
|
|
430
|
+
identify: _,
|
|
431
431
|
represent: (e) => {
|
|
432
432
|
let t = /* @__PURE__ */ new Map();
|
|
433
433
|
for (let n of Object.keys(e)) t.set(n, e[n]);
|
|
@@ -449,7 +449,7 @@ var He = n("tag:yaml.org,2002:omap", {
|
|
|
449
449
|
let n = String(t);
|
|
450
450
|
return Object.prototype.hasOwnProperty.call(e, n) ? e[n] : null;
|
|
451
451
|
}
|
|
452
|
-
}),
|
|
452
|
+
}), Ke = r("tag:yaml.org,2002:set", {
|
|
453
453
|
create: () => /* @__PURE__ */ new Set(),
|
|
454
454
|
identify: (e) => e instanceof Set,
|
|
455
455
|
represent: (e) => {
|
|
@@ -464,36 +464,36 @@ var He = n("tag:yaml.org,2002:omap", {
|
|
|
464
464
|
});
|
|
465
465
|
//#endregion
|
|
466
466
|
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
|
|
467
|
-
function
|
|
467
|
+
function v(e) {
|
|
468
468
|
"@babel/helpers - typeof";
|
|
469
|
-
return
|
|
469
|
+
return v = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
470
470
|
return typeof e;
|
|
471
471
|
} : function(e) {
|
|
472
472
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
473
|
-
},
|
|
473
|
+
}, v(e);
|
|
474
474
|
}
|
|
475
475
|
//#endregion
|
|
476
476
|
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
|
|
477
|
-
function
|
|
478
|
-
if (
|
|
477
|
+
function qe(e, t) {
|
|
478
|
+
if (v(e) != "object" || !e) return e;
|
|
479
479
|
var n = e[Symbol.toPrimitive];
|
|
480
480
|
if (n !== void 0) {
|
|
481
481
|
var r = n.call(e, t || "default");
|
|
482
|
-
if (
|
|
482
|
+
if (v(r) != "object") return r;
|
|
483
483
|
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
484
484
|
}
|
|
485
485
|
return (t === "string" ? String : Number)(e);
|
|
486
486
|
}
|
|
487
487
|
//#endregion
|
|
488
488
|
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
|
|
489
|
-
function
|
|
490
|
-
var t =
|
|
491
|
-
return
|
|
489
|
+
function Je(e) {
|
|
490
|
+
var t = qe(e, "string");
|
|
491
|
+
return v(t) == "symbol" ? t : t + "";
|
|
492
492
|
}
|
|
493
493
|
//#endregion
|
|
494
494
|
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
|
|
495
|
-
function
|
|
496
|
-
return (t =
|
|
495
|
+
function y(e, t, n) {
|
|
496
|
+
return (t = Je(t)) in e ? Object.defineProperty(e, t, {
|
|
497
497
|
value: n,
|
|
498
498
|
enumerable: !0,
|
|
499
499
|
configurable: !0,
|
|
@@ -502,7 +502,7 @@ function b(e, t, n) {
|
|
|
502
502
|
}
|
|
503
503
|
//#endregion
|
|
504
504
|
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/objectSpread2.js
|
|
505
|
-
function
|
|
505
|
+
function Ye(e, t) {
|
|
506
506
|
var n = Object.keys(e);
|
|
507
507
|
if (Object.getOwnPropertySymbols) {
|
|
508
508
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -512,12 +512,12 @@ function Je(e, t) {
|
|
|
512
512
|
}
|
|
513
513
|
return n;
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function b(e) {
|
|
516
516
|
for (var t = 1; t < arguments.length; t++) {
|
|
517
517
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
518
|
-
t % 2 ?
|
|
519
|
-
|
|
520
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
518
|
+
t % 2 ? Ye(Object(n), !0).forEach(function(t) {
|
|
519
|
+
y(e, t, n[t]);
|
|
520
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Ye(Object(n)).forEach(function(t) {
|
|
521
521
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
522
522
|
});
|
|
523
523
|
}
|
|
@@ -525,21 +525,21 @@ function x(e) {
|
|
|
525
525
|
}
|
|
526
526
|
//#endregion
|
|
527
527
|
//#region src/schema.ts
|
|
528
|
-
function
|
|
528
|
+
function Xe() {
|
|
529
529
|
return {
|
|
530
530
|
scalar: Object.create(null),
|
|
531
531
|
sequence: Object.create(null),
|
|
532
532
|
mapping: Object.create(null)
|
|
533
533
|
};
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function Ze() {
|
|
536
536
|
return {
|
|
537
537
|
scalar: [],
|
|
538
538
|
sequence: [],
|
|
539
539
|
mapping: []
|
|
540
540
|
};
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function Qe(e) {
|
|
543
543
|
let t = [];
|
|
544
544
|
for (let n of e) {
|
|
545
545
|
let e = t.length;
|
|
@@ -554,10 +554,10 @@ function Ze(e) {
|
|
|
554
554
|
}
|
|
555
555
|
return t;
|
|
556
556
|
}
|
|
557
|
-
var
|
|
557
|
+
var x = class t {
|
|
558
558
|
constructor(e) {
|
|
559
|
-
|
|
560
|
-
let t =
|
|
559
|
+
y(this, "tags", void 0), y(this, "implicitScalarTags", void 0), y(this, "implicitScalarByFirstChar", void 0), y(this, "implicitScalarAnyFirstChar", void 0), y(this, "defaultScalarTag", void 0), y(this, "defaultSequenceTag", void 0), y(this, "defaultMappingTag", void 0), y(this, "exact", void 0), y(this, "prefix", void 0);
|
|
560
|
+
let t = Qe(e), n = [], r = Xe(), i = Ze();
|
|
561
561
|
for (let e of t) {
|
|
562
562
|
if (e.nodeKind === "scalar" && e.implicit) {
|
|
563
563
|
if (e.matchByTagPrefix) throw Error("Implicit scalar tags cannot match by tag prefix");
|
|
@@ -619,47 +619,47 @@ var S = class t {
|
|
|
619
619
|
for (let t of e) n = n.concat(t);
|
|
620
620
|
return new t([...this.tags, ...n]);
|
|
621
621
|
}
|
|
622
|
-
},
|
|
622
|
+
}, S = new x([
|
|
623
623
|
i,
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
]),
|
|
627
|
-
...
|
|
624
|
+
Ve,
|
|
625
|
+
Ge
|
|
626
|
+
]), $e = new x([
|
|
627
|
+
...S.tags,
|
|
628
628
|
s,
|
|
629
629
|
h,
|
|
630
630
|
fe,
|
|
631
|
-
|
|
632
|
-
]),
|
|
633
|
-
...
|
|
631
|
+
Ee
|
|
632
|
+
]), et = new x([
|
|
633
|
+
...S.tags,
|
|
634
634
|
o,
|
|
635
635
|
f,
|
|
636
636
|
se,
|
|
637
|
-
|
|
638
|
-
]),
|
|
639
|
-
...
|
|
637
|
+
xe
|
|
638
|
+
]), tt = new x([
|
|
639
|
+
...S.tags,
|
|
640
640
|
l,
|
|
641
641
|
ne,
|
|
642
|
+
ge,
|
|
642
643
|
g,
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
Pe,
|
|
647
|
-
He,
|
|
644
|
+
Be,
|
|
645
|
+
je,
|
|
646
|
+
Fe,
|
|
648
647
|
Ue,
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
648
|
+
We,
|
|
649
|
+
Ke
|
|
650
|
+
]), nt = tt.withTags(b(b({}, ge), {}, { resolve: (t, n, r) => {
|
|
651
|
+
let i = ge.resolve(t, n, r);
|
|
652
652
|
return i === e ? se.resolve(t, n, r) : i;
|
|
653
|
-
} }),
|
|
654
|
-
let i =
|
|
655
|
-
return i === e ?
|
|
656
|
-
} })),
|
|
653
|
+
} }), b(b({}, g), {}, { resolve: (t, n, r) => {
|
|
654
|
+
let i = g.resolve(t, n, r);
|
|
655
|
+
return i === e ? xe.resolve(t, n, r) : i;
|
|
656
|
+
} })), rt = r("tag:yaml.org,2002:map", {
|
|
657
657
|
create: () => /* @__PURE__ */ new Map(),
|
|
658
658
|
addPair: (e, t, n) => (e.set(t, n), ""),
|
|
659
659
|
has: (e, t) => e.has(t),
|
|
660
660
|
keys: (e) => e.keys(),
|
|
661
661
|
get: (e, t) => e.get(t),
|
|
662
|
-
identify: (e) => e instanceof Map ||
|
|
662
|
+
identify: (e) => e instanceof Map || _(e),
|
|
663
663
|
represent: (e) => {
|
|
664
664
|
if (e instanceof Map) return e;
|
|
665
665
|
let t = /* @__PURE__ */ new Map(), n = e;
|
|
@@ -669,7 +669,7 @@ var S = class t {
|
|
|
669
669
|
});
|
|
670
670
|
//#endregion
|
|
671
671
|
//#region src/tag/mapping/legacy_map.ts
|
|
672
|
-
function
|
|
672
|
+
function it(e) {
|
|
673
673
|
if (Array.isArray(e)) {
|
|
674
674
|
let t = Array.prototype.slice.call(e);
|
|
675
675
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -680,16 +680,16 @@ function rt(e) {
|
|
|
680
680
|
}
|
|
681
681
|
return typeof e == "object" && Object.prototype.toString.call(e) === "[object Object]" ? "[object Object]" : String(e);
|
|
682
682
|
}
|
|
683
|
-
var
|
|
683
|
+
var at = r("tag:yaml.org,2002:map", {
|
|
684
684
|
create: () => ({}),
|
|
685
|
-
identify:
|
|
685
|
+
identify: _,
|
|
686
686
|
represent: (e) => {
|
|
687
687
|
let t = /* @__PURE__ */ new Map();
|
|
688
688
|
for (let n of Object.keys(e)) t.set(n, e[n]);
|
|
689
689
|
return t;
|
|
690
690
|
},
|
|
691
691
|
addPair: (e, t, n) => {
|
|
692
|
-
let r =
|
|
692
|
+
let r = it(t);
|
|
693
693
|
return r === null ? "nested arrays are not supported inside keys" : (r === "__proto__" ? Object.defineProperty(e, r, {
|
|
694
694
|
value: n,
|
|
695
695
|
enumerable: !0,
|
|
@@ -698,7 +698,7 @@ var it = r("tag:yaml.org,2002:map", {
|
|
|
698
698
|
}) : e[r] = n, "");
|
|
699
699
|
},
|
|
700
700
|
has: (e, t) => {
|
|
701
|
-
let n =
|
|
701
|
+
let n = it(t);
|
|
702
702
|
return n !== null && Object.prototype.hasOwnProperty.call(e, n);
|
|
703
703
|
},
|
|
704
704
|
keys: (e) => Object.keys(e),
|
|
@@ -706,52 +706,52 @@ var it = r("tag:yaml.org,2002:map", {
|
|
|
706
706
|
let n = String(t);
|
|
707
707
|
return Object.prototype.hasOwnProperty.call(e, n) ? e[n] : null;
|
|
708
708
|
}
|
|
709
|
-
}),
|
|
709
|
+
}), ot = {
|
|
710
710
|
maxLength: 79,
|
|
711
711
|
indent: 1,
|
|
712
712
|
linesBefore: 3,
|
|
713
713
|
linesAfter: 2
|
|
714
714
|
};
|
|
715
|
-
function
|
|
715
|
+
function st(e, t, n, r, i) {
|
|
716
716
|
let a = "", o = "", s = Math.floor(i / 2) - 1;
|
|
717
717
|
return r - t > s && (a = " ... ", t = r - s + a.length), n - r > s && (o = " ...", n = r + s - o.length), {
|
|
718
718
|
str: a + e.slice(t, n).replace(/\t/g, "→") + o,
|
|
719
719
|
pos: r - t + a.length
|
|
720
720
|
};
|
|
721
721
|
}
|
|
722
|
-
function
|
|
722
|
+
function ct(e, t) {
|
|
723
723
|
return " ".repeat(Math.max(t - e.length, 0)) + e;
|
|
724
724
|
}
|
|
725
|
-
function
|
|
725
|
+
function lt(e, t) {
|
|
726
726
|
if (!e.buffer) return null;
|
|
727
|
-
let n =
|
|
727
|
+
let n = b(b({}, ot), t), r = /\r?\n|\r|\0/g, i = [0], a = [], o, s = -1;
|
|
728
728
|
for (; o = r.exec(e.buffer);) a.push(o.index), i.push(o.index + o[0].length), e.position <= o.index && s < 0 && (s = i.length - 2);
|
|
729
729
|
s < 0 && (s = i.length - 1);
|
|
730
730
|
let c = "", l = Math.min(e.line + n.linesAfter, a.length).toString().length, u = n.maxLength - (n.indent + l + 3);
|
|
731
731
|
for (let t = 1; t <= n.linesBefore && !(s - t < 0); t++) {
|
|
732
|
-
let r =
|
|
733
|
-
c = `${" ".repeat(n.indent)}${
|
|
732
|
+
let r = st(e.buffer, i[s - t], a[s - t], e.position - (i[s] - i[s - t]), u);
|
|
733
|
+
c = `${" ".repeat(n.indent)}${ct((e.line - t + 1).toString(), l)} | ${r.str}\n${c}`;
|
|
734
734
|
}
|
|
735
|
-
let d =
|
|
736
|
-
c += `${" ".repeat(n.indent)}${
|
|
735
|
+
let d = st(e.buffer, i[s], a[s], e.position, u);
|
|
736
|
+
c += `${" ".repeat(n.indent)}${ct((e.line + 1).toString(), l)} | ${d.str}\n`, c += `${"-".repeat(n.indent + l + 3 + d.pos)}^\n`;
|
|
737
737
|
for (let t = 1; t <= n.linesAfter && !(s + t >= a.length); t++) {
|
|
738
|
-
let r =
|
|
739
|
-
c += `${" ".repeat(n.indent)}${
|
|
738
|
+
let r = st(e.buffer, i[s + t], a[s + t], e.position - (i[s] - i[s + t]), u);
|
|
739
|
+
c += `${" ".repeat(n.indent)}${ct((e.line + t + 1).toString(), l)} | ${r.str}\n`;
|
|
740
740
|
}
|
|
741
741
|
return c.replace(/\n$/, "");
|
|
742
742
|
}
|
|
743
743
|
//#endregion
|
|
744
744
|
//#region src/common/exception.ts
|
|
745
|
-
function
|
|
745
|
+
function ut(e, t) {
|
|
746
746
|
let n = "";
|
|
747
747
|
return e.mark ? (e.mark.name && (n += `in "${e.mark.name}" `), n += `(${e.mark.line + 1}:${e.mark.column + 1})`, !t && e.mark.snippet && (n += `\n\n${e.mark.snippet}`), `${e.reason} ${n}`) : e.reason;
|
|
748
748
|
}
|
|
749
|
-
var
|
|
749
|
+
var C = class e extends Error {
|
|
750
750
|
constructor(e, t) {
|
|
751
|
-
super(),
|
|
751
|
+
super(), y(this, "reason", void 0), y(this, "mark", void 0), this.name = "YAMLException", this.reason = e, this.mark = t, this.message = ut(this, !1), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
|
|
752
752
|
}
|
|
753
753
|
toString(e) {
|
|
754
|
-
return `${this.name}: ${
|
|
754
|
+
return `${this.name}: ${ut(this, e)}`;
|
|
755
755
|
}
|
|
756
756
|
static throwAt(t, n, r, i = "") {
|
|
757
757
|
let a = 0, o = 0;
|
|
@@ -766,30 +766,30 @@ var w = class e extends Error {
|
|
|
766
766
|
line: a,
|
|
767
767
|
column: n - o
|
|
768
768
|
};
|
|
769
|
-
throw s.snippet =
|
|
769
|
+
throw s.snippet = lt(s), new e(r, s);
|
|
770
770
|
}
|
|
771
|
-
},
|
|
771
|
+
}, w = {
|
|
772
772
|
DOCUMENT: 1,
|
|
773
773
|
SEQUENCE: 2,
|
|
774
774
|
MAPPING: 3,
|
|
775
775
|
SCALAR: 4,
|
|
776
776
|
ALIAS: 5,
|
|
777
777
|
POP: 6
|
|
778
|
-
},
|
|
778
|
+
}, T = {
|
|
779
779
|
PLAIN: 1,
|
|
780
780
|
SINGLE_QUOTED: 2,
|
|
781
781
|
DOUBLE_QUOTED: 3,
|
|
782
782
|
LITERAL_BLOCK: 4,
|
|
783
783
|
FOLDED_BLOCK: 5
|
|
784
|
-
},
|
|
784
|
+
}, E = {
|
|
785
785
|
BLOCK: 1,
|
|
786
786
|
FLOW: 2
|
|
787
|
-
},
|
|
787
|
+
}, D = {
|
|
788
788
|
CLIP: 1,
|
|
789
789
|
STRIP: 2,
|
|
790
790
|
KEEP: 3
|
|
791
|
-
},
|
|
792
|
-
function
|
|
791
|
+
}, dt = -1;
|
|
792
|
+
function ft(e) {
|
|
793
793
|
switch (e) {
|
|
794
794
|
case 48: return "\0";
|
|
795
795
|
case 97: return "\x07";
|
|
@@ -812,18 +812,18 @@ function dt(e) {
|
|
|
812
812
|
default: return "";
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
|
-
var
|
|
816
|
-
for (let e = 0; e < 256; e++)
|
|
817
|
-
function
|
|
815
|
+
var pt = Array(256), mt = Array(256);
|
|
816
|
+
for (let e = 0; e < 256; e++) pt[e] = +!!ft(e), mt[e] = ft(e);
|
|
817
|
+
function ht(e) {
|
|
818
818
|
return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode((e - 65536 >> 10) + 55296, (e - 65536 & 1023) + 56320);
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function gt(e) {
|
|
821
821
|
return e >= 48 && e <= 57 ? e - 48 : (e | 32) - 97 + 10;
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function _t(e) {
|
|
824
824
|
return e === 120 ? 2 : e === 117 ? 4 : 8;
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function O(e, t, n) {
|
|
827
827
|
let r = 0;
|
|
828
828
|
for (; t < n;) {
|
|
829
829
|
let n = e.charCodeAt(t);
|
|
@@ -846,7 +846,7 @@ function yt(e, t, n) {
|
|
|
846
846
|
let t = e.charCodeAt(i);
|
|
847
847
|
if (t === 10 || t === 13) {
|
|
848
848
|
r += e.slice(a, o);
|
|
849
|
-
let t =
|
|
849
|
+
let t = O(e, i, n);
|
|
850
850
|
r += vt(t.breaks), i = a = o = t.position;
|
|
851
851
|
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
852
852
|
}
|
|
@@ -859,7 +859,7 @@ function bt(e, t, n) {
|
|
|
859
859
|
if (t === 39) r += e.slice(a, i) + "'", i += 2, a = o = i;
|
|
860
860
|
else if (t === 10 || t === 13) {
|
|
861
861
|
r += e.slice(a, o);
|
|
862
|
-
let t =
|
|
862
|
+
let t = O(e, i, n);
|
|
863
863
|
r += vt(t.breaks), i = a = o = t.position;
|
|
864
864
|
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
865
865
|
}
|
|
@@ -872,21 +872,21 @@ function xt(e, t, n) {
|
|
|
872
872
|
if (t === 92) {
|
|
873
873
|
r += e.slice(a, i), i++;
|
|
874
874
|
let t = e.charCodeAt(i);
|
|
875
|
-
if (t === 10 || t === 13) i =
|
|
876
|
-
else if (t < 256 &&
|
|
875
|
+
if (t === 10 || t === 13) i = O(e, i, n).position;
|
|
876
|
+
else if (t < 256 && pt[t]) r += mt[t], i++;
|
|
877
877
|
else {
|
|
878
|
-
let n =
|
|
878
|
+
let n = _t(t), a = 0;
|
|
879
879
|
for (; n > 0; n--) {
|
|
880
880
|
i++;
|
|
881
|
-
let t =
|
|
881
|
+
let t = gt(e.charCodeAt(i));
|
|
882
882
|
a = (a << 4) + t;
|
|
883
883
|
}
|
|
884
|
-
r +=
|
|
884
|
+
r += ht(a), i++;
|
|
885
885
|
}
|
|
886
886
|
a = o = i;
|
|
887
887
|
} else if (t === 10 || t === 13) {
|
|
888
888
|
r += e.slice(a, o);
|
|
889
|
-
let t =
|
|
889
|
+
let t = O(e, i, n);
|
|
890
890
|
r += vt(t.breaks), i = a = o = t.position;
|
|
891
891
|
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
892
892
|
}
|
|
@@ -904,17 +904,17 @@ function St(e, t, n, r, i, a) {
|
|
|
904
904
|
let n = e.slice(o), i = n.charCodeAt(0);
|
|
905
905
|
a ? i === 32 || i === 9 ? (f = !0, l += "\n".repeat(u ? 1 + d : d)) : f ? (f = !1, l += "\n".repeat(d + 1)) : d === 0 ? u && (l += " ") : l += "\n".repeat(d) : l += "\n".repeat(u ? 1 + d : d), l += n, u = !0, d = 0;
|
|
906
906
|
}
|
|
907
|
-
return i ===
|
|
907
|
+
return i === D.KEEP ? l += "\n".repeat(u ? 1 + d : d) : i !== D.STRIP && u && (l += "\n"), l;
|
|
908
908
|
}
|
|
909
909
|
function Ct(e, t) {
|
|
910
|
-
if (t.valueStart ===
|
|
910
|
+
if (t.valueStart === dt) return "";
|
|
911
911
|
let { valueStart: n, valueEnd: r } = t;
|
|
912
912
|
if (t.fast) return e.slice(n, r);
|
|
913
913
|
switch (t.style) {
|
|
914
|
-
case
|
|
915
|
-
case
|
|
916
|
-
case
|
|
917
|
-
case
|
|
914
|
+
case T.SINGLE_QUOTED: return bt(e, n, r);
|
|
915
|
+
case T.DOUBLE_QUOTED: return xt(e, n, r);
|
|
916
|
+
case T.LITERAL_BLOCK: return St(e, n, r, t.indent, t.chomping, !1);
|
|
917
|
+
case T.FOLDED_BLOCK: return St(e, n, r, t.indent, t.chomping, !0);
|
|
918
918
|
default: return yt(e, n, r);
|
|
919
919
|
}
|
|
920
920
|
}
|
|
@@ -941,7 +941,7 @@ function Dt(e) {
|
|
|
941
941
|
//#region src/parser/constructor.ts
|
|
942
942
|
var k = -1, Ot = "tag:yaml.org,2002:merge", kt = {
|
|
943
943
|
filename: "",
|
|
944
|
-
schema:
|
|
944
|
+
schema: et,
|
|
945
945
|
json: !1,
|
|
946
946
|
maxTotalMergeKeys: 1e4,
|
|
947
947
|
maxAliases: -1
|
|
@@ -950,14 +950,14 @@ function At(e) {
|
|
|
950
950
|
return "tagStart" in e && e.tagStart !== k ? e.tagStart : "anchorStart" in e && e.anchorStart !== k ? e.anchorStart : "valueStart" in e && e.valueStart !== k ? e.valueStart : "start" in e ? e.start : 0;
|
|
951
951
|
}
|
|
952
952
|
function A(e, t) {
|
|
953
|
-
|
|
953
|
+
C.throwAt(e.source, e.position, t, e.filename);
|
|
954
954
|
}
|
|
955
955
|
function jt(e, t, n, r) {
|
|
956
956
|
try {
|
|
957
957
|
return n.finalize(r);
|
|
958
958
|
} catch (n) {
|
|
959
|
-
if (n instanceof
|
|
960
|
-
|
|
959
|
+
if (n instanceof C) throw n;
|
|
960
|
+
C.throwAt(e.source, t, n instanceof Error ? n.message : String(n), e.filename);
|
|
961
961
|
}
|
|
962
962
|
}
|
|
963
963
|
function Mt(t, n) {
|
|
@@ -987,7 +987,7 @@ function Mt(t, n) {
|
|
|
987
987
|
}
|
|
988
988
|
A(t, `unknown scalar tag !<${n}>`);
|
|
989
989
|
}
|
|
990
|
-
return n.style ===
|
|
990
|
+
return n.style === T.PLAIN ? t.schema.resolveImplicitScalarTag(r) : {
|
|
991
991
|
value: a.resolve(r, !1, a.tagName),
|
|
992
992
|
tag: a
|
|
993
993
|
};
|
|
@@ -1054,7 +1054,7 @@ function Bt(e, t, n, r, i) {
|
|
|
1054
1054
|
return null;
|
|
1055
1055
|
}
|
|
1056
1056
|
function Vt(e, t) {
|
|
1057
|
-
let n =
|
|
1057
|
+
let n = b(b(b({}, kt), t), {}, {
|
|
1058
1058
|
events: e,
|
|
1059
1059
|
documents: [],
|
|
1060
1060
|
eventIndex: 0,
|
|
@@ -1069,7 +1069,7 @@ function Vt(e, t) {
|
|
|
1069
1069
|
for (; n.eventIndex < n.events.length;) {
|
|
1070
1070
|
let e = n.events[n.eventIndex++];
|
|
1071
1071
|
switch (n.position = At(e), e.type) {
|
|
1072
|
-
case
|
|
1072
|
+
case w.DOCUMENT:
|
|
1073
1073
|
n.anchors = /* @__PURE__ */ new Map(), n.nodeTags = /* @__PURE__ */ new Map(), n.aliasCount = 0, n.tagHandlers = Object.create(null);
|
|
1074
1074
|
for (let t of e.directives) t.kind === "tag" && (n.tagHandlers[t.handle] = t.prefix);
|
|
1075
1075
|
n.frames.push({
|
|
@@ -1079,12 +1079,12 @@ function Vt(e, t) {
|
|
|
1079
1079
|
hasValue: !1
|
|
1080
1080
|
});
|
|
1081
1081
|
break;
|
|
1082
|
-
case
|
|
1082
|
+
case w.SCALAR: {
|
|
1083
1083
|
let { value: t, tag: r } = Mt(n, e);
|
|
1084
1084
|
Bt(n, e, t, r, !0), zt(n, t, r);
|
|
1085
1085
|
break;
|
|
1086
1086
|
}
|
|
1087
|
-
case
|
|
1087
|
+
case w.SEQUENCE: {
|
|
1088
1088
|
let t = Nt(n, e, "tag:yaml.org,2002:seq"), r = n.schema.lookupSequenceTag(t);
|
|
1089
1089
|
r || A(n, `unknown sequence tag !<${t}>`);
|
|
1090
1090
|
let i = r.create(t), a = Bt(n, e, i, r, r.carrierIsResult);
|
|
@@ -1098,7 +1098,7 @@ function Vt(e, t) {
|
|
|
1098
1098
|
});
|
|
1099
1099
|
break;
|
|
1100
1100
|
}
|
|
1101
|
-
case
|
|
1101
|
+
case w.MAPPING: {
|
|
1102
1102
|
let t = Nt(n, e, "tag:yaml.org,2002:map"), r = n.schema.lookupMappingTag(t);
|
|
1103
1103
|
r || A(n, `unknown mapping tag !<${t}>`);
|
|
1104
1104
|
let i = r.create(t), a = Bt(n, e, i, r, r.carrierIsResult);
|
|
@@ -1116,13 +1116,13 @@ function Vt(e, t) {
|
|
|
1116
1116
|
});
|
|
1117
1117
|
break;
|
|
1118
1118
|
}
|
|
1119
|
-
case
|
|
1119
|
+
case w.ALIAS: {
|
|
1120
1120
|
n.maxAliases !== -1 && ++n.aliasCount > n.maxAliases && A(n, `aliases exceeded maxAliases (${n.maxAliases})`);
|
|
1121
1121
|
let t = n.source.slice(e.anchorStart, e.anchorEnd), r = n.anchors.get(t);
|
|
1122
1122
|
r || A(n, `unidentified alias "${t}"`), r.isValueFinal || A(n, `recursive alias "${t}" is not supported for tag ${r.tag.tagName} because it uses finalize()`), zt(n, r.value, r.tag);
|
|
1123
1123
|
break;
|
|
1124
1124
|
}
|
|
1125
|
-
case
|
|
1125
|
+
case w.POP: {
|
|
1126
1126
|
let e = n.frames.pop();
|
|
1127
1127
|
if (e.kind === "mapping" && e.hasKey && (n.position = e.keyPosition, A(n, "incomplete mapping pair in event stream")), e.kind === "document") n.documents.push(e.value);
|
|
1128
1128
|
else {
|
|
@@ -1137,21 +1137,21 @@ function Vt(e, t) {
|
|
|
1137
1137
|
}
|
|
1138
1138
|
//#endregion
|
|
1139
1139
|
//#region src/parser/parser.ts
|
|
1140
|
-
var j = -1, Ht = Object.prototype.hasOwnProperty, M = 1, Ut = 2, Wt = 3,
|
|
1140
|
+
var j = -1, Ht = Object.prototype.hasOwnProperty, M = 1, Ut = 2, Wt = 3, N = 4, Gt = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Kt = /[,\[\]{}]/, qt = /^(?:!|!!|![0-9A-Za-z-]+!)$/, Jt = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`, Yt = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`, Xt = RegExp(`^(?:${Jt})*$`), Zt = RegExp(`^(?:${Yt})+$`), Qt = RegExp(`^(?:!(?:${Jt})*|${Yt}(?:${Jt})*)$`), $t = {
|
|
1141
1141
|
filename: "",
|
|
1142
1142
|
maxDepth: 100
|
|
1143
1143
|
};
|
|
1144
|
-
function
|
|
1144
|
+
function en(e, t, n) {
|
|
1145
1145
|
e.events.push({
|
|
1146
|
-
type:
|
|
1146
|
+
type: w.DOCUMENT,
|
|
1147
1147
|
explicitStart: t,
|
|
1148
1148
|
explicitEnd: n,
|
|
1149
1149
|
directives: e.directives
|
|
1150
1150
|
});
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function tn(e, t, n, r, i, a, o) {
|
|
1153
1153
|
e.events.push({
|
|
1154
|
-
type:
|
|
1154
|
+
type: w.SEQUENCE,
|
|
1155
1155
|
start: t,
|
|
1156
1156
|
anchorStart: n,
|
|
1157
1157
|
anchorEnd: r,
|
|
@@ -1160,9 +1160,9 @@ function nn(e, t, n, r, i, a, o) {
|
|
|
1160
1160
|
style: o
|
|
1161
1161
|
});
|
|
1162
1162
|
}
|
|
1163
|
-
function
|
|
1163
|
+
function nn(e, t, n, r, i, a, o) {
|
|
1164
1164
|
e.events.push({
|
|
1165
|
-
type:
|
|
1165
|
+
type: w.MAPPING,
|
|
1166
1166
|
start: t,
|
|
1167
1167
|
anchorStart: n,
|
|
1168
1168
|
anchorEnd: r,
|
|
@@ -1171,20 +1171,20 @@ function rn(e, t, n, r, i, a, o) {
|
|
|
1171
1171
|
style: o
|
|
1172
1172
|
});
|
|
1173
1173
|
}
|
|
1174
|
-
function
|
|
1174
|
+
function rn(e, t) {
|
|
1175
1175
|
e.events.splice(t.eventsLength, 0, {
|
|
1176
|
-
type:
|
|
1176
|
+
type: w.MAPPING,
|
|
1177
1177
|
start: t.position,
|
|
1178
1178
|
anchorStart: j,
|
|
1179
1179
|
anchorEnd: j,
|
|
1180
1180
|
tagStart: j,
|
|
1181
1181
|
tagEnd: j,
|
|
1182
|
-
style:
|
|
1182
|
+
style: E.FLOW
|
|
1183
1183
|
});
|
|
1184
1184
|
}
|
|
1185
|
-
function
|
|
1185
|
+
function P(e, t, n, r, i, a, o, s, c = D.CLIP, l = -1, u = !1) {
|
|
1186
1186
|
e.events.push({
|
|
1187
|
-
type:
|
|
1187
|
+
type: w.SCALAR,
|
|
1188
1188
|
valueStart: t,
|
|
1189
1189
|
valueEnd: n,
|
|
1190
1190
|
anchorStart: r,
|
|
@@ -1197,20 +1197,20 @@ function N(e, t, n, r, i, a, o, s, c = O.CLIP, l = -1, u = !1) {
|
|
|
1197
1197
|
fast: u
|
|
1198
1198
|
});
|
|
1199
1199
|
}
|
|
1200
|
-
function
|
|
1200
|
+
function an(e, t, n) {
|
|
1201
1201
|
e.events.push({
|
|
1202
|
-
type:
|
|
1202
|
+
type: w.ALIAS,
|
|
1203
1203
|
anchorStart: t,
|
|
1204
1204
|
anchorEnd: n
|
|
1205
1205
|
});
|
|
1206
1206
|
}
|
|
1207
|
-
function P(e) {
|
|
1208
|
-
e.events.push({ type: T.POP });
|
|
1209
|
-
}
|
|
1210
1207
|
function F(e) {
|
|
1211
|
-
|
|
1208
|
+
e.events.push({ type: w.POP });
|
|
1209
|
+
}
|
|
1210
|
+
function I(e) {
|
|
1211
|
+
P(e, j, j, j, j, j, j, T.PLAIN);
|
|
1212
1212
|
}
|
|
1213
|
-
function
|
|
1213
|
+
function on() {
|
|
1214
1214
|
return {
|
|
1215
1215
|
anchorStart: j,
|
|
1216
1216
|
anchorEnd: j,
|
|
@@ -1218,7 +1218,7 @@ function sn() {
|
|
|
1218
1218
|
tagEnd: j
|
|
1219
1219
|
};
|
|
1220
1220
|
}
|
|
1221
|
-
function
|
|
1221
|
+
function L(e) {
|
|
1222
1222
|
return {
|
|
1223
1223
|
position: e.position,
|
|
1224
1224
|
line: e.line,
|
|
@@ -1228,116 +1228,116 @@ function I(e) {
|
|
|
1228
1228
|
eventsLength: e.events.length
|
|
1229
1229
|
};
|
|
1230
1230
|
}
|
|
1231
|
-
function L(e, t) {
|
|
1232
|
-
e.position = t.position, e.line = t.line, e.lineStart = t.lineStart, e.lineIndent = t.lineIndent, e.firstTabInLine = t.firstTabInLine, e.events.length = t.eventsLength;
|
|
1233
|
-
}
|
|
1234
1231
|
function R(e, t) {
|
|
1235
|
-
|
|
1232
|
+
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;
|
|
1236
1233
|
}
|
|
1237
|
-
function z(e) {
|
|
1238
|
-
|
|
1234
|
+
function z(e, t) {
|
|
1235
|
+
C.throwAt(e.input.slice(0, e.length), e.position, t, e.filename);
|
|
1239
1236
|
}
|
|
1240
1237
|
function B(e) {
|
|
1241
|
-
return e ===
|
|
1238
|
+
return e === 10 || e === 13;
|
|
1242
1239
|
}
|
|
1243
1240
|
function V(e) {
|
|
1244
|
-
return
|
|
1241
|
+
return e === 9 || e === 32;
|
|
1245
1242
|
}
|
|
1246
1243
|
function H(e) {
|
|
1247
|
-
return e
|
|
1244
|
+
return V(e) || B(e);
|
|
1248
1245
|
}
|
|
1249
1246
|
function U(e) {
|
|
1247
|
+
return e === 0 || H(e);
|
|
1248
|
+
}
|
|
1249
|
+
function W(e) {
|
|
1250
1250
|
return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
|
|
1251
1251
|
}
|
|
1252
|
-
function
|
|
1252
|
+
function sn(e) {
|
|
1253
1253
|
return e >= 48 && e <= 57 ? e - 48 : -1;
|
|
1254
1254
|
}
|
|
1255
|
-
function
|
|
1255
|
+
function cn(e) {
|
|
1256
1256
|
if (e >= 48 && e <= 57) return e - 48;
|
|
1257
1257
|
let t = e | 32;
|
|
1258
1258
|
return t >= 97 && t <= 102 ? t - 97 + 10 : -1;
|
|
1259
1259
|
}
|
|
1260
|
-
function
|
|
1260
|
+
function ln(e) {
|
|
1261
1261
|
return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
|
|
1262
1262
|
}
|
|
1263
|
-
function
|
|
1263
|
+
function un(e) {
|
|
1264
1264
|
return e === 48 || e === 97 || e === 98 || e === 116 || e === 9 || e === 110 || e === 118 || e === 102 || e === 114 || e === 101 || e === 32 || e === 34 || e === 47 || e === 92 || e === 78 || e === 95 || e === 76 || e === 80;
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1266
|
+
function dn(e) {
|
|
1267
1267
|
e.input.charCodeAt(e.position) === 10 ? e.position++ : (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++), e.line++, e.lineStart = e.position, e.lineIndent = 0, e.firstTabInLine = -1;
|
|
1268
1268
|
}
|
|
1269
|
-
function
|
|
1270
|
-
let n = 0, r = e.input.charCodeAt(e.position), i = e.position === e.lineStart ||
|
|
1269
|
+
function G(e, t) {
|
|
1270
|
+
let n = 0, r = e.input.charCodeAt(e.position), i = e.position === e.lineStart || H(e.input.charCodeAt(e.position - 1));
|
|
1271
1271
|
for (; r !== 0;) {
|
|
1272
|
-
for (;
|
|
1272
|
+
for (; V(r);) i = !0, r === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), r = e.input.charCodeAt(++e.position);
|
|
1273
1273
|
if (t && i && r === 35) do
|
|
1274
1274
|
r = e.input.charCodeAt(++e.position);
|
|
1275
|
-
while (!
|
|
1276
|
-
if (!
|
|
1277
|
-
for (
|
|
1275
|
+
while (!B(r) && r !== 0);
|
|
1276
|
+
if (!B(r)) break;
|
|
1277
|
+
for (dn(e), n++, i = !0, r = e.input.charCodeAt(e.position); r === 32;) e.lineIndent++, r = e.input.charCodeAt(++e.position);
|
|
1278
1278
|
}
|
|
1279
1279
|
return n;
|
|
1280
1280
|
}
|
|
1281
|
-
function
|
|
1281
|
+
function K(e, t = e.position) {
|
|
1282
1282
|
let n = e.input.charCodeAt(t);
|
|
1283
1283
|
if ((n === 45 || n === 46) && n === e.input.charCodeAt(t + 1) && n === e.input.charCodeAt(t + 2)) {
|
|
1284
1284
|
let n = e.input.charCodeAt(t + 3);
|
|
1285
|
-
return n === 0 ||
|
|
1285
|
+
return n === 0 || H(n);
|
|
1286
1286
|
}
|
|
1287
1287
|
return !1;
|
|
1288
1288
|
}
|
|
1289
|
-
function
|
|
1289
|
+
function fn(e) {
|
|
1290
1290
|
e.position === e.lineStart && e.input.charCodeAt(e.position) === 65279 && (e.position++, e.lineStart = e.position);
|
|
1291
1291
|
}
|
|
1292
|
-
function
|
|
1292
|
+
function pn(e) {
|
|
1293
1293
|
if (e.position !== e.lineStart) return !1;
|
|
1294
|
-
if (
|
|
1294
|
+
if (K(e)) return !0;
|
|
1295
1295
|
if (e.input.charCodeAt(e.position) !== 65279) return !1;
|
|
1296
|
-
let t =
|
|
1297
|
-
|
|
1298
|
-
let n = e.input.charCodeAt(e.position), r = e.position === e.lineStart && (n === 37 || n === 45 &&
|
|
1299
|
-
return
|
|
1296
|
+
let t = L(e);
|
|
1297
|
+
fn(e), G(e, !0);
|
|
1298
|
+
let n = e.input.charCodeAt(e.position), r = e.position === e.lineStart && (n === 37 || n === 45 && K(e));
|
|
1299
|
+
return R(e, t), r;
|
|
1300
1300
|
}
|
|
1301
|
-
function
|
|
1301
|
+
function mn(e) {
|
|
1302
1302
|
let t = e.input.charCodeAt(e.position);
|
|
1303
|
-
for (; t !== 0 && !
|
|
1303
|
+
for (; t !== 0 && !B(t);) t = e.input.charCodeAt(++e.position);
|
|
1304
1304
|
}
|
|
1305
|
-
function
|
|
1306
|
-
|
|
1305
|
+
function hn(e, t, n) {
|
|
1306
|
+
Gt.test(e.input.slice(t, n)) && z(e, "the stream contains non-printable characters");
|
|
1307
1307
|
}
|
|
1308
|
-
function
|
|
1308
|
+
function gn(e, t, n) {
|
|
1309
1309
|
if (e.input.charCodeAt(e.position) !== 33) return !1;
|
|
1310
|
-
t.tagStart !== j &&
|
|
1310
|
+
t.tagStart !== j && z(e, "duplication of a tag property");
|
|
1311
1311
|
let r = e.position, i = !1, a = !1, o = "!", s = e.input.charCodeAt(++e.position);
|
|
1312
1312
|
s === 60 ? (i = !0, s = e.input.charCodeAt(++e.position)) : s === 33 && (a = !0, o = "!!", s = e.input.charCodeAt(++e.position));
|
|
1313
1313
|
let c = e.position, l;
|
|
1314
1314
|
if (i) {
|
|
1315
1315
|
for (; s !== 0 && s !== 62;) s = e.input.charCodeAt(++e.position);
|
|
1316
|
-
s !== 62 &&
|
|
1316
|
+
s !== 62 && z(e, "unexpected end of the stream within a verbatim tag"), l = e.input.slice(c, e.position), e.position++;
|
|
1317
1317
|
} else {
|
|
1318
|
-
for (; s !== 0 && !
|
|
1319
|
-
l = e.input.slice(c, e.position),
|
|
1318
|
+
for (; s !== 0 && !H(s) && !(n && W(s));) s === 33 && (a ? z(e, "tag suffix cannot contain exclamation marks") : (o = e.input.slice(c - 1, e.position + 1), qt.test(o) || z(e, "named tag handle cannot contain such characters"), a = !0, c = e.position + 1)), s = e.input.charCodeAt(++e.position);
|
|
1319
|
+
l = e.input.slice(c, e.position), Kt.test(l) && z(e, "tag suffix cannot contain flow indicator characters");
|
|
1320
1320
|
}
|
|
1321
|
-
return l && !(i ?
|
|
1321
|
+
return l && !(i ? Xt.test(l) : Zt.test(l)) && z(e, `tag name cannot contain such characters: ${l}`), !i && o !== "!" && o !== "!!" && !Ht.call(e.tagHandlers, o) && z(e, `undeclared tag handle "${o}"`), t.tagStart = r, t.tagEnd = e.position, !0;
|
|
1322
1322
|
}
|
|
1323
|
-
function
|
|
1323
|
+
function _n(e, t) {
|
|
1324
1324
|
if (e.input.charCodeAt(e.position) !== 38) return !1;
|
|
1325
|
-
t.anchorStart !== j &&
|
|
1325
|
+
t.anchorStart !== j && z(e, "duplication of an anchor property"), e.position++;
|
|
1326
1326
|
let n = e.position;
|
|
1327
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1328
|
-
return e.position === n &&
|
|
1327
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !H(e.input.charCodeAt(e.position)) && !W(e.input.charCodeAt(e.position));) e.position++;
|
|
1328
|
+
return e.position === n && z(e, "name of an anchor node must contain at least one character"), t.anchorStart = n, t.anchorEnd = e.position, !0;
|
|
1329
1329
|
}
|
|
1330
|
-
function
|
|
1330
|
+
function vn(e, t) {
|
|
1331
1331
|
if (e.input.charCodeAt(e.position) !== 42) return !1;
|
|
1332
|
-
(t.anchorStart !== j || t.tagStart !== j) &&
|
|
1332
|
+
(t.anchorStart !== j || t.tagStart !== j) && z(e, "alias node should not have any properties"), e.position++;
|
|
1333
1333
|
let n = e.position;
|
|
1334
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1335
|
-
return e.position === n &&
|
|
1334
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !H(e.input.charCodeAt(e.position)) && !W(e.input.charCodeAt(e.position));) e.position++;
|
|
1335
|
+
return e.position === n && z(e, "name of an alias node must contain at least one character"), an(e, n, e.position), !0;
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1338
|
-
|
|
1337
|
+
function yn(e, t) {
|
|
1338
|
+
G(e, !1), e.lineIndent < t && z(e, "deficient indentation");
|
|
1339
1339
|
}
|
|
1340
|
-
function
|
|
1340
|
+
function bn(e, t, n) {
|
|
1341
1341
|
if (e.input.charCodeAt(e.position) !== 39) return !1;
|
|
1342
1342
|
e.position++;
|
|
1343
1343
|
let r = e.position, i = !0;
|
|
@@ -1349,13 +1349,13 @@ function xn(e, t, n) {
|
|
|
1349
1349
|
continue;
|
|
1350
1350
|
}
|
|
1351
1351
|
let t = e.position;
|
|
1352
|
-
return e.position++,
|
|
1352
|
+
return e.position++, P(e, r, t, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, T.SINGLE_QUOTED, D.CLIP, -1, i), !0;
|
|
1353
1353
|
}
|
|
1354
|
-
|
|
1354
|
+
B(a) ? (i = !1, yn(e, t)) : e.position === e.lineStart && K(e) ? z(e, "unexpected end of the document within a single quoted scalar") : a !== 9 && a < 32 ? z(e, "expected valid JSON character") : e.position++;
|
|
1355
1355
|
}
|
|
1356
|
-
|
|
1356
|
+
z(e, "unexpected end of the stream within a single quoted scalar");
|
|
1357
1357
|
}
|
|
1358
|
-
function
|
|
1358
|
+
function xn(e, t, n) {
|
|
1359
1359
|
if (e.input.charCodeAt(e.position) !== 34) return !1;
|
|
1360
1360
|
e.position++;
|
|
1361
1361
|
let r = e.position, i = !0;
|
|
@@ -1363,35 +1363,35 @@ function Sn(e, t, n) {
|
|
|
1363
1363
|
let a = e.input.charCodeAt(e.position);
|
|
1364
1364
|
if (a === 34) {
|
|
1365
1365
|
let t = e.position;
|
|
1366
|
-
return e.position++,
|
|
1366
|
+
return e.position++, P(e, r, t, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, T.DOUBLE_QUOTED, D.CLIP, -1, i), !0;
|
|
1367
1367
|
}
|
|
1368
1368
|
if (a === 92) {
|
|
1369
1369
|
i = !1;
|
|
1370
1370
|
let n = e.input.charCodeAt(++e.position);
|
|
1371
|
-
if (
|
|
1372
|
-
else if (
|
|
1371
|
+
if (B(n)) yn(e, t);
|
|
1372
|
+
else if (un(n)) e.position++;
|
|
1373
1373
|
else {
|
|
1374
|
-
let t =
|
|
1375
|
-
for (t === 0 &&
|
|
1374
|
+
let t = ln(n);
|
|
1375
|
+
for (t === 0 && z(e, "unknown escape sequence"); t-- > 0;) e.position++, cn(e.input.charCodeAt(e.position)) < 0 && z(e, "expected hexadecimal character");
|
|
1376
1376
|
e.position++;
|
|
1377
1377
|
}
|
|
1378
|
-
} else
|
|
1378
|
+
} else B(a) ? (i = !1, yn(e, t)) : e.position === e.lineStart && K(e) ? z(e, "unexpected end of the document within a double quoted scalar") : a !== 9 && a < 32 ? z(e, "expected valid JSON character") : e.position++;
|
|
1379
1379
|
}
|
|
1380
|
-
|
|
1380
|
+
z(e, "unexpected end of the stream within a double quoted scalar");
|
|
1381
1381
|
}
|
|
1382
|
-
function
|
|
1383
|
-
let r = e.input.charCodeAt(e.position), i =
|
|
1382
|
+
function Sn(e, t, n) {
|
|
1383
|
+
let r = e.input.charCodeAt(e.position), i = D.CLIP, a = -1, o = !1;
|
|
1384
1384
|
if (r !== 124 && r !== 62) return !1;
|
|
1385
|
-
let s = r === 124 ?
|
|
1385
|
+
let s = r === 124 ? T.LITERAL_BLOCK : T.FOLDED_BLOCK;
|
|
1386
1386
|
for (e.position++; e.input.charCodeAt(e.position) !== 0;) {
|
|
1387
|
-
let n = e.input.charCodeAt(e.position), r =
|
|
1388
|
-
if (n === 43 || n === 45) i !==
|
|
1389
|
-
else if (r >= 0) r === 0 &&
|
|
1387
|
+
let n = e.input.charCodeAt(e.position), r = sn(n);
|
|
1388
|
+
if (n === 43 || n === 45) i !== D.CLIP && z(e, "repeat of a chomping mode identifier"), i = n === 43 ? D.KEEP : D.STRIP, e.position++;
|
|
1389
|
+
else if (r >= 0) r === 0 && z(e, "bad explicit indentation width of a block scalar; it cannot be less than one"), o && z(e, "repeat of an indentation width identifier"), a = t + r - 1, o = !0, e.position++;
|
|
1390
1390
|
else break;
|
|
1391
1391
|
}
|
|
1392
1392
|
let c = !1;
|
|
1393
|
-
for (;
|
|
1394
|
-
c && e.input.charCodeAt(e.position) === 35 &&
|
|
1393
|
+
for (; V(e.input.charCodeAt(e.position));) c = !0, e.position++;
|
|
1394
|
+
c && e.input.charCodeAt(e.position) === 35 && mn(e), B(e.input.charCodeAt(e.position)) ? dn(e) : e.input.charCodeAt(e.position) !== 0 && z(e, "a line break is expected");
|
|
1395
1395
|
let l = o ? a : -1, u = 0, d = e.position, f = e.position;
|
|
1396
1396
|
for (; e.input.charCodeAt(e.position) !== 0;) {
|
|
1397
1397
|
let n = e.position, r = 0;
|
|
@@ -1401,170 +1401,173 @@ function Cn(e, t, n) {
|
|
|
1401
1401
|
l >= 0 ? r > l && (f = n + r) : r > 0 && (f = n + r);
|
|
1402
1402
|
break;
|
|
1403
1403
|
}
|
|
1404
|
-
if (
|
|
1405
|
-
if (!o && l === -1 &&
|
|
1404
|
+
if (pn(e)) break;
|
|
1405
|
+
if (!o && l === -1 && B(i) && (u = Math.max(u, r)), !o && l === -1 && !B(i) && (i === 9 && r < t && (e.position = n + r, z(e, "tab characters must not be used in indentation")), r >= t && r < u && (e.position = n + r, z(e, "bad indentation of a mapping entry"))), l === -1 && i !== 0 && !B(i) && r < t) {
|
|
1406
1406
|
e.lineIndent = r, e.position = n + r;
|
|
1407
1407
|
break;
|
|
1408
1408
|
}
|
|
1409
|
-
!o && i !== 0 && !
|
|
1409
|
+
!o && i !== 0 && !B(i) && l === -1 && (l = r);
|
|
1410
1410
|
let a = l === -1 ? t + 1 : l;
|
|
1411
|
-
if (i !== 0 && !
|
|
1411
|
+
if (i !== 0 && !B(i) && r < a) {
|
|
1412
1412
|
e.lineIndent = r, e.position = n + r;
|
|
1413
1413
|
break;
|
|
1414
1414
|
}
|
|
1415
|
-
|
|
1415
|
+
mn(e), f = e.position, B(e.input.charCodeAt(e.position)) && (dn(e), f = e.position);
|
|
1416
1416
|
}
|
|
1417
|
-
return
|
|
1417
|
+
return hn(e, d, f), P(e, d, f, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, s, i, l), !0;
|
|
1418
1418
|
}
|
|
1419
|
-
function
|
|
1419
|
+
function Cn(e, t) {
|
|
1420
1420
|
let n = e.input.charCodeAt(e.position), r = t === M;
|
|
1421
|
-
if (n === 0 ||
|
|
1421
|
+
if (n === 0 || H(n) || n === 35 || n === 38 || n === 42 || n === 33 || n === 124 || n === 62 || n === 39 || n === 34 || n === 37 || n === 64 || n === 96 || r && W(n)) return !1;
|
|
1422
1422
|
if (n === 63 || n === 45) {
|
|
1423
1423
|
let t = e.input.charCodeAt(e.position + 1);
|
|
1424
|
-
if (
|
|
1424
|
+
if (U(t) || r && W(t)) return !1;
|
|
1425
1425
|
}
|
|
1426
1426
|
return !0;
|
|
1427
1427
|
}
|
|
1428
|
-
function
|
|
1429
|
-
if (!
|
|
1428
|
+
function wn(e, t, n, r) {
|
|
1429
|
+
if (!Cn(e, n)) return !1;
|
|
1430
1430
|
let i = e.position, a = e.position, o = e.input.charCodeAt(e.position), s = n === M, c = !1;
|
|
1431
|
-
for (; o !== 0 && !
|
|
1431
|
+
for (; o !== 0 && !pn(e);) {
|
|
1432
1432
|
if (o === 58) {
|
|
1433
1433
|
let t = e.input.charCodeAt(e.position + 1);
|
|
1434
|
-
if (
|
|
1434
|
+
if (U(t) || s && W(t)) break;
|
|
1435
1435
|
} else if (o === 35) {
|
|
1436
|
-
if (
|
|
1437
|
-
} else if (s &&
|
|
1438
|
-
else if (
|
|
1436
|
+
if (H(e.input.charCodeAt(e.position - 1))) break;
|
|
1437
|
+
} else if (s && W(o)) break;
|
|
1438
|
+
else if (B(o)) {
|
|
1439
1439
|
let n = e.position, r = e.line, i = e.lineStart, a = e.lineIndent;
|
|
1440
|
-
if (
|
|
1440
|
+
if (G(e, !1), e.lineIndent >= t) {
|
|
1441
1441
|
c = !0, o = e.input.charCodeAt(e.position);
|
|
1442
1442
|
continue;
|
|
1443
1443
|
}
|
|
1444
1444
|
e.position = n, e.line = r, e.lineStart = i, e.lineIndent = a;
|
|
1445
1445
|
break;
|
|
1446
1446
|
}
|
|
1447
|
-
|
|
1447
|
+
V(o) || (a = e.position + 1), o = e.input.charCodeAt(++e.position);
|
|
1448
1448
|
}
|
|
1449
|
-
return a === i ? !1 : (
|
|
1449
|
+
return a === i ? !1 : (hn(e, i, a), P(e, i, a, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, T.PLAIN, D.CLIP, -1, !c), !0);
|
|
1450
1450
|
}
|
|
1451
|
-
function
|
|
1451
|
+
function q(e, t) {
|
|
1452
1452
|
let n = e.line;
|
|
1453
|
-
|
|
1453
|
+
G(e, !0), (e.line > n && e.lineIndent < t || e.firstTabInLine !== -1 && e.lineIndent < t) && z(e, "deficient indentation");
|
|
1454
1454
|
}
|
|
1455
|
-
function
|
|
1455
|
+
function Tn(e, t, n) {
|
|
1456
1456
|
let r = e.input.charCodeAt(e.position), i = r === 123, a = e.position, o = !0;
|
|
1457
1457
|
if (r !== 91 && r !== 123) return !1;
|
|
1458
1458
|
let s = i ? 125 : 93;
|
|
1459
|
-
for (i ?
|
|
1460
|
-
|
|
1459
|
+
for (i ? nn(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, E.FLOW) : tn(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, E.FLOW), e.position++; e.input.charCodeAt(e.position) !== 0;) {
|
|
1460
|
+
q(e, t);
|
|
1461
1461
|
let n = e.input.charCodeAt(e.position);
|
|
1462
|
-
if (n === s) return e.position++,
|
|
1463
|
-
o ? n === 44 &&
|
|
1462
|
+
if (n === s) return e.position++, F(e), !0;
|
|
1463
|
+
o ? n === 44 && z(e, "expected the node content, but found ','") : z(e, "missed comma between flow collection entries");
|
|
1464
1464
|
let r = !1, a = !1;
|
|
1465
|
-
n === 63 &&
|
|
1466
|
-
let c = e.line, l =
|
|
1467
|
-
|
|
1465
|
+
n === 63 && H(e.input.charCodeAt(e.position + 1)) && (r = a = !0, e.position += 1, q(e, t));
|
|
1466
|
+
let c = e.line, l = L(e), u = J(e, t, M, !1, !0);
|
|
1467
|
+
q(e, t), n = e.input.charCodeAt(e.position), (i || a || e.line === c) && n === 58 ? (r = !0, e.position++, q(e, t), i || rn(e, l), u || I(e), J(e, t, M, !1, !0) || I(e), q(e, t), i || F(e)) : i && r ? (u || I(e), I(e)) : i ? I(e) : r && (rn(e, l), u || I(e), I(e), F(e)), n = e.input.charCodeAt(e.position), n === 44 ? (o = !0, e.position++) : o = !1;
|
|
1468
1468
|
}
|
|
1469
|
-
|
|
1469
|
+
z(e, "unexpected end of the stream within a flow collection");
|
|
1470
1470
|
}
|
|
1471
|
-
function
|
|
1472
|
-
if (e.firstTabInLine !== -1 || e.input.charCodeAt(e.position) !== 45 || !
|
|
1473
|
-
for (
|
|
1474
|
-
e.firstTabInLine !== -1 && (e.position = e.firstTabInLine,
|
|
1471
|
+
function En(e, t, n) {
|
|
1472
|
+
if (e.firstTabInLine !== -1 || e.input.charCodeAt(e.position) !== 45 || !U(e.input.charCodeAt(e.position + 1))) return !1;
|
|
1473
|
+
for (tn(e, e.position, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, E.BLOCK); e.input.charCodeAt(e.position) === 45 && U(e.input.charCodeAt(e.position + 1));) {
|
|
1474
|
+
e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, z(e, "tab characters must not be used in indentation"));
|
|
1475
1475
|
let n = e.line;
|
|
1476
1476
|
e.position++;
|
|
1477
|
-
let r =
|
|
1478
|
-
if (e.firstTabInLine !== -1 && e.input.charCodeAt(e.position) === 45 &&
|
|
1479
|
-
e.lineIndent > t &&
|
|
1477
|
+
let r = G(e, !0) > 0;
|
|
1478
|
+
if (e.firstTabInLine !== -1 && e.input.charCodeAt(e.position) === 45 && U(e.input.charCodeAt(e.position + 1)) && z(e, "bad indentation of a sequence entry"), r && e.lineIndent <= t ? I(e) : J(e, t, Wt, !1, !0), G(e, !0), e.lineIndent < t || e.position >= e.length) break;
|
|
1479
|
+
e.lineIndent > t && z(e, "bad indentation of a sequence entry"), e.line === n && e.input.charCodeAt(e.position) === 45 && U(e.input.charCodeAt(e.position + 1)) && z(e, "bad indentation of a sequence entry");
|
|
1480
1480
|
}
|
|
1481
|
-
return
|
|
1481
|
+
return F(e), !0;
|
|
1482
1482
|
}
|
|
1483
|
-
function
|
|
1483
|
+
function Dn(e, t, n, r) {
|
|
1484
1484
|
let i = !1, a = !1, o = !1, s = !1;
|
|
1485
1485
|
if (e.firstTabInLine !== -1) return !1;
|
|
1486
1486
|
let c = e.input.charCodeAt(e.position);
|
|
1487
1487
|
for (; c !== 0;) {
|
|
1488
|
-
!i && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine,
|
|
1488
|
+
!i && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, z(e, "tab characters must not be used in indentation"));
|
|
1489
1489
|
let l = e.input.charCodeAt(e.position + 1), u = e.line;
|
|
1490
|
-
if ((c === 63 || c === 58) &&
|
|
1490
|
+
if ((c === 63 || c === 58) && U(l)) o || (nn(e, e.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, E.BLOCK), o = !0), c === 63 ? (i && I(e), a = !0, i = !0) : i ? i = !1 : (I(e), a = !0, i = !1), e.position += 1, s = !0;
|
|
1491
1491
|
else {
|
|
1492
|
-
i && (
|
|
1493
|
-
let t =
|
|
1494
|
-
if (!
|
|
1492
|
+
i && (I(e), i = !1);
|
|
1493
|
+
let t = L(e);
|
|
1494
|
+
if (!J(e, n, Ut, !1, !0)) break;
|
|
1495
1495
|
if (e.line === u) {
|
|
1496
|
-
for (c = e.input.charCodeAt(e.position);
|
|
1497
|
-
if (c === 58) {
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1496
|
+
for (c = e.input.charCodeAt(e.position); V(c);) c = e.input.charCodeAt(++e.position);
|
|
1497
|
+
if (c === 58) c = e.input.charCodeAt(++e.position), U(c) || z(e, "a whitespace character is expected after the key-value separator within a block mapping"), o || (e.events.splice(t.eventsLength, 0, {
|
|
1498
|
+
type: w.MAPPING,
|
|
1499
|
+
start: t.position,
|
|
1500
|
+
anchorStart: r.anchorStart,
|
|
1501
|
+
anchorEnd: r.anchorEnd,
|
|
1502
|
+
tagStart: r.tagStart,
|
|
1503
|
+
tagEnd: r.tagEnd,
|
|
1504
|
+
style: E.BLOCK
|
|
1505
|
+
}), o = !0), a = !0, i = !1, s = !1;
|
|
1506
|
+
else if (a) z(e, "expected ':' after a mapping key");
|
|
1507
|
+
else return r.anchorStart !== j || r.tagStart !== j ? (R(e, t), !1) : !0;
|
|
1508
|
+
} else if (a) z(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
1509
|
+
else return r.anchorStart !== j || r.tagStart !== j ? (R(e, t), !1) : !0;
|
|
1507
1510
|
}
|
|
1508
|
-
if (
|
|
1511
|
+
if (J(e, t, N, !0, s) && (s = !1), i || s && (I(e), s = !1), G(e, !0), c = e.input.charCodeAt(e.position), (e.line === u || e.lineIndent > t) && c !== 0) z(e, "bad indentation of a mapping entry");
|
|
1509
1512
|
else if (e.lineIndent < t) break;
|
|
1510
1513
|
}
|
|
1511
|
-
return a ? (i &&
|
|
1514
|
+
return a ? (i && I(e), o && F(e), !0) : !1;
|
|
1512
1515
|
}
|
|
1513
|
-
function
|
|
1514
|
-
e.depth >= e.maxDepth &&
|
|
1515
|
-
let o = 1, s = !1, c = !1, l = null, u =
|
|
1516
|
-
if (r &&
|
|
1517
|
-
let r = e.input.charCodeAt(e.position), i =
|
|
1516
|
+
function J(e, t, n, r, i, a = !0) {
|
|
1517
|
+
e.depth >= e.maxDepth && z(e, `nesting exceeded maxDepth (${e.maxDepth})`), e.depth++;
|
|
1518
|
+
let o = 1, s = !1, c = !1, l = null, u = on(), d = n === N || n === Wt, f = d, p = d;
|
|
1519
|
+
if (r && G(e, !0) && (s = !0, o = e.lineIndent > t ? 1 : e.lineIndent === t ? 0 : -1), o === 1) for (;;) {
|
|
1520
|
+
let r = e.input.charCodeAt(e.position), i = L(e);
|
|
1518
1521
|
if (s && o !== 1 && (r === 33 || r === 38)) break;
|
|
1519
1522
|
if (s && p && (u.tagStart !== j || u.anchorStart !== j) && (r === 33 || r === 38)) {
|
|
1520
1523
|
var m;
|
|
1521
|
-
let n =
|
|
1522
|
-
if (
|
|
1523
|
-
|
|
1524
|
+
let n = L(e), r = t + 1;
|
|
1525
|
+
if (Dn(e, e.position - e.lineStart, r, u) && ((m = e.events[n.eventsLength]) == null ? void 0 : m.type) === w.MAPPING) return e.depth--, !0;
|
|
1526
|
+
R(e, n);
|
|
1524
1527
|
}
|
|
1525
|
-
if (s && (r === 33 && u.tagStart !== j || r === 38 && u.anchorStart !== j) || !
|
|
1526
|
-
l === null && (l = i),
|
|
1528
|
+
if (s && (r === 33 && u.tagStart !== j || r === 38 && u.anchorStart !== j) || !gn(e, u, n === M) && !_n(e, u)) break;
|
|
1529
|
+
l === null && (l = i), G(e, !0) ? (s = !0, f = p, o = e.lineIndent > t ? 1 : e.lineIndent === t ? 0 : -1) : f = !1;
|
|
1527
1530
|
}
|
|
1528
|
-
if (f && (f = s || i), o === 1 || n ===
|
|
1531
|
+
if (f && (f = s || i), o === 1 || n === N) {
|
|
1529
1532
|
let r = n === M || n === Ut ? t : t + 1, i = e.position - e.lineStart;
|
|
1530
|
-
if (o === 1) if (f && (
|
|
1533
|
+
if (o === 1) if (f && (En(e, i, u) || Dn(e, i, r, u)) || Tn(e, r, u)) c = !0;
|
|
1531
1534
|
else {
|
|
1532
1535
|
let t = e.input.charCodeAt(e.position);
|
|
1533
1536
|
if (l !== null && a && p && !f && t !== 124 && t !== 62) {
|
|
1534
1537
|
var h;
|
|
1535
|
-
let t =
|
|
1536
|
-
|
|
1538
|
+
let t = L(e), n = l.position - l.lineStart;
|
|
1539
|
+
R(e, l), Dn(e, n, r, on()) && ((h = e.events[t.eventsLength]) == null ? void 0 : h.type) === w.MAPPING ? c = !0 : R(e, t);
|
|
1537
1540
|
}
|
|
1538
|
-
!c && (d &&
|
|
1541
|
+
!c && (d && Sn(e, r, u) || bn(e, r, u) || xn(e, r, u) || vn(e, u) || wn(e, r, n, u)) && (c = !0);
|
|
1539
1542
|
}
|
|
1540
|
-
else o === 0 && (c = f &&
|
|
1543
|
+
else o === 0 && (c = f && En(e, i, u));
|
|
1541
1544
|
}
|
|
1542
|
-
return d = d && !c, !c && (u.anchorStart !== j || u.tagStart !== j || d) && (
|
|
1545
|
+
return d = d && !c, !c && (u.anchorStart !== j || u.tagStart !== j || d) && (P(e, j, j, u.anchorStart, u.anchorEnd, u.tagStart, u.tagEnd, T.PLAIN), c = !0), e.depth--, c || u.anchorStart !== j || u.tagStart !== j;
|
|
1543
1546
|
}
|
|
1544
|
-
function
|
|
1547
|
+
function On(e) {
|
|
1545
1548
|
if (e.lineIndent > 0 || e.input.charCodeAt(e.position) !== 37) return !1;
|
|
1546
1549
|
e.position++;
|
|
1547
1550
|
let t = e.position;
|
|
1548
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1551
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !H(e.input.charCodeAt(e.position));) e.position++;
|
|
1549
1552
|
let n = e.input.slice(t, e.position), r = [];
|
|
1550
|
-
for (n.length === 0 &&
|
|
1551
|
-
for (;
|
|
1552
|
-
if (e.input.charCodeAt(e.position) === 35 ||
|
|
1553
|
+
for (n.length === 0 && z(e, "directive name must not be less than one character in length"); e.input.charCodeAt(e.position) !== 0 && !B(e.input.charCodeAt(e.position));) {
|
|
1554
|
+
for (; V(e.input.charCodeAt(e.position));) e.position++;
|
|
1555
|
+
if (e.input.charCodeAt(e.position) === 35 || B(e.input.charCodeAt(e.position)) || e.input.charCodeAt(e.position) === 0) break;
|
|
1553
1556
|
let t = e.position;
|
|
1554
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1557
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !H(e.input.charCodeAt(e.position));) e.position++;
|
|
1555
1558
|
r.push(e.input.slice(t, e.position));
|
|
1556
1559
|
}
|
|
1557
|
-
if (
|
|
1558
|
-
e.directives.some((e) => e.kind === "yaml") &&
|
|
1560
|
+
if (B(e.input.charCodeAt(e.position)) && dn(e), n === "YAML") {
|
|
1561
|
+
e.directives.some((e) => e.kind === "yaml") && z(e, "duplication of %YAML directive"), r.length !== 1 && z(e, "YAML directive accepts exactly one argument");
|
|
1559
1562
|
let t = /^([0-9]+)\.([0-9]+)$/.exec(r[0]);
|
|
1560
|
-
t === null &&
|
|
1563
|
+
t === null && z(e, "ill-formed argument of the YAML directive"), parseInt(t[1], 10) !== 1 && z(e, "unacceptable YAML version of the document"), e.directives.push({
|
|
1561
1564
|
kind: "yaml",
|
|
1562
1565
|
version: r[0]
|
|
1563
1566
|
});
|
|
1564
1567
|
} else if (n === "TAG") {
|
|
1565
|
-
r.length !== 2 &&
|
|
1568
|
+
r.length !== 2 && z(e, "TAG directive accepts exactly two arguments");
|
|
1566
1569
|
let [t, n] = r;
|
|
1567
|
-
|
|
1570
|
+
qt.test(t) || z(e, "ill-formed tag handle (first argument) of the TAG directive"), Ht.call(e.tagHandlers, t) && z(e, `there is a previously declared suffix for "${t}" tag handle`), Qt.test(n) || z(e, "ill-formed tag prefix (second argument) of the TAG directive"), e.tagHandlers[t] = n, e.directives.push({
|
|
1568
1571
|
kind: "tag",
|
|
1569
1572
|
handle: t,
|
|
1570
1573
|
prefix: n
|
|
@@ -1572,30 +1575,30 @@ function kn(e) {
|
|
|
1572
1575
|
}
|
|
1573
1576
|
return !0;
|
|
1574
1577
|
}
|
|
1575
|
-
function
|
|
1578
|
+
function kn(e) {
|
|
1576
1579
|
e.directives = [], e.tagHandlers = Object.create(null);
|
|
1577
1580
|
let t = !1;
|
|
1578
|
-
for (
|
|
1581
|
+
for (G(e, !0); On(e);) t = !0, G(e, !0);
|
|
1579
1582
|
let n = !1, r = !1, i = !0;
|
|
1580
|
-
if (e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 &&
|
|
1583
|
+
if (e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 && U(e.input.charCodeAt(e.position + 3))) {
|
|
1581
1584
|
n = !0;
|
|
1582
1585
|
let t = e.line;
|
|
1583
|
-
e.position += 3,
|
|
1584
|
-
} else t &&
|
|
1586
|
+
e.position += 3, G(e, !0), i = e.line > t;
|
|
1587
|
+
} else t && z(e, "directives end mark is expected");
|
|
1585
1588
|
let a = e.events.length;
|
|
1586
|
-
if (!n && e.position === e.lineStart && e.input.charCodeAt(e.position) === 46 &&
|
|
1587
|
-
e.position += 3,
|
|
1589
|
+
if (!n && e.position === e.lineStart && e.input.charCodeAt(e.position) === 46 && K(e)) {
|
|
1590
|
+
e.position += 3, G(e, !0);
|
|
1588
1591
|
return;
|
|
1589
1592
|
}
|
|
1590
|
-
if (
|
|
1593
|
+
if (en(e, n, !1), J(e, e.lineIndent - 1, N, !1, i, i) || I(e), G(e, !0), e.position === e.lineStart && K(e) && (r = e.input.charCodeAt(e.position) === 46, r)) {
|
|
1591
1594
|
let t = e.line;
|
|
1592
|
-
e.position += 3,
|
|
1595
|
+
e.position += 3, G(e, !0), e.line === t && e.position < e.length && z(e, "end of the stream or a document separator is expected");
|
|
1593
1596
|
}
|
|
1594
1597
|
let o = e.events[a];
|
|
1595
|
-
(o == null ? void 0 : o.type) ===
|
|
1598
|
+
(o == null ? void 0 : o.type) === w.DOCUMENT && (o.explicitEnd = r), F(e), !r && e.position < e.length && !pn(e) && z(e, "end of the stream or a document separator is expected");
|
|
1596
1599
|
}
|
|
1597
|
-
function
|
|
1598
|
-
let n = e.length, r =
|
|
1600
|
+
function An(e, t) {
|
|
1601
|
+
let n = e.length, r = b(b(b({}, $t), t), {}, {
|
|
1599
1602
|
input: `${e}\0`,
|
|
1600
1603
|
length: n,
|
|
1601
1604
|
position: 0,
|
|
@@ -1608,36 +1611,36 @@ function jn(e, t) {
|
|
|
1608
1611
|
tagHandlers: Object.create(null),
|
|
1609
1612
|
events: []
|
|
1610
1613
|
}), i = e.indexOf("\0");
|
|
1611
|
-
for (i !== -1 &&
|
|
1614
|
+
for (i !== -1 && C.throwAt(e, i, "null byte is not allowed in input", r.filename); r.position < r.length && (fn(r), G(r, !0), !(r.position >= r.length));) {
|
|
1612
1615
|
let e = r.position;
|
|
1613
|
-
|
|
1616
|
+
kn(r), r.position === e && z(r, "can not read a document");
|
|
1614
1617
|
}
|
|
1615
1618
|
return r.events;
|
|
1616
1619
|
}
|
|
1617
1620
|
//#endregion
|
|
1618
1621
|
//#region src/load.ts
|
|
1619
|
-
var
|
|
1620
|
-
function
|
|
1621
|
-
let n =
|
|
1622
|
-
return Vt(
|
|
1622
|
+
var jn = b(b({}, $t), kt);
|
|
1623
|
+
function Mn(e, t = {}) {
|
|
1624
|
+
let n = b(b({}, jn), t), r = String(e), i = Object.keys($t), a = Object.keys(kt);
|
|
1625
|
+
return Vt(An(r, He(n, i)), b(b({}, He(n, a)), {}, { source: r }));
|
|
1623
1626
|
}
|
|
1624
|
-
function
|
|
1627
|
+
function Nn(e, t, n) {
|
|
1625
1628
|
let r = null;
|
|
1626
1629
|
typeof t == "function" ? r = t : typeof t == "object" && t && (n = t);
|
|
1627
|
-
let i =
|
|
1630
|
+
let i = Mn(e, n);
|
|
1628
1631
|
if (r === null) return i;
|
|
1629
1632
|
for (let e of i) r(e);
|
|
1630
1633
|
}
|
|
1631
|
-
function
|
|
1632
|
-
let n =
|
|
1633
|
-
if (n.length === 0) throw new
|
|
1634
|
+
function Pn(e, t) {
|
|
1635
|
+
let n = Mn(e, t);
|
|
1636
|
+
if (n.length === 0) throw new C("expected a document, but the input is empty");
|
|
1634
1637
|
if (n.length === 1) return n[0];
|
|
1635
|
-
throw new
|
|
1638
|
+
throw new C("expected a single document in the stream, but found more");
|
|
1636
1639
|
}
|
|
1637
1640
|
//#endregion
|
|
1638
1641
|
//#region src/ast/from_js.ts
|
|
1639
|
-
var
|
|
1640
|
-
function
|
|
1642
|
+
var Y = Symbol("INVALID");
|
|
1643
|
+
function Fn(e) {
|
|
1641
1644
|
let t = new Set([
|
|
1642
1645
|
e.defaultScalarTag,
|
|
1643
1646
|
e.defaultSequenceTag,
|
|
@@ -1658,7 +1661,7 @@ function In(e) {
|
|
|
1658
1661
|
}))
|
|
1659
1662
|
];
|
|
1660
1663
|
}
|
|
1661
|
-
function
|
|
1664
|
+
function In(e, t) {
|
|
1662
1665
|
for (let n = 0, r = e.representTypes.length; n < r; n += 1) {
|
|
1663
1666
|
let { tag: r, implicitTag: i } = e.representTypes[n];
|
|
1664
1667
|
if (r.identify(t)) {
|
|
@@ -1672,7 +1675,7 @@ function Ln(e, t) {
|
|
|
1672
1675
|
}
|
|
1673
1676
|
return null;
|
|
1674
1677
|
}
|
|
1675
|
-
function
|
|
1678
|
+
function X(e, t) {
|
|
1676
1679
|
if (!e.noRefs && typeof t == "object" && t) {
|
|
1677
1680
|
let n = e.refs.get(t);
|
|
1678
1681
|
if (n) return n.anchor === void 0 && (n.anchor = `ref_${e.refCounter++}`), {
|
|
@@ -1680,17 +1683,17 @@ function Y(e, t) {
|
|
|
1680
1683
|
anchor: n.anchor
|
|
1681
1684
|
};
|
|
1682
1685
|
}
|
|
1683
|
-
let n =
|
|
1686
|
+
let n = In(e, t);
|
|
1684
1687
|
if (!n) {
|
|
1685
|
-
if (t === void 0 || e.skipInvalid) return
|
|
1686
|
-
throw new
|
|
1688
|
+
if (t === void 0 || e.skipInvalid) return Y;
|
|
1689
|
+
throw new C(`unacceptable kind of an object to dump ${Object.prototype.toString.call(t)}`);
|
|
1687
1690
|
}
|
|
1688
1691
|
let { tag: r, tagName: i, implicitTag: a } = n, o = a ? i : Dt(i);
|
|
1689
1692
|
if (r.nodeKind === "scalar") return {
|
|
1690
1693
|
kind: "scalar",
|
|
1691
1694
|
tag: o,
|
|
1692
1695
|
tagged: !a,
|
|
1693
|
-
style:
|
|
1696
|
+
style: T.PLAIN,
|
|
1694
1697
|
value: r.represent(t)
|
|
1695
1698
|
};
|
|
1696
1699
|
if (r.nodeKind === "sequence") {
|
|
@@ -1698,13 +1701,13 @@ function Y(e, t) {
|
|
|
1698
1701
|
kind: "sequence",
|
|
1699
1702
|
tag: o,
|
|
1700
1703
|
tagged: !a,
|
|
1701
|
-
style:
|
|
1704
|
+
style: E.BLOCK,
|
|
1702
1705
|
items: []
|
|
1703
1706
|
};
|
|
1704
1707
|
e.noRefs || e.refs.set(t, i);
|
|
1705
1708
|
for (let t = 0, r = n.length; t < r; t += 1) {
|
|
1706
|
-
let r =
|
|
1707
|
-
r ===
|
|
1709
|
+
let r = X(e, n[t]);
|
|
1710
|
+
r === Y && n[t] === void 0 && (r = X(e, null)), r !== Y && i.items.push(r);
|
|
1708
1711
|
}
|
|
1709
1712
|
return i;
|
|
1710
1713
|
}
|
|
@@ -1712,57 +1715,57 @@ function Y(e, t) {
|
|
|
1712
1715
|
kind: "mapping",
|
|
1713
1716
|
tag: o,
|
|
1714
1717
|
tagged: !a,
|
|
1715
|
-
style:
|
|
1718
|
+
style: E.BLOCK,
|
|
1716
1719
|
items: []
|
|
1717
1720
|
};
|
|
1718
1721
|
e.noRefs || e.refs.set(t, c);
|
|
1719
1722
|
for (let [t, n] of s) {
|
|
1720
|
-
let r =
|
|
1721
|
-
if (r ===
|
|
1722
|
-
let i =
|
|
1723
|
-
i !==
|
|
1723
|
+
let r = X(e, t);
|
|
1724
|
+
if (r === Y) continue;
|
|
1725
|
+
let i = X(e, n);
|
|
1726
|
+
i !== Y && c.items.push({
|
|
1724
1727
|
key: r,
|
|
1725
1728
|
value: i
|
|
1726
1729
|
});
|
|
1727
1730
|
}
|
|
1728
1731
|
return c;
|
|
1729
1732
|
}
|
|
1730
|
-
function
|
|
1733
|
+
function Ln(e, t, n = {}) {
|
|
1731
1734
|
var r, i;
|
|
1732
|
-
let a =
|
|
1733
|
-
representTypes:
|
|
1735
|
+
let a = X({
|
|
1736
|
+
representTypes: Fn(t),
|
|
1734
1737
|
noRefs: (r = n.noRefs) == null ? !1 : r,
|
|
1735
1738
|
skipInvalid: (i = n.skipInvalid) == null ? !1 : i,
|
|
1736
1739
|
refs: /* @__PURE__ */ new Map(),
|
|
1737
1740
|
refCounter: 0
|
|
1738
1741
|
}, e);
|
|
1739
1742
|
return [{
|
|
1740
|
-
contents: a ===
|
|
1743
|
+
contents: a === Y ? null : a,
|
|
1741
1744
|
directives: []
|
|
1742
1745
|
}];
|
|
1743
1746
|
}
|
|
1744
1747
|
//#endregion
|
|
1745
1748
|
//#region src/ast/visit.ts
|
|
1746
|
-
var
|
|
1747
|
-
function
|
|
1749
|
+
var Rn = Symbol("visit:break"), zn = Symbol("visit:skip");
|
|
1750
|
+
function Bn(e, t, n) {
|
|
1748
1751
|
let r = t(e, n);
|
|
1749
|
-
if (r ===
|
|
1750
|
-
if (r ===
|
|
1752
|
+
if (r === Rn) return !0;
|
|
1753
|
+
if (r === zn) return !1;
|
|
1751
1754
|
let i = n.depth + 1;
|
|
1752
1755
|
switch (e.kind) {
|
|
1753
1756
|
case "sequence":
|
|
1754
|
-
for (let n of e.items) if (
|
|
1757
|
+
for (let n of e.items) if (Bn(n, t, {
|
|
1755
1758
|
depth: i,
|
|
1756
1759
|
parent: e,
|
|
1757
1760
|
isKey: !1
|
|
1758
1761
|
})) return !0;
|
|
1759
1762
|
break;
|
|
1760
1763
|
case "mapping":
|
|
1761
|
-
for (let { key: n, value: r } of e.items) if (
|
|
1764
|
+
for (let { key: n, value: r } of e.items) if (Bn(n, t, {
|
|
1762
1765
|
depth: i,
|
|
1763
1766
|
parent: e,
|
|
1764
1767
|
isKey: !0
|
|
1765
|
-
}) ||
|
|
1768
|
+
}) || Bn(r, t, {
|
|
1766
1769
|
depth: i,
|
|
1767
1770
|
parent: e,
|
|
1768
1771
|
isKey: !1
|
|
@@ -1771,8 +1774,8 @@ function Vn(e, t, n) {
|
|
|
1771
1774
|
}
|
|
1772
1775
|
return !1;
|
|
1773
1776
|
}
|
|
1774
|
-
function
|
|
1775
|
-
for (let n of e) if (n.contents &&
|
|
1777
|
+
function Vn(e, t) {
|
|
1778
|
+
for (let n of e) if (n.contents && Bn(n.contents, t, {
|
|
1776
1779
|
depth: 0,
|
|
1777
1780
|
parent: null,
|
|
1778
1781
|
isKey: !1
|
|
@@ -1780,43 +1783,43 @@ function Hn(e, t) {
|
|
|
1780
1783
|
}
|
|
1781
1784
|
//#endregion
|
|
1782
1785
|
//#region src/ast/styler_defaults.ts
|
|
1783
|
-
function
|
|
1786
|
+
function Hn(e, t) {
|
|
1784
1787
|
return (e & 1 << t) != 0;
|
|
1785
1788
|
}
|
|
1786
|
-
var
|
|
1787
|
-
applyQuoteFlowKeysOption:
|
|
1788
|
-
doubleQuoteForInvisibles:
|
|
1789
|
-
doubleQuoteWhitespaceOnly:
|
|
1790
|
-
applyForceQuotesOption:
|
|
1791
|
-
tryLongOrMultilineAsBlock:
|
|
1792
|
-
quoteInvalidPlain:
|
|
1793
|
-
fallbackToDoubleQuoted:
|
|
1789
|
+
var Un = {
|
|
1790
|
+
applyQuoteFlowKeysOption: Gn,
|
|
1791
|
+
doubleQuoteForInvisibles: Kn,
|
|
1792
|
+
doubleQuoteWhitespaceOnly: qn,
|
|
1793
|
+
applyForceQuotesOption: Jn,
|
|
1794
|
+
tryLongOrMultilineAsBlock: Yn,
|
|
1795
|
+
quoteInvalidPlain: Xn,
|
|
1796
|
+
fallbackToDoubleQuoted: Zn
|
|
1794
1797
|
};
|
|
1798
|
+
function Wn(e) {
|
|
1799
|
+
return e.presenterOptions.quoteStyle === "single" && Hn(e.allowedStylesMask, T.SINGLE_QUOTED) ? T.SINGLE_QUOTED : T.DOUBLE_QUOTED;
|
|
1800
|
+
}
|
|
1795
1801
|
function Gn(e) {
|
|
1796
|
-
|
|
1802
|
+
e.presenterOptions.quoteFlowKeys && (!e.isKey || !e.flowOnly || e.style !== T.PLAIN || (e.style = T.DOUBLE_QUOTED));
|
|
1797
1803
|
}
|
|
1798
1804
|
function Kn(e) {
|
|
1799
|
-
e.
|
|
1805
|
+
e.style === T.PLAIN && /[\t\x7F-\xA0\u2028\u2029\uFEFF\uFFFE\uFFFF]/.test(e.node.value) && (e.style = T.DOUBLE_QUOTED);
|
|
1800
1806
|
}
|
|
1801
1807
|
function qn(e) {
|
|
1802
|
-
e.style ===
|
|
1808
|
+
e.style === T.PLAIN && /^\s+$/.test(e.node.value) && (e.style = T.DOUBLE_QUOTED);
|
|
1803
1809
|
}
|
|
1804
1810
|
function Jn(e) {
|
|
1805
|
-
e.style
|
|
1811
|
+
e.presenterOptions.forceQuotes && (e.isKey || e.style !== T.PLAIN || e.node.tag === e.presenterOptions.schema.defaultScalarTag.tagName && (e.style = e.node.value.includes("\n") ? T.DOUBLE_QUOTED : Wn(e)));
|
|
1806
1812
|
}
|
|
1807
1813
|
function Yn(e) {
|
|
1808
|
-
|
|
1809
|
-
}
|
|
1810
|
-
function Xn(e) {
|
|
1811
|
-
if (e.style !== E.PLAIN || e.isKey) return;
|
|
1814
|
+
if (e.style !== T.PLAIN || e.isKey) return;
|
|
1812
1815
|
let t = e.node.value, n = t.indexOf("\n") !== -1;
|
|
1813
|
-
if (!
|
|
1814
|
-
n && (e.style =
|
|
1816
|
+
if (!Hn(e.allowedStylesMask, T.LITERAL_BLOCK)) {
|
|
1817
|
+
n && (e.style = T.DOUBLE_QUOTED);
|
|
1815
1818
|
return;
|
|
1816
1819
|
}
|
|
1817
1820
|
let r = e.presenterOptions.lineWidth;
|
|
1818
1821
|
if (r === -1) {
|
|
1819
|
-
n && (e.style =
|
|
1822
|
+
n && (e.style = T.LITERAL_BLOCK);
|
|
1820
1823
|
return;
|
|
1821
1824
|
}
|
|
1822
1825
|
let i = Math.max(Math.min(r, 40), r - e.shiftOfContent), a = 0, o = !1;
|
|
@@ -1827,80 +1830,80 @@ function Xn(e) {
|
|
|
1827
1830
|
if (r.length > i && r[0] !== " " && / [^ \t]/.test(r) && (o = !0), n === -1) break;
|
|
1828
1831
|
a = n + 1;
|
|
1829
1832
|
}
|
|
1830
|
-
o ? e.style =
|
|
1833
|
+
o ? e.style = T.FOLDED_BLOCK : n && (e.style = T.LITERAL_BLOCK);
|
|
1831
1834
|
}
|
|
1832
|
-
function
|
|
1833
|
-
e.style ===
|
|
1835
|
+
function Xn(e) {
|
|
1836
|
+
e.style === T.PLAIN && !Hn(e.allowedStylesMask, T.PLAIN) && (e.style = Wn(e));
|
|
1834
1837
|
}
|
|
1835
|
-
function
|
|
1836
|
-
|
|
1838
|
+
function Zn(e) {
|
|
1839
|
+
Hn(e.allowedStylesMask, e.style) || (e.style = T.DOUBLE_QUOTED);
|
|
1837
1840
|
}
|
|
1838
1841
|
//#endregion
|
|
1839
1842
|
//#region src/ast/scalar_styler.ts
|
|
1840
|
-
function
|
|
1843
|
+
function Z(e, t) {
|
|
1841
1844
|
return e | 1 << t;
|
|
1842
1845
|
}
|
|
1843
|
-
var
|
|
1844
|
-
function
|
|
1846
|
+
var Qn = "[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]", $n = "[\\n\\r]", er = "\\uFEFF", tr = "[ \\t]", nr = `(?:(?!(?:${$n}|${er}))${Qn})`, rr = `(?:(?!${tr})${nr})`, ir = "[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]", ar = "[-?:,\\[\\]{}#&*!|>'\"%@`]", or = "[,\\[\\]{}]", sr = rr, cr = `(?:(?!${or})${rr})`, lr = `(?:(?:(?!${ar})${rr})|[?:-](?=${sr}))`, ur = `(?:(?:(?!${ar})${rr})|[?:-](?=${cr}))`, dr = `(?:(?:(?![:#])${sr})|:(?=${sr}))#*`, fr = `(?:(?:(?![:#])${cr})|:(?=${cr}))#*`, pr = `(?:${tr}*${dr})*`, mr = `(?:${tr}*${fr})*`, hr = `${lr}#*${pr}`, gr = `${ur}#*${mr}`, _r = hr, vr = gr, yr = `\\n+${dr}${pr}`, br = `\\n+${fr}${mr}`, xr = `${hr}(?:${yr})*`, Sr = `${gr}(?:${br})*`, Cr = RegExp(`^(?:${xr})$`, "u"), wr = RegExp(`^(?:${Sr})$`, "u"), Tr = RegExp(`^(?:${_r})$`, "u"), Er = RegExp(`^(?:${vr})$`, "u"), Dr = RegExp(`^(?:${ir})*$`, "u"), Or = RegExp(`^(?:${ir}|\\n)*$`, "u"), kr = RegExp(`^(?:${nr}|\\n)*$`, "u"), Ar = /^(?:---|\.\.\.)(?=$|[ \t\n\r])/, jr = /^(?:---|\.\.\.)(?=$|[ \t\n\r])/m;
|
|
1847
|
+
function Mr(e) {
|
|
1845
1848
|
let t = e.node.value;
|
|
1846
1849
|
if (t !== "") {
|
|
1847
|
-
if (!(e.isKey ? e.flowOnly ?
|
|
1850
|
+
if (!(e.isKey ? e.flowOnly ? Er : Tr : e.flowOnly ? wr : Cr).test(t) || e.shiftOfFirstLine === 0 && Ar.test(t)) return !1;
|
|
1848
1851
|
if (e.shiftOfContent === 0) {
|
|
1849
1852
|
let e = t.indexOf("\n");
|
|
1850
1853
|
if (e !== -1) {
|
|
1851
1854
|
let n = t.slice(e + 1);
|
|
1852
|
-
if (
|
|
1855
|
+
if (jr.test(n)) return !1;
|
|
1853
1856
|
}
|
|
1854
1857
|
}
|
|
1855
1858
|
}
|
|
1856
1859
|
let n = e.presenterOptions.schema.resolveImplicitScalarTag(t).tag.tagName;
|
|
1857
1860
|
return !(!e.node.tagged && n !== e.node.tag || !e.node.tagged && t === "=" && n === e.presenterOptions.schema.defaultScalarTag.tagName);
|
|
1858
1861
|
}
|
|
1859
|
-
function
|
|
1862
|
+
function Nr(e) {
|
|
1860
1863
|
let t = e.node.value;
|
|
1861
|
-
if (!(e.isKey ?
|
|
1864
|
+
if (!(e.isKey ? Dr : Or).test(t) || /[ \t]\n|\n[ \t]/.test(t)) return !1;
|
|
1862
1865
|
if (!e.isKey && e.shiftOfContent === 0) {
|
|
1863
1866
|
let e = t.indexOf("\n");
|
|
1864
|
-
if (e !== -1 &&
|
|
1867
|
+
if (e !== -1 && jr.test(t.slice(e + 1))) return !1;
|
|
1865
1868
|
}
|
|
1866
1869
|
return !0;
|
|
1867
1870
|
}
|
|
1868
|
-
function
|
|
1869
|
-
if (e.flowOnly || !
|
|
1871
|
+
function Pr(e) {
|
|
1872
|
+
if (e.flowOnly || !kr.test(e.node.value)) return !1;
|
|
1870
1873
|
let t = e.shiftOfContent - e.shiftOfParent;
|
|
1871
|
-
return !(t < 1 || t > 9 && /^\n* /.test(e.node.value) || e.shiftOfContent === 0 &&
|
|
1874
|
+
return !(t < 1 || t > 9 && /^\n* /.test(e.node.value) || e.shiftOfContent === 0 && jr.test(e.node.value));
|
|
1872
1875
|
}
|
|
1873
|
-
function
|
|
1874
|
-
let t =
|
|
1875
|
-
|
|
1876
|
+
function Fr(e) {
|
|
1877
|
+
let t = Z(0, T.DOUBLE_QUOTED);
|
|
1878
|
+
Mr(e) && (t = Z(t, T.PLAIN)), Nr(e) && (t = Z(t, T.SINGLE_QUOTED)), Pr(e) && (t = Z(Z(t, T.LITERAL_BLOCK), T.FOLDED_BLOCK)), e.allowedStylesMask = t;
|
|
1876
1879
|
}
|
|
1877
|
-
function
|
|
1880
|
+
function Ir(e) {
|
|
1878
1881
|
switch (e.style) {
|
|
1879
|
-
case
|
|
1880
|
-
case
|
|
1881
|
-
case
|
|
1882
|
-
case
|
|
1883
|
-
case
|
|
1882
|
+
case T.PLAIN: return Lr(e);
|
|
1883
|
+
case T.SINGLE_QUOTED: return Rr(e);
|
|
1884
|
+
case T.LITERAL_BLOCK: return zr(e);
|
|
1885
|
+
case T.FOLDED_BLOCK: return Br(e);
|
|
1886
|
+
case T.DOUBLE_QUOTED: return Vr(e);
|
|
1884
1887
|
}
|
|
1885
1888
|
}
|
|
1889
|
+
function Lr(e) {
|
|
1890
|
+
return Hr(e.node.value, e.shiftOfContent);
|
|
1891
|
+
}
|
|
1886
1892
|
function Rr(e) {
|
|
1887
|
-
return
|
|
1893
|
+
return `'${Hr(e.node.value, e.shiftOfContent).replace(/'/g, "''")}'`;
|
|
1888
1894
|
}
|
|
1889
1895
|
function zr(e) {
|
|
1890
|
-
return `'${Ur(e.node.value, e.shiftOfContent).replace(/'/g, "''")}'`;
|
|
1891
|
-
}
|
|
1892
|
-
function Br(e) {
|
|
1893
1896
|
let t = e.node.value;
|
|
1894
|
-
return "|" +
|
|
1897
|
+
return "|" + Gr(t, e.shiftOfParent, e.shiftOfContent) + Kr(Ur(t, e.shiftOfContent));
|
|
1895
1898
|
}
|
|
1896
|
-
function
|
|
1899
|
+
function Br(e) {
|
|
1897
1900
|
let t = e.node.value, n = e.presenterOptions.lineWidth, r = Infinity;
|
|
1898
|
-
return n !== -1 && (r = Math.max(Math.min(n, 40), n - e.shiftOfContent)), ">" +
|
|
1901
|
+
return n !== -1 && (r = Math.max(Math.min(n, 40), n - e.shiftOfContent)), ">" + Gr(t, e.shiftOfParent, e.shiftOfContent) + Kr(Ur(Yr(t, r), e.shiftOfContent));
|
|
1899
1902
|
}
|
|
1900
|
-
function
|
|
1901
|
-
return `"${
|
|
1903
|
+
function Vr(e) {
|
|
1904
|
+
return `"${Qr(e.node.value)}"`;
|
|
1902
1905
|
}
|
|
1903
|
-
function
|
|
1906
|
+
function Hr(e, t) {
|
|
1904
1907
|
let n = e.indexOf("\n");
|
|
1905
1908
|
if (n === -1) return e;
|
|
1906
1909
|
let r = " ".repeat(t), i = e.slice(0, n), a = /(\n+)([^\n]*)/g;
|
|
@@ -1912,7 +1915,7 @@ function Ur(e, t) {
|
|
|
1912
1915
|
}
|
|
1913
1916
|
return i;
|
|
1914
1917
|
}
|
|
1915
|
-
function
|
|
1918
|
+
function Ur(e, t) {
|
|
1916
1919
|
let n = " ".repeat(t), r = 0, i = "", a = e.length;
|
|
1917
1920
|
for (; r < a;) {
|
|
1918
1921
|
let t, o = e.indexOf("\n", r);
|
|
@@ -1920,37 +1923,37 @@ function Wr(e, t) {
|
|
|
1920
1923
|
}
|
|
1921
1924
|
return i;
|
|
1922
1925
|
}
|
|
1923
|
-
function
|
|
1926
|
+
function Wr(e) {
|
|
1924
1927
|
return /^\n* /.test(e);
|
|
1925
1928
|
}
|
|
1926
|
-
function
|
|
1927
|
-
let r =
|
|
1929
|
+
function Gr(e, t, n) {
|
|
1930
|
+
let r = Wr(e) ? String(n - t) : "", i = e[e.length - 1] === "\n";
|
|
1928
1931
|
return `${r}${i && (e[e.length - 2] === "\n" || e === "\n") ? "+" : i ? "" : "-"}\n`;
|
|
1929
1932
|
}
|
|
1930
|
-
function
|
|
1933
|
+
function Kr(e) {
|
|
1931
1934
|
return e[e.length - 1] === "\n" ? e.slice(0, -1) : e;
|
|
1932
1935
|
}
|
|
1933
|
-
function
|
|
1936
|
+
function qr(e) {
|
|
1934
1937
|
return e === " " || e === " ";
|
|
1935
1938
|
}
|
|
1936
|
-
function
|
|
1937
|
-
if (e === "" ||
|
|
1939
|
+
function Jr(e, t) {
|
|
1940
|
+
if (e === "" || qr(e[0])) return e;
|
|
1938
1941
|
let n = / [^ \t]/g, r, i = 0, a, o = 0, s = 0, c = "";
|
|
1939
1942
|
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;
|
|
1940
1943
|
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);
|
|
1941
1944
|
}
|
|
1942
|
-
function
|
|
1945
|
+
function Yr(e, t) {
|
|
1943
1946
|
let n = /(\n+)([^\n]*)/g, r = e.indexOf("\n");
|
|
1944
1947
|
r === -1 && (r = e.length), n.lastIndex = r;
|
|
1945
|
-
let i =
|
|
1948
|
+
let i = Jr(e.slice(0, r), t), a = e[0] === "\n" || qr(e[0]), o, s;
|
|
1946
1949
|
for (; s = n.exec(e);) {
|
|
1947
1950
|
let e = s[1], n = s[2];
|
|
1948
|
-
o = n !== "" &&
|
|
1951
|
+
o = n !== "" && qr(n[0]), i += e + (!a && !o && n !== "" ? "\n" : "") + Jr(n, t), a = o;
|
|
1949
1952
|
}
|
|
1950
1953
|
return i;
|
|
1951
1954
|
}
|
|
1952
|
-
var
|
|
1953
|
-
function
|
|
1955
|
+
var Xr = /["\\\x00-\x1F\x7F-\xA0\u2028\u2029\uD800-\uDFFF\uFEFF\uFFFE\uFFFF]/gu;
|
|
1956
|
+
function Zr(e) {
|
|
1954
1957
|
switch (e) {
|
|
1955
1958
|
case "\0": return "\\0";
|
|
1956
1959
|
case "\x07": return "\\a";
|
|
@@ -1971,12 +1974,12 @@ function Qr(e) {
|
|
|
1971
1974
|
let t = e.charCodeAt(0), n = t.toString(16).toUpperCase();
|
|
1972
1975
|
return t <= 255 ? `\\x${"0".repeat(2 - n.length)}${n}` : `\\u${"0".repeat(4 - n.length)}${n}`;
|
|
1973
1976
|
}
|
|
1974
|
-
function
|
|
1975
|
-
return e.replace(
|
|
1977
|
+
function Qr(e) {
|
|
1978
|
+
return e.replace(Xr, Zr);
|
|
1976
1979
|
}
|
|
1977
1980
|
//#endregion
|
|
1978
1981
|
//#region src/ast/presenter.ts
|
|
1979
|
-
var
|
|
1982
|
+
var $r = 10, ei = {
|
|
1980
1983
|
indent: 2,
|
|
1981
1984
|
seqNoIndent: !1,
|
|
1982
1985
|
seqInlineFirst: !0,
|
|
@@ -1987,15 +1990,15 @@ var Z = 10, ei = {
|
|
|
1987
1990
|
quoteFlowKeys: !1,
|
|
1988
1991
|
quoteStyle: "single",
|
|
1989
1992
|
forceQuotes: !1,
|
|
1990
|
-
scalarStyleRules: Object.keys(
|
|
1993
|
+
scalarStyleRules: Object.keys(Un).map((e) => Reflect.get(Un, e)),
|
|
1991
1994
|
tagBeforeAnchor: !1
|
|
1992
1995
|
};
|
|
1993
1996
|
function ti(e) {
|
|
1994
1997
|
return e.tagged ? e.tag : Dt(e.tag);
|
|
1995
1998
|
}
|
|
1996
1999
|
function ni(e) {
|
|
1997
|
-
let t =
|
|
1998
|
-
return t.flowSkipColonSpace && (t.quoteFlowKeys = !0),
|
|
2000
|
+
let t = b(b({}, ei), e);
|
|
2001
|
+
return t.flowSkipColonSpace && (t.quoteFlowKeys = !0), b(b({}, t), {}, {
|
|
1999
2002
|
defaultScalarTagName: t.schema.defaultScalarTag.tagName,
|
|
2000
2003
|
openEnded: !1
|
|
2001
2004
|
});
|
|
@@ -2035,7 +2038,7 @@ function oi(e, t, n, r) {
|
|
|
2035
2038
|
compact: e.seqInlineFirst,
|
|
2036
2039
|
isblockseq: !0
|
|
2037
2040
|
}).text;
|
|
2038
|
-
(!r || i !== "") && (i += ri(e, t)), o === "" ||
|
|
2041
|
+
(!r || i !== "") && (i += ri(e, t)), o === "" || $r === o.charCodeAt(0) ? i += "-" : i += "- ", i += o;
|
|
2039
2042
|
}
|
|
2040
2043
|
return i;
|
|
2041
2044
|
}
|
|
@@ -2055,7 +2058,7 @@ function ci(e, t, n, r) {
|
|
|
2055
2058
|
for (let a = 0, o = n.items.length; a < o; a += 1) {
|
|
2056
2059
|
let o = "";
|
|
2057
2060
|
(!r || i !== "") && (o += ri(e, t));
|
|
2058
|
-
let { key: s, value: c } = n.items[a], l = (s.kind === "mapping" || s.kind === "sequence") && s.style ===
|
|
2061
|
+
let { key: s, value: c } = n.items[a], l = (s.kind === "mapping" || s.kind === "sequence") && s.style === E.BLOCK && s.items.length !== 0 || s.kind === "scalar" && (s.style === T.LITERAL_BLOCK || s.style === T.FOLDED_BLOCK), u = l ? Q(e, t + 1, s, n, {
|
|
2059
2062
|
block: !0,
|
|
2060
2063
|
compact: !0,
|
|
2061
2064
|
isblockseq: !li(e, s, t + 1)
|
|
@@ -2064,13 +2067,13 @@ function ci(e, t, n, r) {
|
|
|
2064
2067
|
compact: !0,
|
|
2065
2068
|
iskey: !0
|
|
2066
2069
|
}), d = u.text, f = s.kind === "scalar" && s.value.indexOf("\n") !== -1, p = d.length > 1024 && /^[\s\S]{1025}/u.test(d), m = l || f || p;
|
|
2067
|
-
m && (d &&
|
|
2070
|
+
m && (d && $r === d.charCodeAt(0) ? o += "?" : o += "? "), o += d, m && (o += ri(e, t));
|
|
2068
2071
|
let h = Q(e, t + 1, c, n, {
|
|
2069
2072
|
block: !0,
|
|
2070
2073
|
compact: m,
|
|
2071
2074
|
isblockseq: m && !li(e, c, t + 1)
|
|
2072
2075
|
}).text, ee = s.kind === "scalar" && u.noBody && (s.tagged || s.anchor !== void 0), te = !m && (s.kind === "alias" || ee) ? " " : "";
|
|
2073
|
-
h === "" ||
|
|
2076
|
+
h === "" || $r === h.charCodeAt(0) ? o += `${te}:` : o += `${te}: `, o += h, i += o;
|
|
2074
2077
|
}
|
|
2075
2078
|
return i;
|
|
2076
2079
|
}
|
|
@@ -2085,21 +2088,21 @@ function Q(e, t, n, r, i) {
|
|
|
2085
2088
|
};
|
|
2086
2089
|
let { block: o = !1, iskey: s = !1, isblockseq: c = !1 } = i, l = (a = i.compact) == null ? !1 : a, u = n.anchor !== void 0;
|
|
2087
2090
|
li(e, n, t) && (l = !1);
|
|
2088
|
-
let d, f = n.tagged, p = o && (n.kind === "mapping" || n.kind === "sequence") && n.style ===
|
|
2091
|
+
let d, f = n.tagged, p = o && (n.kind === "mapping" || n.kind === "sequence") && n.style === E.BLOCK && n.items.length !== 0;
|
|
2089
2092
|
if (n.kind === "mapping") d = p ? ci(e, t, n, l) : si(e, t, n);
|
|
2090
2093
|
else if (n.kind === "sequence") d = p ? e.seqNoIndent && !c && t > 0 ? oi(e, t - 1, n, l) : oi(e, t, n, l) : ai(e, t, n);
|
|
2091
2094
|
else {
|
|
2092
2095
|
let i = ii(e, n, r, t, s, !o);
|
|
2093
|
-
|
|
2096
|
+
Fr(i);
|
|
2094
2097
|
for (let t of e.scalarStyleRules) t(i);
|
|
2095
|
-
d =
|
|
2098
|
+
d = Ir(i), e.openEnded = (i.style === T.LITERAL_BLOCK || i.style === T.FOLDED_BLOCK) && (n.value === "\n" || n.value.endsWith("\n\n")), f = n.tagged || d === "" && i.flowOnly && (r == null ? void 0 : r.kind) === "sequence" && !u || i.style !== T.PLAIN && n.tag !== e.defaultScalarTagName;
|
|
2096
2099
|
}
|
|
2097
2100
|
(n.kind === "mapping" || n.kind === "sequence") && !p && (e.openEnded = !1), p && l && t > 0 && e.indent > 2 && (d = `${" ".repeat(e.indent - 2)}${d}`);
|
|
2098
2101
|
let m = d === "", h = d;
|
|
2099
2102
|
if (f || u) {
|
|
2100
2103
|
let t = [], r = f ? ti(n) : null, i = u ? `&${n.anchor}` : null;
|
|
2101
2104
|
e.tagBeforeAnchor ? (r !== null && t.push(r), i !== null && t.push(i)) : (i !== null && t.push(i), r !== null && t.push(r));
|
|
2102
|
-
let a = d === "" || d.charCodeAt(0) ===
|
|
2105
|
+
let a = d === "" || d.charCodeAt(0) === $r ? "" : " ";
|
|
2103
2106
|
h = `${t.join(" ")}${a}${d}`;
|
|
2104
2107
|
}
|
|
2105
2108
|
return {
|
|
@@ -2108,7 +2111,7 @@ function Q(e, t, n, r, i) {
|
|
|
2108
2111
|
};
|
|
2109
2112
|
}
|
|
2110
2113
|
function ui(e) {
|
|
2111
|
-
return (e.kind === "sequence" || e.kind === "mapping") && e.style ===
|
|
2114
|
+
return (e.kind === "sequence" || e.kind === "mapping") && e.style === E.BLOCK && e.items.length !== 0 && !e.tagged && e.anchor === void 0;
|
|
2112
2115
|
}
|
|
2113
2116
|
function di(e) {
|
|
2114
2117
|
let t = "";
|
|
@@ -2145,8 +2148,8 @@ function fi(e, t) {
|
|
|
2145
2148
|
}
|
|
2146
2149
|
//#endregion
|
|
2147
2150
|
//#region src/dump.ts
|
|
2148
|
-
var pi =
|
|
2149
|
-
schema:
|
|
2151
|
+
var pi = b(b({}, ei), {}, {
|
|
2152
|
+
schema: nt,
|
|
2150
2153
|
skipInvalid: !1,
|
|
2151
2154
|
noRefs: !1,
|
|
2152
2155
|
flowLevel: -1,
|
|
@@ -2158,19 +2161,19 @@ function mi(e, t) {
|
|
|
2158
2161
|
return n < r ? -1 : +(n > r);
|
|
2159
2162
|
}
|
|
2160
2163
|
function hi(e, t = {}) {
|
|
2161
|
-
let n =
|
|
2164
|
+
let n = b(b({}, pi), t), r = Ln(e, n.schema, {
|
|
2162
2165
|
noRefs: n.noRefs,
|
|
2163
2166
|
skipInvalid: n.skipInvalid
|
|
2164
2167
|
});
|
|
2165
|
-
if (n.flowLevel >= 0 &&
|
|
2166
|
-
if (!(t.depth < n.flowLevel)) return (e.kind === "sequence" || e.kind === "mapping") && (e.style =
|
|
2168
|
+
if (n.flowLevel >= 0 && Vn(r, (e, t) => {
|
|
2169
|
+
if (!(t.depth < n.flowLevel)) return (e.kind === "sequence" || e.kind === "mapping") && (e.style = E.FLOW), zn;
|
|
2167
2170
|
}), n.sortKeys) {
|
|
2168
2171
|
let e = n.sortKeys === !0 ? mi : n.sortKeys;
|
|
2169
|
-
|
|
2172
|
+
Vn(r, (t) => {
|
|
2170
2173
|
t.kind === "mapping" && t.items.sort((t, n) => e(t.key.kind === "scalar" ? t.key.value : "", n.key.kind === "scalar" ? n.key.value : ""));
|
|
2171
2174
|
});
|
|
2172
2175
|
}
|
|
2173
|
-
return n.transform(r), fi(r,
|
|
2176
|
+
return n.transform(r), fi(r, b(b({}, He(n, Object.keys(ei))), {}, { schema: n.schema }));
|
|
2174
2177
|
}
|
|
2175
2178
|
//#endregion
|
|
2176
2179
|
//#region src/ast/from_events.ts
|
|
@@ -2186,7 +2189,7 @@ function vi(e, t) {
|
|
|
2186
2189
|
}
|
|
2187
2190
|
function yi(e, t) {
|
|
2188
2191
|
let n = Ct(e.source, t), r = _i(e, t), i, a = !1;
|
|
2189
|
-
return r === "" ? i = t.style ===
|
|
2192
|
+
return r === "" ? i = t.style === T.PLAIN ? e.schema.resolveImplicitScalarTag(n).tag.tagName : e.schema.defaultScalarTag.tagName : (a = !0, i = r), {
|
|
2190
2193
|
kind: "scalar",
|
|
2191
2194
|
tag: i,
|
|
2192
2195
|
tagged: a,
|
|
@@ -2223,7 +2226,7 @@ function Si(e, t) {
|
|
|
2223
2226
|
for (; n.eventIndex < e.length;) {
|
|
2224
2227
|
let t = e[n.eventIndex++];
|
|
2225
2228
|
switch (n.position = gi(t), t.type) {
|
|
2226
|
-
case
|
|
2229
|
+
case w.DOCUMENT: {
|
|
2227
2230
|
let e = {
|
|
2228
2231
|
contents: null,
|
|
2229
2232
|
explicitStart: t.explicitStart,
|
|
@@ -2236,10 +2239,10 @@ function Si(e, t) {
|
|
|
2236
2239
|
});
|
|
2237
2240
|
break;
|
|
2238
2241
|
}
|
|
2239
|
-
case
|
|
2242
|
+
case w.SCALAR:
|
|
2240
2243
|
xi(n, yi(n, t));
|
|
2241
2244
|
break;
|
|
2242
|
-
case
|
|
2245
|
+
case w.SEQUENCE: {
|
|
2243
2246
|
let { tag: e, tagged: r, style: i, anchor: a } = bi(n, t, "tag:yaml.org,2002:seq"), o = {
|
|
2244
2247
|
kind: "sequence",
|
|
2245
2248
|
tag: e,
|
|
@@ -2254,7 +2257,7 @@ function Si(e, t) {
|
|
|
2254
2257
|
});
|
|
2255
2258
|
break;
|
|
2256
2259
|
}
|
|
2257
|
-
case
|
|
2260
|
+
case w.MAPPING: {
|
|
2258
2261
|
let { tag: e, tagged: r, style: i, anchor: a } = bi(n, t, "tag:yaml.org,2002:map"), o = {
|
|
2259
2262
|
kind: "mapping",
|
|
2260
2263
|
tag: e,
|
|
@@ -2270,13 +2273,13 @@ function Si(e, t) {
|
|
|
2270
2273
|
});
|
|
2271
2274
|
break;
|
|
2272
2275
|
}
|
|
2273
|
-
case
|
|
2276
|
+
case w.ALIAS:
|
|
2274
2277
|
xi(n, {
|
|
2275
2278
|
kind: "alias",
|
|
2276
2279
|
anchor: n.source.slice(t.anchorStart, t.anchorEnd)
|
|
2277
2280
|
});
|
|
2278
2281
|
break;
|
|
2279
|
-
case
|
|
2282
|
+
case w.POP: {
|
|
2280
2283
|
let e = n.frames.pop();
|
|
2281
2284
|
if (e.kind === "mapping" && e.key) throw Error("incomplete mapping pair in event stream");
|
|
2282
2285
|
e.kind === "document" ? n.documents.push(e.doc) : xi(n, e.node);
|
|
@@ -2288,8 +2291,8 @@ function Si(e, t) {
|
|
|
2288
2291
|
}
|
|
2289
2292
|
//#endregion
|
|
2290
2293
|
//#region src/index.ts
|
|
2291
|
-
var Ci =
|
|
2294
|
+
var Ci = w.DOCUMENT, wi = w.SEQUENCE, Ti = w.MAPPING, Ei = w.SCALAR, Di = w.ALIAS, Oi = w.POP, ki = T.PLAIN, Ai = T.SINGLE_QUOTED, ji = T.DOUBLE_QUOTED, Mi = T.LITERAL_BLOCK, Ni = T.FOLDED_BLOCK, Pi = E.BLOCK, Fi = E.FLOW, Ii = D.CLIP, Li = D.STRIP, Ri = D.KEEP;
|
|
2292
2295
|
//#endregion
|
|
2293
|
-
export { Ii as CHOMPING_CLIP, Ri as CHOMPING_KEEP,
|
|
2296
|
+
export { Ii as CHOMPING_CLIP, Ri as CHOMPING_KEEP, D as CHOMPING_MODE, Li as CHOMPING_STRIP, E as COLLECTION_STYLE, Pi as COLLECTION_STYLE_BLOCK, Fi as COLLECTION_STYLE_FLOW, et as CORE_SCHEMA, Un as DEFAULT_SCALAR_STYLE_RULES, nt as DUMP_SCHEMA, Di as EVENT_ALIAS, Ci as EVENT_DOCUMENT, w as EVENT_ID, Ti as EVENT_MAPPING, Oi as EVENT_POP, Ei as EVENT_SCALAR, wi as EVENT_SEQUENCE, S as FAILSAFE_SCHEMA, $e as JSON_SCHEMA, e as NOT_RESOLVED, T as SCALAR_STYLE, ji as SCALAR_STYLE_DOUBLE_QUOTED, Ni as SCALAR_STYLE_FOLDED_BLOCK, Mi as SCALAR_STYLE_LITERAL_BLOCK, ki as SCALAR_STYLE_PLAIN, Ai as SCALAR_STYLE_SINGLE_QUOTED, x as Schema, Rn as VISIT_BREAK, zn as VISIT_SKIP, tt as YAML11_SCHEMA, C as YAMLException, Fe as binaryTag, f as boolCoreTag, h as boolJsonTag, ne as boolYaml11Tag, Vt as constructFromEvents, r as defineMappingTag, t as defineScalarTag, n as defineSequenceTag, hi as dump, Si as eventsToAst, xe as floatCoreTag, Ee as floatJsonTag, g as floatYaml11Tag, Ct as getScalarValue, se as intCoreTag, fe as intJsonTag, ge as intYaml11Tag, Ln as jsToAst, at as legacyMapTag, Pn as load, Nn as loadAll, Ge as mapTag, je as mergeTag, o as nullCoreTag, s as nullJsonTag, l as nullYaml11Tag, Ue as omapTag, We as pairsTag, An as parseEvents, fi as present, rt as realMapTag, Ve as seqTag, Ke as setTag, i as strTag, Be as timestampTag, Vn as visit };
|
|
2294
2297
|
|
|
2295
2298
|
//# sourceMappingURL=js-yaml.esm.min.mjs.map
|