@caiquecamargo/vite-plugin-netlify-cms 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +58 -57
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.es.js +494 -489
- package/dist/index.es.js.map +1 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { readdir as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { readdir as $s, mkdir as Cs, writeFile as vs, readFile as _s } from "fs/promises";
|
|
2
|
+
import Xe from "path";
|
|
3
|
+
const ft = Symbol.for("yaml.alias"), rt = Symbol.for("yaml.document"), W = Symbol.for("yaml.map"), Kt = Symbol.for("yaml.pair"), R = Symbol.for("yaml.scalar"), ce = Symbol.for("yaml.seq"), M = Symbol.for("yaml.node.type"), X = (s) => !!s && typeof s == "object" && s[M] === ft, ke = (s) => !!s && typeof s == "object" && s[M] === rt, z = (s) => !!s && typeof s == "object" && s[M] === W, I = (s) => !!s && typeof s == "object" && s[M] === Kt, A = (s) => !!s && typeof s == "object" && s[M] === R, fe = (s) => !!s && typeof s == "object" && s[M] === ce;
|
|
4
4
|
function L(s) {
|
|
5
5
|
if (s && typeof s == "object")
|
|
6
6
|
switch (s[M]) {
|
|
@@ -13,7 +13,7 @@ function L(s) {
|
|
|
13
13
|
function T(s) {
|
|
14
14
|
if (s && typeof s == "object")
|
|
15
15
|
switch (s[M]) {
|
|
16
|
-
case
|
|
16
|
+
case ft:
|
|
17
17
|
case W:
|
|
18
18
|
case R:
|
|
19
19
|
case ce:
|
|
@@ -21,8 +21,8 @@ function T(s) {
|
|
|
21
21
|
}
|
|
22
22
|
return !1;
|
|
23
23
|
}
|
|
24
|
-
const
|
|
25
|
-
class
|
|
24
|
+
const Bs = (s) => (A(s) || L(s)) && !!s.anchor;
|
|
25
|
+
class ut {
|
|
26
26
|
constructor(e) {
|
|
27
27
|
Object.defineProperty(this, M, { value: e });
|
|
28
28
|
}
|
|
@@ -32,18 +32,18 @@ class ht {
|
|
|
32
32
|
return this.range && (e.range = this.range.slice()), e;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
const
|
|
35
|
+
const v = Symbol("break visit"), Ft = Symbol("skip children"), K = Symbol("remove node");
|
|
36
36
|
function J(s, e) {
|
|
37
|
-
const t =
|
|
37
|
+
const t = qt(e);
|
|
38
38
|
ke(s) ? ne(null, s.contents, t, Object.freeze([s])) === K && (s.contents = null) : ne(null, s, t, Object.freeze([]));
|
|
39
39
|
}
|
|
40
|
-
J.BREAK =
|
|
41
|
-
J.SKIP =
|
|
40
|
+
J.BREAK = v;
|
|
41
|
+
J.SKIP = Ft;
|
|
42
42
|
J.REMOVE = K;
|
|
43
43
|
function ne(s, e, t, n) {
|
|
44
|
-
const i =
|
|
44
|
+
const i = Ut(s, e, t, n);
|
|
45
45
|
if (T(i) || I(i))
|
|
46
|
-
return
|
|
46
|
+
return Rt(s, n, i), ne(s, i, t, n);
|
|
47
47
|
if (typeof i != "symbol") {
|
|
48
48
|
if (L(e)) {
|
|
49
49
|
n = Object.freeze(n.concat(e));
|
|
@@ -52,36 +52,36 @@ function ne(s, e, t, n) {
|
|
|
52
52
|
if (typeof o == "number")
|
|
53
53
|
r = o - 1;
|
|
54
54
|
else {
|
|
55
|
-
if (o ===
|
|
56
|
-
return
|
|
55
|
+
if (o === v)
|
|
56
|
+
return v;
|
|
57
57
|
o === K && (e.items.splice(r, 1), r -= 1);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
} else if (I(e)) {
|
|
61
61
|
n = Object.freeze(n.concat(e));
|
|
62
62
|
const r = ne("key", e.key, t, n);
|
|
63
|
-
if (r ===
|
|
64
|
-
return
|
|
63
|
+
if (r === v)
|
|
64
|
+
return v;
|
|
65
65
|
r === K && (e.key = null);
|
|
66
66
|
const o = ne("value", e.value, t, n);
|
|
67
|
-
if (o ===
|
|
68
|
-
return
|
|
67
|
+
if (o === v)
|
|
68
|
+
return v;
|
|
69
69
|
o === K && (e.value = null);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
return i;
|
|
73
73
|
}
|
|
74
|
-
async function
|
|
75
|
-
const t =
|
|
74
|
+
async function Pe(s, e) {
|
|
75
|
+
const t = qt(e);
|
|
76
76
|
ke(s) ? await ie(null, s.contents, t, Object.freeze([s])) === K && (s.contents = null) : await ie(null, s, t, Object.freeze([]));
|
|
77
77
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
Pe.BREAK = v;
|
|
79
|
+
Pe.SKIP = Ft;
|
|
80
|
+
Pe.REMOVE = K;
|
|
81
81
|
async function ie(s, e, t, n) {
|
|
82
|
-
const i = await
|
|
82
|
+
const i = await Ut(s, e, t, n);
|
|
83
83
|
if (T(i) || I(i))
|
|
84
|
-
return
|
|
84
|
+
return Rt(s, n, i), ie(s, i, t, n);
|
|
85
85
|
if (typeof i != "symbol") {
|
|
86
86
|
if (L(e)) {
|
|
87
87
|
n = Object.freeze(n.concat(e));
|
|
@@ -90,26 +90,26 @@ async function ie(s, e, t, n) {
|
|
|
90
90
|
if (typeof o == "number")
|
|
91
91
|
r = o - 1;
|
|
92
92
|
else {
|
|
93
|
-
if (o ===
|
|
94
|
-
return
|
|
93
|
+
if (o === v)
|
|
94
|
+
return v;
|
|
95
95
|
o === K && (e.items.splice(r, 1), r -= 1);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
} else if (I(e)) {
|
|
99
99
|
n = Object.freeze(n.concat(e));
|
|
100
100
|
const r = await ie("key", e.key, t, n);
|
|
101
|
-
if (r ===
|
|
102
|
-
return
|
|
101
|
+
if (r === v)
|
|
102
|
+
return v;
|
|
103
103
|
r === K && (e.key = null);
|
|
104
104
|
const o = await ie("value", e.value, t, n);
|
|
105
|
-
if (o ===
|
|
106
|
-
return
|
|
105
|
+
if (o === v)
|
|
106
|
+
return v;
|
|
107
107
|
o === K && (e.value = null);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
return i;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function qt(s) {
|
|
113
113
|
return typeof s == "object" && (s.Collection || s.Node || s.Value) ? Object.assign({
|
|
114
114
|
Alias: s.Node,
|
|
115
115
|
Map: s.Node,
|
|
@@ -124,7 +124,7 @@ function Ut(s) {
|
|
|
124
124
|
Seq: s.Collection
|
|
125
125
|
}, s) : s;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function Ut(s, e, t, n) {
|
|
128
128
|
if (typeof t == "function")
|
|
129
129
|
return t(s, e, n);
|
|
130
130
|
if (z(e))
|
|
@@ -138,7 +138,7 @@ function Rt(s, e, t, n) {
|
|
|
138
138
|
if (X(e))
|
|
139
139
|
return t.Alias?.(s, e, n);
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function Rt(s, e, t) {
|
|
142
142
|
const n = e[e.length - 1];
|
|
143
143
|
if (L(n))
|
|
144
144
|
n.items[s] = t;
|
|
@@ -151,14 +151,14 @@ function Vt(s, e, t) {
|
|
|
151
151
|
throw new Error(`Cannot replace node with ${i} parent`);
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
const
|
|
154
|
+
const js = {
|
|
155
155
|
"!": "%21",
|
|
156
156
|
",": "%2C",
|
|
157
157
|
"[": "%5B",
|
|
158
158
|
"]": "%5D",
|
|
159
159
|
"{": "%7B",
|
|
160
160
|
"}": "%7D"
|
|
161
|
-
},
|
|
161
|
+
}, Ms = (s) => s.replace(/[!,[\]{}]/g, (e) => js[e]);
|
|
162
162
|
class C {
|
|
163
163
|
constructor(e, t) {
|
|
164
164
|
this.docStart = null, this.docEnd = !1, this.yaml = Object.assign({}, C.defaultYaml, e), this.tags = Object.assign({}, C.defaultTags, t);
|
|
@@ -242,7 +242,7 @@ class C {
|
|
|
242
242
|
tagString(e) {
|
|
243
243
|
for (const [t, n] of Object.entries(this.tags))
|
|
244
244
|
if (e.startsWith(n))
|
|
245
|
-
return t +
|
|
245
|
+
return t + Ms(e.substring(n.length));
|
|
246
246
|
return e[0] === "!" ? e : `!<${e}>`;
|
|
247
247
|
}
|
|
248
248
|
toString(e) {
|
|
@@ -263,14 +263,14 @@ class C {
|
|
|
263
263
|
}
|
|
264
264
|
C.defaultYaml = { explicit: !1, version: "1.2" };
|
|
265
265
|
C.defaultTags = { "!!": "tag:yaml.org,2002:" };
|
|
266
|
-
function
|
|
266
|
+
function Vt(s) {
|
|
267
267
|
if (/[\x00-\x19\s,[\]{}]/.test(s)) {
|
|
268
268
|
const t = `Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;
|
|
269
269
|
throw new Error(t);
|
|
270
270
|
}
|
|
271
271
|
return !0;
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function Wt(s) {
|
|
274
274
|
const e = /* @__PURE__ */ new Set();
|
|
275
275
|
return J(s, {
|
|
276
276
|
Value(t, n) {
|
|
@@ -278,20 +278,20 @@ function Jt(s) {
|
|
|
278
278
|
}
|
|
279
279
|
}), e;
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function Jt(s, e) {
|
|
282
282
|
for (let t = 1; ; ++t) {
|
|
283
283
|
const n = `${s}${t}`;
|
|
284
284
|
if (!e.has(n))
|
|
285
285
|
return n;
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function Ps(s, e) {
|
|
289
289
|
const t = [], n = /* @__PURE__ */ new Map();
|
|
290
290
|
let i = null;
|
|
291
291
|
return {
|
|
292
292
|
onAnchor: (r) => {
|
|
293
|
-
t.push(r), i || (i =
|
|
294
|
-
const o =
|
|
293
|
+
t.push(r), i || (i = Wt(s));
|
|
294
|
+
const o = Jt(e, i);
|
|
295
295
|
return i.add(o), o;
|
|
296
296
|
},
|
|
297
297
|
/**
|
|
@@ -313,9 +313,9 @@ function Ks(s, e) {
|
|
|
313
313
|
sourceObjects: n
|
|
314
314
|
};
|
|
315
315
|
}
|
|
316
|
-
class
|
|
316
|
+
class De extends ut {
|
|
317
317
|
constructor(e) {
|
|
318
|
-
super(
|
|
318
|
+
super(ft), this.source = e, Object.defineProperty(this, "tag", {
|
|
319
319
|
set() {
|
|
320
320
|
throw new Error("Alias nodes cannot have tags");
|
|
321
321
|
}
|
|
@@ -348,7 +348,7 @@ class Ke extends ht {
|
|
|
348
348
|
const a = "This should not happen: Alias anchor was not resolved?";
|
|
349
349
|
throw new ReferenceError(a);
|
|
350
350
|
}
|
|
351
|
-
if (r >= 0 && (l.count += 1, l.aliasCount === 0 && (l.aliasCount =
|
|
351
|
+
if (r >= 0 && (l.count += 1, l.aliasCount === 0 && (l.aliasCount = Te(i, o, n)), l.count * l.aliasCount > r)) {
|
|
352
352
|
const a = "Excessive alias count indicates a resource exhaustion attack";
|
|
353
353
|
throw new ReferenceError(a);
|
|
354
354
|
}
|
|
@@ -357,7 +357,7 @@ class Ke extends ht {
|
|
|
357
357
|
toString(e, t, n) {
|
|
358
358
|
const i = `*${this.source}`;
|
|
359
359
|
if (e) {
|
|
360
|
-
if (
|
|
360
|
+
if (Vt(this.source), e.options.verifyAliasOrder && !e.anchors.has(this.source)) {
|
|
361
361
|
const r = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
362
362
|
throw new Error(r);
|
|
363
363
|
}
|
|
@@ -367,19 +367,19 @@ class Ke extends ht {
|
|
|
367
367
|
return i;
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function Te(s, e, t) {
|
|
371
371
|
if (X(e)) {
|
|
372
372
|
const n = e.resolve(s), i = t && n && t.get(n);
|
|
373
373
|
return i ? i.count * i.aliasCount : 0;
|
|
374
374
|
} else if (L(e)) {
|
|
375
375
|
let n = 0;
|
|
376
376
|
for (const i of e.items) {
|
|
377
|
-
const r =
|
|
377
|
+
const r = Te(s, i, t);
|
|
378
378
|
r > n && (n = r);
|
|
379
379
|
}
|
|
380
380
|
return n;
|
|
381
381
|
} else if (I(e)) {
|
|
382
|
-
const n =
|
|
382
|
+
const n = Te(s, e.key, t), i = Te(s, e.value, t);
|
|
383
383
|
return Math.max(n, i);
|
|
384
384
|
}
|
|
385
385
|
return 1;
|
|
@@ -388,7 +388,7 @@ function F(s, e, t) {
|
|
|
388
388
|
if (Array.isArray(s))
|
|
389
389
|
return s.map((n, i) => F(n, String(i), t));
|
|
390
390
|
if (s && typeof s.toJSON == "function") {
|
|
391
|
-
if (!t || !
|
|
391
|
+
if (!t || !Bs(s))
|
|
392
392
|
return s.toJSON(e, t);
|
|
393
393
|
const n = { aliasCount: 0, count: 1, res: void 0 };
|
|
394
394
|
t.anchors.set(s, n), t.onCreate = (r) => {
|
|
@@ -399,8 +399,8 @@ function F(s, e, t) {
|
|
|
399
399
|
}
|
|
400
400
|
return typeof s == "bigint" && !t?.keep ? Number(s) : s;
|
|
401
401
|
}
|
|
402
|
-
const
|
|
403
|
-
class N extends
|
|
402
|
+
const Yt = (s) => !s || typeof s != "function" && typeof s != "object";
|
|
403
|
+
class N extends ut {
|
|
404
404
|
constructor(e) {
|
|
405
405
|
super(R), this.value = e;
|
|
406
406
|
}
|
|
@@ -416,8 +416,8 @@ N.BLOCK_LITERAL = "BLOCK_LITERAL";
|
|
|
416
416
|
N.PLAIN = "PLAIN";
|
|
417
417
|
N.QUOTE_DOUBLE = "QUOTE_DOUBLE";
|
|
418
418
|
N.QUOTE_SINGLE = "QUOTE_SINGLE";
|
|
419
|
-
const
|
|
420
|
-
function
|
|
419
|
+
const Ds = "tag:yaml.org,2002:";
|
|
420
|
+
function Ks(s, e, t) {
|
|
421
421
|
if (e) {
|
|
422
422
|
const n = t.filter((r) => r.tag === e), i = n.find((r) => !r.format) ?? n[0];
|
|
423
423
|
if (!i)
|
|
@@ -438,11 +438,11 @@ function be(s, e, t) {
|
|
|
438
438
|
let a;
|
|
439
439
|
if (n && s && typeof s == "object") {
|
|
440
440
|
if (a = l.get(s), a)
|
|
441
|
-
return a.anchor || (a.anchor = i(s)), new
|
|
441
|
+
return a.anchor || (a.anchor = i(s)), new De(a.anchor);
|
|
442
442
|
a = { anchor: null, node: null }, l.set(s, a);
|
|
443
443
|
}
|
|
444
|
-
e?.startsWith("!!") && (e =
|
|
445
|
-
let c =
|
|
444
|
+
e?.startsWith("!!") && (e = Ds + e.slice(2));
|
|
445
|
+
let c = Ks(s, e, o.tags);
|
|
446
446
|
if (!c) {
|
|
447
447
|
if (s && typeof s.toJSON == "function" && (s = s.toJSON()), !s || typeof s != "object") {
|
|
448
448
|
const f = new N(s);
|
|
@@ -454,7 +454,7 @@ function be(s, e, t) {
|
|
|
454
454
|
const u = c?.createNode ? c.createNode(t.schema, s, t) : new N(s);
|
|
455
455
|
return e && (u.tag = e), a && (a.node = u), u;
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function _e(s, e, t) {
|
|
458
458
|
let n = t;
|
|
459
459
|
for (let i = e.length - 1; i >= 0; --i) {
|
|
460
460
|
const r = e[i];
|
|
@@ -475,7 +475,7 @@ function Be(s, e, t) {
|
|
|
475
475
|
});
|
|
476
476
|
}
|
|
477
477
|
const me = (s) => s == null || typeof s == "object" && !!s[Symbol.iterator]().next().done;
|
|
478
|
-
class
|
|
478
|
+
class Ke extends ut {
|
|
479
479
|
constructor(e, t) {
|
|
480
480
|
super(e), Object.defineProperty(this, "schema", {
|
|
481
481
|
value: t,
|
|
@@ -506,7 +506,7 @@ class Fe extends ht {
|
|
|
506
506
|
if (L(r))
|
|
507
507
|
r.addIn(i, t);
|
|
508
508
|
else if (r === void 0 && this.schema)
|
|
509
|
-
this.set(n,
|
|
509
|
+
this.set(n, _e(this.schema, i, t));
|
|
510
510
|
else
|
|
511
511
|
throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`);
|
|
512
512
|
}
|
|
@@ -564,22 +564,22 @@ class Fe extends ht {
|
|
|
564
564
|
if (L(r))
|
|
565
565
|
r.setIn(i, t);
|
|
566
566
|
else if (r === void 0 && this.schema)
|
|
567
|
-
this.set(n,
|
|
567
|
+
this.set(n, _e(this.schema, i, t));
|
|
568
568
|
else
|
|
569
569
|
throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`);
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
|
-
|
|
574
|
-
const
|
|
573
|
+
Ke.maxFlowStringSingleLineLength = 60;
|
|
574
|
+
const Fs = (s) => s.replace(/^(?!$)(?: $)?/gm, "#");
|
|
575
575
|
function U(s, e) {
|
|
576
576
|
return /^\n+$/.test(s) ? s.substring(1) : e ? s.replace(/^(?! *$)/gm, e) : s;
|
|
577
577
|
}
|
|
578
578
|
const V = (s, e, t) => s.endsWith(`
|
|
579
579
|
`) ? U(t, e) : t.includes(`
|
|
580
580
|
`) ? `
|
|
581
|
-
` + U(t, e) : (s.endsWith(" ") ? "" : " ") + t,
|
|
582
|
-
function
|
|
581
|
+
` + U(t, e) : (s.endsWith(" ") ? "" : " ") + t, Gt = "flow", ot = "block", $e = "quoted";
|
|
582
|
+
function Fe(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentWidth: r = 20, onFold: o, onOverflow: l } = {}) {
|
|
583
583
|
if (!i || i < 0)
|
|
584
584
|
return s;
|
|
585
585
|
const a = Math.max(1 + r, 1 + i - e.length);
|
|
@@ -589,9 +589,9 @@ function qe(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
589
589
|
let f = i - e.length;
|
|
590
590
|
typeof n == "number" && (n > i - Math.max(2, r) ? c.push(0) : f = i - n);
|
|
591
591
|
let h, p, y = !1, d = -1, m = -1, b = -1;
|
|
592
|
-
t ===
|
|
592
|
+
t === ot && (d = It(s, d), d !== -1 && (f = d + a));
|
|
593
593
|
for (let k; k = s[d += 1]; ) {
|
|
594
|
-
if (t ===
|
|
594
|
+
if (t === $e && k === "\\") {
|
|
595
595
|
switch (m = d, s[d + 1]) {
|
|
596
596
|
case "x":
|
|
597
597
|
d += 3;
|
|
@@ -609,7 +609,7 @@ function qe(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
609
609
|
}
|
|
610
610
|
if (k === `
|
|
611
611
|
`)
|
|
612
|
-
t ===
|
|
612
|
+
t === ot && (d = It(s, d)), f = d + a, h = void 0;
|
|
613
613
|
else {
|
|
614
614
|
if (k === " " && p && p !== " " && p !== `
|
|
615
615
|
` && p !== " ") {
|
|
@@ -620,7 +620,7 @@ function qe(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
620
620
|
if (d >= f)
|
|
621
621
|
if (h)
|
|
622
622
|
c.push(h), f = h + a, h = void 0;
|
|
623
|
-
else if (t ===
|
|
623
|
+
else if (t === $e) {
|
|
624
624
|
for (; p === " " || p === " "; )
|
|
625
625
|
p = k, k = s[d += 1], y = !0;
|
|
626
626
|
const S = d > b + 1 ? d - 2 : m - 1;
|
|
@@ -639,12 +639,12 @@ function qe(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
639
639
|
for (let k = 0; k < c.length; ++k) {
|
|
640
640
|
const S = c[k], O = c[k + 1] || s.length;
|
|
641
641
|
S === 0 ? w = `
|
|
642
|
-
${e}${s.slice(0, O)}` : (t ===
|
|
642
|
+
${e}${s.slice(0, O)}` : (t === $e && u[S] && (w += `${s[S]}\\`), w += `
|
|
643
643
|
${e}${s.slice(S + 1, O)}`);
|
|
644
644
|
}
|
|
645
645
|
return w;
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function It(s, e) {
|
|
648
648
|
let t = s[e + 1];
|
|
649
649
|
for (; t === " " || t === " "; ) {
|
|
650
650
|
do
|
|
@@ -655,12 +655,12 @@ function Lt(s, e) {
|
|
|
655
655
|
}
|
|
656
656
|
return e;
|
|
657
657
|
}
|
|
658
|
-
const
|
|
658
|
+
const qe = (s) => ({
|
|
659
659
|
indentAtStart: s.indentAtStart,
|
|
660
660
|
lineWidth: s.options.lineWidth,
|
|
661
661
|
minContentWidth: s.options.minContentWidth
|
|
662
|
-
}),
|
|
663
|
-
function
|
|
662
|
+
}), Ue = (s) => /^(%|---|\.\.\.)/m.test(s);
|
|
663
|
+
function qs(s, e, t) {
|
|
664
664
|
if (!e || e < 0)
|
|
665
665
|
return !1;
|
|
666
666
|
const n = e - t, i = s.length;
|
|
@@ -680,7 +680,7 @@ function ye(s, e) {
|
|
|
680
680
|
const t = JSON.stringify(s);
|
|
681
681
|
if (e.options.doubleQuotedAsJSON)
|
|
682
682
|
return t;
|
|
683
|
-
const { implicitKey: n } = e, i = e.options.doubleQuotedMinMultiLineLength, r = e.indent || (
|
|
683
|
+
const { implicitKey: n } = e, i = e.options.doubleQuotedMinMultiLineLength, r = e.indent || (Ue(s) ? " " : "");
|
|
684
684
|
let o = "", l = 0;
|
|
685
685
|
for (let a = 0, c = t[a]; c; c = t[++a])
|
|
686
686
|
if (c === " " && t[a + 1] === "\\" && t[a + 2] === "n" && (o += t.slice(l, a) + "\\ ", a += 1, l = a, c = "\\"), c === "\\")
|
|
@@ -735,15 +735,15 @@ function ye(s, e) {
|
|
|
735
735
|
default:
|
|
736
736
|
a += 1;
|
|
737
737
|
}
|
|
738
|
-
return o = l ? o + t.slice(l) : t, n ? o :
|
|
738
|
+
return o = l ? o + t.slice(l) : t, n ? o : Fe(o, r, $e, qe(e));
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function lt(s, e) {
|
|
741
741
|
if (e.options.singleQuote === !1 || e.implicitKey && s.includes(`
|
|
742
742
|
`) || /[ \t]\n|\n[ \t]/.test(s))
|
|
743
743
|
return ye(s, e);
|
|
744
|
-
const t = e.indent || (
|
|
744
|
+
const t = e.indent || (Ue(s) ? " " : ""), n = "'" + s.replace(/'/g, "''").replace(/\n+/g, `$&
|
|
745
745
|
${t}`) + "'";
|
|
746
|
-
return e.implicitKey ? n :
|
|
746
|
+
return e.implicitKey ? n : Fe(n, t, Gt, qe(e));
|
|
747
747
|
}
|
|
748
748
|
function re(s, e) {
|
|
749
749
|
const { singleQuote: t } = e.options;
|
|
@@ -752,15 +752,15 @@ function re(s, e) {
|
|
|
752
752
|
n = ye;
|
|
753
753
|
else {
|
|
754
754
|
const i = s.includes('"'), r = s.includes("'");
|
|
755
|
-
i && !r ? n =
|
|
755
|
+
i && !r ? n = lt : r && !i ? n = ye : n = t ? lt : ye;
|
|
756
756
|
}
|
|
757
757
|
return n(s, e);
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function Ce({ comment: s, type: e, value: t }, n, i, r) {
|
|
760
760
|
const { blockQuote: o, commentString: l, lineWidth: a } = n.options;
|
|
761
761
|
if (!o || /\n[\t ]+$/.test(t) || /^\s*$/.test(t))
|
|
762
762
|
return re(t, n);
|
|
763
|
-
const c = n.indent || (n.forceBlockIndent ||
|
|
763
|
+
const c = n.indent || (n.forceBlockIndent || Ue(t) ? " " : ""), u = o === "literal" ? !0 : o === "folded" || e === N.BLOCK_FOLDED ? !1 : e === N.BLOCK_LITERAL ? !0 : !qs(t, a, c.length);
|
|
764
764
|
if (!t)
|
|
765
765
|
return u ? `|
|
|
766
766
|
` : `>
|
|
@@ -796,23 +796,23 @@ function _e({ comment: s, type: e, value: t }, n, i, r) {
|
|
|
796
796
|
${c}${w}${t}${p}`;
|
|
797
797
|
t = t.replace(/\n+/g, `
|
|
798
798
|
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${c}`);
|
|
799
|
-
const O =
|
|
799
|
+
const O = Fe(`${w}${t}${p}`, c, ot, qe(n));
|
|
800
800
|
return `${S}
|
|
801
801
|
${c}${O}`;
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function Us(s, e, t, n) {
|
|
804
804
|
const { type: i, value: r } = s, { actualString: o, implicitKey: l, indent: a, indentStep: c, inFlow: u } = e;
|
|
805
805
|
if (l && /[\n[\]{},]/.test(r) || u && /[[\]{},]/.test(r))
|
|
806
806
|
return re(r, e);
|
|
807
807
|
if (!r || /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))
|
|
808
808
|
return l || u || !r.includes(`
|
|
809
|
-
`) ? re(r, e) :
|
|
809
|
+
`) ? re(r, e) : Ce(s, e, t, n);
|
|
810
810
|
if (!l && !u && i !== N.PLAIN && r.includes(`
|
|
811
811
|
`))
|
|
812
|
-
return
|
|
813
|
-
if (
|
|
812
|
+
return Ce(s, e, t, n);
|
|
813
|
+
if (Ue(r)) {
|
|
814
814
|
if (a === "")
|
|
815
|
-
return e.forceBlockIndent = !0,
|
|
815
|
+
return e.forceBlockIndent = !0, Ce(s, e, t, n);
|
|
816
816
|
if (l && a === c)
|
|
817
817
|
return re(r, e);
|
|
818
818
|
}
|
|
@@ -823,7 +823,7 @@ ${a}`);
|
|
|
823
823
|
if (y.some(h) || p?.some(h))
|
|
824
824
|
return re(r, e);
|
|
825
825
|
}
|
|
826
|
-
return l ? f :
|
|
826
|
+
return l ? f : Fe(f, a, Gt, qe(e));
|
|
827
827
|
}
|
|
828
828
|
function Ne(s, e, t, n) {
|
|
829
829
|
const { implicitKey: i, inFlow: r } = e, o = typeof s.value == "string" ? s : Object.assign({}, s, { value: String(s.value) });
|
|
@@ -833,13 +833,13 @@ function Ne(s, e, t, n) {
|
|
|
833
833
|
switch (u) {
|
|
834
834
|
case N.BLOCK_FOLDED:
|
|
835
835
|
case N.BLOCK_LITERAL:
|
|
836
|
-
return i || r ? re(o.value, e) :
|
|
836
|
+
return i || r ? re(o.value, e) : Ce(o, e, t, n);
|
|
837
837
|
case N.QUOTE_DOUBLE:
|
|
838
838
|
return ye(o.value, e);
|
|
839
839
|
case N.QUOTE_SINGLE:
|
|
840
|
-
return
|
|
840
|
+
return lt(o.value, e);
|
|
841
841
|
case N.PLAIN:
|
|
842
|
-
return
|
|
842
|
+
return Us(o, e, t, n);
|
|
843
843
|
default:
|
|
844
844
|
return null;
|
|
845
845
|
}
|
|
@@ -852,10 +852,10 @@ function Ne(s, e, t, n) {
|
|
|
852
852
|
}
|
|
853
853
|
return c;
|
|
854
854
|
}
|
|
855
|
-
function
|
|
855
|
+
function Qt(s, e) {
|
|
856
856
|
const t = Object.assign({
|
|
857
857
|
blockQuote: !0,
|
|
858
|
-
commentString:
|
|
858
|
+
commentString: Fs,
|
|
859
859
|
defaultKeyType: null,
|
|
860
860
|
defaultStringType: "PLAIN",
|
|
861
861
|
directives: null,
|
|
@@ -893,7 +893,7 @@ function Ht(s, e) {
|
|
|
893
893
|
options: t
|
|
894
894
|
};
|
|
895
895
|
}
|
|
896
|
-
function
|
|
896
|
+
function Rs(s, e) {
|
|
897
897
|
if (e.tag) {
|
|
898
898
|
const i = s.filter((r) => r.tag === e.tag);
|
|
899
899
|
if (i.length > 0)
|
|
@@ -912,11 +912,11 @@ function Ws(s, e) {
|
|
|
912
912
|
}
|
|
913
913
|
return t;
|
|
914
914
|
}
|
|
915
|
-
function
|
|
915
|
+
function Vs(s, e, { anchors: t, doc: n }) {
|
|
916
916
|
if (!n.directives)
|
|
917
917
|
return "";
|
|
918
918
|
const i = [], r = (A(s) || L(s)) && s.anchor;
|
|
919
|
-
r &&
|
|
919
|
+
r && Vt(r) && (t.add(r), i.push(`&${r}`));
|
|
920
920
|
const o = s.tag ? s.tag : e.default ? null : e.tag;
|
|
921
921
|
return o && i.push(n.directives.tagString(o)), i.join(" ");
|
|
922
922
|
}
|
|
@@ -932,14 +932,14 @@ function H(s, e, t, n) {
|
|
|
932
932
|
}
|
|
933
933
|
let i;
|
|
934
934
|
const r = T(s) ? s : e.doc.createNode(s, { onTagObj: (a) => i = a });
|
|
935
|
-
i || (i =
|
|
936
|
-
const o =
|
|
935
|
+
i || (i = Rs(e.doc.schema.tags, r));
|
|
936
|
+
const o = Vs(r, i, e);
|
|
937
937
|
o.length > 0 && (e.indentAtStart = (e.indentAtStart ?? 0) + o.length + 1);
|
|
938
938
|
const l = typeof i.stringify == "function" ? i.stringify(r, e, t, n) : A(r) ? Ne(r, e, t, n) : r.toString(e, t, n);
|
|
939
939
|
return o ? A(r) || l[0] === "{" || l[0] === "[" ? `${o} ${l}` : `${o}
|
|
940
940
|
${e.indent}${l}` : l;
|
|
941
941
|
}
|
|
942
|
-
function
|
|
942
|
+
function Ws({ key: s, value: e }, t, n, i) {
|
|
943
943
|
const { allNullValues: r, doc: o, indent: l, indentStep: a, options: { commentString: c, indentSeq: u, simpleKeys: f } } = t;
|
|
944
944
|
let h = T(s) && s.comment || null;
|
|
945
945
|
if (f) {
|
|
@@ -988,14 +988,14 @@ ${U(E, t.indent)}`;
|
|
|
988
988
|
${t.indent}`;
|
|
989
989
|
} else if (!p && L(e)) {
|
|
990
990
|
const E = O[0], q = O.indexOf(`
|
|
991
|
-
`), ee = q !== -1,
|
|
992
|
-
if (ee || !
|
|
993
|
-
let
|
|
991
|
+
`), ee = q !== -1, _ = t.inFlow ?? e.flow ?? e.items.length === 0;
|
|
992
|
+
if (ee || !_) {
|
|
993
|
+
let Et = !1;
|
|
994
994
|
if (ee && (E === "&" || E === "!")) {
|
|
995
995
|
let Y = O.indexOf(" ");
|
|
996
|
-
E === "&" && Y !== -1 && Y < q && O[Y + 1] === "!" && (Y = O.indexOf(" ", Y + 1)), (Y === -1 || q < Y) && (
|
|
996
|
+
E === "&" && Y !== -1 && Y < q && O[Y + 1] === "!" && (Y = O.indexOf(" ", Y + 1)), (Y === -1 || q < Y) && (Et = !0);
|
|
997
997
|
}
|
|
998
|
-
|
|
998
|
+
Et || (g = `
|
|
999
999
|
${t.indent}`);
|
|
1000
1000
|
}
|
|
1001
1001
|
} else
|
|
@@ -1003,12 +1003,12 @@ ${t.indent}`);
|
|
|
1003
1003
|
`) && (g = "");
|
|
1004
1004
|
return m += g + O, t.inFlow ? S && n && n() : k && !S ? m += V(m, t.indent, c(k)) : d && i && i(), m;
|
|
1005
1005
|
}
|
|
1006
|
-
function
|
|
1006
|
+
function Ht(s, e) {
|
|
1007
1007
|
(s === "debug" || s === "warn") && (typeof process < "u" && process.emitWarning ? process.emitWarning(e) : console.warn(e));
|
|
1008
1008
|
}
|
|
1009
|
-
const
|
|
1010
|
-
function
|
|
1011
|
-
if (s?.doc.schema.merge &&
|
|
1009
|
+
const Lt = "<<";
|
|
1010
|
+
function xt(s, e, { key: t, value: n }) {
|
|
1011
|
+
if (s?.doc.schema.merge && Js(t))
|
|
1012
1012
|
if (n = X(n) ? n.resolve(s.doc) : n, fe(n))
|
|
1013
1013
|
for (const i of n.items)
|
|
1014
1014
|
ze(s, e, i);
|
|
@@ -1024,7 +1024,7 @@ function Xt(s, e, { key: t, value: n }) {
|
|
|
1024
1024
|
else if (e instanceof Set)
|
|
1025
1025
|
e.add(i);
|
|
1026
1026
|
else {
|
|
1027
|
-
const r =
|
|
1027
|
+
const r = Ys(t, i, s), o = F(n, r, s);
|
|
1028
1028
|
r in e ? Object.defineProperty(e, r, {
|
|
1029
1029
|
value: o,
|
|
1030
1030
|
writable: !0,
|
|
@@ -1035,7 +1035,7 @@ function Xt(s, e, { key: t, value: n }) {
|
|
|
1035
1035
|
}
|
|
1036
1036
|
return e;
|
|
1037
1037
|
}
|
|
1038
|
-
const
|
|
1038
|
+
const Js = (s) => s === Lt || A(s) && s.value === Lt && (!s.type || s.type === N.PLAIN);
|
|
1039
1039
|
function ze(s, e, t) {
|
|
1040
1040
|
const n = s && X(t) ? t.resolve(s.doc) : t;
|
|
1041
1041
|
if (!z(n))
|
|
@@ -1050,13 +1050,13 @@ function ze(s, e, t) {
|
|
|
1050
1050
|
});
|
|
1051
1051
|
return e;
|
|
1052
1052
|
}
|
|
1053
|
-
function
|
|
1053
|
+
function Ys(s, e, t) {
|
|
1054
1054
|
if (e === null)
|
|
1055
1055
|
return "";
|
|
1056
1056
|
if (typeof e != "object")
|
|
1057
1057
|
return String(e);
|
|
1058
1058
|
if (T(s) && t && t.doc) {
|
|
1059
|
-
const n =
|
|
1059
|
+
const n = Qt(t.doc, {});
|
|
1060
1060
|
n.anchors = /* @__PURE__ */ new Set();
|
|
1061
1061
|
for (const r of t.anchors.keys())
|
|
1062
1062
|
n.anchors.add(r.anchor);
|
|
@@ -1064,19 +1064,19 @@ function Qs(s, e, t) {
|
|
|
1064
1064
|
const i = s.toString(n);
|
|
1065
1065
|
if (!t.mapKeyWarned) {
|
|
1066
1066
|
let r = JSON.stringify(i);
|
|
1067
|
-
r.length > 40 && (r = r.substring(0, 36) + '..."'),
|
|
1067
|
+
r.length > 40 && (r = r.substring(0, 36) + '..."'), Ht(t.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`), t.mapKeyWarned = !0;
|
|
1068
1068
|
}
|
|
1069
1069
|
return i;
|
|
1070
1070
|
}
|
|
1071
1071
|
return JSON.stringify(e);
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function ht(s, e, t) {
|
|
1074
1074
|
const n = be(s, void 0, t), i = be(e, void 0, t);
|
|
1075
1075
|
return new $(n, i);
|
|
1076
1076
|
}
|
|
1077
1077
|
class $ {
|
|
1078
1078
|
constructor(e, t = null) {
|
|
1079
|
-
Object.defineProperty(this, M, { value:
|
|
1079
|
+
Object.defineProperty(this, M, { value: Kt }), this.key = e, this.value = t;
|
|
1080
1080
|
}
|
|
1081
1081
|
clone(e) {
|
|
1082
1082
|
let { key: t, value: n } = this;
|
|
@@ -1084,16 +1084,16 @@ class $ {
|
|
|
1084
1084
|
}
|
|
1085
1085
|
toJSON(e, t) {
|
|
1086
1086
|
const n = t?.mapAsMap ? /* @__PURE__ */ new Map() : {};
|
|
1087
|
-
return
|
|
1087
|
+
return xt(t, n, this);
|
|
1088
1088
|
}
|
|
1089
1089
|
toString(e, t, n) {
|
|
1090
|
-
return e?.doc ?
|
|
1090
|
+
return e?.doc ? Ws(this, e, t, n) : JSON.stringify(this);
|
|
1091
1091
|
}
|
|
1092
1092
|
}
|
|
1093
|
-
function
|
|
1094
|
-
return (e.inFlow ?? s.flow ?
|
|
1093
|
+
function Xt(s, e, t) {
|
|
1094
|
+
return (e.inFlow ?? s.flow ? Qs : Gs)(s, e, t);
|
|
1095
1095
|
}
|
|
1096
|
-
function
|
|
1096
|
+
function Gs({ comment: s, items: e }, t, { blockItemPrefix: n, flowChars: i, itemIndent: r, onChompKeep: o, onComment: l }) {
|
|
1097
1097
|
const { indent: a, options: { commentString: c } } = t, u = Object.assign({}, t, { indent: r, type: null });
|
|
1098
1098
|
let f = !1;
|
|
1099
1099
|
const h = [];
|
|
@@ -1101,10 +1101,10 @@ function Hs({ comment: s, items: e }, t, { blockItemPrefix: n, flowChars: i, ite
|
|
|
1101
1101
|
const d = e[y];
|
|
1102
1102
|
let m = null;
|
|
1103
1103
|
if (T(d))
|
|
1104
|
-
!f && d.spaceBefore && h.push(""),
|
|
1104
|
+
!f && d.spaceBefore && h.push(""), Be(t, h, d.commentBefore, f), d.comment && (m = d.comment);
|
|
1105
1105
|
else if (I(d)) {
|
|
1106
1106
|
const w = T(d.key) ? d.key : null;
|
|
1107
|
-
w && (!f && w.spaceBefore && h.push(""),
|
|
1107
|
+
w && (!f && w.spaceBefore && h.push(""), Be(t, h, w.commentBefore, f));
|
|
1108
1108
|
}
|
|
1109
1109
|
f = !1;
|
|
1110
1110
|
let b = H(d, u, () => m = null, () => f = !0);
|
|
@@ -1125,7 +1125,7 @@ ${a}${d}` : `
|
|
|
1125
1125
|
return s ? (p += `
|
|
1126
1126
|
` + U(c(s), a), l && l()) : f && o && o(), p;
|
|
1127
1127
|
}
|
|
1128
|
-
function
|
|
1128
|
+
function Qs({ comment: s, items: e }, t, { flowChars: n, itemIndent: i, onComment: r }) {
|
|
1129
1129
|
const { indent: o, indentStep: l, flowCollectionPadding: a, options: { commentString: c } } = t;
|
|
1130
1130
|
i += l;
|
|
1131
1131
|
const u = Object.assign({}, t, {
|
|
@@ -1139,10 +1139,10 @@ function xs({ comment: s, items: e }, t, { flowChars: n, itemIndent: i, onCommen
|
|
|
1139
1139
|
const w = e[b];
|
|
1140
1140
|
let k = null;
|
|
1141
1141
|
if (T(w))
|
|
1142
|
-
w.spaceBefore && p.push(""),
|
|
1142
|
+
w.spaceBefore && p.push(""), Be(t, p, w.commentBefore, !1), w.comment && (k = w.comment);
|
|
1143
1143
|
else if (I(w)) {
|
|
1144
1144
|
const O = T(w.key) ? w.key : null;
|
|
1145
|
-
O && (O.spaceBefore && p.push(""),
|
|
1145
|
+
O && (O.spaceBefore && p.push(""), Be(t, p, O.commentBefore, !1), O.comment && (f = !0));
|
|
1146
1146
|
const g = T(w.value) ? w.value : null;
|
|
1147
1147
|
g ? (g.comment && (k = g.comment), g.commentBefore && (f = !0)) : w.value == null && O && O.comment && (k = O.comment);
|
|
1148
1148
|
}
|
|
@@ -1155,7 +1155,7 @@ function xs({ comment: s, items: e }, t, { flowChars: n, itemIndent: i, onCommen
|
|
|
1155
1155
|
const { start: d, end: m } = n;
|
|
1156
1156
|
if (p.length === 0)
|
|
1157
1157
|
y = d + m;
|
|
1158
|
-
else if (f || (f = p.reduce((w, k) => w + k.length + 2, 2) >
|
|
1158
|
+
else if (f || (f = p.reduce((w, k) => w + k.length + 2, 2) > Ke.maxFlowStringSingleLineLength), f) {
|
|
1159
1159
|
y = d;
|
|
1160
1160
|
for (const b of p)
|
|
1161
1161
|
y += b ? `
|
|
@@ -1167,7 +1167,7 @@ ${o}${m}`;
|
|
|
1167
1167
|
y = `${d}${a}${p.join(" ")}${a}${m}`;
|
|
1168
1168
|
return s && (y += V(y, c(s), o), r && r()), y;
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1170
|
+
function Be({ indent: s, options: { commentString: e } }, t, n, i) {
|
|
1171
1171
|
if (n && i && (n = n.replace(/^\n+/, "")), n) {
|
|
1172
1172
|
const r = U(e(n), s);
|
|
1173
1173
|
t.push(r.trimStart());
|
|
@@ -1179,7 +1179,7 @@ function G(s, e) {
|
|
|
1179
1179
|
if (I(n) && (n.key === e || n.key === t || A(n.key) && n.key.value === t))
|
|
1180
1180
|
return n;
|
|
1181
1181
|
}
|
|
1182
|
-
class j extends
|
|
1182
|
+
class j extends Ke {
|
|
1183
1183
|
static get tagName() {
|
|
1184
1184
|
return "tag:yaml.org,2002:map";
|
|
1185
1185
|
}
|
|
@@ -1199,7 +1199,7 @@ class j extends Fe {
|
|
|
1199
1199
|
if (i) {
|
|
1200
1200
|
if (!t)
|
|
1201
1201
|
throw new Error(`Key ${n.key} already set`);
|
|
1202
|
-
A(i.value) &&
|
|
1202
|
+
A(i.value) && Yt(n.value) ? i.value.value = n.value : i.value = n.value;
|
|
1203
1203
|
} else if (r) {
|
|
1204
1204
|
const o = this.items.findIndex((l) => r(n, l) < 0);
|
|
1205
1205
|
o === -1 ? this.items.push(n) : this.items.splice(o, 0, n);
|
|
@@ -1229,7 +1229,7 @@ class j extends Fe {
|
|
|
1229
1229
|
const i = n ? new n() : t?.mapAsMap ? /* @__PURE__ */ new Map() : {};
|
|
1230
1230
|
t?.onCreate && t.onCreate(i);
|
|
1231
1231
|
for (const r of this.items)
|
|
1232
|
-
|
|
1232
|
+
xt(t, i, r);
|
|
1233
1233
|
return i;
|
|
1234
1234
|
}
|
|
1235
1235
|
toString(e, t, n) {
|
|
@@ -1238,7 +1238,7 @@ class j extends Fe {
|
|
|
1238
1238
|
for (const i of this.items)
|
|
1239
1239
|
if (!I(i))
|
|
1240
1240
|
throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);
|
|
1241
|
-
return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })),
|
|
1241
|
+
return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })), Xt(this, e, {
|
|
1242
1242
|
blockItemPrefix: "",
|
|
1243
1243
|
flowChars: { start: "{", end: "}" },
|
|
1244
1244
|
itemIndent: e.indent || "",
|
|
@@ -1247,13 +1247,13 @@ class j extends Fe {
|
|
|
1247
1247
|
});
|
|
1248
1248
|
}
|
|
1249
1249
|
}
|
|
1250
|
-
function
|
|
1250
|
+
function Hs(s, e, t) {
|
|
1251
1251
|
const { keepUndefined: n, replacer: i } = t, r = new j(s), o = (l, a) => {
|
|
1252
1252
|
if (typeof i == "function")
|
|
1253
1253
|
a = i.call(e, l, a);
|
|
1254
1254
|
else if (Array.isArray(i) && !i.includes(l))
|
|
1255
1255
|
return;
|
|
1256
|
-
(a !== void 0 || n) && r.items.push(
|
|
1256
|
+
(a !== void 0 || n) && r.items.push(ht(l, a, t));
|
|
1257
1257
|
};
|
|
1258
1258
|
if (e instanceof Map)
|
|
1259
1259
|
for (const [l, a] of e)
|
|
@@ -1265,7 +1265,7 @@ function Xs(s, e, t) {
|
|
|
1265
1265
|
}
|
|
1266
1266
|
const ue = {
|
|
1267
1267
|
collection: "map",
|
|
1268
|
-
createNode:
|
|
1268
|
+
createNode: Hs,
|
|
1269
1269
|
default: !0,
|
|
1270
1270
|
nodeClass: j,
|
|
1271
1271
|
tag: "tag:yaml.org,2002:map",
|
|
@@ -1273,7 +1273,7 @@ const ue = {
|
|
|
1273
1273
|
return z(s) || e("Expected a mapping for this tag"), s;
|
|
1274
1274
|
}
|
|
1275
1275
|
};
|
|
1276
|
-
class Z extends
|
|
1276
|
+
class Z extends Ke {
|
|
1277
1277
|
static get tagName() {
|
|
1278
1278
|
return "tag:yaml.org,2002:seq";
|
|
1279
1279
|
}
|
|
@@ -1324,7 +1324,7 @@ class Z extends Fe {
|
|
|
1324
1324
|
if (typeof n != "number")
|
|
1325
1325
|
throw new Error(`Expected a valid index, not ${e}.`);
|
|
1326
1326
|
const i = this.items[n];
|
|
1327
|
-
A(i) &&
|
|
1327
|
+
A(i) && Yt(t) ? i.value = t : this.items[n] = t;
|
|
1328
1328
|
}
|
|
1329
1329
|
toJSON(e, t) {
|
|
1330
1330
|
const n = [];
|
|
@@ -1335,7 +1335,7 @@ class Z extends Fe {
|
|
|
1335
1335
|
return n;
|
|
1336
1336
|
}
|
|
1337
1337
|
toString(e, t, n) {
|
|
1338
|
-
return e ?
|
|
1338
|
+
return e ? Xt(this, e, {
|
|
1339
1339
|
blockItemPrefix: "- ",
|
|
1340
1340
|
flowChars: { start: "[", end: "]" },
|
|
1341
1341
|
itemIndent: (e.indent || "") + " ",
|
|
@@ -1348,7 +1348,7 @@ function Ee(s) {
|
|
|
1348
1348
|
let e = A(s) ? s.value : s;
|
|
1349
1349
|
return e && typeof e == "string" && (e = Number(e)), typeof e == "number" && Number.isInteger(e) && e >= 0 ? e : null;
|
|
1350
1350
|
}
|
|
1351
|
-
function
|
|
1351
|
+
function xs(s, e, t) {
|
|
1352
1352
|
const { replacer: n } = t, i = new Z(s);
|
|
1353
1353
|
if (e && Symbol.iterator in Object(e)) {
|
|
1354
1354
|
let r = 0;
|
|
@@ -1364,14 +1364,14 @@ function zs(s, e, t) {
|
|
|
1364
1364
|
}
|
|
1365
1365
|
const he = {
|
|
1366
1366
|
collection: "seq",
|
|
1367
|
-
createNode:
|
|
1367
|
+
createNode: xs,
|
|
1368
1368
|
default: !0,
|
|
1369
1369
|
nodeClass: Z,
|
|
1370
1370
|
tag: "tag:yaml.org,2002:seq",
|
|
1371
1371
|
resolve(s, e) {
|
|
1372
1372
|
return fe(s) || e("Expected a sequence for this tag"), s;
|
|
1373
1373
|
}
|
|
1374
|
-
},
|
|
1374
|
+
}, Re = {
|
|
1375
1375
|
identify: (s) => typeof s == "string",
|
|
1376
1376
|
default: !0,
|
|
1377
1377
|
tag: "tag:yaml.org,2002:str",
|
|
@@ -1379,22 +1379,22 @@ const he = {
|
|
|
1379
1379
|
stringify(s, e, t, n) {
|
|
1380
1380
|
return e = Object.assign({ actualString: !0 }, e), Ne(s, e, t, n);
|
|
1381
1381
|
}
|
|
1382
|
-
},
|
|
1382
|
+
}, Ve = {
|
|
1383
1383
|
identify: (s) => s == null,
|
|
1384
1384
|
createNode: () => new N(null),
|
|
1385
1385
|
default: !0,
|
|
1386
1386
|
tag: "tag:yaml.org,2002:null",
|
|
1387
1387
|
test: /^(?:~|[Nn]ull|NULL)?$/,
|
|
1388
1388
|
resolve: () => new N(null),
|
|
1389
|
-
stringify: ({ source: s }, e) => typeof s == "string" &&
|
|
1390
|
-
},
|
|
1389
|
+
stringify: ({ source: s }, e) => typeof s == "string" && Ve.test.test(s) ? s : e.options.nullStr
|
|
1390
|
+
}, dt = {
|
|
1391
1391
|
identify: (s) => typeof s == "boolean",
|
|
1392
1392
|
default: !0,
|
|
1393
1393
|
tag: "tag:yaml.org,2002:bool",
|
|
1394
1394
|
test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
|
|
1395
1395
|
resolve: (s) => new N(s[0] === "t" || s[0] === "T"),
|
|
1396
1396
|
stringify({ source: s, value: e }, t) {
|
|
1397
|
-
if (s &&
|
|
1397
|
+
if (s && dt.test.test(s)) {
|
|
1398
1398
|
const n = s[0] === "t" || s[0] === "T";
|
|
1399
1399
|
if (e === n)
|
|
1400
1400
|
return s;
|
|
@@ -1418,14 +1418,14 @@ function D({ format: s, minFractionDigits: e, tag: t, value: n }) {
|
|
|
1418
1418
|
}
|
|
1419
1419
|
return r;
|
|
1420
1420
|
}
|
|
1421
|
-
const
|
|
1421
|
+
const zt = {
|
|
1422
1422
|
identify: (s) => typeof s == "number",
|
|
1423
1423
|
default: !0,
|
|
1424
1424
|
tag: "tag:yaml.org,2002:float",
|
|
1425
1425
|
test: /^(?:[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN))$/,
|
|
1426
1426
|
resolve: (s) => s.slice(-3).toLowerCase() === "nan" ? NaN : s[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
|
1427
1427
|
stringify: D
|
|
1428
|
-
},
|
|
1428
|
+
}, Zt = {
|
|
1429
1429
|
identify: (s) => typeof s == "number",
|
|
1430
1430
|
default: !0,
|
|
1431
1431
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1436,7 +1436,7 @@ const Zt = {
|
|
|
1436
1436
|
const e = Number(s.value);
|
|
1437
1437
|
return isFinite(e) ? e.toExponential() : D(s);
|
|
1438
1438
|
}
|
|
1439
|
-
},
|
|
1439
|
+
}, es = {
|
|
1440
1440
|
identify: (s) => typeof s == "number",
|
|
1441
1441
|
default: !0,
|
|
1442
1442
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1446,51 +1446,51 @@ const Zt = {
|
|
|
1446
1446
|
return t !== -1 && s[s.length - 1] === "0" && (e.minFractionDigits = s.length - t - 1), e;
|
|
1447
1447
|
},
|
|
1448
1448
|
stringify: D
|
|
1449
|
-
},
|
|
1450
|
-
function
|
|
1449
|
+
}, We = (s) => typeof s == "bigint" || Number.isInteger(s), pt = (s, e, t, { intAsBigInt: n }) => n ? BigInt(s) : parseInt(s.substring(e), t);
|
|
1450
|
+
function ts(s, e, t) {
|
|
1451
1451
|
const { value: n } = s;
|
|
1452
|
-
return
|
|
1452
|
+
return We(n) && n >= 0 ? t + n.toString(e) : D(s);
|
|
1453
1453
|
}
|
|
1454
|
-
const
|
|
1455
|
-
identify: (s) =>
|
|
1454
|
+
const ss = {
|
|
1455
|
+
identify: (s) => We(s) && s >= 0,
|
|
1456
1456
|
default: !0,
|
|
1457
1457
|
tag: "tag:yaml.org,2002:int",
|
|
1458
1458
|
format: "OCT",
|
|
1459
1459
|
test: /^0o[0-7]+$/,
|
|
1460
|
-
resolve: (s, e, t) =>
|
|
1461
|
-
stringify: (s) =>
|
|
1462
|
-
},
|
|
1463
|
-
identify:
|
|
1460
|
+
resolve: (s, e, t) => pt(s, 2, 8, t),
|
|
1461
|
+
stringify: (s) => ts(s, 8, "0o")
|
|
1462
|
+
}, ns = {
|
|
1463
|
+
identify: We,
|
|
1464
1464
|
default: !0,
|
|
1465
1465
|
tag: "tag:yaml.org,2002:int",
|
|
1466
1466
|
test: /^[-+]?[0-9]+$/,
|
|
1467
|
-
resolve: (s, e, t) =>
|
|
1467
|
+
resolve: (s, e, t) => pt(s, 0, 10, t),
|
|
1468
1468
|
stringify: D
|
|
1469
|
-
},
|
|
1470
|
-
identify: (s) =>
|
|
1469
|
+
}, is = {
|
|
1470
|
+
identify: (s) => We(s) && s >= 0,
|
|
1471
1471
|
default: !0,
|
|
1472
1472
|
tag: "tag:yaml.org,2002:int",
|
|
1473
1473
|
format: "HEX",
|
|
1474
1474
|
test: /^0x[0-9a-fA-F]+$/,
|
|
1475
|
-
resolve: (s, e, t) =>
|
|
1476
|
-
stringify: (s) =>
|
|
1477
|
-
},
|
|
1475
|
+
resolve: (s, e, t) => pt(s, 2, 16, t),
|
|
1476
|
+
stringify: (s) => ts(s, 16, "0x")
|
|
1477
|
+
}, Xs = [
|
|
1478
1478
|
ue,
|
|
1479
1479
|
he,
|
|
1480
|
+
Re,
|
|
1480
1481
|
Ve,
|
|
1481
|
-
|
|
1482
|
-
|
|
1482
|
+
dt,
|
|
1483
|
+
ss,
|
|
1483
1484
|
ns,
|
|
1484
1485
|
is,
|
|
1485
|
-
|
|
1486
|
+
zt,
|
|
1486
1487
|
Zt,
|
|
1487
|
-
es
|
|
1488
|
-
ts
|
|
1488
|
+
es
|
|
1489
1489
|
];
|
|
1490
|
-
function
|
|
1490
|
+
function Tt(s) {
|
|
1491
1491
|
return typeof s == "bigint" || Number.isInteger(s);
|
|
1492
1492
|
}
|
|
1493
|
-
const Ie = ({ value: s }) => JSON.stringify(s),
|
|
1493
|
+
const Ie = ({ value: s }) => JSON.stringify(s), zs = [
|
|
1494
1494
|
{
|
|
1495
1495
|
identify: (s) => typeof s == "string",
|
|
1496
1496
|
default: !0,
|
|
@@ -1516,12 +1516,12 @@ const Ie = ({ value: s }) => JSON.stringify(s), en = [
|
|
|
1516
1516
|
stringify: Ie
|
|
1517
1517
|
},
|
|
1518
1518
|
{
|
|
1519
|
-
identify:
|
|
1519
|
+
identify: Tt,
|
|
1520
1520
|
default: !0,
|
|
1521
1521
|
tag: "tag:yaml.org,2002:int",
|
|
1522
1522
|
test: /^-?(?:0|[1-9][0-9]*)$/,
|
|
1523
1523
|
resolve: (s, e, { intAsBigInt: t }) => t ? BigInt(s) : parseInt(s, 10),
|
|
1524
|
-
stringify: ({ value: s }) =>
|
|
1524
|
+
stringify: ({ value: s }) => Tt(s) ? s.toString() : JSON.stringify(s)
|
|
1525
1525
|
},
|
|
1526
1526
|
{
|
|
1527
1527
|
identify: (s) => typeof s == "number",
|
|
@@ -1531,14 +1531,14 @@ const Ie = ({ value: s }) => JSON.stringify(s), en = [
|
|
|
1531
1531
|
resolve: (s) => parseFloat(s),
|
|
1532
1532
|
stringify: Ie
|
|
1533
1533
|
}
|
|
1534
|
-
],
|
|
1534
|
+
], Zs = {
|
|
1535
1535
|
default: !0,
|
|
1536
1536
|
tag: "",
|
|
1537
1537
|
test: /^/,
|
|
1538
1538
|
resolve(s, e) {
|
|
1539
1539
|
return e(`Unresolved plain scalar ${JSON.stringify(s)}`), s;
|
|
1540
1540
|
}
|
|
1541
|
-
},
|
|
1541
|
+
}, en = [ue, he].concat(zs, Zs), mt = {
|
|
1542
1542
|
identify: (s) => s instanceof Uint8Array,
|
|
1543
1543
|
default: !1,
|
|
1544
1544
|
tag: "tag:yaml.org,2002:binary",
|
|
@@ -1583,7 +1583,7 @@ const Ie = ({ value: s }) => JSON.stringify(s), en = [
|
|
|
1583
1583
|
return Ne({ comment: s, type: e, value: l }, n, i, r);
|
|
1584
1584
|
}
|
|
1585
1585
|
};
|
|
1586
|
-
function
|
|
1586
|
+
function rs(s, e) {
|
|
1587
1587
|
if (fe(s))
|
|
1588
1588
|
for (let t = 0; t < s.items.length; ++t) {
|
|
1589
1589
|
let n = s.items[t];
|
|
@@ -1606,7 +1606,7 @@ ${r.comment}` : n.comment;
|
|
|
1606
1606
|
e("Expected a sequence for this tag");
|
|
1607
1607
|
return s;
|
|
1608
1608
|
}
|
|
1609
|
-
function
|
|
1609
|
+
function os(s, e, t) {
|
|
1610
1610
|
const { replacer: n } = t, i = new Z(s);
|
|
1611
1611
|
i.tag = "tag:yaml.org,2002:pairs";
|
|
1612
1612
|
let r = 0;
|
|
@@ -1627,16 +1627,16 @@ function ls(s, e, t) {
|
|
|
1627
1627
|
throw new TypeError(`Expected { key: value } tuple: ${o}`);
|
|
1628
1628
|
} else
|
|
1629
1629
|
l = o;
|
|
1630
|
-
i.items.push(
|
|
1630
|
+
i.items.push(ht(l, a, t));
|
|
1631
1631
|
}
|
|
1632
1632
|
return i;
|
|
1633
1633
|
}
|
|
1634
|
-
const
|
|
1634
|
+
const gt = {
|
|
1635
1635
|
collection: "seq",
|
|
1636
1636
|
default: !1,
|
|
1637
1637
|
tag: "tag:yaml.org,2002:pairs",
|
|
1638
|
-
resolve:
|
|
1639
|
-
createNode:
|
|
1638
|
+
resolve: rs,
|
|
1639
|
+
createNode: os
|
|
1640
1640
|
};
|
|
1641
1641
|
class oe extends Z {
|
|
1642
1642
|
constructor() {
|
|
@@ -1661,48 +1661,48 @@ class oe extends Z {
|
|
|
1661
1661
|
}
|
|
1662
1662
|
}
|
|
1663
1663
|
oe.tag = "tag:yaml.org,2002:omap";
|
|
1664
|
-
const
|
|
1664
|
+
const yt = {
|
|
1665
1665
|
collection: "seq",
|
|
1666
1666
|
identify: (s) => s instanceof Map,
|
|
1667
1667
|
nodeClass: oe,
|
|
1668
1668
|
default: !1,
|
|
1669
1669
|
tag: "tag:yaml.org,2002:omap",
|
|
1670
1670
|
resolve(s, e) {
|
|
1671
|
-
const t =
|
|
1671
|
+
const t = rs(s, e), n = [];
|
|
1672
1672
|
for (const { key: i } of t.items)
|
|
1673
1673
|
A(i) && (n.includes(i.value) ? e(`Ordered maps must not include duplicate keys: ${i.value}`) : n.push(i.value));
|
|
1674
1674
|
return Object.assign(new oe(), t);
|
|
1675
1675
|
},
|
|
1676
1676
|
createNode(s, e, t) {
|
|
1677
|
-
const n =
|
|
1677
|
+
const n = os(s, e, t), i = new oe();
|
|
1678
1678
|
return i.items = n.items, i;
|
|
1679
1679
|
}
|
|
1680
1680
|
};
|
|
1681
|
-
function
|
|
1682
|
-
return e && (s ?
|
|
1681
|
+
function ls({ value: s, source: e }, t) {
|
|
1682
|
+
return e && (s ? as : cs).test.test(e) ? e : s ? t.options.trueStr : t.options.falseStr;
|
|
1683
1683
|
}
|
|
1684
|
-
const
|
|
1684
|
+
const as = {
|
|
1685
1685
|
identify: (s) => s === !0,
|
|
1686
1686
|
default: !0,
|
|
1687
1687
|
tag: "tag:yaml.org,2002:bool",
|
|
1688
1688
|
test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
|
|
1689
1689
|
resolve: () => new N(!0),
|
|
1690
|
-
stringify:
|
|
1691
|
-
},
|
|
1690
|
+
stringify: ls
|
|
1691
|
+
}, cs = {
|
|
1692
1692
|
identify: (s) => s === !1,
|
|
1693
1693
|
default: !0,
|
|
1694
1694
|
tag: "tag:yaml.org,2002:bool",
|
|
1695
1695
|
test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,
|
|
1696
1696
|
resolve: () => new N(!1),
|
|
1697
|
-
stringify:
|
|
1698
|
-
},
|
|
1697
|
+
stringify: ls
|
|
1698
|
+
}, tn = {
|
|
1699
1699
|
identify: (s) => typeof s == "number",
|
|
1700
1700
|
default: !0,
|
|
1701
1701
|
tag: "tag:yaml.org,2002:float",
|
|
1702
1702
|
test: /^[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN)$/,
|
|
1703
1703
|
resolve: (s) => s.slice(-3).toLowerCase() === "nan" ? NaN : s[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
|
1704
1704
|
stringify: D
|
|
1705
|
-
},
|
|
1705
|
+
}, sn = {
|
|
1706
1706
|
identify: (s) => typeof s == "number",
|
|
1707
1707
|
default: !0,
|
|
1708
1708
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1713,7 +1713,7 @@ const cs = {
|
|
|
1713
1713
|
const e = Number(s.value);
|
|
1714
1714
|
return isFinite(e) ? e.toExponential() : D(s);
|
|
1715
1715
|
}
|
|
1716
|
-
},
|
|
1716
|
+
}, nn = {
|
|
1717
1717
|
identify: (s) => typeof s == "number",
|
|
1718
1718
|
default: !0,
|
|
1719
1719
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1728,7 +1728,7 @@ const cs = {
|
|
|
1728
1728
|
},
|
|
1729
1729
|
stringify: D
|
|
1730
1730
|
}, Oe = (s) => typeof s == "bigint" || Number.isInteger(s);
|
|
1731
|
-
function
|
|
1731
|
+
function Je(s, e, t, { intAsBigInt: n }) {
|
|
1732
1732
|
const i = s[0];
|
|
1733
1733
|
if ((i === "-" || i === "+") && (e += 1), s = s.substring(e).replace(/_/g, ""), n) {
|
|
1734
1734
|
switch (t) {
|
|
@@ -1748,7 +1748,7 @@ function Ye(s, e, t, { intAsBigInt: n }) {
|
|
|
1748
1748
|
const r = parseInt(s, t);
|
|
1749
1749
|
return i === "-" ? -1 * r : r;
|
|
1750
1750
|
}
|
|
1751
|
-
function
|
|
1751
|
+
function bt(s, e, t) {
|
|
1752
1752
|
const { value: n } = s;
|
|
1753
1753
|
if (Oe(n)) {
|
|
1754
1754
|
const i = n.toString(e);
|
|
@@ -1756,37 +1756,37 @@ function wt(s, e, t) {
|
|
|
1756
1756
|
}
|
|
1757
1757
|
return D(s);
|
|
1758
1758
|
}
|
|
1759
|
-
const
|
|
1759
|
+
const rn = {
|
|
1760
1760
|
identify: Oe,
|
|
1761
1761
|
default: !0,
|
|
1762
1762
|
tag: "tag:yaml.org,2002:int",
|
|
1763
1763
|
format: "BIN",
|
|
1764
1764
|
test: /^[-+]?0b[0-1_]+$/,
|
|
1765
|
-
resolve: (s, e, t) =>
|
|
1766
|
-
stringify: (s) =>
|
|
1767
|
-
},
|
|
1765
|
+
resolve: (s, e, t) => Je(s, 2, 2, t),
|
|
1766
|
+
stringify: (s) => bt(s, 2, "0b")
|
|
1767
|
+
}, on = {
|
|
1768
1768
|
identify: Oe,
|
|
1769
1769
|
default: !0,
|
|
1770
1770
|
tag: "tag:yaml.org,2002:int",
|
|
1771
1771
|
format: "OCT",
|
|
1772
1772
|
test: /^[-+]?0[0-7_]+$/,
|
|
1773
|
-
resolve: (s, e, t) =>
|
|
1774
|
-
stringify: (s) =>
|
|
1775
|
-
},
|
|
1773
|
+
resolve: (s, e, t) => Je(s, 1, 8, t),
|
|
1774
|
+
stringify: (s) => bt(s, 8, "0")
|
|
1775
|
+
}, ln = {
|
|
1776
1776
|
identify: Oe,
|
|
1777
1777
|
default: !0,
|
|
1778
1778
|
tag: "tag:yaml.org,2002:int",
|
|
1779
1779
|
test: /^[-+]?[0-9][0-9_]*$/,
|
|
1780
|
-
resolve: (s, e, t) =>
|
|
1780
|
+
resolve: (s, e, t) => Je(s, 0, 10, t),
|
|
1781
1781
|
stringify: D
|
|
1782
|
-
},
|
|
1782
|
+
}, an = {
|
|
1783
1783
|
identify: Oe,
|
|
1784
1784
|
default: !0,
|
|
1785
1785
|
tag: "tag:yaml.org,2002:int",
|
|
1786
1786
|
format: "HEX",
|
|
1787
1787
|
test: /^[-+]?0x[0-9a-fA-F_]+$/,
|
|
1788
|
-
resolve: (s, e, t) =>
|
|
1789
|
-
stringify: (s) =>
|
|
1788
|
+
resolve: (s, e, t) => Je(s, 2, 16, t),
|
|
1789
|
+
stringify: (s) => bt(s, 16, "0x")
|
|
1790
1790
|
};
|
|
1791
1791
|
class le extends j {
|
|
1792
1792
|
constructor(e) {
|
|
@@ -1822,7 +1822,7 @@ class le extends j {
|
|
|
1822
1822
|
}
|
|
1823
1823
|
}
|
|
1824
1824
|
le.tag = "tag:yaml.org,2002:set";
|
|
1825
|
-
const
|
|
1825
|
+
const wt = {
|
|
1826
1826
|
collection: "map",
|
|
1827
1827
|
identify: (s) => s instanceof Set,
|
|
1828
1828
|
nodeClass: le,
|
|
@@ -1841,15 +1841,15 @@ const St = {
|
|
|
1841
1841
|
const { replacer: n } = t, i = new le(s);
|
|
1842
1842
|
if (e && Symbol.iterator in Object(e))
|
|
1843
1843
|
for (let r of e)
|
|
1844
|
-
typeof n == "function" && (r = n.call(e, r, r)), i.items.push(
|
|
1844
|
+
typeof n == "function" && (r = n.call(e, r, r)), i.items.push(ht(r, null, t));
|
|
1845
1845
|
return i;
|
|
1846
1846
|
}
|
|
1847
1847
|
};
|
|
1848
|
-
function
|
|
1848
|
+
function St(s, e) {
|
|
1849
1849
|
const t = s[0], n = t === "-" || t === "+" ? s.substring(1) : s, i = (o) => e ? BigInt(o) : Number(o), r = n.replace(/_/g, "").split(":").reduce((o, l) => o * i(60) + i(l), i(0));
|
|
1850
1850
|
return t === "-" ? i(-1) * r : r;
|
|
1851
1851
|
}
|
|
1852
|
-
function
|
|
1852
|
+
function fs(s) {
|
|
1853
1853
|
let { value: e } = s, t = (o) => o;
|
|
1854
1854
|
if (typeof e == "bigint")
|
|
1855
1855
|
t = (o) => BigInt(o);
|
|
@@ -1860,23 +1860,23 @@ function us(s) {
|
|
|
1860
1860
|
const i = t(60), r = [e % i];
|
|
1861
1861
|
return e < 60 ? r.unshift(0) : (e = (e - r[0]) / i, r.unshift(e % i), e >= 60 && (e = (e - r[0]) / i, r.unshift(e))), n + r.map((o) => o < 10 ? "0" + String(o) : String(o)).join(":").replace(/000000\d*$/, "");
|
|
1862
1862
|
}
|
|
1863
|
-
const
|
|
1863
|
+
const us = {
|
|
1864
1864
|
identify: (s) => typeof s == "bigint" || Number.isInteger(s),
|
|
1865
1865
|
default: !0,
|
|
1866
1866
|
tag: "tag:yaml.org,2002:int",
|
|
1867
1867
|
format: "TIME",
|
|
1868
1868
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
|
|
1869
|
-
resolve: (s, e, { intAsBigInt: t }) =>
|
|
1870
|
-
stringify:
|
|
1871
|
-
},
|
|
1869
|
+
resolve: (s, e, { intAsBigInt: t }) => St(s, t),
|
|
1870
|
+
stringify: fs
|
|
1871
|
+
}, hs = {
|
|
1872
1872
|
identify: (s) => typeof s == "number",
|
|
1873
1873
|
default: !0,
|
|
1874
1874
|
tag: "tag:yaml.org,2002:float",
|
|
1875
1875
|
format: "TIME",
|
|
1876
1876
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
|
|
1877
|
-
resolve: (s) =>
|
|
1878
|
-
stringify:
|
|
1879
|
-
},
|
|
1877
|
+
resolve: (s) => St(s, !1),
|
|
1878
|
+
stringify: fs
|
|
1879
|
+
}, Ye = {
|
|
1880
1880
|
identify: (s) => s instanceof Date,
|
|
1881
1881
|
default: !0,
|
|
1882
1882
|
tag: "tag:yaml.org,2002:timestamp",
|
|
@@ -1885,78 +1885,78 @@ const hs = {
|
|
|
1885
1885
|
// assumed to be 00:00:00Z (start of day, UTC).
|
|
1886
1886
|
test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),
|
|
1887
1887
|
resolve(s) {
|
|
1888
|
-
const e = s.match(
|
|
1888
|
+
const e = s.match(Ye.test);
|
|
1889
1889
|
if (!e)
|
|
1890
1890
|
throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
|
|
1891
1891
|
const [, t, n, i, r, o, l] = e.map(Number), a = e[7] ? Number((e[7] + "00").substr(1, 3)) : 0;
|
|
1892
1892
|
let c = Date.UTC(t, n - 1, i, r || 0, o || 0, l || 0, a);
|
|
1893
1893
|
const u = e[8];
|
|
1894
1894
|
if (u && u !== "Z") {
|
|
1895
|
-
let f =
|
|
1895
|
+
let f = St(u, !1);
|
|
1896
1896
|
Math.abs(f) < 30 && (f *= 60), c -= 6e4 * f;
|
|
1897
1897
|
}
|
|
1898
1898
|
return new Date(c);
|
|
1899
1899
|
},
|
|
1900
1900
|
stringify: ({ value: s }) => s.toISOString().replace(/((T00:00)?:00)?\.000Z$/, "")
|
|
1901
|
-
},
|
|
1901
|
+
}, $t = [
|
|
1902
1902
|
ue,
|
|
1903
1903
|
he,
|
|
1904
|
+
Re,
|
|
1904
1905
|
Ve,
|
|
1905
|
-
|
|
1906
|
+
as,
|
|
1906
1907
|
cs,
|
|
1907
|
-
|
|
1908
|
+
rn,
|
|
1909
|
+
on,
|
|
1908
1910
|
ln,
|
|
1909
1911
|
an,
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
+
tn,
|
|
1913
|
+
sn,
|
|
1912
1914
|
nn,
|
|
1913
|
-
|
|
1914
|
-
on,
|
|
1915
|
-
gt,
|
|
1916
|
-
bt,
|
|
1915
|
+
mt,
|
|
1917
1916
|
yt,
|
|
1918
|
-
|
|
1917
|
+
gt,
|
|
1918
|
+
wt,
|
|
1919
|
+
us,
|
|
1919
1920
|
hs,
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
],
|
|
1923
|
-
["
|
|
1924
|
-
["
|
|
1925
|
-
["
|
|
1926
|
-
["
|
|
1927
|
-
["yaml-1.1", Ct]
|
|
1921
|
+
Ye
|
|
1922
|
+
], Ct = /* @__PURE__ */ new Map([
|
|
1923
|
+
["core", Xs],
|
|
1924
|
+
["failsafe", [ue, he, Re]],
|
|
1925
|
+
["json", en],
|
|
1926
|
+
["yaml11", $t],
|
|
1927
|
+
["yaml-1.1", $t]
|
|
1928
1928
|
]), vt = {
|
|
1929
|
-
binary:
|
|
1930
|
-
bool:
|
|
1931
|
-
float:
|
|
1932
|
-
floatExp:
|
|
1933
|
-
floatNaN:
|
|
1934
|
-
floatTime:
|
|
1935
|
-
int:
|
|
1936
|
-
intHex:
|
|
1937
|
-
intOct:
|
|
1938
|
-
intTime:
|
|
1929
|
+
binary: mt,
|
|
1930
|
+
bool: dt,
|
|
1931
|
+
float: es,
|
|
1932
|
+
floatExp: Zt,
|
|
1933
|
+
floatNaN: zt,
|
|
1934
|
+
floatTime: hs,
|
|
1935
|
+
int: ns,
|
|
1936
|
+
intHex: is,
|
|
1937
|
+
intOct: ss,
|
|
1938
|
+
intTime: us,
|
|
1939
1939
|
map: ue,
|
|
1940
|
-
null:
|
|
1941
|
-
omap:
|
|
1942
|
-
pairs:
|
|
1940
|
+
null: Ve,
|
|
1941
|
+
omap: yt,
|
|
1942
|
+
pairs: gt,
|
|
1943
1943
|
seq: he,
|
|
1944
|
-
set:
|
|
1945
|
-
timestamp:
|
|
1946
|
-
},
|
|
1947
|
-
"tag:yaml.org,2002:binary":
|
|
1948
|
-
"tag:yaml.org,2002:omap":
|
|
1949
|
-
"tag:yaml.org,2002:pairs":
|
|
1950
|
-
"tag:yaml.org,2002:set":
|
|
1951
|
-
"tag:yaml.org,2002:timestamp":
|
|
1944
|
+
set: wt,
|
|
1945
|
+
timestamp: Ye
|
|
1946
|
+
}, cn = {
|
|
1947
|
+
"tag:yaml.org,2002:binary": mt,
|
|
1948
|
+
"tag:yaml.org,2002:omap": yt,
|
|
1949
|
+
"tag:yaml.org,2002:pairs": gt,
|
|
1950
|
+
"tag:yaml.org,2002:set": wt,
|
|
1951
|
+
"tag:yaml.org,2002:timestamp": Ye
|
|
1952
1952
|
};
|
|
1953
1953
|
function Ze(s, e) {
|
|
1954
|
-
let t =
|
|
1954
|
+
let t = Ct.get(e);
|
|
1955
1955
|
if (!t)
|
|
1956
1956
|
if (Array.isArray(s))
|
|
1957
1957
|
t = [];
|
|
1958
1958
|
else {
|
|
1959
|
-
const n = Array.from(
|
|
1959
|
+
const n = Array.from(Ct.keys()).filter((i) => i !== "yaml11").map((i) => JSON.stringify(i)).join(", ");
|
|
1960
1960
|
throw new Error(`Unknown schema "${e}"; use one of ${n} or define customTags array`);
|
|
1961
1961
|
}
|
|
1962
1962
|
if (Array.isArray(s))
|
|
@@ -1974,17 +1974,17 @@ function Ze(s, e) {
|
|
|
1974
1974
|
throw new Error(`Unknown custom tag "${n}"; use one of ${r}`);
|
|
1975
1975
|
});
|
|
1976
1976
|
}
|
|
1977
|
-
const
|
|
1978
|
-
class
|
|
1977
|
+
const fn = (s, e) => s.key < e.key ? -1 : s.key > e.key ? 1 : 0;
|
|
1978
|
+
class Ge {
|
|
1979
1979
|
constructor({ compat: e, customTags: t, merge: n, resolveKnownTags: i, schema: r, sortMapEntries: o, toStringDefaults: l }) {
|
|
1980
|
-
this.compat = Array.isArray(e) ? Ze(e, "compat") : e ? Ze(null, e) : null, this.merge = !!n, this.name = typeof r == "string" && r || "core", this.knownTags = i ?
|
|
1980
|
+
this.compat = Array.isArray(e) ? Ze(e, "compat") : e ? Ze(null, e) : null, this.merge = !!n, this.name = typeof r == "string" && r || "core", this.knownTags = i ? cn : {}, this.tags = Ze(t, this.name), this.toStringOptions = l ?? null, Object.defineProperty(this, W, { value: ue }), Object.defineProperty(this, R, { value: Re }), Object.defineProperty(this, ce, { value: he }), this.sortMapEntries = typeof o == "function" ? o : o === !0 ? fn : null;
|
|
1981
1981
|
}
|
|
1982
1982
|
clone() {
|
|
1983
|
-
const e = Object.create(
|
|
1983
|
+
const e = Object.create(Ge.prototype, Object.getOwnPropertyDescriptors(this));
|
|
1984
1984
|
return e.tags = this.tags.slice(), e;
|
|
1985
1985
|
}
|
|
1986
1986
|
}
|
|
1987
|
-
function
|
|
1987
|
+
function un(s, e) {
|
|
1988
1988
|
const t = [];
|
|
1989
1989
|
let n = e.directives === !0;
|
|
1990
1990
|
if (e.directives !== !1 && s.directives) {
|
|
@@ -1992,7 +1992,7 @@ function dn(s, e) {
|
|
|
1992
1992
|
a ? (t.push(a), n = !0) : s.directives.docStart && (n = !0);
|
|
1993
1993
|
}
|
|
1994
1994
|
n && t.push("---");
|
|
1995
|
-
const i =
|
|
1995
|
+
const i = Qt(s, e), { commentString: r } = i.options;
|
|
1996
1996
|
if (s.commentBefore) {
|
|
1997
1997
|
t.length !== 1 && t.unshift("");
|
|
1998
1998
|
const a = r(s.commentBefore);
|
|
@@ -2053,7 +2053,7 @@ function ge(s, e, t, n) {
|
|
|
2053
2053
|
}
|
|
2054
2054
|
class de {
|
|
2055
2055
|
constructor(e, t, n) {
|
|
2056
|
-
this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, M, { value:
|
|
2056
|
+
this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, M, { value: rt });
|
|
2057
2057
|
let i = null;
|
|
2058
2058
|
typeof t == "function" || Array.isArray(t) ? i = t : n === void 0 && t && (n = t, t = void 0);
|
|
2059
2059
|
const r = Object.assign({
|
|
@@ -2076,7 +2076,7 @@ class de {
|
|
|
2076
2076
|
*/
|
|
2077
2077
|
clone() {
|
|
2078
2078
|
const e = Object.create(de.prototype, {
|
|
2079
|
-
[M]: { value:
|
|
2079
|
+
[M]: { value: rt }
|
|
2080
2080
|
});
|
|
2081
2081
|
return e.commentBefore = this.commentBefore, e.comment = this.comment, e.errors = this.errors.slice(), e.warnings = this.warnings.slice(), e.options = Object.assign({}, this.options), this.directives && (e.directives = this.directives.clone()), e.schema = this.schema.clone(), e.contents = T(this.contents) ? this.contents.clone(e.schema) : this.contents, this.range && (e.range = this.range.slice()), e;
|
|
2082
2082
|
}
|
|
@@ -2099,11 +2099,11 @@ class de {
|
|
|
2099
2099
|
*/
|
|
2100
2100
|
createAlias(e, t) {
|
|
2101
2101
|
if (!e.anchor) {
|
|
2102
|
-
const n =
|
|
2102
|
+
const n = Wt(this);
|
|
2103
2103
|
e.anchor = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
2104
|
-
!t || n.has(t) ?
|
|
2104
|
+
!t || n.has(t) ? Jt(t || "a", n) : t;
|
|
2105
2105
|
}
|
|
2106
|
-
return new
|
|
2106
|
+
return new De(e.anchor);
|
|
2107
2107
|
}
|
|
2108
2108
|
createNode(e, t, n) {
|
|
2109
2109
|
let i;
|
|
@@ -2114,7 +2114,7 @@ class de {
|
|
|
2114
2114
|
b.length > 0 && (t = t.concat(b)), i = t;
|
|
2115
2115
|
} else
|
|
2116
2116
|
n === void 0 && t && (n = t, t = void 0);
|
|
2117
|
-
const { aliasDuplicateObjects: r, anchorPrefix: o, flow: l, keepUndefined: a, onTagObj: c, tag: u } = n ?? {}, { onAnchor: f, setAnchors: h, sourceObjects: p } =
|
|
2117
|
+
const { aliasDuplicateObjects: r, anchorPrefix: o, flow: l, keepUndefined: a, onTagObj: c, tag: u } = n ?? {}, { onAnchor: f, setAnchors: h, sourceObjects: p } = Ps(
|
|
2118
2118
|
this,
|
|
2119
2119
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
2120
2120
|
o || "a"
|
|
@@ -2184,14 +2184,14 @@ class de {
|
|
|
2184
2184
|
* boolean to add/remove the item from the set.
|
|
2185
2185
|
*/
|
|
2186
2186
|
set(e, t) {
|
|
2187
|
-
this.contents == null ? this.contents =
|
|
2187
|
+
this.contents == null ? this.contents = _e(this.schema, [e], t) : te(this.contents) && this.contents.set(e, t);
|
|
2188
2188
|
}
|
|
2189
2189
|
/**
|
|
2190
2190
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
2191
2191
|
* boolean to add/remove the item from the set.
|
|
2192
2192
|
*/
|
|
2193
2193
|
setIn(e, t) {
|
|
2194
|
-
me(e) ? this.contents = t : this.contents == null ? this.contents =
|
|
2194
|
+
me(e) ? this.contents = t : this.contents == null ? this.contents = _e(this.schema, Array.from(e), t) : te(this.contents) && this.contents.setIn(e, t);
|
|
2195
2195
|
}
|
|
2196
2196
|
/**
|
|
2197
2197
|
* Change the YAML version and schema used by the document.
|
|
@@ -2222,7 +2222,7 @@ class de {
|
|
|
2222
2222
|
if (t.schema instanceof Object)
|
|
2223
2223
|
this.schema = t.schema;
|
|
2224
2224
|
else if (n)
|
|
2225
|
-
this.schema = new
|
|
2225
|
+
this.schema = new Ge(Object.assign(n, t));
|
|
2226
2226
|
else
|
|
2227
2227
|
throw new Error("With a null YAML version, the { schema: Schema } option is required");
|
|
2228
2228
|
}
|
|
@@ -2259,7 +2259,7 @@ class de {
|
|
|
2259
2259
|
const t = JSON.stringify(e.indent);
|
|
2260
2260
|
throw new Error(`"indent" option must be a positive integer, not ${t}`);
|
|
2261
2261
|
}
|
|
2262
|
-
return
|
|
2262
|
+
return un(this, e);
|
|
2263
2263
|
}
|
|
2264
2264
|
}
|
|
2265
2265
|
function te(s) {
|
|
@@ -2267,22 +2267,22 @@ function te(s) {
|
|
|
2267
2267
|
return !0;
|
|
2268
2268
|
throw new Error("Expected a YAML collection as document contents");
|
|
2269
2269
|
}
|
|
2270
|
-
class
|
|
2270
|
+
class kt extends Error {
|
|
2271
2271
|
constructor(e, t, n, i) {
|
|
2272
2272
|
super(), this.name = e, this.code = n, this.message = i, this.pos = t;
|
|
2273
2273
|
}
|
|
2274
2274
|
}
|
|
2275
|
-
class Q extends
|
|
2275
|
+
class Q extends kt {
|
|
2276
2276
|
constructor(e, t, n) {
|
|
2277
2277
|
super("YAMLParseError", e, t, n);
|
|
2278
2278
|
}
|
|
2279
2279
|
}
|
|
2280
|
-
class
|
|
2280
|
+
class ds extends kt {
|
|
2281
2281
|
constructor(e, t, n) {
|
|
2282
2282
|
super("YAMLWarning", e, t, n);
|
|
2283
2283
|
}
|
|
2284
2284
|
}
|
|
2285
|
-
const
|
|
2285
|
+
const je = (s, e) => (t) => {
|
|
2286
2286
|
if (t.pos[0] === -1)
|
|
2287
2287
|
return;
|
|
2288
2288
|
t.linePos = t.pos.map((l) => e.linePos(l));
|
|
@@ -2393,21 +2393,21 @@ function we(s) {
|
|
|
2393
2393
|
return !0;
|
|
2394
2394
|
}
|
|
2395
2395
|
}
|
|
2396
|
-
function
|
|
2396
|
+
function at(s, e, t) {
|
|
2397
2397
|
if (e?.type === "flow-collection") {
|
|
2398
2398
|
const n = e.end[0];
|
|
2399
2399
|
n.indent === s && (n.source === "]" || n.source === "}") && we(e) && t(n, "BAD_INDENT", "Flow end indicator should be more indented than parent", !0);
|
|
2400
2400
|
}
|
|
2401
2401
|
}
|
|
2402
|
-
function
|
|
2402
|
+
function ps(s, e, t) {
|
|
2403
2403
|
const { uniqueKeys: n } = s.options;
|
|
2404
2404
|
if (n === !1)
|
|
2405
2405
|
return !1;
|
|
2406
2406
|
const i = typeof n == "function" ? n : (r, o) => r === o || A(r) && A(o) && r.value === o.value && !(r.value === "<<" && s.schema.merge);
|
|
2407
2407
|
return e.some((r) => i(r.key, t));
|
|
2408
2408
|
}
|
|
2409
|
-
const
|
|
2410
|
-
function
|
|
2409
|
+
const _t = "All mapping items must start at the same column";
|
|
2410
|
+
function hn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
|
|
2411
2411
|
const r = new j(t.schema);
|
|
2412
2412
|
t.atRoot && (t.atRoot = !1);
|
|
2413
2413
|
let o = n.offset, l = null;
|
|
@@ -2420,16 +2420,16 @@ function pn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
|
|
|
2420
2420
|
startOnNewline: !0
|
|
2421
2421
|
}), y = !p.found;
|
|
2422
2422
|
if (y) {
|
|
2423
|
-
if (u && (u.type === "block-seq" ? i(o, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in u && u.indent !== n.indent && i(o, "BAD_INDENT",
|
|
2423
|
+
if (u && (u.type === "block-seq" ? i(o, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in u && u.indent !== n.indent && i(o, "BAD_INDENT", _t)), !p.anchor && !p.tag && !f) {
|
|
2424
2424
|
l = p.end, p.comment && (r.comment ? r.comment += `
|
|
2425
2425
|
` + p.comment : r.comment = p.comment);
|
|
2426
2426
|
continue;
|
|
2427
2427
|
}
|
|
2428
2428
|
(p.hasNewlineAfterProp || we(u)) && i(u ?? c[c.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
|
2429
2429
|
} else
|
|
2430
|
-
p.found?.indent !== n.indent && i(o, "BAD_INDENT",
|
|
2430
|
+
p.found?.indent !== n.indent && i(o, "BAD_INDENT", _t);
|
|
2431
2431
|
const d = p.end, m = u ? s(t, u, p, i) : e(t, d, c, null, p, i);
|
|
2432
|
-
t.schema.compat &&
|
|
2432
|
+
t.schema.compat && at(n.indent, u, i), ps(t, r.items, m) && i(d, "DUPLICATE_KEY", "Map keys must be unique");
|
|
2433
2433
|
const b = ae(f ?? [], {
|
|
2434
2434
|
indicator: "map-value-ind",
|
|
2435
2435
|
next: h,
|
|
@@ -2440,7 +2440,7 @@ function pn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
|
|
|
2440
2440
|
if (o = b.end, b.found) {
|
|
2441
2441
|
y && (h?.type === "block-map" && !b.hasNewline && i(o, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"), t.options.strict && p.start < b.found.offset - 1024 && i(m.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));
|
|
2442
2442
|
const w = h ? s(t, h, b, i) : e(t, o, f, null, b, i);
|
|
2443
|
-
t.schema.compat &&
|
|
2443
|
+
t.schema.compat && at(n.indent, h, i), o = w.range[2];
|
|
2444
2444
|
const k = new $(m, w);
|
|
2445
2445
|
t.options.keepSourceTokens && (k.srcToken = a), r.items.push(k);
|
|
2446
2446
|
} else {
|
|
@@ -2452,7 +2452,7 @@ function pn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
|
|
|
2452
2452
|
}
|
|
2453
2453
|
return l && l < o && i(l, "IMPOSSIBLE", "Map comment with trailing content"), r.range = [n.offset, o, l ?? o], r;
|
|
2454
2454
|
}
|
|
2455
|
-
function
|
|
2455
|
+
function dn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
|
|
2456
2456
|
const r = new Z(t.schema);
|
|
2457
2457
|
t.atRoot && (t.atRoot = !1);
|
|
2458
2458
|
let o = n.offset, l = null;
|
|
@@ -2472,7 +2472,7 @@ function mn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
|
|
|
2472
2472
|
continue;
|
|
2473
2473
|
}
|
|
2474
2474
|
const f = c ? s(t, c, u, i) : e(t, u.end, a, null, u, i);
|
|
2475
|
-
t.schema.compat &&
|
|
2475
|
+
t.schema.compat && at(n.indent, c, i), o = f.range[2], r.items.push(f);
|
|
2476
2476
|
}
|
|
2477
2477
|
return r.range = [n.offset, o, l ?? o], r;
|
|
2478
2478
|
}
|
|
@@ -2504,7 +2504,7 @@ function Ae(s, e, t, n) {
|
|
|
2504
2504
|
return { comment: i, offset: e };
|
|
2505
2505
|
}
|
|
2506
2506
|
const et = "Block collections are not allowed within flow collections", tt = (s) => s && (s.type === "block-map" || s.type === "block-seq");
|
|
2507
|
-
function
|
|
2507
|
+
function pn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
|
|
2508
2508
|
const r = n.start.source === "{", o = r ? "flow map" : "flow sequence", l = r ? new j(t.schema) : new Z(t.schema);
|
|
2509
2509
|
l.flow = !0;
|
|
2510
2510
|
const a = t.atRoot;
|
|
@@ -2571,11 +2571,11 @@ function gn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
|
|
|
2571
2571
|
if (E.found) {
|
|
2572
2572
|
if (!r && !S.found && t.options.strict) {
|
|
2573
2573
|
if (w)
|
|
2574
|
-
for (const
|
|
2575
|
-
if (
|
|
2574
|
+
for (const _ of w) {
|
|
2575
|
+
if (_ === E.found)
|
|
2576
2576
|
break;
|
|
2577
|
-
if (
|
|
2578
|
-
i(
|
|
2577
|
+
if (_.type === "newline") {
|
|
2578
|
+
i(_, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
|
|
2579
2579
|
break;
|
|
2580
2580
|
}
|
|
2581
2581
|
}
|
|
@@ -2588,11 +2588,11 @@ function gn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
|
|
|
2588
2588
|
` + E.comment : g.comment = E.comment);
|
|
2589
2589
|
const ee = new $(g, q);
|
|
2590
2590
|
if (t.options.keepSourceTokens && (ee.srcToken = d), r) {
|
|
2591
|
-
const
|
|
2592
|
-
|
|
2591
|
+
const _ = l;
|
|
2592
|
+
ps(t, _.items, g) && i(O, "DUPLICATE_KEY", "Map keys must be unique"), _.items.push(ee);
|
|
2593
2593
|
} else {
|
|
2594
|
-
const
|
|
2595
|
-
|
|
2594
|
+
const _ = new j(t.schema);
|
|
2595
|
+
_.flow = !0, _.items.push(ee), l.items.push(_);
|
|
2596
2596
|
}
|
|
2597
2597
|
c = q ? q.range[2] : E.end;
|
|
2598
2598
|
}
|
|
@@ -2613,19 +2613,19 @@ function gn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
|
|
|
2613
2613
|
l.range = [n.offset, p, p];
|
|
2614
2614
|
return l;
|
|
2615
2615
|
}
|
|
2616
|
-
function
|
|
2616
|
+
function mn(s, e, t, n, i) {
|
|
2617
2617
|
let r;
|
|
2618
2618
|
switch (t.type) {
|
|
2619
2619
|
case "block-map": {
|
|
2620
|
-
r =
|
|
2620
|
+
r = hn(s, e, t, i);
|
|
2621
2621
|
break;
|
|
2622
2622
|
}
|
|
2623
2623
|
case "block-seq": {
|
|
2624
|
-
r =
|
|
2624
|
+
r = dn(s, e, t, i);
|
|
2625
2625
|
break;
|
|
2626
2626
|
}
|
|
2627
2627
|
case "flow-collection": {
|
|
2628
|
-
r =
|
|
2628
|
+
r = pn(s, e, t, i);
|
|
2629
2629
|
break;
|
|
2630
2630
|
}
|
|
2631
2631
|
}
|
|
@@ -2649,11 +2649,11 @@ function yn(s, e, t, n, i) {
|
|
|
2649
2649
|
const u = c.resolve(r, (h) => i(n, "TAG_RESOLVE_FAILED", h), e.options), f = T(u) ? u : new N(u);
|
|
2650
2650
|
return f.range = r.range, f.tag = o, c?.format && (f.format = c.format), f;
|
|
2651
2651
|
}
|
|
2652
|
-
function
|
|
2653
|
-
const n = s.offset, i =
|
|
2652
|
+
function ms(s, e, t) {
|
|
2653
|
+
const n = s.offset, i = gn(s, e, t);
|
|
2654
2654
|
if (!i)
|
|
2655
2655
|
return { value: "", type: null, comment: "", range: [n, n, n] };
|
|
2656
|
-
const r = i.mode === ">" ? N.BLOCK_FOLDED : N.BLOCK_LITERAL, o = s.source ?
|
|
2656
|
+
const r = i.mode === ">" ? N.BLOCK_FOLDED : N.BLOCK_LITERAL, o = s.source ? yn(s.source) : [];
|
|
2657
2657
|
let l = o.length;
|
|
2658
2658
|
for (let d = o.length - 1; d >= 0; --d) {
|
|
2659
2659
|
const m = o[d][1];
|
|
@@ -2726,7 +2726,7 @@ function gs(s, e, t) {
|
|
|
2726
2726
|
const y = n + i.length + s.source.length;
|
|
2727
2727
|
return { value: f, type: r, comment: i.comment, range: [n, y, y] };
|
|
2728
2728
|
}
|
|
2729
|
-
function
|
|
2729
|
+
function gn({ offset: s, props: e }, t, n) {
|
|
2730
2730
|
if (e[0].type !== "block-scalar-header")
|
|
2731
2731
|
return n(e[0], "IMPOSSIBLE", "Block scalar header not found"), null;
|
|
2732
2732
|
const { source: i } = e[0], r = i[0];
|
|
@@ -2766,25 +2766,25 @@ function bn({ offset: s, props: e }, t, n) {
|
|
|
2766
2766
|
}
|
|
2767
2767
|
return { mode: r, indent: o, chomp: l, comment: u, length: f };
|
|
2768
2768
|
}
|
|
2769
|
-
function
|
|
2769
|
+
function yn(s) {
|
|
2770
2770
|
const e = s.split(/\n( *)/), t = e[0], n = t.match(/^( *)/), r = [n?.[1] ? [n[1], t.slice(n[1].length)] : ["", t]];
|
|
2771
2771
|
for (let o = 1; o < e.length; o += 2)
|
|
2772
2772
|
r.push([e[o], e[o + 1]]);
|
|
2773
2773
|
return r;
|
|
2774
2774
|
}
|
|
2775
|
-
function
|
|
2775
|
+
function gs(s, e, t) {
|
|
2776
2776
|
const { offset: n, type: i, source: r, end: o } = s;
|
|
2777
2777
|
let l, a;
|
|
2778
2778
|
const c = (h, p, y) => t(n + h, p, y);
|
|
2779
2779
|
switch (i) {
|
|
2780
2780
|
case "scalar":
|
|
2781
|
-
l = N.PLAIN, a =
|
|
2781
|
+
l = N.PLAIN, a = bn(r, c);
|
|
2782
2782
|
break;
|
|
2783
2783
|
case "single-quoted-scalar":
|
|
2784
|
-
l = N.QUOTE_SINGLE, a =
|
|
2784
|
+
l = N.QUOTE_SINGLE, a = wn(r, c);
|
|
2785
2785
|
break;
|
|
2786
2786
|
case "double-quoted-scalar":
|
|
2787
|
-
l = N.QUOTE_DOUBLE, a =
|
|
2787
|
+
l = N.QUOTE_DOUBLE, a = Sn(r, c);
|
|
2788
2788
|
break;
|
|
2789
2789
|
default:
|
|
2790
2790
|
return t(s, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${i}`), {
|
|
@@ -2802,7 +2802,7 @@ function ys(s, e, t) {
|
|
|
2802
2802
|
range: [n, u, f.offset]
|
|
2803
2803
|
};
|
|
2804
2804
|
}
|
|
2805
|
-
function
|
|
2805
|
+
function bn(s, e) {
|
|
2806
2806
|
let t = "";
|
|
2807
2807
|
switch (s[0]) {
|
|
2808
2808
|
case " ":
|
|
@@ -2825,12 +2825,12 @@ function Sn(s, e) {
|
|
|
2825
2825
|
break;
|
|
2826
2826
|
}
|
|
2827
2827
|
}
|
|
2828
|
-
return t && e(0, "BAD_SCALAR_START", `Plain value cannot start with ${t}`),
|
|
2828
|
+
return t && e(0, "BAD_SCALAR_START", `Plain value cannot start with ${t}`), ys(s);
|
|
2829
2829
|
}
|
|
2830
|
-
function
|
|
2831
|
-
return (s[s.length - 1] !== "'" || s.length === 1) && e(s.length, "MISSING_CHAR", "Missing closing 'quote"),
|
|
2830
|
+
function wn(s, e) {
|
|
2831
|
+
return (s[s.length - 1] !== "'" || s.length === 1) && e(s.length, "MISSING_CHAR", "Missing closing 'quote"), ys(s.slice(1, -1)).replace(/''/g, "'");
|
|
2832
2832
|
}
|
|
2833
|
-
function
|
|
2833
|
+
function ys(s) {
|
|
2834
2834
|
let e, t;
|
|
2835
2835
|
try {
|
|
2836
2836
|
e = new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
@@ -2850,7 +2850,7 @@ function bs(s) {
|
|
|
2850
2850
|
const l = /[ \t]*(.*)/sy;
|
|
2851
2851
|
return l.lastIndex = o, n = l.exec(s), i + r + (n?.[1] ?? "");
|
|
2852
2852
|
}
|
|
2853
|
-
function
|
|
2853
|
+
function Sn(s, e) {
|
|
2854
2854
|
let t = "";
|
|
2855
2855
|
for (let n = 1; n < s.length - 1; ++n) {
|
|
2856
2856
|
const i = s[n];
|
|
@@ -2858,11 +2858,11 @@ function Nn(s, e) {
|
|
|
2858
2858
|
`))
|
|
2859
2859
|
if (i === `
|
|
2860
2860
|
`) {
|
|
2861
|
-
const { fold: r, offset: o } =
|
|
2861
|
+
const { fold: r, offset: o } = kn(s, n);
|
|
2862
2862
|
t += r, n = o;
|
|
2863
2863
|
} else if (i === "\\") {
|
|
2864
2864
|
let r = s[++n];
|
|
2865
|
-
const o =
|
|
2865
|
+
const o = Nn[r];
|
|
2866
2866
|
if (o)
|
|
2867
2867
|
t += o;
|
|
2868
2868
|
else if (r === `
|
|
@@ -2875,7 +2875,7 @@ function Nn(s, e) {
|
|
|
2875
2875
|
r = s[++n + 1];
|
|
2876
2876
|
else if (r === "x" || r === "u" || r === "U") {
|
|
2877
2877
|
const l = { x: 2, u: 4, U: 8 }[r];
|
|
2878
|
-
t +=
|
|
2878
|
+
t += On(s, n + 1, l, e), n += l;
|
|
2879
2879
|
} else {
|
|
2880
2880
|
const l = s.substr(n - 1, 2);
|
|
2881
2881
|
e(n - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${l}`), t += l;
|
|
@@ -2893,7 +2893,7 @@ function Nn(s, e) {
|
|
|
2893
2893
|
}
|
|
2894
2894
|
return (s[s.length - 1] !== '"' || s.length === 1) && e(s.length, "MISSING_CHAR", 'Missing closing "quote'), t;
|
|
2895
2895
|
}
|
|
2896
|
-
function
|
|
2896
|
+
function kn(s, e) {
|
|
2897
2897
|
let t = "", n = s[e + 1];
|
|
2898
2898
|
for (; (n === " " || n === " " || n === `
|
|
2899
2899
|
` || n === "\r") && !(n === "\r" && s[e + 2] !== `
|
|
@@ -2903,7 +2903,7 @@ function On(s, e) {
|
|
|
2903
2903
|
`), e += 1, n = s[e + 1];
|
|
2904
2904
|
return t || (t = " "), { fold: t, offset: e };
|
|
2905
2905
|
}
|
|
2906
|
-
const
|
|
2906
|
+
const Nn = {
|
|
2907
2907
|
0: "\0",
|
|
2908
2908
|
a: "\x07",
|
|
2909
2909
|
b: "\b",
|
|
@@ -2924,7 +2924,7 @@ const An = {
|
|
|
2924
2924
|
"\\": "\\",
|
|
2925
2925
|
" ": " "
|
|
2926
2926
|
};
|
|
2927
|
-
function
|
|
2927
|
+
function On(s, e, t, n) {
|
|
2928
2928
|
const i = s.substr(e, t), o = i.length === t && /^[0-9a-fA-F]+$/.test(i) ? parseInt(i, 16) : NaN;
|
|
2929
2929
|
if (isNaN(o)) {
|
|
2930
2930
|
const l = s.substr(e - 2, t + 2);
|
|
@@ -2932,8 +2932,8 @@ function En(s, e, t, n) {
|
|
|
2932
2932
|
}
|
|
2933
2933
|
return String.fromCodePoint(o);
|
|
2934
2934
|
}
|
|
2935
|
-
function
|
|
2936
|
-
const { value: i, type: r, comment: o, range: l } = e.type === "block-scalar" ?
|
|
2935
|
+
function bs(s, e, t, n) {
|
|
2936
|
+
const { value: i, type: r, comment: o, range: l } = e.type === "block-scalar" ? ms(e, s.options.strict, n) : gs(e, s.options.strict, n), a = t ? s.directives.tagName(t.source, (f) => n(t, "TAG_RESOLVE_FAILED", f)) : null, c = t && a ? An(s.schema, i, a, t, n) : e.type === "scalar" ? En(s, i, e, n) : s.schema[R];
|
|
2937
2937
|
let u;
|
|
2938
2938
|
try {
|
|
2939
2939
|
const f = c.resolve(i, (h) => n(t ?? e, "TAG_RESOLVE_FAILED", h), s.options);
|
|
@@ -2944,7 +2944,7 @@ function ws(s, e, t, n) {
|
|
|
2944
2944
|
}
|
|
2945
2945
|
return u.range = l, u.source = i, r && (u.type = r), a && (u.tag = a), c.format && (u.format = c.format), o && (u.comment = o), u;
|
|
2946
2946
|
}
|
|
2947
|
-
function
|
|
2947
|
+
function An(s, e, t, n, i) {
|
|
2948
2948
|
if (t === "!")
|
|
2949
2949
|
return s[R];
|
|
2950
2950
|
const r = [];
|
|
@@ -2960,7 +2960,7 @@ function In(s, e, t, n, i) {
|
|
|
2960
2960
|
const o = s.knownTags[t];
|
|
2961
2961
|
return o && !o.collection ? (s.tags.push(Object.assign({}, o, { default: !1, test: void 0 })), o) : (i(n, "TAG_RESOLVE_FAILED", `Unresolved tag: ${t}`, t !== "tag:yaml.org,2002:str"), s[R]);
|
|
2962
2962
|
}
|
|
2963
|
-
function
|
|
2963
|
+
function En({ directives: s, schema: e }, t, n, i) {
|
|
2964
2964
|
const r = e.tags.find((o) => o.default && o.test?.test(t)) || e[R];
|
|
2965
2965
|
if (e.compat) {
|
|
2966
2966
|
const o = e.compat.find((l) => l.default && l.test?.test(t)) ?? e[R];
|
|
@@ -2971,7 +2971,7 @@ function Ln({ directives: s, schema: e }, t, n, i) {
|
|
|
2971
2971
|
}
|
|
2972
2972
|
return r;
|
|
2973
2973
|
}
|
|
2974
|
-
function
|
|
2974
|
+
function In(s, e, t) {
|
|
2975
2975
|
if (e) {
|
|
2976
2976
|
t === null && (t = e.length);
|
|
2977
2977
|
for (let n = t - 1; n >= 0; --n) {
|
|
@@ -2990,48 +2990,48 @@ function Tn(s, e, t) {
|
|
|
2990
2990
|
}
|
|
2991
2991
|
return s;
|
|
2992
2992
|
}
|
|
2993
|
-
const
|
|
2994
|
-
function
|
|
2993
|
+
const Ln = { composeNode: ws, composeEmptyNode: Nt };
|
|
2994
|
+
function ws(s, e, t, n) {
|
|
2995
2995
|
const { spaceBefore: i, comment: r, anchor: o, tag: l } = t;
|
|
2996
2996
|
let a, c = !0;
|
|
2997
2997
|
switch (e.type) {
|
|
2998
2998
|
case "alias":
|
|
2999
|
-
a =
|
|
2999
|
+
a = Tn(s, e, n), (o || l) && n(e, "ALIAS_PROPS", "An alias node must not specify any properties");
|
|
3000
3000
|
break;
|
|
3001
3001
|
case "scalar":
|
|
3002
3002
|
case "single-quoted-scalar":
|
|
3003
3003
|
case "double-quoted-scalar":
|
|
3004
3004
|
case "block-scalar":
|
|
3005
|
-
a =
|
|
3005
|
+
a = bs(s, e, l, n), o && (a.anchor = o.source.substring(1));
|
|
3006
3006
|
break;
|
|
3007
3007
|
case "block-map":
|
|
3008
3008
|
case "block-seq":
|
|
3009
3009
|
case "flow-collection":
|
|
3010
|
-
a =
|
|
3010
|
+
a = mn(Ln, s, e, l, n), o && (a.anchor = o.source.substring(1));
|
|
3011
3011
|
break;
|
|
3012
3012
|
default: {
|
|
3013
3013
|
const u = e.type === "error" ? e.message : `Unsupported token (type: ${e.type})`;
|
|
3014
|
-
n(e, "UNEXPECTED_TOKEN", u), a =
|
|
3014
|
+
n(e, "UNEXPECTED_TOKEN", u), a = Nt(s, e.offset, void 0, null, t, n), c = !1;
|
|
3015
3015
|
}
|
|
3016
3016
|
}
|
|
3017
3017
|
return o && a.anchor === "" && n(o, "BAD_ALIAS", "Anchor cannot be an empty string"), i && (a.spaceBefore = !0), r && (e.type === "scalar" && e.source === "" ? a.comment = r : a.commentBefore = r), s.options.keepSourceTokens && c && (a.srcToken = e), a;
|
|
3018
3018
|
}
|
|
3019
|
-
function
|
|
3019
|
+
function Nt(s, e, t, n, { spaceBefore: i, comment: r, anchor: o, tag: l, end: a }, c) {
|
|
3020
3020
|
const u = {
|
|
3021
3021
|
type: "scalar",
|
|
3022
|
-
offset:
|
|
3022
|
+
offset: In(e, t, n),
|
|
3023
3023
|
indent: -1,
|
|
3024
3024
|
source: ""
|
|
3025
|
-
}, f =
|
|
3025
|
+
}, f = bs(s, u, l, c);
|
|
3026
3026
|
return o && (f.anchor = o.source.substring(1), f.anchor === "" && c(o, "BAD_ALIAS", "Anchor cannot be an empty string")), i && (f.spaceBefore = !0), r && (f.comment = r, f.range[2] = a), f;
|
|
3027
3027
|
}
|
|
3028
|
-
function
|
|
3029
|
-
const r = new
|
|
3028
|
+
function Tn({ options: s }, { offset: e, source: t, end: n }, i) {
|
|
3029
|
+
const r = new De(t.substring(1));
|
|
3030
3030
|
r.source === "" && i(e, "BAD_ALIAS", "Alias cannot be an empty string"), r.source.endsWith(":") && i(e + t.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", !0);
|
|
3031
3031
|
const o = e + t.length, l = Ae(n, o, s.strict, i);
|
|
3032
3032
|
return r.range = [e, o, l.offset], l.comment && (r.comment = l.comment), r;
|
|
3033
3033
|
}
|
|
3034
|
-
function
|
|
3034
|
+
function $n(s, e, { offset: t, start: n, value: i, end: r }, o) {
|
|
3035
3035
|
const l = Object.assign({ _directives: e }, s), a = new de(void 0, l), c = {
|
|
3036
3036
|
atRoot: !0,
|
|
3037
3037
|
directives: a.directives,
|
|
@@ -3044,7 +3044,7 @@ function _n(s, e, { offset: t, start: n, value: i, end: r }, o) {
|
|
|
3044
3044
|
onError: o,
|
|
3045
3045
|
startOnNewline: !0
|
|
3046
3046
|
});
|
|
3047
|
-
u.found && (a.directives.docStart = !0, i && (i.type === "block-map" || i.type === "block-seq") && !u.hasNewline && o(u.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), a.contents = i ?
|
|
3047
|
+
u.found && (a.directives.docStart = !0, i && (i.type === "block-map" || i.type === "block-seq") && !u.hasNewline && o(u.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), a.contents = i ? ws(c, i, u, o) : Nt(c, u.end, n, null, u, o);
|
|
3048
3048
|
const f = a.contents.range[2], h = Ae(r, f, !1, o);
|
|
3049
3049
|
return h.comment && (a.comment = h.comment), a.range = [t, f, h.offset], a;
|
|
3050
3050
|
}
|
|
@@ -3056,7 +3056,7 @@ function pe(s) {
|
|
|
3056
3056
|
const { offset: e, source: t } = s;
|
|
3057
3057
|
return [e, e + (typeof t == "string" ? t.length : 1)];
|
|
3058
3058
|
}
|
|
3059
|
-
function
|
|
3059
|
+
function Bt(s) {
|
|
3060
3060
|
let e = "", t = !1, n = !1;
|
|
3061
3061
|
for (let i = 0; i < s.length; ++i) {
|
|
3062
3062
|
const r = s[i];
|
|
@@ -3076,15 +3076,15 @@ function jt(s) {
|
|
|
3076
3076
|
}
|
|
3077
3077
|
return { comment: e, afterEmptyLine: n };
|
|
3078
3078
|
}
|
|
3079
|
-
class
|
|
3079
|
+
class Ot {
|
|
3080
3080
|
constructor(e = {}) {
|
|
3081
3081
|
this.doc = null, this.atDirectives = !1, this.prelude = [], this.errors = [], this.warnings = [], this.onError = (t, n, i, r) => {
|
|
3082
3082
|
const o = pe(t);
|
|
3083
|
-
r ? this.warnings.push(new
|
|
3083
|
+
r ? this.warnings.push(new ds(o, n, i)) : this.errors.push(new Q(o, n, i));
|
|
3084
3084
|
}, this.directives = new C({ version: e.version || "1.2" }), this.options = e;
|
|
3085
3085
|
}
|
|
3086
3086
|
decorate(e, t) {
|
|
3087
|
-
const { comment: n, afterEmptyLine: i } =
|
|
3087
|
+
const { comment: n, afterEmptyLine: i } = Bt(this.prelude);
|
|
3088
3088
|
if (n) {
|
|
3089
3089
|
const r = e.contents;
|
|
3090
3090
|
if (t)
|
|
@@ -3113,7 +3113,7 @@ ${o}` : n;
|
|
|
3113
3113
|
*/
|
|
3114
3114
|
streamInfo() {
|
|
3115
3115
|
return {
|
|
3116
|
-
comment:
|
|
3116
|
+
comment: Bt(this.prelude).comment,
|
|
3117
3117
|
directives: this.directives,
|
|
3118
3118
|
errors: this.errors,
|
|
3119
3119
|
warnings: this.warnings
|
|
@@ -3140,7 +3140,7 @@ ${o}` : n;
|
|
|
3140
3140
|
}), this.prelude.push(e.source), this.atDirectives = !0;
|
|
3141
3141
|
break;
|
|
3142
3142
|
case "document": {
|
|
3143
|
-
const t =
|
|
3143
|
+
const t = $n(this.options, this.directives, e, this.onError);
|
|
3144
3144
|
this.atDirectives && !t.directives.docStart && this.onError(e, "MISSING_CHAR", "Missing directives-end/doc-start indicator line"), this.decorate(t, !1), this.doc && (yield this.doc), this.doc = t, this.atDirectives = !1;
|
|
3145
3145
|
break;
|
|
3146
3146
|
}
|
|
@@ -3191,7 +3191,7 @@ ${t.comment}` : t.comment;
|
|
|
3191
3191
|
}
|
|
3192
3192
|
}
|
|
3193
3193
|
}
|
|
3194
|
-
function
|
|
3194
|
+
function Cn(s, e = !0, t) {
|
|
3195
3195
|
if (s) {
|
|
3196
3196
|
const n = (i, r, o) => {
|
|
3197
3197
|
const l = typeof i == "number" ? i : Array.isArray(i) ? i[0] : i.offset;
|
|
@@ -3204,14 +3204,14 @@ function vn(s, e = !0, t) {
|
|
|
3204
3204
|
case "scalar":
|
|
3205
3205
|
case "single-quoted-scalar":
|
|
3206
3206
|
case "double-quoted-scalar":
|
|
3207
|
-
return ys(s, e, n);
|
|
3208
|
-
case "block-scalar":
|
|
3209
3207
|
return gs(s, e, n);
|
|
3208
|
+
case "block-scalar":
|
|
3209
|
+
return ms(s, e, n);
|
|
3210
3210
|
}
|
|
3211
3211
|
}
|
|
3212
3212
|
return null;
|
|
3213
3213
|
}
|
|
3214
|
-
function
|
|
3214
|
+
function vn(s, e) {
|
|
3215
3215
|
const { implicitKey: t = !1, indent: n, inFlow: i = !1, offset: r = -1, type: o = "PLAIN" } = e, l = Ne({ type: o, value: s }, {
|
|
3216
3216
|
implicitKey: t,
|
|
3217
3217
|
indent: n > 0 ? " ".repeat(n) : "",
|
|
@@ -3229,7 +3229,7 @@ function Bn(s, e) {
|
|
|
3229
3229
|
`, h = [
|
|
3230
3230
|
{ type: "block-scalar-header", offset: r, indent: n, source: u }
|
|
3231
3231
|
];
|
|
3232
|
-
return
|
|
3232
|
+
return Ss(h, a) || h.push({ type: "newline", offset: -1, indent: n, source: `
|
|
3233
3233
|
` }), { type: "block-scalar", offset: r, indent: n, props: h, source: f };
|
|
3234
3234
|
}
|
|
3235
3235
|
case '"':
|
|
@@ -3240,7 +3240,7 @@ function Bn(s, e) {
|
|
|
3240
3240
|
return { type: "scalar", offset: r, indent: n, source: l, end: a };
|
|
3241
3241
|
}
|
|
3242
3242
|
}
|
|
3243
|
-
function
|
|
3243
|
+
function _n(s, e, t = {}) {
|
|
3244
3244
|
let { afterKey: n = !1, implicitKey: i = !1, inFlow: r = !1, type: o } = t, l = "indent" in s ? s.indent : null;
|
|
3245
3245
|
if (n && typeof l == "number" && (l += 2), !o)
|
|
3246
3246
|
switch (s.type) {
|
|
@@ -3269,7 +3269,7 @@ function jn(s, e, t = {}) {
|
|
|
3269
3269
|
switch (a[0]) {
|
|
3270
3270
|
case "|":
|
|
3271
3271
|
case ">":
|
|
3272
|
-
|
|
3272
|
+
Bn(s, a);
|
|
3273
3273
|
break;
|
|
3274
3274
|
case '"':
|
|
3275
3275
|
st(s, a, "double-quoted-scalar");
|
|
@@ -3281,7 +3281,7 @@ function jn(s, e, t = {}) {
|
|
|
3281
3281
|
st(s, a, "scalar");
|
|
3282
3282
|
}
|
|
3283
3283
|
}
|
|
3284
|
-
function
|
|
3284
|
+
function Bn(s, e) {
|
|
3285
3285
|
const t = e.indexOf(`
|
|
3286
3286
|
`), n = e.substring(0, t), i = e.substring(t + 1) + `
|
|
3287
3287
|
`;
|
|
@@ -3294,14 +3294,14 @@ function Mn(s, e) {
|
|
|
3294
3294
|
const { offset: r } = s, o = "indent" in s ? s.indent : -1, l = [
|
|
3295
3295
|
{ type: "block-scalar-header", offset: r, indent: o, source: n }
|
|
3296
3296
|
];
|
|
3297
|
-
|
|
3297
|
+
Ss(l, "end" in s ? s.end : void 0) || l.push({ type: "newline", offset: -1, indent: o, source: `
|
|
3298
3298
|
` });
|
|
3299
3299
|
for (const a of Object.keys(s))
|
|
3300
3300
|
a !== "type" && a !== "offset" && delete s[a];
|
|
3301
3301
|
Object.assign(s, { type: "block-scalar", indent: o, props: l, source: i });
|
|
3302
3302
|
}
|
|
3303
3303
|
}
|
|
3304
|
-
function
|
|
3304
|
+
function Ss(s, e) {
|
|
3305
3305
|
if (e)
|
|
3306
3306
|
for (const t of e)
|
|
3307
3307
|
switch (t.type) {
|
|
@@ -3345,13 +3345,13 @@ function st(s, e, t) {
|
|
|
3345
3345
|
}
|
|
3346
3346
|
}
|
|
3347
3347
|
}
|
|
3348
|
-
const
|
|
3349
|
-
function
|
|
3348
|
+
const jn = (s) => "type" in s ? Me(s) : ve(s);
|
|
3349
|
+
function Me(s) {
|
|
3350
3350
|
switch (s.type) {
|
|
3351
3351
|
case "block-scalar": {
|
|
3352
3352
|
let e = "";
|
|
3353
3353
|
for (const t of s.props)
|
|
3354
|
-
e +=
|
|
3354
|
+
e += Me(t);
|
|
3355
3355
|
return e + s.source;
|
|
3356
3356
|
}
|
|
3357
3357
|
case "block-map":
|
|
@@ -3389,18 +3389,18 @@ function ve({ start: s, key: e, sep: t, value: n }) {
|
|
|
3389
3389
|
let i = "";
|
|
3390
3390
|
for (const r of s)
|
|
3391
3391
|
i += r.source;
|
|
3392
|
-
if (e && (i +=
|
|
3392
|
+
if (e && (i += Me(e)), t)
|
|
3393
3393
|
for (const r of t)
|
|
3394
3394
|
i += r.source;
|
|
3395
|
-
return n && (i +=
|
|
3395
|
+
return n && (i += Me(n)), i;
|
|
3396
3396
|
}
|
|
3397
|
-
const
|
|
3397
|
+
const ct = Symbol("break visit"), Mn = Symbol("skip children"), ks = Symbol("remove item");
|
|
3398
3398
|
function x(s, e) {
|
|
3399
|
-
"type" in s && s.type === "document" && (s = { start: s.start, value: s.value }),
|
|
3399
|
+
"type" in s && s.type === "document" && (s = { start: s.start, value: s.value }), Ns(Object.freeze([]), s, e);
|
|
3400
3400
|
}
|
|
3401
|
-
x.BREAK =
|
|
3402
|
-
x.SKIP =
|
|
3403
|
-
x.REMOVE =
|
|
3401
|
+
x.BREAK = ct;
|
|
3402
|
+
x.SKIP = Mn;
|
|
3403
|
+
x.REMOVE = ks;
|
|
3404
3404
|
x.itemAtPath = (s, e) => {
|
|
3405
3405
|
let t = s;
|
|
3406
3406
|
for (const [n, i] of e) {
|
|
@@ -3418,7 +3418,7 @@ x.parentCollection = (s, e) => {
|
|
|
3418
3418
|
return i;
|
|
3419
3419
|
throw new Error("Parent collection not found");
|
|
3420
3420
|
};
|
|
3421
|
-
function
|
|
3421
|
+
function Ns(s, e, t) {
|
|
3422
3422
|
let n = t(e, s);
|
|
3423
3423
|
if (typeof n == "symbol")
|
|
3424
3424
|
return n;
|
|
@@ -3426,13 +3426,13 @@ function Os(s, e, t) {
|
|
|
3426
3426
|
const r = e[i];
|
|
3427
3427
|
if (r && "items" in r) {
|
|
3428
3428
|
for (let o = 0; o < r.items.length; ++o) {
|
|
3429
|
-
const l =
|
|
3429
|
+
const l = Ns(Object.freeze(s.concat([[i, o]])), r.items[o], t);
|
|
3430
3430
|
if (typeof l == "number")
|
|
3431
3431
|
o = l - 1;
|
|
3432
3432
|
else {
|
|
3433
|
-
if (l ===
|
|
3434
|
-
return
|
|
3435
|
-
l ===
|
|
3433
|
+
if (l === ct)
|
|
3434
|
+
return ct;
|
|
3435
|
+
l === ks && (r.items.splice(o, 1), o -= 1);
|
|
3436
3436
|
}
|
|
3437
3437
|
}
|
|
3438
3438
|
typeof n == "function" && i === "key" && (n = n(e, s));
|
|
@@ -3440,14 +3440,14 @@ function Os(s, e, t) {
|
|
|
3440
3440
|
}
|
|
3441
3441
|
return typeof n == "function" ? n(e, s) : n;
|
|
3442
3442
|
}
|
|
3443
|
-
const
|
|
3444
|
-
function
|
|
3443
|
+
const Qe = "\uFEFF", He = "", xe = "", Se = "", Pn = (s) => !!s && "items" in s, Dn = (s) => !!s && (s.type === "scalar" || s.type === "single-quoted-scalar" || s.type === "double-quoted-scalar" || s.type === "block-scalar");
|
|
3444
|
+
function Kn(s) {
|
|
3445
3445
|
switch (s) {
|
|
3446
|
-
case
|
|
3446
|
+
case Qe:
|
|
3447
3447
|
return "<BOM>";
|
|
3448
|
-
case
|
|
3448
|
+
case He:
|
|
3449
3449
|
return "<DOC>";
|
|
3450
|
-
case
|
|
3450
|
+
case xe:
|
|
3451
3451
|
return "<FLOW_END>";
|
|
3452
3452
|
case Se:
|
|
3453
3453
|
return "<SCALAR>";
|
|
@@ -3455,13 +3455,13 @@ function qn(s) {
|
|
|
3455
3455
|
return JSON.stringify(s);
|
|
3456
3456
|
}
|
|
3457
3457
|
}
|
|
3458
|
-
function
|
|
3458
|
+
function Os(s) {
|
|
3459
3459
|
switch (s) {
|
|
3460
|
-
case
|
|
3460
|
+
case Qe:
|
|
3461
3461
|
return "byte-order-mark";
|
|
3462
|
-
case
|
|
3462
|
+
case He:
|
|
3463
3463
|
return "doc-mode";
|
|
3464
|
-
case
|
|
3464
|
+
case xe:
|
|
3465
3465
|
return "flow-error-end";
|
|
3466
3466
|
case Se:
|
|
3467
3467
|
return "scalar";
|
|
@@ -3516,20 +3516,20 @@ function As(s) {
|
|
|
3516
3516
|
}
|
|
3517
3517
|
return null;
|
|
3518
3518
|
}
|
|
3519
|
-
const
|
|
3519
|
+
const Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3520
3520
|
__proto__: null,
|
|
3521
|
-
BOM:
|
|
3522
|
-
DOCUMENT:
|
|
3523
|
-
FLOW_END:
|
|
3521
|
+
BOM: Qe,
|
|
3522
|
+
DOCUMENT: He,
|
|
3523
|
+
FLOW_END: xe,
|
|
3524
3524
|
SCALAR: Se,
|
|
3525
|
-
createScalarToken:
|
|
3526
|
-
isCollection:
|
|
3527
|
-
isScalar:
|
|
3528
|
-
prettyToken:
|
|
3529
|
-
resolveAsScalar:
|
|
3530
|
-
setScalarValue:
|
|
3531
|
-
stringify:
|
|
3532
|
-
tokenType:
|
|
3525
|
+
createScalarToken: vn,
|
|
3526
|
+
isCollection: Pn,
|
|
3527
|
+
isScalar: Dn,
|
|
3528
|
+
prettyToken: Kn,
|
|
3529
|
+
resolveAsScalar: Cn,
|
|
3530
|
+
setScalarValue: _n,
|
|
3531
|
+
stringify: jn,
|
|
3532
|
+
tokenType: Os,
|
|
3533
3533
|
visit: x
|
|
3534
3534
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3535
3535
|
function B(s) {
|
|
@@ -3545,9 +3545,9 @@ function B(s) {
|
|
|
3545
3545
|
return !1;
|
|
3546
3546
|
}
|
|
3547
3547
|
}
|
|
3548
|
-
const
|
|
3549
|
-
\r `.split(""), it = (s) => !s ||
|
|
3550
|
-
class
|
|
3548
|
+
const jt = "0123456789ABCDEFabcdef".split(""), qn = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()".split(""), nt = ",[]{}".split(""), Un = ` ,[]{}
|
|
3549
|
+
\r `.split(""), it = (s) => !s || Un.includes(s);
|
|
3550
|
+
class As {
|
|
3551
3551
|
constructor() {
|
|
3552
3552
|
this.atEnd = !1, this.blockScalarIndent = -1, this.blockScalarKeep = !1, this.buffer = "", this.flowKey = !1, this.flowLevel = 0, this.indentNext = 0, this.indentValue = 0, this.lineEndPos = null, this.next = null, this.pos = 0;
|
|
3553
3553
|
}
|
|
@@ -3634,7 +3634,7 @@ class Es {
|
|
|
3634
3634
|
let e = this.getLine();
|
|
3635
3635
|
if (e === null)
|
|
3636
3636
|
return this.setNext("stream");
|
|
3637
|
-
if (e[0] ===
|
|
3637
|
+
if (e[0] === Qe && (yield* this.pushCount(1), e = e.substring(1)), e[0] === "%") {
|
|
3638
3638
|
let t = e.length;
|
|
3639
3639
|
const n = e.indexOf("#");
|
|
3640
3640
|
if (n !== -1) {
|
|
@@ -3655,7 +3655,7 @@ class Es {
|
|
|
3655
3655
|
const t = yield* this.pushSpaces(!0);
|
|
3656
3656
|
return yield* this.pushCount(e.length - t), yield* this.pushNewline(), "stream";
|
|
3657
3657
|
}
|
|
3658
|
-
return yield
|
|
3658
|
+
return yield He, yield* this.parseLineStart();
|
|
3659
3659
|
}
|
|
3660
3660
|
*parseLineStart() {
|
|
3661
3661
|
const e = this.charAt(0);
|
|
@@ -3720,7 +3720,7 @@ class Es {
|
|
|
3720
3720
|
if (i === null)
|
|
3721
3721
|
return this.setNext("flow");
|
|
3722
3722
|
if ((n !== -1 && n < this.indentNext && i[0] !== "#" || n === 0 && (i.startsWith("---") || i.startsWith("...")) && B(i[3])) && !(n === this.indentNext - 1 && this.flowLevel === 1 && (i[0] === "]" || i[0] === "}")))
|
|
3723
|
-
return this.flowLevel = 0, yield
|
|
3723
|
+
return this.flowLevel = 0, yield xe, yield* this.parseLineStart();
|
|
3724
3724
|
let r = 0;
|
|
3725
3725
|
for (; i[r] === ","; )
|
|
3726
3726
|
r += yield* this.pushCount(1), r += yield* this.pushSpaces(!0), this.flowKey = !1;
|
|
@@ -3914,9 +3914,9 @@ class Es {
|
|
|
3914
3914
|
} else {
|
|
3915
3915
|
let e = this.pos + 1, t = this.buffer[e];
|
|
3916
3916
|
for (; t; )
|
|
3917
|
-
if (
|
|
3917
|
+
if (qn.includes(t))
|
|
3918
3918
|
t = this.buffer[++e];
|
|
3919
|
-
else if (t === "%" &&
|
|
3919
|
+
else if (t === "%" && jt.includes(this.buffer[e + 1]) && jt.includes(this.buffer[e + 2]))
|
|
3920
3920
|
t = this.buffer[e += 3];
|
|
3921
3921
|
else
|
|
3922
3922
|
break;
|
|
@@ -3944,7 +3944,7 @@ class Es {
|
|
|
3944
3944
|
return yield* this.pushToIndex(t, !1);
|
|
3945
3945
|
}
|
|
3946
3946
|
}
|
|
3947
|
-
class
|
|
3947
|
+
class Es {
|
|
3948
3948
|
constructor() {
|
|
3949
3949
|
this.lineStarts = [], this.addNewLine = (e) => this.lineStarts.push(e), this.linePos = (e) => {
|
|
3950
3950
|
let t = 0, n = this.lineStarts.length;
|
|
@@ -3967,7 +3967,7 @@ function P(s, e) {
|
|
|
3967
3967
|
return !0;
|
|
3968
3968
|
return !1;
|
|
3969
3969
|
}
|
|
3970
|
-
function
|
|
3970
|
+
function Mt(s) {
|
|
3971
3971
|
for (let e = 0; e < s.length; ++e)
|
|
3972
3972
|
switch (s[e].type) {
|
|
3973
3973
|
case "space":
|
|
@@ -3979,7 +3979,7 @@ function Pt(s) {
|
|
|
3979
3979
|
}
|
|
3980
3980
|
return -1;
|
|
3981
3981
|
}
|
|
3982
|
-
function
|
|
3982
|
+
function Is(s) {
|
|
3983
3983
|
switch (s?.type) {
|
|
3984
3984
|
case "alias":
|
|
3985
3985
|
case "scalar":
|
|
@@ -4023,18 +4023,18 @@ function se(s) {
|
|
|
4023
4023
|
;
|
|
4024
4024
|
return s.splice(e, s.length);
|
|
4025
4025
|
}
|
|
4026
|
-
function
|
|
4026
|
+
function Pt(s) {
|
|
4027
4027
|
if (s.start.type === "flow-seq-start")
|
|
4028
4028
|
for (const e of s.items)
|
|
4029
|
-
e.sep && !e.value && !P(e.start, "explicit-key-ind") && !P(e.sep, "map-value-ind") && (e.key && (e.value = e.key), delete e.key,
|
|
4029
|
+
e.sep && !e.value && !P(e.start, "explicit-key-ind") && !P(e.sep, "map-value-ind") && (e.key && (e.value = e.key), delete e.key, Is(e.value) ? e.value.end ? Array.prototype.push.apply(e.value.end, e.sep) : e.value.end = e.sep : Array.prototype.push.apply(e.start, e.sep), delete e.sep);
|
|
4030
4030
|
}
|
|
4031
|
-
class
|
|
4031
|
+
class At {
|
|
4032
4032
|
/**
|
|
4033
4033
|
* @param onNewLine - If defined, called separately with the start position of
|
|
4034
4034
|
* each new line (in `parse()`, including the start of input).
|
|
4035
4035
|
*/
|
|
4036
4036
|
constructor(e) {
|
|
4037
|
-
this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new
|
|
4037
|
+
this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new As(), this.onNewLine = e;
|
|
4038
4038
|
}
|
|
4039
4039
|
/**
|
|
4040
4040
|
* Parse `source` as a YAML stream.
|
|
@@ -4058,7 +4058,7 @@ class Et {
|
|
|
4058
4058
|
this.atScalar = !1, yield* this.step(), this.offset += e.length;
|
|
4059
4059
|
return;
|
|
4060
4060
|
}
|
|
4061
|
-
const t =
|
|
4061
|
+
const t = Os(e);
|
|
4062
4062
|
if (t)
|
|
4063
4063
|
if (t === "scalar")
|
|
4064
4064
|
this.atNewLine = !1, this.atScalar = !0, this.type = "scalar";
|
|
@@ -4146,7 +4146,7 @@ class Et {
|
|
|
4146
4146
|
yield t;
|
|
4147
4147
|
else {
|
|
4148
4148
|
const n = this.peek(1);
|
|
4149
|
-
switch (t.type === "block-scalar" ? t.indent = "indent" in n ? n.indent : 0 : t.type === "flow-collection" && n.type === "document" && (t.indent = 0), t.type === "flow-collection" &&
|
|
4149
|
+
switch (t.type === "block-scalar" ? t.indent = "indent" in n ? n.indent : 0 : t.type === "flow-collection" && n.type === "document" && (t.indent = 0), t.type === "flow-collection" && Pt(t), n.type) {
|
|
4150
4150
|
case "document":
|
|
4151
4151
|
n.value = t;
|
|
4152
4152
|
break;
|
|
@@ -4181,7 +4181,7 @@ class Et {
|
|
|
4181
4181
|
}
|
|
4182
4182
|
if ((n.type === "document" || n.type === "block-map" || n.type === "block-seq") && (t.type === "block-map" || t.type === "block-seq")) {
|
|
4183
4183
|
const i = t.items[t.items.length - 1];
|
|
4184
|
-
i && !i.sep && !i.value && i.start.length > 0 &&
|
|
4184
|
+
i && !i.sep && !i.value && i.start.length > 0 && Mt(i.start) === -1 && (t.indent === 0 || i.start.every((r) => r.type !== "comment" || r.indent < t.indent)) && (n.type === "document" ? n.end = i.start : n.items.push({ start: i.start }), t.items.splice(-1, 1));
|
|
4185
4185
|
}
|
|
4186
4186
|
}
|
|
4187
4187
|
else {
|
|
@@ -4223,7 +4223,7 @@ class Et {
|
|
|
4223
4223
|
return yield* this.lineEnd(e);
|
|
4224
4224
|
switch (this.type) {
|
|
4225
4225
|
case "doc-start": {
|
|
4226
|
-
|
|
4226
|
+
Mt(e.start) !== -1 ? (yield* this.pop(), yield* this.step()) : e.start.push(this.sourceToken);
|
|
4227
4227
|
return;
|
|
4228
4228
|
}
|
|
4229
4229
|
case "anchor":
|
|
@@ -4353,7 +4353,7 @@ class Et {
|
|
|
4353
4353
|
indent: this.indent,
|
|
4354
4354
|
items: [{ start: i, key: null, sep: [this.sourceToken] }]
|
|
4355
4355
|
});
|
|
4356
|
-
else if (
|
|
4356
|
+
else if (Is(t.key) && !P(t.sep, "newline")) {
|
|
4357
4357
|
const r = se(t.start), o = t.key, l = t.sep;
|
|
4358
4358
|
l.push(this.sourceToken), delete t.key, delete t.sep, this.stack.push({
|
|
4359
4359
|
type: "block-map",
|
|
@@ -4492,7 +4492,7 @@ class Et {
|
|
|
4492
4492
|
yield* this.pop(), yield* this.step();
|
|
4493
4493
|
else if (this.type === "map-value-ind" && n.type !== "flow-collection") {
|
|
4494
4494
|
const i = Le(n), r = se(i);
|
|
4495
|
-
|
|
4495
|
+
Pt(e);
|
|
4496
4496
|
const o = e.end.splice(1, e.end.length);
|
|
4497
4497
|
o.push(this.sourceToken);
|
|
4498
4498
|
const l = {
|
|
@@ -4601,19 +4601,19 @@ class Et {
|
|
|
4601
4601
|
}
|
|
4602
4602
|
}
|
|
4603
4603
|
}
|
|
4604
|
-
function
|
|
4604
|
+
function Ls(s) {
|
|
4605
4605
|
const e = s.prettyErrors !== !1;
|
|
4606
|
-
return { lineCounter: s.lineCounter || e && new
|
|
4606
|
+
return { lineCounter: s.lineCounter || e && new Es() || null, prettyErrors: e };
|
|
4607
4607
|
}
|
|
4608
|
-
function
|
|
4609
|
-
const { lineCounter: t, prettyErrors: n } =
|
|
4608
|
+
function Rn(s, e = {}) {
|
|
4609
|
+
const { lineCounter: t, prettyErrors: n } = Ls(e), i = new At(t?.addNewLine), r = new Ot(e), o = Array.from(r.compose(i.parse(s)));
|
|
4610
4610
|
if (n && t)
|
|
4611
4611
|
for (const l of o)
|
|
4612
|
-
l.errors.forEach(
|
|
4612
|
+
l.errors.forEach(je(s, t)), l.warnings.forEach(je(s, t));
|
|
4613
4613
|
return o.length > 0 ? o : Object.assign([], { empty: !0 }, r.streamInfo());
|
|
4614
4614
|
}
|
|
4615
|
-
function
|
|
4616
|
-
const { lineCounter: t, prettyErrors: n } =
|
|
4615
|
+
function Ts(s, e = {}) {
|
|
4616
|
+
const { lineCounter: t, prettyErrors: n } = Ls(e), i = new At(t?.addNewLine), r = new Ot(e);
|
|
4617
4617
|
let o = null;
|
|
4618
4618
|
for (const l of r.compose(i.parse(s), !0, s.length))
|
|
4619
4619
|
if (!o)
|
|
@@ -4622,22 +4622,22 @@ function $s(s, e = {}) {
|
|
|
4622
4622
|
o.errors.push(new Q(l.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
|
|
4623
4623
|
break;
|
|
4624
4624
|
}
|
|
4625
|
-
return n && t && (o.errors.forEach(
|
|
4625
|
+
return n && t && (o.errors.forEach(je(s, t)), o.warnings.forEach(je(s, t))), o;
|
|
4626
4626
|
}
|
|
4627
|
-
function
|
|
4627
|
+
function Vn(s, e, t) {
|
|
4628
4628
|
let n;
|
|
4629
4629
|
typeof e == "function" ? n = e : t === void 0 && e && typeof e == "object" && (t = e);
|
|
4630
|
-
const i =
|
|
4630
|
+
const i = Ts(s, t);
|
|
4631
4631
|
if (!i)
|
|
4632
4632
|
return null;
|
|
4633
|
-
if (i.warnings.forEach((r) =>
|
|
4633
|
+
if (i.warnings.forEach((r) => Ht(i.options.logLevel, r)), i.errors.length > 0) {
|
|
4634
4634
|
if (i.options.logLevel !== "silent")
|
|
4635
4635
|
throw i.errors[0];
|
|
4636
4636
|
i.errors = [];
|
|
4637
4637
|
}
|
|
4638
4638
|
return i.toJS(Object.assign({ reviver: n }, t));
|
|
4639
4639
|
}
|
|
4640
|
-
function
|
|
4640
|
+
function Wn(s, e, t) {
|
|
4641
4641
|
let n = null;
|
|
4642
4642
|
if (typeof e == "function" || Array.isArray(e) ? n = e : t === void 0 && e && (t = e), typeof t == "string" && (t = t.length), typeof t == "number") {
|
|
4643
4643
|
const i = Math.round(t);
|
|
@@ -4650,23 +4650,23 @@ function Yn(s, e, t) {
|
|
|
4650
4650
|
}
|
|
4651
4651
|
return new de(s, n, t).toString(t);
|
|
4652
4652
|
}
|
|
4653
|
-
const
|
|
4653
|
+
const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4654
4654
|
__proto__: null,
|
|
4655
|
-
Alias:
|
|
4656
|
-
CST:
|
|
4657
|
-
Composer:
|
|
4655
|
+
Alias: De,
|
|
4656
|
+
CST: Fn,
|
|
4657
|
+
Composer: Ot,
|
|
4658
4658
|
Document: de,
|
|
4659
|
-
Lexer:
|
|
4660
|
-
LineCounter:
|
|
4659
|
+
Lexer: As,
|
|
4660
|
+
LineCounter: Es,
|
|
4661
4661
|
Pair: $,
|
|
4662
|
-
Parser:
|
|
4662
|
+
Parser: At,
|
|
4663
4663
|
Scalar: N,
|
|
4664
|
-
Schema:
|
|
4665
|
-
YAMLError:
|
|
4664
|
+
Schema: Ge,
|
|
4665
|
+
YAMLError: kt,
|
|
4666
4666
|
YAMLMap: j,
|
|
4667
4667
|
YAMLParseError: Q,
|
|
4668
4668
|
YAMLSeq: Z,
|
|
4669
|
-
YAMLWarning:
|
|
4669
|
+
YAMLWarning: ds,
|
|
4670
4670
|
isAlias: X,
|
|
4671
4671
|
isCollection: L,
|
|
4672
4672
|
isDocument: ke,
|
|
@@ -4675,62 +4675,62 @@ const Gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4675
4675
|
isPair: I,
|
|
4676
4676
|
isScalar: A,
|
|
4677
4677
|
isSeq: fe,
|
|
4678
|
-
parse:
|
|
4679
|
-
parseAllDocuments:
|
|
4680
|
-
parseDocument:
|
|
4681
|
-
stringify:
|
|
4678
|
+
parse: Vn,
|
|
4679
|
+
parseAllDocuments: Rn,
|
|
4680
|
+
parseDocument: Ts,
|
|
4681
|
+
stringify: Wn,
|
|
4682
4682
|
visit: J,
|
|
4683
|
-
visitAsync:
|
|
4684
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4683
|
+
visitAsync: Pe
|
|
4684
|
+
}, Symbol.toStringTag, { value: "Module" })), Xn = (s) => s, zn = (s) => s, Zn = (s) => s, ei = (s) => ({
|
|
4685
4685
|
widget: "boolean",
|
|
4686
4686
|
...s
|
|
4687
|
-
}),
|
|
4687
|
+
}), ti = (s) => ({
|
|
4688
4688
|
widget: "code",
|
|
4689
4689
|
...s
|
|
4690
|
-
}),
|
|
4690
|
+
}), si = (s) => ({
|
|
4691
4691
|
widget: "color",
|
|
4692
4692
|
...s
|
|
4693
|
-
}),
|
|
4693
|
+
}), ni = (s) => ({ widget: "datetime", ...s }), ii = (s) => ({
|
|
4694
4694
|
widget: "hidden",
|
|
4695
4695
|
...s
|
|
4696
|
-
}),
|
|
4696
|
+
}), ri = (s) => ({
|
|
4697
4697
|
widget: "file",
|
|
4698
4698
|
...s
|
|
4699
|
-
}),
|
|
4699
|
+
}), oi = (s) => ({
|
|
4700
4700
|
widget: "image",
|
|
4701
4701
|
...s
|
|
4702
|
-
}),
|
|
4702
|
+
}), li = (s) => ({
|
|
4703
4703
|
widget: "list",
|
|
4704
4704
|
...s
|
|
4705
|
-
}),
|
|
4705
|
+
}), ai = (s) => ({
|
|
4706
4706
|
widget: "map",
|
|
4707
4707
|
...s
|
|
4708
|
-
}),
|
|
4708
|
+
}), ci = (s) => ({
|
|
4709
4709
|
widget: "number",
|
|
4710
4710
|
...s
|
|
4711
|
-
}),
|
|
4711
|
+
}), fi = (s) => ({
|
|
4712
4712
|
widget: "object",
|
|
4713
4713
|
...s
|
|
4714
|
-
}),
|
|
4714
|
+
}), ui = (s) => ({ widget: "relation", ...s }), hi = (s) => ({
|
|
4715
4715
|
widget: "select",
|
|
4716
4716
|
...s
|
|
4717
|
-
}),
|
|
4717
|
+
}), di = (s) => ({
|
|
4718
4718
|
widget: "string",
|
|
4719
4719
|
...s
|
|
4720
|
-
}),
|
|
4720
|
+
}), pi = (s) => ({
|
|
4721
4721
|
widget: "text",
|
|
4722
4722
|
...s
|
|
4723
|
-
}),
|
|
4723
|
+
}), Yn = async (s) => {
|
|
4724
4724
|
try {
|
|
4725
|
-
await
|
|
4725
|
+
await $s(s);
|
|
4726
4726
|
} catch {
|
|
4727
|
-
await
|
|
4727
|
+
await Cs(s, { recursive: !0 });
|
|
4728
4728
|
}
|
|
4729
|
-
},
|
|
4729
|
+
}, Gn = async (s, e) => {
|
|
4730
4730
|
await vs(e, s);
|
|
4731
|
-
},
|
|
4731
|
+
}, Qn = async (s) => {
|
|
4732
4732
|
try {
|
|
4733
|
-
await
|
|
4733
|
+
await _s(s);
|
|
4734
4734
|
const { default: e } = await import(
|
|
4735
4735
|
/* @vite-ignore */
|
|
4736
4736
|
s
|
|
@@ -4739,41 +4739,46 @@ const Gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4739
4739
|
} catch {
|
|
4740
4740
|
throw new Error("Config file not found");
|
|
4741
4741
|
}
|
|
4742
|
-
},
|
|
4743
|
-
const { configFile:
|
|
4744
|
-
await
|
|
4745
|
-
const
|
|
4746
|
-
await
|
|
4742
|
+
}, Dt = async (s, e) => {
|
|
4743
|
+
const { configFile: t = "./netlify.config.ts", config: n, saveFolder: i = "./public/admin" } = e ?? {};
|
|
4744
|
+
await Yn(Xe.join(s, i));
|
|
4745
|
+
const r = n ?? await Qn(Xe.join(s, t)), o = Jn.stringify(r);
|
|
4746
|
+
await Gn(o, Xe.join(s, i, "config.yml"));
|
|
4747
4747
|
};
|
|
4748
|
-
async function
|
|
4748
|
+
async function mi(s) {
|
|
4749
|
+
let e = "";
|
|
4749
4750
|
return {
|
|
4750
4751
|
name: "vite-plugin-netlify-cms",
|
|
4752
|
+
configResolved: (t) => {
|
|
4753
|
+
e = t.root;
|
|
4754
|
+
},
|
|
4751
4755
|
buildStart: async () => {
|
|
4752
|
-
await
|
|
4756
|
+
await Dt(e, s);
|
|
4753
4757
|
},
|
|
4754
|
-
handleHotUpdate: async ({ file:
|
|
4755
|
-
|
|
4758
|
+
handleHotUpdate: async ({ file: t }) => {
|
|
4759
|
+
t.endsWith("netlify.config.ts") && await Dt(e, s);
|
|
4756
4760
|
}
|
|
4757
4761
|
};
|
|
4758
4762
|
}
|
|
4759
4763
|
export {
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4764
|
+
mi as default,
|
|
4765
|
+
ei as defineBooleanWidget,
|
|
4766
|
+
ti as defineCodeWidget,
|
|
4767
|
+
si as defineColorWidget,
|
|
4768
|
+
Xn as defineConfig,
|
|
4769
|
+
ni as defineDateTimeWidget,
|
|
4770
|
+
Zn as defineFileCollection,
|
|
4771
|
+
ri as defineFileWidget,
|
|
4772
|
+
zn as defineFolderCollection,
|
|
4773
|
+
ii as defineHiddenWidget,
|
|
4774
|
+
oi as defineImageWidget,
|
|
4775
|
+
li as defineListWidget,
|
|
4776
|
+
ai as defineMapWidget,
|
|
4777
|
+
ci as defineNumberWidget,
|
|
4778
|
+
fi as defineObjectWidget,
|
|
4779
|
+
ui as defineRelationWidget,
|
|
4780
|
+
hi as defineSelectWidget,
|
|
4781
|
+
di as defineStringWidget,
|
|
4782
|
+
pi as defineTextWidget
|
|
4779
4783
|
};
|
|
4784
|
+
//# sourceMappingURL=index.es.js.map
|