@caiquecamargo/vite-plugin-netlify-cms 0.0.5 → 0.0.6
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 +33 -33
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +120 -120
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readdir as $s, mkdir as Cs, writeFile as vs, readFile as _s } from "fs/promises";
|
|
2
|
-
import
|
|
2
|
+
import Ee from "path";
|
|
3
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")
|
|
@@ -71,13 +71,13 @@ function ne(s, e, t, n) {
|
|
|
71
71
|
}
|
|
72
72
|
return i;
|
|
73
73
|
}
|
|
74
|
-
async function
|
|
74
|
+
async function De(s, e) {
|
|
75
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
|
+
De.BREAK = v;
|
|
79
|
+
De.SKIP = Ft;
|
|
80
|
+
De.REMOVE = K;
|
|
81
81
|
async function ie(s, e, t, n) {
|
|
82
82
|
const i = await Ut(s, e, t, n);
|
|
83
83
|
if (T(i) || I(i))
|
|
@@ -313,7 +313,7 @@ function Ps(s, e) {
|
|
|
313
313
|
sourceObjects: n
|
|
314
314
|
};
|
|
315
315
|
}
|
|
316
|
-
class
|
|
316
|
+
class Ke extends ut {
|
|
317
317
|
constructor(e) {
|
|
318
318
|
super(ft), this.source = e, Object.defineProperty(this, "tag", {
|
|
319
319
|
set() {
|
|
@@ -348,7 +348,7 @@ class De extends ut {
|
|
|
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 = $e(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
|
}
|
|
@@ -367,19 +367,19 @@ class De extends ut {
|
|
|
367
367
|
return i;
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function $e(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 = $e(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 = $e(s, e.key, t), i = $e(s, e.value, t);
|
|
383
383
|
return Math.max(n, i);
|
|
384
384
|
}
|
|
385
385
|
return 1;
|
|
@@ -438,7 +438,7 @@ 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 Ke(a.anchor);
|
|
442
442
|
a = { anchor: null, node: null }, l.set(s, a);
|
|
443
443
|
}
|
|
444
444
|
e?.startsWith("!!") && (e = Ds + e.slice(2));
|
|
@@ -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 Be(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 _e(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 Fe extends ut {
|
|
479
479
|
constructor(e, t) {
|
|
480
480
|
super(e), Object.defineProperty(this, "schema", {
|
|
481
481
|
value: t,
|
|
@@ -506,7 +506,7 @@ class Ke extends ut {
|
|
|
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, Be(this.schema, i, t));
|
|
510
510
|
else
|
|
511
511
|
throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`);
|
|
512
512
|
}
|
|
@@ -564,13 +564,13 @@ class Ke extends ut {
|
|
|
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, Be(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
|
-
|
|
573
|
+
Fe.maxFlowStringSingleLineLength = 60;
|
|
574
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;
|
|
@@ -578,8 +578,8 @@ function U(s, e) {
|
|
|
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, Gt = "flow", ot = "block",
|
|
582
|
-
function
|
|
581
|
+
` + U(t, e) : (s.endsWith(" ") ? "" : " ") + t, Gt = "flow", ot = "block", Ce = "quoted";
|
|
582
|
+
function qe(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);
|
|
@@ -591,7 +591,7 @@ function Fe(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
591
591
|
let h, p, y = !1, d = -1, m = -1, b = -1;
|
|
592
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 === Ce && k === "\\") {
|
|
595
595
|
switch (m = d, s[d + 1]) {
|
|
596
596
|
case "x":
|
|
597
597
|
d += 3;
|
|
@@ -620,7 +620,7 @@ function Fe(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 === Ce) {
|
|
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,7 +639,7 @@ function Fe(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 === Ce && u[S] && (w += `${s[S]}\\`), w += `
|
|
643
643
|
${e}${s.slice(S + 1, O)}`);
|
|
644
644
|
}
|
|
645
645
|
return w;
|
|
@@ -655,11 +655,11 @@ function It(s, e) {
|
|
|
655
655
|
}
|
|
656
656
|
return e;
|
|
657
657
|
}
|
|
658
|
-
const
|
|
658
|
+
const Ue = (s) => ({
|
|
659
659
|
indentAtStart: s.indentAtStart,
|
|
660
660
|
lineWidth: s.options.lineWidth,
|
|
661
661
|
minContentWidth: s.options.minContentWidth
|
|
662
|
-
}),
|
|
662
|
+
}), Re = (s) => /^(%|---|\.\.\.)/m.test(s);
|
|
663
663
|
function qs(s, e, t) {
|
|
664
664
|
if (!e || e < 0)
|
|
665
665
|
return !1;
|
|
@@ -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 || (Re(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 : qe(o, r, Ce, Ue(e));
|
|
739
739
|
}
|
|
740
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 || (Re(s) ? " " : ""), n = "'" + s.replace(/'/g, "''").replace(/\n+/g, `$&
|
|
745
745
|
${t}`) + "'";
|
|
746
|
-
return e.implicitKey ? n :
|
|
746
|
+
return e.implicitKey ? n : qe(n, t, Gt, Ue(e));
|
|
747
747
|
}
|
|
748
748
|
function re(s, e) {
|
|
749
749
|
const { singleQuote: t } = e.options;
|
|
@@ -756,11 +756,11 @@ function re(s, e) {
|
|
|
756
756
|
}
|
|
757
757
|
return n(s, e);
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function ve({ 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 || Re(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,7 +796,7 @@ function Ce({ 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 = qe(`${w}${t}${p}`, c, ot, Ue(n));
|
|
800
800
|
return `${S}
|
|
801
801
|
${c}${O}`;
|
|
802
802
|
}
|
|
@@ -806,13 +806,13 @@ function Us(s, e, t, n) {
|
|
|
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) : ve(s, e, t, n);
|
|
810
810
|
if (!l && !u && i !== N.PLAIN && r.includes(`
|
|
811
811
|
`))
|
|
812
|
-
return
|
|
813
|
-
if (
|
|
812
|
+
return ve(s, e, t, n);
|
|
813
|
+
if (Re(r)) {
|
|
814
814
|
if (a === "")
|
|
815
|
-
return e.forceBlockIndent = !0,
|
|
815
|
+
return e.forceBlockIndent = !0, ve(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 : qe(f, a, Gt, Ue(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,7 +833,7 @@ 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) : ve(o, e, t, n);
|
|
837
837
|
case N.QUOTE_DOUBLE:
|
|
838
838
|
return ye(o.value, e);
|
|
839
839
|
case N.QUOTE_SINGLE:
|
|
@@ -1101,10 +1101,10 @@ function Gs({ 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(""), je(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(""), je(t, h, w.commentBefore, f));
|
|
1108
1108
|
}
|
|
1109
1109
|
f = !1;
|
|
1110
1110
|
let b = H(d, u, () => m = null, () => f = !0);
|
|
@@ -1139,10 +1139,10 @@ function Qs({ 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(""), je(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(""), je(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 Qs({ 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) > Fe.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 je({ 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 Fe {
|
|
1183
1183
|
static get tagName() {
|
|
1184
1184
|
return "tag:yaml.org,2002:map";
|
|
1185
1185
|
}
|
|
@@ -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 Fe {
|
|
1277
1277
|
static get tagName() {
|
|
1278
1278
|
return "tag:yaml.org,2002:seq";
|
|
1279
1279
|
}
|
|
@@ -1292,11 +1292,11 @@ class Z extends Ke {
|
|
|
1292
1292
|
* @returns `true` if the item was found and removed.
|
|
1293
1293
|
*/
|
|
1294
1294
|
delete(e) {
|
|
1295
|
-
const t =
|
|
1295
|
+
const t = Ie(e);
|
|
1296
1296
|
return typeof t != "number" ? !1 : this.items.splice(t, 1).length > 0;
|
|
1297
1297
|
}
|
|
1298
1298
|
get(e, t) {
|
|
1299
|
-
const n =
|
|
1299
|
+
const n = Ie(e);
|
|
1300
1300
|
if (typeof n != "number")
|
|
1301
1301
|
return;
|
|
1302
1302
|
const i = this.items[n];
|
|
@@ -1309,7 +1309,7 @@ class Z extends Ke {
|
|
|
1309
1309
|
* It may be wrapped in a `Scalar`.
|
|
1310
1310
|
*/
|
|
1311
1311
|
has(e) {
|
|
1312
|
-
const t =
|
|
1312
|
+
const t = Ie(e);
|
|
1313
1313
|
return typeof t == "number" && t < this.items.length;
|
|
1314
1314
|
}
|
|
1315
1315
|
/**
|
|
@@ -1320,7 +1320,7 @@ class Z extends Ke {
|
|
|
1320
1320
|
* It may be wrapped in a `Scalar`.
|
|
1321
1321
|
*/
|
|
1322
1322
|
set(e, t) {
|
|
1323
|
-
const n =
|
|
1323
|
+
const n = Ie(e);
|
|
1324
1324
|
if (typeof n != "number")
|
|
1325
1325
|
throw new Error(`Expected a valid index, not ${e}.`);
|
|
1326
1326
|
const i = this.items[n];
|
|
@@ -1344,7 +1344,7 @@ class Z extends Ke {
|
|
|
1344
1344
|
}) : JSON.stringify(this);
|
|
1345
1345
|
}
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function Ie(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
|
}
|
|
@@ -1371,7 +1371,7 @@ const he = {
|
|
|
1371
1371
|
resolve(s, e) {
|
|
1372
1372
|
return fe(s) || e("Expected a sequence for this tag"), s;
|
|
1373
1373
|
}
|
|
1374
|
-
},
|
|
1374
|
+
}, Ve = {
|
|
1375
1375
|
identify: (s) => typeof s == "string",
|
|
1376
1376
|
default: !0,
|
|
1377
1377
|
tag: "tag:yaml.org,2002:str",
|
|
@@ -1379,14 +1379,14 @@ 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
|
+
}, We = {
|
|
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" &&
|
|
1389
|
+
stringify: ({ source: s }, e) => typeof s == "string" && We.test.test(s) ? s : e.options.nullStr
|
|
1390
1390
|
}, dt = {
|
|
1391
1391
|
identify: (s) => typeof s == "boolean",
|
|
1392
1392
|
default: !0,
|
|
@@ -1446,13 +1446,13 @@ 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
|
-
},
|
|
1449
|
+
}, Je = (s) => typeof s == "bigint" || Number.isInteger(s), pt = (s, e, t, { intAsBigInt: n }) => n ? BigInt(s) : parseInt(s.substring(e), t);
|
|
1450
1450
|
function ts(s, e, t) {
|
|
1451
1451
|
const { value: n } = s;
|
|
1452
|
-
return
|
|
1452
|
+
return Je(n) && n >= 0 ? t + n.toString(e) : D(s);
|
|
1453
1453
|
}
|
|
1454
1454
|
const ss = {
|
|
1455
|
-
identify: (s) =>
|
|
1455
|
+
identify: (s) => Je(s) && s >= 0,
|
|
1456
1456
|
default: !0,
|
|
1457
1457
|
tag: "tag:yaml.org,2002:int",
|
|
1458
1458
|
format: "OCT",
|
|
@@ -1460,14 +1460,14 @@ const ss = {
|
|
|
1460
1460
|
resolve: (s, e, t) => pt(s, 2, 8, t),
|
|
1461
1461
|
stringify: (s) => ts(s, 8, "0o")
|
|
1462
1462
|
}, ns = {
|
|
1463
|
-
identify:
|
|
1463
|
+
identify: Je,
|
|
1464
1464
|
default: !0,
|
|
1465
1465
|
tag: "tag:yaml.org,2002:int",
|
|
1466
1466
|
test: /^[-+]?[0-9]+$/,
|
|
1467
1467
|
resolve: (s, e, t) => pt(s, 0, 10, t),
|
|
1468
1468
|
stringify: D
|
|
1469
1469
|
}, is = {
|
|
1470
|
-
identify: (s) =>
|
|
1470
|
+
identify: (s) => Je(s) && s >= 0,
|
|
1471
1471
|
default: !0,
|
|
1472
1472
|
tag: "tag:yaml.org,2002:int",
|
|
1473
1473
|
format: "HEX",
|
|
@@ -1477,8 +1477,8 @@ const ss = {
|
|
|
1477
1477
|
}, Xs = [
|
|
1478
1478
|
ue,
|
|
1479
1479
|
he,
|
|
1480
|
-
Re,
|
|
1481
1480
|
Ve,
|
|
1481
|
+
We,
|
|
1482
1482
|
dt,
|
|
1483
1483
|
ss,
|
|
1484
1484
|
ns,
|
|
@@ -1490,13 +1490,13 @@ const ss = {
|
|
|
1490
1490
|
function Tt(s) {
|
|
1491
1491
|
return typeof s == "bigint" || Number.isInteger(s);
|
|
1492
1492
|
}
|
|
1493
|
-
const
|
|
1493
|
+
const Le = ({ value: s }) => JSON.stringify(s), zs = [
|
|
1494
1494
|
{
|
|
1495
1495
|
identify: (s) => typeof s == "string",
|
|
1496
1496
|
default: !0,
|
|
1497
1497
|
tag: "tag:yaml.org,2002:str",
|
|
1498
1498
|
resolve: (s) => s,
|
|
1499
|
-
stringify:
|
|
1499
|
+
stringify: Le
|
|
1500
1500
|
},
|
|
1501
1501
|
{
|
|
1502
1502
|
identify: (s) => s == null,
|
|
@@ -1505,7 +1505,7 @@ const Ie = ({ value: s }) => JSON.stringify(s), zs = [
|
|
|
1505
1505
|
tag: "tag:yaml.org,2002:null",
|
|
1506
1506
|
test: /^null$/,
|
|
1507
1507
|
resolve: () => null,
|
|
1508
|
-
stringify:
|
|
1508
|
+
stringify: Le
|
|
1509
1509
|
},
|
|
1510
1510
|
{
|
|
1511
1511
|
identify: (s) => typeof s == "boolean",
|
|
@@ -1513,7 +1513,7 @@ const Ie = ({ value: s }) => JSON.stringify(s), zs = [
|
|
|
1513
1513
|
tag: "tag:yaml.org,2002:bool",
|
|
1514
1514
|
test: /^true|false$/,
|
|
1515
1515
|
resolve: (s) => s === "true",
|
|
1516
|
-
stringify:
|
|
1516
|
+
stringify: Le
|
|
1517
1517
|
},
|
|
1518
1518
|
{
|
|
1519
1519
|
identify: Tt,
|
|
@@ -1529,7 +1529,7 @@ const Ie = ({ value: s }) => JSON.stringify(s), zs = [
|
|
|
1529
1529
|
tag: "tag:yaml.org,2002:float",
|
|
1530
1530
|
test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
|
|
1531
1531
|
resolve: (s) => parseFloat(s),
|
|
1532
|
-
stringify:
|
|
1532
|
+
stringify: Le
|
|
1533
1533
|
}
|
|
1534
1534
|
], Zs = {
|
|
1535
1535
|
default: !0,
|
|
@@ -1728,7 +1728,7 @@ const as = {
|
|
|
1728
1728
|
},
|
|
1729
1729
|
stringify: D
|
|
1730
1730
|
}, Oe = (s) => typeof s == "bigint" || Number.isInteger(s);
|
|
1731
|
-
function
|
|
1731
|
+
function Ye(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) {
|
|
@@ -1762,7 +1762,7 @@ const rn = {
|
|
|
1762
1762
|
tag: "tag:yaml.org,2002:int",
|
|
1763
1763
|
format: "BIN",
|
|
1764
1764
|
test: /^[-+]?0b[0-1_]+$/,
|
|
1765
|
-
resolve: (s, e, t) =>
|
|
1765
|
+
resolve: (s, e, t) => Ye(s, 2, 2, t),
|
|
1766
1766
|
stringify: (s) => bt(s, 2, "0b")
|
|
1767
1767
|
}, on = {
|
|
1768
1768
|
identify: Oe,
|
|
@@ -1770,14 +1770,14 @@ const rn = {
|
|
|
1770
1770
|
tag: "tag:yaml.org,2002:int",
|
|
1771
1771
|
format: "OCT",
|
|
1772
1772
|
test: /^[-+]?0[0-7_]+$/,
|
|
1773
|
-
resolve: (s, e, t) =>
|
|
1773
|
+
resolve: (s, e, t) => Ye(s, 1, 8, t),
|
|
1774
1774
|
stringify: (s) => bt(s, 8, "0")
|
|
1775
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) => Ye(s, 0, 10, t),
|
|
1781
1781
|
stringify: D
|
|
1782
1782
|
}, an = {
|
|
1783
1783
|
identify: Oe,
|
|
@@ -1785,7 +1785,7 @@ const rn = {
|
|
|
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) =>
|
|
1788
|
+
resolve: (s, e, t) => Ye(s, 2, 16, t),
|
|
1789
1789
|
stringify: (s) => bt(s, 16, "0x")
|
|
1790
1790
|
};
|
|
1791
1791
|
class le extends j {
|
|
@@ -1876,7 +1876,7 @@ const us = {
|
|
|
1876
1876
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
|
|
1877
1877
|
resolve: (s) => St(s, !1),
|
|
1878
1878
|
stringify: fs
|
|
1879
|
-
},
|
|
1879
|
+
}, Ge = {
|
|
1880
1880
|
identify: (s) => s instanceof Date,
|
|
1881
1881
|
default: !0,
|
|
1882
1882
|
tag: "tag:yaml.org,2002:timestamp",
|
|
@@ -1885,7 +1885,7 @@ const us = {
|
|
|
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(Ge.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;
|
|
@@ -1901,8 +1901,8 @@ const us = {
|
|
|
1901
1901
|
}, $t = [
|
|
1902
1902
|
ue,
|
|
1903
1903
|
he,
|
|
1904
|
-
Re,
|
|
1905
1904
|
Ve,
|
|
1905
|
+
We,
|
|
1906
1906
|
as,
|
|
1907
1907
|
cs,
|
|
1908
1908
|
rn,
|
|
@@ -1918,10 +1918,10 @@ const us = {
|
|
|
1918
1918
|
wt,
|
|
1919
1919
|
us,
|
|
1920
1920
|
hs,
|
|
1921
|
-
|
|
1921
|
+
Ge
|
|
1922
1922
|
], Ct = /* @__PURE__ */ new Map([
|
|
1923
1923
|
["core", Xs],
|
|
1924
|
-
["failsafe", [ue, he,
|
|
1924
|
+
["failsafe", [ue, he, Ve]],
|
|
1925
1925
|
["json", en],
|
|
1926
1926
|
["yaml11", $t],
|
|
1927
1927
|
["yaml-1.1", $t]
|
|
@@ -1937,18 +1937,18 @@ const us = {
|
|
|
1937
1937
|
intOct: ss,
|
|
1938
1938
|
intTime: us,
|
|
1939
1939
|
map: ue,
|
|
1940
|
-
null:
|
|
1940
|
+
null: We,
|
|
1941
1941
|
omap: yt,
|
|
1942
1942
|
pairs: gt,
|
|
1943
1943
|
seq: he,
|
|
1944
1944
|
set: wt,
|
|
1945
|
-
timestamp:
|
|
1945
|
+
timestamp: Ge
|
|
1946
1946
|
}, cn = {
|
|
1947
1947
|
"tag:yaml.org,2002:binary": mt,
|
|
1948
1948
|
"tag:yaml.org,2002:omap": yt,
|
|
1949
1949
|
"tag:yaml.org,2002:pairs": gt,
|
|
1950
1950
|
"tag:yaml.org,2002:set": wt,
|
|
1951
|
-
"tag:yaml.org,2002:timestamp":
|
|
1951
|
+
"tag:yaml.org,2002:timestamp": Ge
|
|
1952
1952
|
};
|
|
1953
1953
|
function Ze(s, e) {
|
|
1954
1954
|
let t = Ct.get(e);
|
|
@@ -1975,12 +1975,12 @@ function Ze(s, e) {
|
|
|
1975
1975
|
});
|
|
1976
1976
|
}
|
|
1977
1977
|
const fn = (s, e) => s.key < e.key ? -1 : s.key > e.key ? 1 : 0;
|
|
1978
|
-
class
|
|
1978
|
+
class Qe {
|
|
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 ? cn : {}, this.tags = Ze(t, this.name), this.toStringOptions = l ?? null, Object.defineProperty(this, W, { value: ue }), Object.defineProperty(this, R, { value:
|
|
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: Ve }), 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(Qe.prototype, Object.getOwnPropertyDescriptors(this));
|
|
1984
1984
|
return e.tags = this.tags.slice(), e;
|
|
1985
1985
|
}
|
|
1986
1986
|
}
|
|
@@ -2103,7 +2103,7 @@ class de {
|
|
|
2103
2103
|
e.anchor = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
2104
2104
|
!t || n.has(t) ? Jt(t || "a", n) : t;
|
|
2105
2105
|
}
|
|
2106
|
-
return new
|
|
2106
|
+
return new Ke(e.anchor);
|
|
2107
2107
|
}
|
|
2108
2108
|
createNode(e, t, n) {
|
|
2109
2109
|
let i;
|
|
@@ -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 = Be(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 = Be(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 Qe(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
|
}
|
|
@@ -2282,7 +2282,7 @@ class ds extends kt {
|
|
|
2282
2282
|
super("YAMLWarning", e, t, n);
|
|
2283
2283
|
}
|
|
2284
2284
|
}
|
|
2285
|
-
const
|
|
2285
|
+
const Me = (s, e) => (t) => {
|
|
2286
2286
|
if (t.pos[0] === -1)
|
|
2287
2287
|
return;
|
|
2288
2288
|
t.linePos = t.pos.map((l) => e.linePos(l));
|
|
@@ -3026,7 +3026,7 @@ function Nt(s, e, t, n, { spaceBefore: i, comment: r, anchor: o, tag: l, end: a
|
|
|
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
3028
|
function Tn({ options: s }, { offset: e, source: t, end: n }, i) {
|
|
3029
|
-
const r = new
|
|
3029
|
+
const r = new Ke(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;
|
|
@@ -3345,32 +3345,32 @@ function st(s, e, t) {
|
|
|
3345
3345
|
}
|
|
3346
3346
|
}
|
|
3347
3347
|
}
|
|
3348
|
-
const jn = (s) => "type" in s ?
|
|
3349
|
-
function
|
|
3348
|
+
const jn = (s) => "type" in s ? Pe(s) : _e(s);
|
|
3349
|
+
function Pe(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 += Pe(t);
|
|
3355
3355
|
return e + s.source;
|
|
3356
3356
|
}
|
|
3357
3357
|
case "block-map":
|
|
3358
3358
|
case "block-seq": {
|
|
3359
3359
|
let e = "";
|
|
3360
3360
|
for (const t of s.items)
|
|
3361
|
-
e +=
|
|
3361
|
+
e += _e(t);
|
|
3362
3362
|
return e;
|
|
3363
3363
|
}
|
|
3364
3364
|
case "flow-collection": {
|
|
3365
3365
|
let e = s.start.source;
|
|
3366
3366
|
for (const t of s.items)
|
|
3367
|
-
e +=
|
|
3367
|
+
e += _e(t);
|
|
3368
3368
|
for (const t of s.end)
|
|
3369
3369
|
e += t.source;
|
|
3370
3370
|
return e;
|
|
3371
3371
|
}
|
|
3372
3372
|
case "document": {
|
|
3373
|
-
let e =
|
|
3373
|
+
let e = _e(s);
|
|
3374
3374
|
if (s.end)
|
|
3375
3375
|
for (const t of s.end)
|
|
3376
3376
|
e += t.source;
|
|
@@ -3385,14 +3385,14 @@ function Me(s) {
|
|
|
3385
3385
|
}
|
|
3386
3386
|
}
|
|
3387
3387
|
}
|
|
3388
|
-
function
|
|
3388
|
+
function _e({ 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 += Pe(e)), t)
|
|
3393
3393
|
for (const r of t)
|
|
3394
3394
|
i += r.source;
|
|
3395
|
-
return n && (i +=
|
|
3395
|
+
return n && (i += Pe(n)), i;
|
|
3396
3396
|
}
|
|
3397
3397
|
const ct = Symbol("break visit"), Mn = Symbol("skip children"), ks = Symbol("remove item");
|
|
3398
3398
|
function x(s, e) {
|
|
@@ -3440,14 +3440,14 @@ function Ns(s, e, t) {
|
|
|
3440
3440
|
}
|
|
3441
3441
|
return typeof n == "function" ? n(e, s) : n;
|
|
3442
3442
|
}
|
|
3443
|
-
const
|
|
3443
|
+
const He = "\uFEFF", xe = "", 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
3444
|
function Kn(s) {
|
|
3445
3445
|
switch (s) {
|
|
3446
|
-
case Qe:
|
|
3447
|
-
return "<BOM>";
|
|
3448
3446
|
case He:
|
|
3449
|
-
return "<
|
|
3447
|
+
return "<BOM>";
|
|
3450
3448
|
case xe:
|
|
3449
|
+
return "<DOC>";
|
|
3450
|
+
case Xe:
|
|
3451
3451
|
return "<FLOW_END>";
|
|
3452
3452
|
case Se:
|
|
3453
3453
|
return "<SCALAR>";
|
|
@@ -3457,11 +3457,11 @@ function Kn(s) {
|
|
|
3457
3457
|
}
|
|
3458
3458
|
function Os(s) {
|
|
3459
3459
|
switch (s) {
|
|
3460
|
-
case Qe:
|
|
3461
|
-
return "byte-order-mark";
|
|
3462
3460
|
case He:
|
|
3463
|
-
return "
|
|
3461
|
+
return "byte-order-mark";
|
|
3464
3462
|
case xe:
|
|
3463
|
+
return "doc-mode";
|
|
3464
|
+
case Xe:
|
|
3465
3465
|
return "flow-error-end";
|
|
3466
3466
|
case Se:
|
|
3467
3467
|
return "scalar";
|
|
@@ -3518,9 +3518,9 @@ function Os(s) {
|
|
|
3518
3518
|
}
|
|
3519
3519
|
const Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3520
3520
|
__proto__: null,
|
|
3521
|
-
BOM:
|
|
3522
|
-
DOCUMENT:
|
|
3523
|
-
FLOW_END:
|
|
3521
|
+
BOM: He,
|
|
3522
|
+
DOCUMENT: xe,
|
|
3523
|
+
FLOW_END: Xe,
|
|
3524
3524
|
SCALAR: Se,
|
|
3525
3525
|
createScalarToken: vn,
|
|
3526
3526
|
isCollection: Pn,
|
|
@@ -3634,7 +3634,7 @@ class As {
|
|
|
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] === He && (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 As {
|
|
|
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 xe, yield* this.parseLineStart();
|
|
3659
3659
|
}
|
|
3660
3660
|
*parseLineStart() {
|
|
3661
3661
|
const e = this.charAt(0);
|
|
@@ -3720,7 +3720,7 @@ class As {
|
|
|
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;
|
|
@@ -3991,7 +3991,7 @@ function Is(s) {
|
|
|
3991
3991
|
return !1;
|
|
3992
3992
|
}
|
|
3993
3993
|
}
|
|
3994
|
-
function
|
|
3994
|
+
function Te(s) {
|
|
3995
3995
|
switch (s.type) {
|
|
3996
3996
|
case "document":
|
|
3997
3997
|
return s.start;
|
|
@@ -4244,7 +4244,7 @@ class At {
|
|
|
4244
4244
|
}
|
|
4245
4245
|
*scalar(e) {
|
|
4246
4246
|
if (this.type === "map-value-ind") {
|
|
4247
|
-
const t =
|
|
4247
|
+
const t = Te(this.peek(2)), n = se(t);
|
|
4248
4248
|
let i;
|
|
4249
4249
|
e.end ? (i = e.end, i.push(this.sourceToken), delete e.end) : i = [this.sourceToken];
|
|
4250
4250
|
const r = {
|
|
@@ -4491,7 +4491,7 @@ class At {
|
|
|
4491
4491
|
if (n.type === "block-map" && (this.type === "map-value-ind" && n.indent === e.indent || this.type === "newline" && !n.items[n.items.length - 1].sep))
|
|
4492
4492
|
yield* this.pop(), yield* this.step();
|
|
4493
4493
|
else if (this.type === "map-value-ind" && n.type !== "flow-collection") {
|
|
4494
|
-
const i =
|
|
4494
|
+
const i = Te(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);
|
|
@@ -4555,7 +4555,7 @@ class At {
|
|
|
4555
4555
|
};
|
|
4556
4556
|
case "explicit-key-ind": {
|
|
4557
4557
|
this.onKeyLine = !0;
|
|
4558
|
-
const t =
|
|
4558
|
+
const t = Te(e), n = se(t);
|
|
4559
4559
|
return n.push(this.sourceToken), {
|
|
4560
4560
|
type: "block-map",
|
|
4561
4561
|
offset: this.offset,
|
|
@@ -4565,7 +4565,7 @@ class At {
|
|
|
4565
4565
|
}
|
|
4566
4566
|
case "map-value-ind": {
|
|
4567
4567
|
this.onKeyLine = !0;
|
|
4568
|
-
const t =
|
|
4568
|
+
const t = Te(e), n = se(t);
|
|
4569
4569
|
return {
|
|
4570
4570
|
type: "block-map",
|
|
4571
4571
|
offset: this.offset,
|
|
@@ -4609,7 +4609,7 @@ function Rn(s, e = {}) {
|
|
|
4609
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(Me(s, t)), l.warnings.forEach(Me(s, t));
|
|
4613
4613
|
return o.length > 0 ? o : Object.assign([], { empty: !0 }, r.streamInfo());
|
|
4614
4614
|
}
|
|
4615
4615
|
function Ts(s, e = {}) {
|
|
@@ -4622,7 +4622,7 @@ function Ts(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(Me(s, t)), o.warnings.forEach(Me(s, t))), o;
|
|
4626
4626
|
}
|
|
4627
4627
|
function Vn(s, e, t) {
|
|
4628
4628
|
let n;
|
|
@@ -4652,7 +4652,7 @@ function Wn(s, e, t) {
|
|
|
4652
4652
|
}
|
|
4653
4653
|
const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4654
4654
|
__proto__: null,
|
|
4655
|
-
Alias:
|
|
4655
|
+
Alias: Ke,
|
|
4656
4656
|
CST: Fn,
|
|
4657
4657
|
Composer: Ot,
|
|
4658
4658
|
Document: de,
|
|
@@ -4661,7 +4661,7 @@ const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4661
4661
|
Pair: $,
|
|
4662
4662
|
Parser: At,
|
|
4663
4663
|
Scalar: N,
|
|
4664
|
-
Schema:
|
|
4664
|
+
Schema: Qe,
|
|
4665
4665
|
YAMLError: kt,
|
|
4666
4666
|
YAMLMap: j,
|
|
4667
4667
|
YAMLParseError: Q,
|
|
@@ -4680,7 +4680,7 @@ const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4680
4680
|
parseDocument: Ts,
|
|
4681
4681
|
stringify: Wn,
|
|
4682
4682
|
visit: J,
|
|
4683
|
-
visitAsync:
|
|
4683
|
+
visitAsync: De
|
|
4684
4684
|
}, Symbol.toStringTag, { value: "Module" })), Xn = (s) => s, zn = (s) => s, Zn = (s) => s, ei = (s) => ({
|
|
4685
4685
|
widget: "boolean",
|
|
4686
4686
|
...s
|
|
@@ -4741,9 +4741,9 @@ const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4741
4741
|
}
|
|
4742
4742
|
}, Dt = async (s, e) => {
|
|
4743
4743
|
const { configFile: t = "./netlify.config.ts", config: n, saveFolder: i = "./public/admin" } = e ?? {};
|
|
4744
|
-
await Yn(
|
|
4745
|
-
const r = n ?? await Qn(
|
|
4746
|
-
await Gn(o,
|
|
4744
|
+
console.log("config path: ", s, t, Ee.join(s, t)), await Yn(Ee.join(s, i));
|
|
4745
|
+
const r = n ?? await Qn(Ee.join(s, t)), o = Jn.stringify(r);
|
|
4746
|
+
await Gn(o, Ee.join(s, i, "config.yml"));
|
|
4747
4747
|
};
|
|
4748
4748
|
async function mi(s) {
|
|
4749
4749
|
let e = "";
|