zudoku 0.12.2 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/main.js +3 -3
- package/dist/app/main.js.map +1 -1
- package/dist/cli/dev/handler.js +2 -2
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/config/validators/validate.d.ts +42 -23
- package/dist/config/validators/validate.js +6 -2
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/lib/components/Banner.js +7 -1
- package/dist/lib/components/Banner.js.map +1 -1
- package/dist/lib/components/Header.js +1 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Layout.js +1 -1
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +2 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/Search.js +1 -1
- package/dist/lib/components/Search.js.map +1 -1
- package/dist/lib/components/SlotletProvider.d.ts +9 -2
- package/dist/lib/components/SlotletProvider.js +4 -2
- package/dist/lib/components/SlotletProvider.js.map +1 -1
- package/dist/lib/components/index.d.ts +2 -1
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +1 -1
- package/dist/lib/oas/graphql/index.js +2 -6
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/plugins/custom-pages/CustomPage.d.ts +2 -0
- package/dist/lib/plugins/custom-pages/CustomPage.js +10 -0
- package/dist/lib/plugins/custom-pages/CustomPage.js.map +1 -0
- package/dist/lib/plugins/custom-pages/index.d.ts +10 -0
- package/dist/lib/plugins/custom-pages/index.js +11 -0
- package/dist/lib/plugins/custom-pages/index.js.map +1 -0
- package/dist/lib/plugins/openapi/Endpoint.js +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +1 -1
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +1 -1
- package/dist/lib/plugins/openapi/Route.js +1 -1
- package/dist/lib/plugins/openapi/Route.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/client/createMemoryClient.js +1 -1
- package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.js +1 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +1 -1
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/ui/Callout.d.ts +36 -35
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/Drawer.d.ts +8 -10
- package/dist/lib/ui/Drawer.js.map +1 -1
- package/dist/lib/util/useExposedProps.d.ts +2 -0
- package/dist/lib/util/useExposedProps.js +8 -0
- package/dist/lib/util/useExposedProps.js.map +1 -0
- package/dist/vite/config.js +2 -0
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/dev-server.d.ts +6 -1
- package/dist/vite/dev-server.js +13 -3
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-component.js +0 -1
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-custom-pages.d.ts +4 -0
- package/dist/vite/plugin-custom-pages.js +30 -0
- package/dist/vite/plugin-custom-pages.js.map +1 -0
- package/dist/vite/plugin.js +2 -0
- package/dist/vite/plugin.js.map +1 -1
- package/lib/{AuthenticationPlugin-Bx9FK124.js → AuthenticationPlugin-CbgJ5SAh.js} +3 -3
- package/lib/{AuthenticationPlugin-Bx9FK124.js.map → AuthenticationPlugin-CbgJ5SAh.js.map} +1 -1
- package/lib/{DeveloperHint-YeWHKvyr.js → DeveloperHint-CiXPc9Xm.js} +2 -2
- package/lib/{DeveloperHint-YeWHKvyr.js.map → DeveloperHint-CiXPc9Xm.js.map} +1 -1
- package/lib/ErrorPage-B-zoPPVx.js +15 -0
- package/lib/{ErrorPage-CsZAN_za.js.map → ErrorPage-B-zoPPVx.js.map} +1 -1
- package/lib/Input-QMLhK7Rb.js +2229 -0
- package/lib/Input-QMLhK7Rb.js.map +1 -0
- package/lib/{Markdown-DapSf3wG.js → Markdown-D6Nze6qq.js} +3281 -5392
- package/lib/Markdown-D6Nze6qq.js.map +1 -0
- package/lib/{MdxPage-BqBWsXZ1.js → MdxPage-DBhq6-5F.js} +15 -15
- package/lib/{MdxPage-BqBWsXZ1.js.map → MdxPage-DBhq6-5F.js.map} +1 -1
- package/lib/{OperationList-CYrmxPa8.js → OperationList-Ba24gUd2.js} +50 -51
- package/lib/OperationList-Ba24gUd2.js.map +1 -0
- package/lib/{Route-Q5mqNQrv.js → Route-DI38nxYt.js} +3 -4
- package/lib/Route-DI38nxYt.js.map +1 -0
- package/lib/SidebarBadge-B9-VJSQr.js +503 -0
- package/lib/SidebarBadge-B9-VJSQr.js.map +1 -0
- package/lib/{SlotletProvider-D3UD5Go3.js → SlotletProvider-Cb8mGpBO.js} +46 -46
- package/lib/{SlotletProvider-D3UD5Go3.js.map → SlotletProvider-Cb8mGpBO.js.map} +1 -1
- package/lib/ZudokuContext-BEmsYQoq.js +1173 -0
- package/lib/ZudokuContext-BEmsYQoq.js.map +1 -0
- package/lib/assets/{index-B9EWVYfo.js → index-B_Jk_Yzp.js} +968 -938
- package/lib/assets/index-B_Jk_Yzp.js.map +1 -0
- package/lib/assets/{worker-Bcj4NA2p.js → worker-Bf8vjASY.js} +4582 -4303
- package/lib/assets/worker-Bf8vjASY.js.map +1 -0
- package/lib/cn-BmFQLtkS.js +2279 -0
- package/lib/cn-BmFQLtkS.js.map +1 -0
- package/lib/{index-BG0g4WW0.js → index-BRCiYFaL.js} +747 -737
- package/lib/index-BRCiYFaL.js.map +1 -0
- package/lib/{index-CLd8ycZz.js → index-CkwDvuPt.js} +947 -917
- package/lib/index-CkwDvuPt.js.map +1 -0
- package/lib/{index-LNp6rxyU.js → index-D06ATMgg.js} +2 -2
- package/lib/{index-LNp6rxyU.js.map → index-D06ATMgg.js.map} +1 -1
- package/lib/{index-BlJ2rj99.js → index-DA74gNq3.js} +1124 -974
- package/lib/index-DA74gNq3.js.map +1 -0
- package/lib/index-DJqnphbT.js +35 -0
- package/lib/{index-Bn6Lc9tq.js.map → index-DJqnphbT.js.map} +1 -1
- package/lib/{index-BngPzhKn.js → index-dgcPryXi.js} +3 -3
- package/lib/{index-BngPzhKn.js.map → index-dgcPryXi.js.map} +1 -1
- package/lib/{index-Dolisrci.js → index-g_JJcuFg.js} +603 -549
- package/lib/index-g_JJcuFg.js.map +1 -0
- package/lib/router-Oe6YmY6B.js +3024 -0
- package/lib/router-Oe6YmY6B.js.map +1 -0
- package/lib/state-CsuHT8ZO.js +183 -0
- package/lib/state-CsuHT8ZO.js.map +1 -0
- package/lib/urql-core-KJnLL26g.js +1455 -0
- package/lib/urql-core-KJnLL26g.js.map +1 -0
- package/lib/useExposedProps-Csw8oAlt.js +9 -0
- package/lib/useExposedProps-Csw8oAlt.js.map +1 -0
- package/lib/{utils-ByIc_KIM.js → utils-Chi3p5nE.js} +4 -4
- package/lib/utils-Chi3p5nE.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +363 -350
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +1697 -1623
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +4599 -4319
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +7 -7
- package/lib/zudoku.plugin-custom-pages.js +21 -0
- package/lib/zudoku.plugin-custom-pages.js.map +1 -0
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +8 -8
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/package.json +61 -68
- package/src/app/main.tsx +3 -3
- package/src/lib/components/Banner.tsx +12 -2
- package/src/lib/components/Header.tsx +4 -2
- package/src/lib/components/Layout.tsx +1 -0
- package/src/lib/components/MobileTopNavigation.tsx +4 -0
- package/src/lib/components/Search.tsx +1 -1
- package/src/lib/components/SlotletProvider.tsx +27 -4
- package/src/lib/components/index.ts +1 -1
- package/src/lib/core/DevPortalContext.ts +1 -1
- package/src/lib/oas/graphql/index.ts +3 -11
- package/src/lib/plugins/custom-pages/CustomPage.tsx +15 -0
- package/src/lib/plugins/custom-pages/index.tsx +24 -0
- package/src/lib/plugins/openapi/Endpoint.tsx +1 -1
- package/src/lib/plugins/openapi/OperationList.tsx +1 -1
- package/src/lib/plugins/openapi/Route.tsx +1 -2
- package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
- package/src/lib/plugins/openapi/client/createMemoryClient.ts +1 -6
- package/src/lib/plugins/openapi/client/createWorkerClient.ts +1 -6
- package/src/lib/plugins/openapi/index.tsx +1 -5
- package/src/lib/ui/Callout.tsx +7 -6
- package/src/lib/ui/Drawer.tsx +38 -36
- package/src/lib/util/useExposedProps.tsx +10 -0
- package/dist/lib/plugins/custom-page/index.d.ts +0 -8
- package/dist/lib/plugins/custom-page/index.js +0 -12
- package/dist/lib/plugins/custom-page/index.js.map +0 -1
- package/dist/lib/plugins/openapi/playground/Editor.d.ts +0 -1
- package/dist/lib/plugins/openapi/playground/Editor.js +0 -5
- package/dist/lib/plugins/openapi/playground/Editor.js.map +0 -1
- package/dist/lib/plugins/openapi/util/urql.d.ts +0 -7
- package/dist/lib/plugins/openapi/util/urql.js +0 -8
- package/dist/lib/plugins/openapi/util/urql.js.map +0 -1
- package/lib/CategoryHeading-ovR-zHRq.js +0 -10
- package/lib/CategoryHeading-ovR-zHRq.js.map +0 -1
- package/lib/ErrorPage-CsZAN_za.js +0 -16
- package/lib/Input-CtVUl3eT.js +0 -2198
- package/lib/Input-CtVUl3eT.js.map +0 -1
- package/lib/Markdown-DapSf3wG.js.map +0 -1
- package/lib/OperationList-CYrmxPa8.js.map +0 -1
- package/lib/Route-Q5mqNQrv.js.map +0 -1
- package/lib/SidebarBadge-Dx7jtnoA.js +0 -498
- package/lib/SidebarBadge-Dx7jtnoA.js.map +0 -1
- package/lib/ZudokuContext-cr-pTRY1.js +0 -1084
- package/lib/ZudokuContext-cr-pTRY1.js.map +0 -1
- package/lib/_commonjsHelpers-BkfeUUK-.js +0 -29
- package/lib/_commonjsHelpers-BkfeUUK-.js.map +0 -1
- package/lib/assets/index-B9EWVYfo.js.map +0 -1
- package/lib/assets/worker-Bcj4NA2p.js.map +0 -1
- package/lib/index-BG0g4WW0.js.map +0 -1
- package/lib/index-BlJ2rj99.js.map +0 -1
- package/lib/index-Bn6Lc9tq.js +0 -9
- package/lib/index-CLd8ycZz.js.map +0 -1
- package/lib/index-Dolisrci.js.map +0 -1
- package/lib/router-D2p7Olpn.js +0 -2971
- package/lib/router-D2p7Olpn.js.map +0 -1
- package/lib/state-hNe1dw4B.js +0 -548
- package/lib/state-hNe1dw4B.js.map +0 -1
- package/lib/urql-YhcsXYy8.js +0 -1591
- package/lib/urql-YhcsXYy8.js.map +0 -1
- package/lib/utils-ByIc_KIM.js.map +0 -1
- package/lib/zudoku.plugin-custom-page.js +0 -13
- package/lib/zudoku.plugin-custom-page.js.map +0 -1
- package/src/lib/plugins/custom-page/index.tsx +0 -22
- package/src/lib/plugins/openapi/playground/Editor.tsx +0 -4
- package/src/lib/plugins/openapi/util/urql.ts +0 -8
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
const
|
|
1
|
+
const dt = Symbol.for("yaml.alias"), lt = Symbol.for("yaml.document"), J = Symbol.for("yaml.map"), qt = Symbol.for("yaml.pair"), U = Symbol.for("yaml.scalar"), he = Symbol.for("yaml.seq"), D = Symbol.for("yaml.node.type"), x = (s) => !!s && typeof s == "object" && s[D] === dt, ee = (s) => !!s && typeof s == "object" && s[D] === lt, de = (s) => !!s && typeof s == "object" && s[D] === J, T = (s) => !!s && typeof s == "object" && s[D] === qt, E = (s) => !!s && typeof s == "object" && s[D] === U, pe = (s) => !!s && typeof s == "object" && s[D] === he;
|
|
2
2
|
function L(s) {
|
|
3
3
|
if (s && typeof s == "object")
|
|
4
|
-
switch (s[
|
|
5
|
-
case
|
|
6
|
-
case
|
|
4
|
+
switch (s[D]) {
|
|
5
|
+
case J:
|
|
6
|
+
case he:
|
|
7
7
|
return !0;
|
|
8
8
|
}
|
|
9
9
|
return !1;
|
|
10
10
|
}
|
|
11
11
|
function $(s) {
|
|
12
12
|
if (s && typeof s == "object")
|
|
13
|
-
switch (s[
|
|
14
|
-
case
|
|
15
|
-
case
|
|
16
|
-
case
|
|
17
|
-
case
|
|
13
|
+
switch (s[D]) {
|
|
14
|
+
case dt:
|
|
15
|
+
case J:
|
|
16
|
+
case U:
|
|
17
|
+
case he:
|
|
18
18
|
return !0;
|
|
19
19
|
}
|
|
20
20
|
return !1;
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
function
|
|
24
|
-
const t =
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
const i =
|
|
32
|
-
if ($(i) ||
|
|
33
|
-
return
|
|
22
|
+
const vs = (s) => (E(s) || L(s)) && !!s.anchor, M = Symbol("break visit"), Rt = Symbol("skip children"), R = Symbol("remove node");
|
|
23
|
+
function G(s, e) {
|
|
24
|
+
const t = Ut(e);
|
|
25
|
+
ee(s) ? ie(null, s.contents, t, Object.freeze([s])) === R && (s.contents = null) : ie(null, s, t, Object.freeze([]));
|
|
26
|
+
}
|
|
27
|
+
G.BREAK = M;
|
|
28
|
+
G.SKIP = Rt;
|
|
29
|
+
G.REMOVE = R;
|
|
30
|
+
function ie(s, e, t, n) {
|
|
31
|
+
const i = Ft(s, e, t, n);
|
|
32
|
+
if ($(i) || T(i))
|
|
33
|
+
return Vt(s, n, i), ie(s, i, t, n);
|
|
34
34
|
if (typeof i != "symbol") {
|
|
35
35
|
if (L(e)) {
|
|
36
36
|
n = Object.freeze(n.concat(e));
|
|
37
37
|
for (let r = 0; r < e.items.length; ++r) {
|
|
38
|
-
const o =
|
|
38
|
+
const o = ie(r, e.items[r], t, n);
|
|
39
39
|
if (typeof o == "number")
|
|
40
40
|
r = o - 1;
|
|
41
41
|
else {
|
|
42
42
|
if (o === M)
|
|
43
43
|
return M;
|
|
44
|
-
o ===
|
|
44
|
+
o === R && (e.items.splice(r, 1), r -= 1);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
} else if (
|
|
47
|
+
} else if (T(e)) {
|
|
48
48
|
n = Object.freeze(n.concat(e));
|
|
49
|
-
const r =
|
|
49
|
+
const r = ie("key", e.key, t, n);
|
|
50
50
|
if (r === M)
|
|
51
51
|
return M;
|
|
52
|
-
r ===
|
|
53
|
-
const o =
|
|
52
|
+
r === R && (e.key = null);
|
|
53
|
+
const o = ie("value", e.value, t, n);
|
|
54
54
|
if (o === M)
|
|
55
55
|
return M;
|
|
56
|
-
o ===
|
|
56
|
+
o === R && (e.value = null);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
return i;
|
|
60
60
|
}
|
|
61
|
-
async function
|
|
62
|
-
const t =
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
async function
|
|
69
|
-
const i = await
|
|
70
|
-
if ($(i) ||
|
|
71
|
-
return
|
|
61
|
+
async function Re(s, e) {
|
|
62
|
+
const t = Ut(e);
|
|
63
|
+
ee(s) ? await re(null, s.contents, t, Object.freeze([s])) === R && (s.contents = null) : await re(null, s, t, Object.freeze([]));
|
|
64
|
+
}
|
|
65
|
+
Re.BREAK = M;
|
|
66
|
+
Re.SKIP = Rt;
|
|
67
|
+
Re.REMOVE = R;
|
|
68
|
+
async function re(s, e, t, n) {
|
|
69
|
+
const i = await Ft(s, e, t, n);
|
|
70
|
+
if ($(i) || T(i))
|
|
71
|
+
return Vt(s, n, i), re(s, i, t, n);
|
|
72
72
|
if (typeof i != "symbol") {
|
|
73
73
|
if (L(e)) {
|
|
74
74
|
n = Object.freeze(n.concat(e));
|
|
75
75
|
for (let r = 0; r < e.items.length; ++r) {
|
|
76
|
-
const o = await
|
|
76
|
+
const o = await re(r, e.items[r], t, n);
|
|
77
77
|
if (typeof o == "number")
|
|
78
78
|
r = o - 1;
|
|
79
79
|
else {
|
|
80
80
|
if (o === M)
|
|
81
81
|
return M;
|
|
82
|
-
o ===
|
|
82
|
+
o === R && (e.items.splice(r, 1), r -= 1);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
} else if (
|
|
85
|
+
} else if (T(e)) {
|
|
86
86
|
n = Object.freeze(n.concat(e));
|
|
87
|
-
const r = await
|
|
87
|
+
const r = await re("key", e.key, t, n);
|
|
88
88
|
if (r === M)
|
|
89
89
|
return M;
|
|
90
|
-
r ===
|
|
91
|
-
const o = await
|
|
90
|
+
r === R && (e.key = null);
|
|
91
|
+
const o = await re("value", e.value, t, n);
|
|
92
92
|
if (o === M)
|
|
93
93
|
return M;
|
|
94
|
-
o ===
|
|
94
|
+
o === R && (e.value = null);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
return i;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function Ut(s) {
|
|
100
100
|
return typeof s == "object" && (s.Collection || s.Node || s.Value) ? Object.assign({
|
|
101
101
|
Alias: s.Node,
|
|
102
102
|
Map: s.Node,
|
|
@@ -111,42 +111,42 @@ function qt(s) {
|
|
|
111
111
|
Seq: s.Collection
|
|
112
112
|
}, s) : s;
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function Ft(s, e, t, n) {
|
|
115
115
|
var i, r, o, l, a;
|
|
116
116
|
if (typeof t == "function")
|
|
117
117
|
return t(s, e, n);
|
|
118
|
-
if (he(e))
|
|
119
|
-
return (i = t.Map) == null ? void 0 : i.call(t, s, e, n);
|
|
120
118
|
if (de(e))
|
|
119
|
+
return (i = t.Map) == null ? void 0 : i.call(t, s, e, n);
|
|
120
|
+
if (pe(e))
|
|
121
121
|
return (r = t.Seq) == null ? void 0 : r.call(t, s, e, n);
|
|
122
|
-
if (
|
|
122
|
+
if (T(e))
|
|
123
123
|
return (o = t.Pair) == null ? void 0 : o.call(t, s, e, n);
|
|
124
124
|
if (E(e))
|
|
125
125
|
return (l = t.Scalar) == null ? void 0 : l.call(t, s, e, n);
|
|
126
|
-
if (
|
|
126
|
+
if (x(e))
|
|
127
127
|
return (a = t.Alias) == null ? void 0 : a.call(t, s, e, n);
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function Vt(s, e, t) {
|
|
130
130
|
const n = e[e.length - 1];
|
|
131
131
|
if (L(n))
|
|
132
132
|
n.items[s] = t;
|
|
133
|
-
else if (
|
|
133
|
+
else if (T(n))
|
|
134
134
|
s === "key" ? n.key = t : n.value = t;
|
|
135
|
-
else if (
|
|
135
|
+
else if (ee(n))
|
|
136
136
|
n.contents = t;
|
|
137
137
|
else {
|
|
138
|
-
const i =
|
|
138
|
+
const i = x(n) ? "alias" : "scalar";
|
|
139
139
|
throw new Error(`Cannot replace node with ${i} parent`);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
const
|
|
142
|
+
const Bs = {
|
|
143
143
|
"!": "%21",
|
|
144
144
|
",": "%2C",
|
|
145
145
|
"[": "%5B",
|
|
146
146
|
"]": "%5D",
|
|
147
147
|
"{": "%7B",
|
|
148
148
|
"}": "%7D"
|
|
149
|
-
},
|
|
149
|
+
}, Ms = (s) => s.replace(/[!,[\]{}]/g, (e) => Bs[e]);
|
|
150
150
|
class B {
|
|
151
151
|
constructor(e, t) {
|
|
152
152
|
this.docStart = null, this.docEnd = !1, this.yaml = Object.assign({}, B.defaultYaml, e), this.tags = Object.assign({}, B.defaultTags, t);
|
|
@@ -236,7 +236,7 @@ class B {
|
|
|
236
236
|
tagString(e) {
|
|
237
237
|
for (const [t, n] of Object.entries(this.tags))
|
|
238
238
|
if (e.startsWith(n))
|
|
239
|
-
return t +
|
|
239
|
+
return t + Ms(e.substring(n.length));
|
|
240
240
|
return e[0] === "!" ? e : `!<${e}>`;
|
|
241
241
|
}
|
|
242
242
|
toString(e) {
|
|
@@ -244,7 +244,7 @@ class B {
|
|
|
244
244
|
let i;
|
|
245
245
|
if (e && n.length > 0 && $(e.contents)) {
|
|
246
246
|
const r = {};
|
|
247
|
-
|
|
247
|
+
G(e.contents, (o, l) => {
|
|
248
248
|
$(l) && l.tag && (r[l.tag] = !0);
|
|
249
249
|
}), i = Object.keys(r);
|
|
250
250
|
} else
|
|
@@ -257,35 +257,35 @@ class B {
|
|
|
257
257
|
}
|
|
258
258
|
B.defaultYaml = { explicit: !1, version: "1.2" };
|
|
259
259
|
B.defaultTags = { "!!": "tag:yaml.org,2002:" };
|
|
260
|
-
function
|
|
260
|
+
function Yt(s) {
|
|
261
261
|
if (/[\x00-\x19\s,[\]{}]/.test(s)) {
|
|
262
262
|
const t = `Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;
|
|
263
263
|
throw new Error(t);
|
|
264
264
|
}
|
|
265
265
|
return !0;
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function Jt(s) {
|
|
268
268
|
const e = /* @__PURE__ */ new Set();
|
|
269
|
-
return
|
|
269
|
+
return G(s, {
|
|
270
270
|
Value(t, n) {
|
|
271
271
|
n.anchor && e.add(n.anchor);
|
|
272
272
|
}
|
|
273
273
|
}), e;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function Gt(s, e) {
|
|
276
276
|
for (let t = 1; ; ++t) {
|
|
277
277
|
const n = `${s}${t}`;
|
|
278
278
|
if (!e.has(n))
|
|
279
279
|
return n;
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function Ks(s, e) {
|
|
283
283
|
const t = [], n = /* @__PURE__ */ new Map();
|
|
284
284
|
let i = null;
|
|
285
285
|
return {
|
|
286
286
|
onAnchor: (r) => {
|
|
287
|
-
t.push(r), i || (i =
|
|
288
|
-
const o =
|
|
287
|
+
t.push(r), i || (i = Jt(s));
|
|
288
|
+
const o = Gt(e, i);
|
|
289
289
|
return i.add(o), o;
|
|
290
290
|
},
|
|
291
291
|
/**
|
|
@@ -307,35 +307,35 @@ function vs(s, e) {
|
|
|
307
307
|
sourceObjects: n
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function oe(s, e, t, n) {
|
|
311
311
|
if (n && typeof n == "object")
|
|
312
312
|
if (Array.isArray(n))
|
|
313
313
|
for (let i = 0, r = n.length; i < r; ++i) {
|
|
314
|
-
const o = n[i], l =
|
|
314
|
+
const o = n[i], l = oe(s, n, String(i), o);
|
|
315
315
|
l === void 0 ? delete n[i] : l !== o && (n[i] = l);
|
|
316
316
|
}
|
|
317
317
|
else if (n instanceof Map)
|
|
318
318
|
for (const i of Array.from(n.keys())) {
|
|
319
|
-
const r = n.get(i), o =
|
|
319
|
+
const r = n.get(i), o = oe(s, n, i, r);
|
|
320
320
|
o === void 0 ? n.delete(i) : o !== r && n.set(i, o);
|
|
321
321
|
}
|
|
322
322
|
else if (n instanceof Set)
|
|
323
323
|
for (const i of Array.from(n)) {
|
|
324
|
-
const r =
|
|
324
|
+
const r = oe(s, n, i, i);
|
|
325
325
|
r === void 0 ? n.delete(i) : r !== i && (n.delete(i), n.add(r));
|
|
326
326
|
}
|
|
327
327
|
else
|
|
328
328
|
for (const [i, r] of Object.entries(n)) {
|
|
329
|
-
const o =
|
|
329
|
+
const o = oe(s, n, i, r);
|
|
330
330
|
o === void 0 ? delete n[i] : o !== r && (n[i] = o);
|
|
331
331
|
}
|
|
332
332
|
return s.call(e, t, n);
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function P(s, e, t) {
|
|
335
335
|
if (Array.isArray(s))
|
|
336
|
-
return s.map((n, i) =>
|
|
336
|
+
return s.map((n, i) => P(n, String(i), t));
|
|
337
337
|
if (s && typeof s.toJSON == "function") {
|
|
338
|
-
if (!t ||
|
|
338
|
+
if (!t || !vs(s))
|
|
339
339
|
return s.toJSON(e, t);
|
|
340
340
|
const n = { aliasCount: 0, count: 1, res: void 0 };
|
|
341
341
|
t.anchors.set(s, n), t.onCreate = (r) => {
|
|
@@ -346,9 +346,9 @@ function D(s, e, t) {
|
|
|
346
346
|
}
|
|
347
347
|
return typeof s == "bigint" && !(t != null && t.keep) ? Number(s) : s;
|
|
348
348
|
}
|
|
349
|
-
class
|
|
349
|
+
class pt {
|
|
350
350
|
constructor(e) {
|
|
351
|
-
Object.defineProperty(this,
|
|
351
|
+
Object.defineProperty(this, D, { value: e });
|
|
352
352
|
}
|
|
353
353
|
/** Create a copy of this node. */
|
|
354
354
|
clone() {
|
|
@@ -357,7 +357,7 @@ class ht {
|
|
|
357
357
|
}
|
|
358
358
|
/** A plain JavaScript representation of this node. */
|
|
359
359
|
toJS(e, { mapAsMap: t, maxAliasCount: n, onAnchor: i, reviver: r } = {}) {
|
|
360
|
-
if (!
|
|
360
|
+
if (!ee(e))
|
|
361
361
|
throw new TypeError("A document argument is required");
|
|
362
362
|
const o = {
|
|
363
363
|
anchors: /* @__PURE__ */ new Map(),
|
|
@@ -366,16 +366,16 @@ class ht {
|
|
|
366
366
|
mapAsMap: t === !0,
|
|
367
367
|
mapKeyWarned: !1,
|
|
368
368
|
maxAliasCount: typeof n == "number" ? n : 100
|
|
369
|
-
}, l =
|
|
369
|
+
}, l = P(this, "", o);
|
|
370
370
|
if (typeof i == "function")
|
|
371
371
|
for (const { count: a, res: c } of o.anchors.values())
|
|
372
372
|
i(c, a);
|
|
373
|
-
return typeof r == "function" ?
|
|
373
|
+
return typeof r == "function" ? oe(r, { "": l }, "", l) : l;
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
-
class
|
|
376
|
+
class Ue extends pt {
|
|
377
377
|
constructor(e) {
|
|
378
|
-
super(
|
|
378
|
+
super(dt), this.source = e, Object.defineProperty(this, "tag", {
|
|
379
379
|
set() {
|
|
380
380
|
throw new Error("Alias nodes cannot have tags");
|
|
381
381
|
}
|
|
@@ -387,10 +387,10 @@ class qe extends ht {
|
|
|
387
387
|
*/
|
|
388
388
|
resolve(e) {
|
|
389
389
|
let t;
|
|
390
|
-
return
|
|
390
|
+
return G(e, {
|
|
391
391
|
Node: (n, i) => {
|
|
392
392
|
if (i === this)
|
|
393
|
-
return
|
|
393
|
+
return G.BREAK;
|
|
394
394
|
i.anchor === this.source && (t = i);
|
|
395
395
|
}
|
|
396
396
|
}), t;
|
|
@@ -404,11 +404,11 @@ class qe extends ht {
|
|
|
404
404
|
throw new ReferenceError(a);
|
|
405
405
|
}
|
|
406
406
|
let l = n.get(o);
|
|
407
|
-
if (l || (
|
|
407
|
+
if (l || (P(o, null, t), l = n.get(o)), !l || l.res === void 0) {
|
|
408
408
|
const a = "This should not happen: Alias anchor was not resolved?";
|
|
409
409
|
throw new ReferenceError(a);
|
|
410
410
|
}
|
|
411
|
-
if (r >= 0 && (l.count += 1, l.aliasCount === 0 && (l.aliasCount =
|
|
411
|
+
if (r >= 0 && (l.count += 1, l.aliasCount === 0 && (l.aliasCount = ve(i, o, n)), l.count * l.aliasCount > r)) {
|
|
412
412
|
const a = "Excessive alias count indicates a resource exhaustion attack";
|
|
413
413
|
throw new ReferenceError(a);
|
|
414
414
|
}
|
|
@@ -417,7 +417,7 @@ class qe extends ht {
|
|
|
417
417
|
toString(e, t, n) {
|
|
418
418
|
const i = `*${this.source}`;
|
|
419
419
|
if (e) {
|
|
420
|
-
if (
|
|
420
|
+
if (Yt(this.source), e.options.verifyAliasOrder && !e.anchors.has(this.source)) {
|
|
421
421
|
const r = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
422
422
|
throw new Error(r);
|
|
423
423
|
}
|
|
@@ -427,30 +427,30 @@ class qe extends ht {
|
|
|
427
427
|
return i;
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
if (
|
|
430
|
+
function ve(s, e, t) {
|
|
431
|
+
if (x(e)) {
|
|
432
432
|
const n = e.resolve(s), i = t && n && t.get(n);
|
|
433
433
|
return i ? i.count * i.aliasCount : 0;
|
|
434
434
|
} else if (L(e)) {
|
|
435
435
|
let n = 0;
|
|
436
436
|
for (const i of e.items) {
|
|
437
|
-
const r =
|
|
437
|
+
const r = ve(s, i, t);
|
|
438
438
|
r > n && (n = r);
|
|
439
439
|
}
|
|
440
440
|
return n;
|
|
441
|
-
} else if (
|
|
442
|
-
const n =
|
|
441
|
+
} else if (T(e)) {
|
|
442
|
+
const n = ve(s, e.key, t), i = ve(s, e.value, t);
|
|
443
443
|
return Math.max(n, i);
|
|
444
444
|
}
|
|
445
445
|
return 1;
|
|
446
446
|
}
|
|
447
|
-
const
|
|
448
|
-
class O extends
|
|
447
|
+
const Qt = (s) => !s || typeof s != "function" && typeof s != "object";
|
|
448
|
+
class O extends pt {
|
|
449
449
|
constructor(e) {
|
|
450
|
-
super(
|
|
450
|
+
super(U), this.value = e;
|
|
451
451
|
}
|
|
452
452
|
toJSON(e, t) {
|
|
453
|
-
return t != null && t.keep ? this.value :
|
|
453
|
+
return t != null && t.keep ? this.value : P(this.value, e, t);
|
|
454
454
|
}
|
|
455
455
|
toString() {
|
|
456
456
|
return String(this.value);
|
|
@@ -461,8 +461,8 @@ O.BLOCK_LITERAL = "BLOCK_LITERAL";
|
|
|
461
461
|
O.PLAIN = "PLAIN";
|
|
462
462
|
O.QUOTE_DOUBLE = "QUOTE_DOUBLE";
|
|
463
463
|
O.QUOTE_SINGLE = "QUOTE_SINGLE";
|
|
464
|
-
const
|
|
465
|
-
function
|
|
464
|
+
const Ps = "tag:yaml.org,2002:";
|
|
465
|
+
function Ds(s, e, t) {
|
|
466
466
|
if (e) {
|
|
467
467
|
const n = t.filter((r) => r.tag === e), i = n.find((r) => !r.format) ?? n[0];
|
|
468
468
|
if (!i)
|
|
@@ -474,12 +474,12 @@ function Ms(s, e, t) {
|
|
|
474
474
|
return ((i = n.identify) == null ? void 0 : i.call(n, s)) && !n.format;
|
|
475
475
|
});
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function ke(s, e, t) {
|
|
478
478
|
var f, d, h;
|
|
479
|
-
if (
|
|
479
|
+
if (ee(s) && (s = s.contents), $(s))
|
|
480
480
|
return s;
|
|
481
|
-
if (
|
|
482
|
-
const y = (d = (f = t.schema[
|
|
481
|
+
if (T(s)) {
|
|
482
|
+
const y = (d = (f = t.schema[J]).createNode) == null ? void 0 : d.call(f, t.schema, null, t);
|
|
483
483
|
return y.items.push(s), y;
|
|
484
484
|
}
|
|
485
485
|
(s instanceof String || s instanceof Number || s instanceof Boolean || typeof BigInt < "u" && s instanceof BigInt) && (s = s.valueOf());
|
|
@@ -487,23 +487,23 @@ function Se(s, e, t) {
|
|
|
487
487
|
let a;
|
|
488
488
|
if (n && s && typeof s == "object") {
|
|
489
489
|
if (a = l.get(s), a)
|
|
490
|
-
return a.anchor || (a.anchor = i(s)), new
|
|
490
|
+
return a.anchor || (a.anchor = i(s)), new Ue(a.anchor);
|
|
491
491
|
a = { anchor: null, node: null }, l.set(s, a);
|
|
492
492
|
}
|
|
493
|
-
e != null && e.startsWith("!!") && (e =
|
|
494
|
-
let c =
|
|
493
|
+
e != null && e.startsWith("!!") && (e = Ps + e.slice(2));
|
|
494
|
+
let c = Ds(s, e, o.tags);
|
|
495
495
|
if (!c) {
|
|
496
496
|
if (s && typeof s.toJSON == "function" && (s = s.toJSON()), !s || typeof s != "object") {
|
|
497
497
|
const y = new O(s);
|
|
498
498
|
return a && (a.node = y), y;
|
|
499
499
|
}
|
|
500
|
-
c = s instanceof Map ? o[
|
|
500
|
+
c = s instanceof Map ? o[J] : Symbol.iterator in Object(s) ? o[he] : o[J];
|
|
501
501
|
}
|
|
502
502
|
r && (r(c), delete t.onTagObj);
|
|
503
|
-
const
|
|
504
|
-
return e ?
|
|
503
|
+
const p = c != null && c.createNode ? c.createNode(t.schema, s, t) : typeof ((h = c == null ? void 0 : c.nodeClass) == null ? void 0 : h.from) == "function" ? c.nodeClass.from(t.schema, s, t) : new O(s);
|
|
504
|
+
return e ? p.tag = e : c.default || (p.tag = c.tag), a && (a.node = p), p;
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function Pe(s, e, t) {
|
|
507
507
|
let n = t;
|
|
508
508
|
for (let i = e.length - 1; i >= 0; --i) {
|
|
509
509
|
const r = e[i];
|
|
@@ -513,7 +513,7 @@ function Me(s, e, t) {
|
|
|
513
513
|
} else
|
|
514
514
|
n = /* @__PURE__ */ new Map([[r, n]]);
|
|
515
515
|
}
|
|
516
|
-
return
|
|
516
|
+
return ke(n, void 0, {
|
|
517
517
|
aliasDuplicateObjects: !1,
|
|
518
518
|
keepUndefined: !1,
|
|
519
519
|
onAnchor: () => {
|
|
@@ -523,8 +523,8 @@ function Me(s, e, t) {
|
|
|
523
523
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
524
524
|
});
|
|
525
525
|
}
|
|
526
|
-
const
|
|
527
|
-
class
|
|
526
|
+
const we = (s) => s == null || typeof s == "object" && !!s[Symbol.iterator]().next().done;
|
|
527
|
+
class Wt extends pt {
|
|
528
528
|
constructor(e, t) {
|
|
529
529
|
super(e), Object.defineProperty(this, "schema", {
|
|
530
530
|
value: t,
|
|
@@ -540,7 +540,7 @@ class Gt extends ht {
|
|
|
540
540
|
*/
|
|
541
541
|
clone(e) {
|
|
542
542
|
const t = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
543
|
-
return e && (t.schema = e), t.items = t.items.map((n) => $(n) ||
|
|
543
|
+
return e && (t.schema = e), t.items = t.items.map((n) => $(n) || T(n) ? n.clone(e) : n), this.range && (t.range = this.range.slice()), t;
|
|
544
544
|
}
|
|
545
545
|
/**
|
|
546
546
|
* Adds a value to the collection. For `!!map` and `!!omap` the value must
|
|
@@ -548,14 +548,14 @@ class Gt extends ht {
|
|
|
548
548
|
* that already exists in the map.
|
|
549
549
|
*/
|
|
550
550
|
addIn(e, t) {
|
|
551
|
-
if (
|
|
551
|
+
if (we(e))
|
|
552
552
|
this.add(t);
|
|
553
553
|
else {
|
|
554
554
|
const [n, ...i] = e, r = this.get(n, !0);
|
|
555
555
|
if (L(r))
|
|
556
556
|
r.addIn(i, t);
|
|
557
557
|
else if (r === void 0 && this.schema)
|
|
558
|
-
this.set(n,
|
|
558
|
+
this.set(n, Pe(this.schema, i, t));
|
|
559
559
|
else
|
|
560
560
|
throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`);
|
|
561
561
|
}
|
|
@@ -584,7 +584,7 @@ class Gt extends ht {
|
|
|
584
584
|
}
|
|
585
585
|
hasAllNullValues(e) {
|
|
586
586
|
return this.items.every((t) => {
|
|
587
|
-
if (!
|
|
587
|
+
if (!T(t))
|
|
588
588
|
return !1;
|
|
589
589
|
const n = t.value;
|
|
590
590
|
return n == null || e && E(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag;
|
|
@@ -613,35 +613,35 @@ class Gt extends ht {
|
|
|
613
613
|
if (L(r))
|
|
614
614
|
r.setIn(i, t);
|
|
615
615
|
else if (r === void 0 && this.schema)
|
|
616
|
-
this.set(n,
|
|
616
|
+
this.set(n, Pe(this.schema, i, t));
|
|
617
617
|
else
|
|
618
618
|
throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`);
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
|
-
const
|
|
622
|
+
const js = (s) => s.replace(/^(?!$)(?: $)?/gm, "#");
|
|
623
623
|
function F(s, e) {
|
|
624
624
|
return /^\n+$/.test(s) ? s.substring(1) : e ? s.replace(/^(?! *$)/gm, e) : s;
|
|
625
625
|
}
|
|
626
|
-
const
|
|
626
|
+
const H = (s, e, t) => s.endsWith(`
|
|
627
627
|
`) ? F(t, e) : t.includes(`
|
|
628
628
|
`) ? `
|
|
629
|
-
` + F(t, e) : (s.endsWith(" ") ? "" : " ") + t,
|
|
630
|
-
function
|
|
629
|
+
` + F(t, e) : (s.endsWith(" ") ? "" : " ") + t, Ht = "flow", at = "block", Be = "quoted";
|
|
630
|
+
function Fe(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentWidth: r = 20, onFold: o, onOverflow: l } = {}) {
|
|
631
631
|
if (!i || i < 0)
|
|
632
632
|
return s;
|
|
633
633
|
i < r && (r = 0);
|
|
634
634
|
const a = Math.max(1 + r, 1 + i - e.length);
|
|
635
635
|
if (s.length <= a)
|
|
636
636
|
return s;
|
|
637
|
-
const c = [],
|
|
637
|
+
const c = [], p = {};
|
|
638
638
|
let f = i - e.length;
|
|
639
639
|
typeof n == "number" && (n > i - Math.max(2, r) ? c.push(0) : f = i - n);
|
|
640
|
-
let d, h, y = !1, u = -1,
|
|
641
|
-
t ===
|
|
640
|
+
let d, h, y = !1, u = -1, m = -1, b = -1;
|
|
641
|
+
t === at && (u = $t(s, u, e.length), u !== -1 && (f = u + a));
|
|
642
642
|
for (let N; N = s[u += 1]; ) {
|
|
643
|
-
if (t ===
|
|
644
|
-
switch (
|
|
643
|
+
if (t === Be && N === "\\") {
|
|
644
|
+
switch (m = u, s[u + 1]) {
|
|
645
645
|
case "x":
|
|
646
646
|
u += 3;
|
|
647
647
|
break;
|
|
@@ -654,11 +654,11 @@ function Ue(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
654
654
|
default:
|
|
655
655
|
u += 1;
|
|
656
656
|
}
|
|
657
|
-
|
|
657
|
+
b = u;
|
|
658
658
|
}
|
|
659
659
|
if (N === `
|
|
660
660
|
`)
|
|
661
|
-
t ===
|
|
661
|
+
t === at && (u = $t(s, u, e.length)), f = u + e.length + a, d = void 0;
|
|
662
662
|
else {
|
|
663
663
|
if (N === " " && h && h !== " " && h !== `
|
|
664
664
|
` && h !== " ") {
|
|
@@ -669,13 +669,13 @@ function Ue(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
669
669
|
if (u >= f)
|
|
670
670
|
if (d)
|
|
671
671
|
c.push(d), f = d + a, d = void 0;
|
|
672
|
-
else if (t ===
|
|
672
|
+
else if (t === Be) {
|
|
673
673
|
for (; h === " " || h === " "; )
|
|
674
674
|
h = N, N = s[u += 1], y = !0;
|
|
675
|
-
const S = u >
|
|
676
|
-
if (
|
|
675
|
+
const S = u > b + 1 ? u - 2 : m - 1;
|
|
676
|
+
if (p[S])
|
|
677
677
|
return s;
|
|
678
|
-
c.push(S),
|
|
678
|
+
c.push(S), p[S] = !0, f = S + a, d = void 0;
|
|
679
679
|
} else
|
|
680
680
|
y = !0;
|
|
681
681
|
}
|
|
@@ -688,12 +688,12 @@ function Ue(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
688
688
|
for (let N = 0; N < c.length; ++N) {
|
|
689
689
|
const S = c[N], A = c[N + 1] || s.length;
|
|
690
690
|
S === 0 ? w = `
|
|
691
|
-
${e}${s.slice(0, A)}` : (t ===
|
|
691
|
+
${e}${s.slice(0, A)}` : (t === Be && p[S] && (w += `${s[S]}\\`), w += `
|
|
692
692
|
${e}${s.slice(S + 1, A)}`);
|
|
693
693
|
}
|
|
694
694
|
return w;
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function $t(s, e, t) {
|
|
697
697
|
let n = e, i = e + 1, r = s[i];
|
|
698
698
|
for (; r === " " || r === " "; )
|
|
699
699
|
if (e < i + t)
|
|
@@ -707,12 +707,12 @@ function It(s, e, t) {
|
|
|
707
707
|
}
|
|
708
708
|
return n;
|
|
709
709
|
}
|
|
710
|
-
const
|
|
710
|
+
const Ve = (s, e) => ({
|
|
711
711
|
indentAtStart: e ? s.indent.length : s.indentAtStart,
|
|
712
712
|
lineWidth: s.options.lineWidth,
|
|
713
713
|
minContentWidth: s.options.minContentWidth
|
|
714
|
-
}),
|
|
715
|
-
function
|
|
714
|
+
}), Ye = (s) => /^(%|---|\.\.\.)/m.test(s);
|
|
715
|
+
function qs(s, e, t) {
|
|
716
716
|
if (!e || e < 0)
|
|
717
717
|
return !1;
|
|
718
718
|
const n = e - t, i = s.length;
|
|
@@ -728,11 +728,11 @@ function Ds(s, e, t) {
|
|
|
728
728
|
}
|
|
729
729
|
return !0;
|
|
730
730
|
}
|
|
731
|
-
function
|
|
731
|
+
function Se(s, e) {
|
|
732
732
|
const t = JSON.stringify(s);
|
|
733
733
|
if (e.options.doubleQuotedAsJSON)
|
|
734
734
|
return t;
|
|
735
|
-
const { implicitKey: n } = e, i = e.options.doubleQuotedMinMultiLineLength, r = e.indent || (
|
|
735
|
+
const { implicitKey: n } = e, i = e.options.doubleQuotedMinMultiLineLength, r = e.indent || (Ye(s) ? " " : "");
|
|
736
736
|
let o = "", l = 0;
|
|
737
737
|
for (let a = 0, c = t[a]; c; c = t[++a])
|
|
738
738
|
if (c === " " && t[a + 1] === "\\" && t[a + 2] === "n" && (o += t.slice(l, a) + "\\ ", a += 1, l = a, c = "\\"), c === "\\")
|
|
@@ -740,8 +740,8 @@ function we(s, e) {
|
|
|
740
740
|
case "u":
|
|
741
741
|
{
|
|
742
742
|
o += t.slice(l, a);
|
|
743
|
-
const
|
|
744
|
-
switch (
|
|
743
|
+
const p = t.substr(a + 2, 4);
|
|
744
|
+
switch (p) {
|
|
745
745
|
case "0000":
|
|
746
746
|
o += "\\0";
|
|
747
747
|
break;
|
|
@@ -767,7 +767,7 @@ function we(s, e) {
|
|
|
767
767
|
o += "\\P";
|
|
768
768
|
break;
|
|
769
769
|
default:
|
|
770
|
-
|
|
770
|
+
p.substr(0, 2) === "00" ? o += "\\x" + p.substr(2) : o += t.substr(a, 6);
|
|
771
771
|
}
|
|
772
772
|
a += 5, l = a + 1;
|
|
773
773
|
}
|
|
@@ -787,43 +787,43 @@ function we(s, e) {
|
|
|
787
787
|
default:
|
|
788
788
|
a += 1;
|
|
789
789
|
}
|
|
790
|
-
return o = l ? o + t.slice(l) : t, n ? o :
|
|
790
|
+
return o = l ? o + t.slice(l) : t, n ? o : Fe(o, r, Be, Ve(e, !1));
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function ct(s, e) {
|
|
793
793
|
if (e.options.singleQuote === !1 || e.implicitKey && s.includes(`
|
|
794
794
|
`) || /[ \t]\n|\n[ \t]/.test(s))
|
|
795
|
-
return
|
|
796
|
-
const t = e.indent || (
|
|
795
|
+
return Se(s, e);
|
|
796
|
+
const t = e.indent || (Ye(s) ? " " : ""), n = "'" + s.replace(/'/g, "''").replace(/\n+/g, `$&
|
|
797
797
|
${t}`) + "'";
|
|
798
|
-
return e.implicitKey ? n :
|
|
798
|
+
return e.implicitKey ? n : Fe(n, t, Ht, Ve(e, !1));
|
|
799
799
|
}
|
|
800
|
-
function
|
|
800
|
+
function le(s, e) {
|
|
801
801
|
const { singleQuote: t } = e.options;
|
|
802
802
|
let n;
|
|
803
803
|
if (t === !1)
|
|
804
|
-
n =
|
|
804
|
+
n = Se;
|
|
805
805
|
else {
|
|
806
806
|
const i = s.includes('"'), r = s.includes("'");
|
|
807
|
-
i && !r ? n =
|
|
807
|
+
i && !r ? n = ct : r && !i ? n = Se : n = t ? ct : Se;
|
|
808
808
|
}
|
|
809
809
|
return n(s, e);
|
|
810
810
|
}
|
|
811
|
-
let
|
|
811
|
+
let ft;
|
|
812
812
|
try {
|
|
813
|
-
|
|
813
|
+
ft = new RegExp(`(^|(?<!
|
|
814
814
|
))
|
|
815
815
|
+(?!
|
|
816
816
|
|$)`, "g");
|
|
817
817
|
} catch {
|
|
818
|
-
|
|
818
|
+
ft = /\n+(?!\n|$)/g;
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function Me({ comment: s, type: e, value: t }, n, i, r) {
|
|
821
821
|
const { blockQuote: o, commentString: l, lineWidth: a } = n.options;
|
|
822
822
|
if (!o || /\n[\t ]+$/.test(t) || /^\s*$/.test(t))
|
|
823
|
-
return
|
|
824
|
-
const c = n.indent || (n.forceBlockIndent ||
|
|
823
|
+
return le(t, n);
|
|
824
|
+
const c = n.indent || (n.forceBlockIndent || Ye(t) ? " " : ""), p = o === "literal" ? !0 : o === "folded" || e === O.BLOCK_FOLDED ? !1 : e === O.BLOCK_LITERAL ? !0 : !qs(t, a, c.length);
|
|
825
825
|
if (!t)
|
|
826
|
-
return
|
|
826
|
+
return p ? `|
|
|
827
827
|
` : `>
|
|
828
828
|
`;
|
|
829
829
|
let f, d;
|
|
@@ -837,90 +837,90 @@ function ve({ comment: s, type: e, value: t }, n, i, r) {
|
|
|
837
837
|
const y = h.indexOf(`
|
|
838
838
|
`);
|
|
839
839
|
y === -1 ? f = "-" : t === h || y !== h.length - 1 ? (f = "+", r && r()) : f = "", h && (t = t.slice(0, -h.length), h[h.length - 1] === `
|
|
840
|
-
` && (h = h.slice(0, -1)), h = h.replace(
|
|
841
|
-
let u = !1,
|
|
842
|
-
for (
|
|
843
|
-
const k = t[
|
|
840
|
+
` && (h = h.slice(0, -1)), h = h.replace(ft, `$&${c}`));
|
|
841
|
+
let u = !1, m, b = -1;
|
|
842
|
+
for (m = 0; m < t.length; ++m) {
|
|
843
|
+
const k = t[m];
|
|
844
844
|
if (k === " ")
|
|
845
845
|
u = !0;
|
|
846
846
|
else if (k === `
|
|
847
847
|
`)
|
|
848
|
-
|
|
848
|
+
b = m;
|
|
849
849
|
else
|
|
850
850
|
break;
|
|
851
851
|
}
|
|
852
|
-
let w = t.substring(0,
|
|
852
|
+
let w = t.substring(0, b < m ? b + 1 : m);
|
|
853
853
|
w && (t = t.substring(w.length), w = w.replace(/\n+/g, `$&${c}`));
|
|
854
|
-
let S = (
|
|
855
|
-
if (s && (S += " " + l(s.replace(/ ?[\r\n]+/g, " ")), i && i()),
|
|
854
|
+
let S = (p ? "|" : ">") + (u ? c ? "2" : "1" : "") + f;
|
|
855
|
+
if (s && (S += " " + l(s.replace(/ ?[\r\n]+/g, " ")), i && i()), p)
|
|
856
856
|
return t = t.replace(/\n+/g, `$&${c}`), `${S}
|
|
857
857
|
${c}${w}${t}${h}`;
|
|
858
858
|
t = t.replace(/\n+/g, `
|
|
859
859
|
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${c}`);
|
|
860
|
-
const A =
|
|
860
|
+
const A = Fe(`${w}${t}${h}`, c, at, Ve(n, !0));
|
|
861
861
|
return `${S}
|
|
862
862
|
${c}${A}`;
|
|
863
863
|
}
|
|
864
|
-
function
|
|
865
|
-
const { type: i, value: r } = s, { actualString: o, implicitKey: l, indent: a, indentStep: c, inFlow:
|
|
864
|
+
function Rs(s, e, t, n) {
|
|
865
|
+
const { type: i, value: r } = s, { actualString: o, implicitKey: l, indent: a, indentStep: c, inFlow: p } = e;
|
|
866
866
|
if (l && r.includes(`
|
|
867
|
-
`) ||
|
|
868
|
-
return
|
|
867
|
+
`) || p && /[[\]{},]/.test(r))
|
|
868
|
+
return le(r, e);
|
|
869
869
|
if (!r || /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))
|
|
870
|
-
return l ||
|
|
871
|
-
`) ?
|
|
872
|
-
if (!l && !
|
|
870
|
+
return l || p || !r.includes(`
|
|
871
|
+
`) ? le(r, e) : Me(s, e, t, n);
|
|
872
|
+
if (!l && !p && i !== O.PLAIN && r.includes(`
|
|
873
873
|
`))
|
|
874
|
-
return
|
|
875
|
-
if (
|
|
874
|
+
return Me(s, e, t, n);
|
|
875
|
+
if (Ye(r)) {
|
|
876
876
|
if (a === "")
|
|
877
|
-
return e.forceBlockIndent = !0,
|
|
877
|
+
return e.forceBlockIndent = !0, Me(s, e, t, n);
|
|
878
878
|
if (l && a === c)
|
|
879
|
-
return
|
|
879
|
+
return le(r, e);
|
|
880
880
|
}
|
|
881
881
|
const f = r.replace(/\n+/g, `$&
|
|
882
882
|
${a}`);
|
|
883
883
|
if (o) {
|
|
884
884
|
const d = (u) => {
|
|
885
|
-
var
|
|
886
|
-
return u.default && u.tag !== "tag:yaml.org,2002:str" && ((
|
|
885
|
+
var m;
|
|
886
|
+
return u.default && u.tag !== "tag:yaml.org,2002:str" && ((m = u.test) == null ? void 0 : m.test(f));
|
|
887
887
|
}, { compat: h, tags: y } = e.doc.schema;
|
|
888
888
|
if (y.some(d) || h != null && h.some(d))
|
|
889
|
-
return
|
|
889
|
+
return le(r, e);
|
|
890
890
|
}
|
|
891
|
-
return l ? f :
|
|
891
|
+
return l ? f : Fe(f, a, Ht, Ve(e, !1));
|
|
892
892
|
}
|
|
893
|
-
function
|
|
893
|
+
function Ae(s, e, t, n) {
|
|
894
894
|
const { implicitKey: i, inFlow: r } = e, o = typeof s.value == "string" ? s : Object.assign({}, s, { value: String(s.value) });
|
|
895
895
|
let { type: l } = s;
|
|
896
896
|
l !== O.QUOTE_DOUBLE && /[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value) && (l = O.QUOTE_DOUBLE);
|
|
897
|
-
const a = (
|
|
898
|
-
switch (
|
|
897
|
+
const a = (p) => {
|
|
898
|
+
switch (p) {
|
|
899
899
|
case O.BLOCK_FOLDED:
|
|
900
900
|
case O.BLOCK_LITERAL:
|
|
901
|
-
return i || r ?
|
|
901
|
+
return i || r ? le(o.value, e) : Me(o, e, t, n);
|
|
902
902
|
case O.QUOTE_DOUBLE:
|
|
903
|
-
return
|
|
903
|
+
return Se(o.value, e);
|
|
904
904
|
case O.QUOTE_SINGLE:
|
|
905
|
-
return
|
|
905
|
+
return ct(o.value, e);
|
|
906
906
|
case O.PLAIN:
|
|
907
|
-
return
|
|
907
|
+
return Rs(o, e, t, n);
|
|
908
908
|
default:
|
|
909
909
|
return null;
|
|
910
910
|
}
|
|
911
911
|
};
|
|
912
912
|
let c = a(l);
|
|
913
913
|
if (c === null) {
|
|
914
|
-
const { defaultKeyType:
|
|
914
|
+
const { defaultKeyType: p, defaultStringType: f } = e.options, d = i && p || f;
|
|
915
915
|
if (c = a(d), c === null)
|
|
916
916
|
throw new Error(`Unsupported default string type ${d}`);
|
|
917
917
|
}
|
|
918
918
|
return c;
|
|
919
919
|
}
|
|
920
|
-
function
|
|
920
|
+
function Xt(s, e) {
|
|
921
921
|
const t = Object.assign({
|
|
922
922
|
blockQuote: !0,
|
|
923
|
-
commentString:
|
|
923
|
+
commentString: js,
|
|
924
924
|
defaultKeyType: null,
|
|
925
925
|
defaultStringType: "PLAIN",
|
|
926
926
|
directives: null,
|
|
@@ -958,7 +958,7 @@ function Wt(s, e) {
|
|
|
958
958
|
options: t
|
|
959
959
|
};
|
|
960
960
|
}
|
|
961
|
-
function
|
|
961
|
+
function Us(s, e) {
|
|
962
962
|
var i;
|
|
963
963
|
if (e.tag) {
|
|
964
964
|
const r = s.filter((o) => o.tag === e.tag);
|
|
@@ -968,10 +968,14 @@ function Ks(s, e) {
|
|
|
968
968
|
let t, n;
|
|
969
969
|
if (E(e)) {
|
|
970
970
|
n = e.value;
|
|
971
|
-
|
|
971
|
+
let r = s.filter((o) => {
|
|
972
972
|
var l;
|
|
973
973
|
return (l = o.identify) == null ? void 0 : l.call(o, n);
|
|
974
974
|
});
|
|
975
|
+
if (r.length > 1) {
|
|
976
|
+
const o = r.filter((l) => l.test);
|
|
977
|
+
o.length > 0 && (r = o);
|
|
978
|
+
}
|
|
975
979
|
t = r.find((o) => o.format === e.format) ?? r.find((o) => !o.format);
|
|
976
980
|
} else
|
|
977
981
|
n = e, t = s.find((r) => r.nodeClass && n instanceof r.nodeClass);
|
|
@@ -981,19 +985,19 @@ function Ks(s, e) {
|
|
|
981
985
|
}
|
|
982
986
|
return t;
|
|
983
987
|
}
|
|
984
|
-
function
|
|
988
|
+
function Fs(s, e, { anchors: t, doc: n }) {
|
|
985
989
|
if (!n.directives)
|
|
986
990
|
return "";
|
|
987
991
|
const i = [], r = (E(s) || L(s)) && s.anchor;
|
|
988
|
-
r &&
|
|
992
|
+
r && Yt(r) && (t.add(r), i.push(`&${r}`));
|
|
989
993
|
const o = s.tag ? s.tag : e.default ? null : e.tag;
|
|
990
994
|
return o && i.push(n.directives.tagString(o)), i.join(" ");
|
|
991
995
|
}
|
|
992
|
-
function
|
|
996
|
+
function fe(s, e, t, n) {
|
|
993
997
|
var a;
|
|
994
|
-
if (
|
|
998
|
+
if (T(s))
|
|
995
999
|
return s.toString(e, t, n);
|
|
996
|
-
if (
|
|
1000
|
+
if (x(s)) {
|
|
997
1001
|
if (e.doc.directives)
|
|
998
1002
|
return s.toString(e);
|
|
999
1003
|
if ((a = e.resolvedAliases) != null && a.has(s))
|
|
@@ -1002,22 +1006,22 @@ function ae(s, e, t, n) {
|
|
|
1002
1006
|
}
|
|
1003
1007
|
let i;
|
|
1004
1008
|
const r = $(s) ? s : e.doc.createNode(s, { onTagObj: (c) => i = c });
|
|
1005
|
-
i || (i =
|
|
1006
|
-
const o =
|
|
1009
|
+
i || (i = Us(e.doc.schema.tags, r));
|
|
1010
|
+
const o = Fs(r, i, e);
|
|
1007
1011
|
o.length > 0 && (e.indentAtStart = (e.indentAtStart ?? 0) + o.length + 1);
|
|
1008
|
-
const l = typeof i.stringify == "function" ? i.stringify(r, e, t, n) : E(r) ?
|
|
1012
|
+
const l = typeof i.stringify == "function" ? i.stringify(r, e, t, n) : E(r) ? Ae(r, e, t, n) : r.toString(e, t, n);
|
|
1009
1013
|
return o ? E(r) || l[0] === "{" || l[0] === "[" ? `${o} ${l}` : `${o}
|
|
1010
1014
|
${e.indent}${l}` : l;
|
|
1011
1015
|
}
|
|
1012
|
-
function
|
|
1013
|
-
const { allNullValues: r, doc: o, indent: l, indentStep: a, options: { commentString: c, indentSeq:
|
|
1016
|
+
function Vs({ key: s, value: e }, t, n, i) {
|
|
1017
|
+
const { allNullValues: r, doc: o, indent: l, indentStep: a, options: { commentString: c, indentSeq: p, simpleKeys: f } } = t;
|
|
1014
1018
|
let d = $(s) && s.comment || null;
|
|
1015
1019
|
if (f) {
|
|
1016
1020
|
if (d)
|
|
1017
1021
|
throw new Error("With simple keys, key nodes cannot have comments");
|
|
1018
1022
|
if (L(s) || !$(s) && typeof s == "object") {
|
|
1019
|
-
const
|
|
1020
|
-
throw new Error(
|
|
1023
|
+
const I = "With simple keys, collection cannot be used as a key value";
|
|
1024
|
+
throw new Error(I);
|
|
1021
1025
|
}
|
|
1022
1026
|
}
|
|
1023
1027
|
let h = !f && (!s || d && e == null && !t.inFlow || L(s) || (E(s) ? s.type === O.BLOCK_FOLDED || s.type === O.BLOCK_LITERAL : typeof s == "object"));
|
|
@@ -1026,30 +1030,30 @@ function Us({ key: s, value: e }, t, n, i) {
|
|
|
1026
1030
|
implicitKey: !h && (f || !r),
|
|
1027
1031
|
indent: l + a
|
|
1028
1032
|
});
|
|
1029
|
-
let y = !1, u = !1,
|
|
1030
|
-
if (!h && !t.inFlow &&
|
|
1033
|
+
let y = !1, u = !1, m = fe(s, t, () => y = !0, () => u = !0);
|
|
1034
|
+
if (!h && !t.inFlow && m.length > 1024) {
|
|
1031
1035
|
if (f)
|
|
1032
1036
|
throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
|
|
1033
1037
|
h = !0;
|
|
1034
1038
|
}
|
|
1035
1039
|
if (t.inFlow) {
|
|
1036
1040
|
if (r || e == null)
|
|
1037
|
-
return y && n && n(),
|
|
1041
|
+
return y && n && n(), m === "" ? "?" : h ? `? ${m}` : m;
|
|
1038
1042
|
} else if (r && !f || e == null && h)
|
|
1039
|
-
return
|
|
1040
|
-
y && (d = null), h ? (d && (
|
|
1041
|
-
${l}:`) : (
|
|
1042
|
-
let
|
|
1043
|
-
$(e) ? (
|
|
1043
|
+
return m = `? ${m}`, d && !y ? m += H(m, t.indent, c(d)) : u && i && i(), m;
|
|
1044
|
+
y && (d = null), h ? (d && (m += H(m, t.indent, c(d))), m = `? ${m}
|
|
1045
|
+
${l}:`) : (m = `${m}:`, d && (m += H(m, t.indent, c(d))));
|
|
1046
|
+
let b, w, N;
|
|
1047
|
+
$(e) ? (b = !!e.spaceBefore, w = e.commentBefore, N = e.comment) : (b = !1, w = null, N = null, e && typeof e == "object" && (e = o.createNode(e))), t.implicitKey = !1, !h && !d && E(e) && (t.indentAtStart = m.length + 1), u = !1, !p && a.length >= 2 && !t.inFlow && !h && pe(e) && !e.flow && !e.tag && !e.anchor && (t.indent = t.indent.substring(2));
|
|
1044
1048
|
let S = !1;
|
|
1045
|
-
const A =
|
|
1049
|
+
const A = fe(e, t, () => S = !0, () => u = !0);
|
|
1046
1050
|
let k = " ";
|
|
1047
|
-
if (d ||
|
|
1048
|
-
if (k =
|
|
1051
|
+
if (d || b || w) {
|
|
1052
|
+
if (k = b ? `
|
|
1049
1053
|
` : "", w) {
|
|
1050
|
-
const
|
|
1054
|
+
const I = c(w);
|
|
1051
1055
|
k += `
|
|
1052
|
-
${F(
|
|
1056
|
+
${F(I, t.indent)}`;
|
|
1053
1057
|
}
|
|
1054
1058
|
A === "" && !t.inFlow ? k === `
|
|
1055
1059
|
` && (k = `
|
|
@@ -1057,43 +1061,71 @@ ${F(T, t.indent)}`;
|
|
|
1057
1061
|
`) : k += `
|
|
1058
1062
|
${t.indent}`;
|
|
1059
1063
|
} else if (!h && L(e)) {
|
|
1060
|
-
const
|
|
1061
|
-
`), _ =
|
|
1062
|
-
if (_ || !
|
|
1063
|
-
let
|
|
1064
|
-
if (_ && (
|
|
1064
|
+
const I = A[0], g = A.indexOf(`
|
|
1065
|
+
`), _ = g !== -1, Y = t.inFlow ?? e.flow ?? e.items.length === 0;
|
|
1066
|
+
if (_ || !Y) {
|
|
1067
|
+
let te = !1;
|
|
1068
|
+
if (_ && (I === "&" || I === "!")) {
|
|
1065
1069
|
let C = A.indexOf(" ");
|
|
1066
|
-
|
|
1070
|
+
I === "&" && C !== -1 && C < g && A[C + 1] === "!" && (C = A.indexOf(" ", C + 1)), (C === -1 || g < C) && (te = !0);
|
|
1067
1071
|
}
|
|
1068
|
-
|
|
1072
|
+
te || (k = `
|
|
1069
1073
|
${t.indent}`);
|
|
1070
1074
|
}
|
|
1071
1075
|
} else (A === "" || A[0] === `
|
|
1072
1076
|
`) && (k = "");
|
|
1073
|
-
return
|
|
1077
|
+
return m += k + A, t.inFlow ? S && n && n() : N && !S ? m += H(m, t.indent, c(N)) : u && i && i(), m;
|
|
1074
1078
|
}
|
|
1075
|
-
function
|
|
1079
|
+
function zt(s, e) {
|
|
1076
1080
|
(s === "debug" || s === "warn") && (typeof process < "u" && process.emitWarning ? process.emitWarning(e) : console.warn(e));
|
|
1077
1081
|
}
|
|
1078
|
-
const
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1082
|
+
const Ie = "<<", V = {
|
|
1083
|
+
identify: (s) => s === Ie || typeof s == "symbol" && s.description === Ie,
|
|
1084
|
+
default: "key",
|
|
1085
|
+
tag: "tag:yaml.org,2002:merge",
|
|
1086
|
+
test: /^<<$/,
|
|
1087
|
+
resolve: () => Object.assign(new O(Symbol(Ie)), {
|
|
1088
|
+
addToJSMap: Zt
|
|
1089
|
+
}),
|
|
1090
|
+
stringify: () => Ie
|
|
1091
|
+
}, Ys = (s, e) => (V.identify(e) || E(e) && (!e.type || e.type === O.PLAIN) && V.identify(e.value)) && (s == null ? void 0 : s.doc.schema.tags.some((t) => t.tag === V.tag && t.default));
|
|
1092
|
+
function Zt(s, e, t) {
|
|
1093
|
+
if (t = s && x(t) ? t.resolve(s.doc) : t, pe(t))
|
|
1094
|
+
for (const n of t.items)
|
|
1095
|
+
et(s, e, n);
|
|
1096
|
+
else if (Array.isArray(t))
|
|
1097
|
+
for (const n of t)
|
|
1098
|
+
et(s, e, n);
|
|
1099
|
+
else
|
|
1100
|
+
et(s, e, t);
|
|
1101
|
+
}
|
|
1102
|
+
function et(s, e, t) {
|
|
1103
|
+
const n = s && x(t) ? t.resolve(s.doc) : t;
|
|
1104
|
+
if (!de(n))
|
|
1105
|
+
throw new Error("Merge sources must be maps or map aliases");
|
|
1106
|
+
const i = n.toJSON(null, s, Map);
|
|
1107
|
+
for (const [r, o] of i)
|
|
1108
|
+
e instanceof Map ? e.has(r) || e.set(r, o) : e instanceof Set ? e.add(r) : Object.prototype.hasOwnProperty.call(e, r) || Object.defineProperty(e, r, {
|
|
1109
|
+
value: o,
|
|
1110
|
+
writable: !0,
|
|
1111
|
+
enumerable: !0,
|
|
1112
|
+
configurable: !0
|
|
1113
|
+
});
|
|
1114
|
+
return e;
|
|
1115
|
+
}
|
|
1116
|
+
function xt(s, e, { key: t, value: n }) {
|
|
1117
|
+
if ($(t) && t.addToJSMap)
|
|
1118
|
+
t.addToJSMap(s, e, n);
|
|
1119
|
+
else if (Ys(s, t))
|
|
1120
|
+
Zt(s, e, n);
|
|
1089
1121
|
else {
|
|
1090
|
-
const i =
|
|
1122
|
+
const i = P(t, "", s);
|
|
1091
1123
|
if (e instanceof Map)
|
|
1092
|
-
e.set(i,
|
|
1124
|
+
e.set(i, P(n, i, s));
|
|
1093
1125
|
else if (e instanceof Set)
|
|
1094
1126
|
e.add(i);
|
|
1095
1127
|
else {
|
|
1096
|
-
const r =
|
|
1128
|
+
const r = Js(t, i, s), o = P(n, r, s);
|
|
1097
1129
|
r in e ? Object.defineProperty(e, r, {
|
|
1098
1130
|
value: o,
|
|
1099
1131
|
writable: !0,
|
|
@@ -1104,28 +1136,13 @@ function Xt(s, e, { key: t, value: n }) {
|
|
|
1104
1136
|
}
|
|
1105
1137
|
return e;
|
|
1106
1138
|
}
|
|
1107
|
-
|
|
1108
|
-
function Ze(s, e, t) {
|
|
1109
|
-
const n = s && Z(t) ? t.resolve(s.doc) : t;
|
|
1110
|
-
if (!he(n))
|
|
1111
|
-
throw new Error("Merge sources must be maps or map aliases");
|
|
1112
|
-
const i = n.toJSON(null, s, Map);
|
|
1113
|
-
for (const [r, o] of i)
|
|
1114
|
-
e instanceof Map ? e.has(r) || e.set(r, o) : e instanceof Set ? e.add(r) : Object.prototype.hasOwnProperty.call(e, r) || Object.defineProperty(e, r, {
|
|
1115
|
-
value: o,
|
|
1116
|
-
writable: !0,
|
|
1117
|
-
enumerable: !0,
|
|
1118
|
-
configurable: !0
|
|
1119
|
-
});
|
|
1120
|
-
return e;
|
|
1121
|
-
}
|
|
1122
|
-
function Rs(s, e, t) {
|
|
1139
|
+
function Js(s, e, t) {
|
|
1123
1140
|
if (e === null)
|
|
1124
1141
|
return "";
|
|
1125
1142
|
if (typeof e != "object")
|
|
1126
1143
|
return String(e);
|
|
1127
1144
|
if ($(s) && (t != null && t.doc)) {
|
|
1128
|
-
const n =
|
|
1145
|
+
const n = Xt(t.doc, {});
|
|
1129
1146
|
n.anchors = /* @__PURE__ */ new Set();
|
|
1130
1147
|
for (const r of t.anchors.keys())
|
|
1131
1148
|
n.anchors.add(r.anchor);
|
|
@@ -1133,19 +1150,19 @@ function Rs(s, e, t) {
|
|
|
1133
1150
|
const i = s.toString(n);
|
|
1134
1151
|
if (!t.mapKeyWarned) {
|
|
1135
1152
|
let r = JSON.stringify(i);
|
|
1136
|
-
r.length > 40 && (r = r.substring(0, 36) + '..."'),
|
|
1153
|
+
r.length > 40 && (r = r.substring(0, 36) + '..."'), zt(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;
|
|
1137
1154
|
}
|
|
1138
1155
|
return i;
|
|
1139
1156
|
}
|
|
1140
1157
|
return JSON.stringify(e);
|
|
1141
1158
|
}
|
|
1142
|
-
function
|
|
1143
|
-
const n =
|
|
1159
|
+
function mt(s, e, t) {
|
|
1160
|
+
const n = ke(s, void 0, t), i = ke(e, void 0, t);
|
|
1144
1161
|
return new v(n, i);
|
|
1145
1162
|
}
|
|
1146
1163
|
class v {
|
|
1147
1164
|
constructor(e, t = null) {
|
|
1148
|
-
Object.defineProperty(this,
|
|
1165
|
+
Object.defineProperty(this, D, { value: qt }), this.key = e, this.value = t;
|
|
1149
1166
|
}
|
|
1150
1167
|
clone(e) {
|
|
1151
1168
|
let { key: t, value: n } = this;
|
|
@@ -1153,31 +1170,31 @@ class v {
|
|
|
1153
1170
|
}
|
|
1154
1171
|
toJSON(e, t) {
|
|
1155
1172
|
const n = t != null && t.mapAsMap ? /* @__PURE__ */ new Map() : {};
|
|
1156
|
-
return
|
|
1173
|
+
return xt(t, n, this);
|
|
1157
1174
|
}
|
|
1158
1175
|
toString(e, t, n) {
|
|
1159
|
-
return e != null && e.doc ?
|
|
1176
|
+
return e != null && e.doc ? Vs(this, e, t, n) : JSON.stringify(this);
|
|
1160
1177
|
}
|
|
1161
1178
|
}
|
|
1162
|
-
function
|
|
1163
|
-
return (e.inFlow ?? s.flow ?
|
|
1179
|
+
function es(s, e, t) {
|
|
1180
|
+
return (e.inFlow ?? s.flow ? Qs : Gs)(s, e, t);
|
|
1164
1181
|
}
|
|
1165
|
-
function
|
|
1166
|
-
const { indent: a, options: { commentString: c } } = t,
|
|
1182
|
+
function Gs({ comment: s, items: e }, t, { blockItemPrefix: n, flowChars: i, itemIndent: r, onChompKeep: o, onComment: l }) {
|
|
1183
|
+
const { indent: a, options: { commentString: c } } = t, p = Object.assign({}, t, { indent: r, type: null });
|
|
1167
1184
|
let f = !1;
|
|
1168
1185
|
const d = [];
|
|
1169
1186
|
for (let y = 0; y < e.length; ++y) {
|
|
1170
1187
|
const u = e[y];
|
|
1171
|
-
let
|
|
1188
|
+
let m = null;
|
|
1172
1189
|
if ($(u))
|
|
1173
|
-
!f && u.spaceBefore && d.push(""),
|
|
1174
|
-
else if (
|
|
1190
|
+
!f && u.spaceBefore && d.push(""), De(t, d, u.commentBefore, f), u.comment && (m = u.comment);
|
|
1191
|
+
else if (T(u)) {
|
|
1175
1192
|
const w = $(u.key) ? u.key : null;
|
|
1176
|
-
w && (!f && w.spaceBefore && d.push(""),
|
|
1193
|
+
w && (!f && w.spaceBefore && d.push(""), De(t, d, w.commentBefore, f));
|
|
1177
1194
|
}
|
|
1178
1195
|
f = !1;
|
|
1179
|
-
let
|
|
1180
|
-
|
|
1196
|
+
let b = fe(u, p, () => m = null, () => f = !0);
|
|
1197
|
+
m && (b += H(b, r, c(m))), f && m && (f = !1), d.push(n + b);
|
|
1181
1198
|
}
|
|
1182
1199
|
let h;
|
|
1183
1200
|
if (d.length === 0)
|
|
@@ -1194,7 +1211,7 @@ ${a}${u}` : `
|
|
|
1194
1211
|
return s ? (h += `
|
|
1195
1212
|
` + F(c(s), a), l && l()) : f && o && o(), h;
|
|
1196
1213
|
}
|
|
1197
|
-
function
|
|
1214
|
+
function Qs({ items: s }, e, { flowChars: t, itemIndent: n }) {
|
|
1198
1215
|
const { indent: i, indentStep: r, flowCollectionPadding: o, options: { commentString: l } } = e;
|
|
1199
1216
|
n += r;
|
|
1200
1217
|
const a = Object.assign({}, e, {
|
|
@@ -1202,29 +1219,29 @@ function Ys({ items: s }, e, { flowChars: t, itemIndent: n }) {
|
|
|
1202
1219
|
inFlow: !0,
|
|
1203
1220
|
type: null
|
|
1204
1221
|
});
|
|
1205
|
-
let c = !1,
|
|
1222
|
+
let c = !1, p = 0;
|
|
1206
1223
|
const f = [];
|
|
1207
1224
|
for (let y = 0; y < s.length; ++y) {
|
|
1208
1225
|
const u = s[y];
|
|
1209
|
-
let
|
|
1226
|
+
let m = null;
|
|
1210
1227
|
if ($(u))
|
|
1211
|
-
u.spaceBefore && f.push(""),
|
|
1212
|
-
else if (
|
|
1228
|
+
u.spaceBefore && f.push(""), De(e, f, u.commentBefore, !1), u.comment && (m = u.comment);
|
|
1229
|
+
else if (T(u)) {
|
|
1213
1230
|
const w = $(u.key) ? u.key : null;
|
|
1214
|
-
w && (w.spaceBefore && f.push(""),
|
|
1231
|
+
w && (w.spaceBefore && f.push(""), De(e, f, w.commentBefore, !1), w.comment && (c = !0));
|
|
1215
1232
|
const N = $(u.value) ? u.value : null;
|
|
1216
|
-
N ? (N.comment && (
|
|
1233
|
+
N ? (N.comment && (m = N.comment), N.commentBefore && (c = !0)) : u.value == null && (w != null && w.comment) && (m = w.comment);
|
|
1217
1234
|
}
|
|
1218
|
-
|
|
1219
|
-
let
|
|
1220
|
-
y < s.length - 1 && (
|
|
1221
|
-
`)) && (c = !0), f.push(
|
|
1235
|
+
m && (c = !0);
|
|
1236
|
+
let b = fe(u, a, () => m = null);
|
|
1237
|
+
y < s.length - 1 && (b += ","), m && (b += H(b, n, l(m))), !c && (f.length > p || b.includes(`
|
|
1238
|
+
`)) && (c = !0), f.push(b), p = f.length;
|
|
1222
1239
|
}
|
|
1223
1240
|
const { start: d, end: h } = t;
|
|
1224
1241
|
if (f.length === 0)
|
|
1225
1242
|
return d + h;
|
|
1226
1243
|
if (!c) {
|
|
1227
|
-
const y = f.reduce((u,
|
|
1244
|
+
const y = f.reduce((u, m) => u + m.length + 2, 2);
|
|
1228
1245
|
c = e.options.lineWidth > 0 && y > e.options.lineWidth;
|
|
1229
1246
|
}
|
|
1230
1247
|
if (c) {
|
|
@@ -1238,24 +1255,24 @@ ${i}${h}`;
|
|
|
1238
1255
|
} else
|
|
1239
1256
|
return `${d}${o}${f.join(" ")}${o}${h}`;
|
|
1240
1257
|
}
|
|
1241
|
-
function
|
|
1258
|
+
function De({ indent: s, options: { commentString: e } }, t, n, i) {
|
|
1242
1259
|
if (n && i && (n = n.replace(/^\n+/, "")), n) {
|
|
1243
1260
|
const r = F(e(n), s);
|
|
1244
1261
|
t.push(r.trimStart());
|
|
1245
1262
|
}
|
|
1246
1263
|
}
|
|
1247
|
-
function
|
|
1264
|
+
function X(s, e) {
|
|
1248
1265
|
const t = E(e) ? e.value : e;
|
|
1249
1266
|
for (const n of s)
|
|
1250
|
-
if (
|
|
1267
|
+
if (T(n) && (n.key === e || n.key === t || E(n.key) && n.key.value === t))
|
|
1251
1268
|
return n;
|
|
1252
1269
|
}
|
|
1253
|
-
class
|
|
1270
|
+
class K extends Wt {
|
|
1254
1271
|
static get tagName() {
|
|
1255
1272
|
return "tag:yaml.org,2002:map";
|
|
1256
1273
|
}
|
|
1257
1274
|
constructor(e) {
|
|
1258
|
-
super(
|
|
1275
|
+
super(J, e), this.items = [];
|
|
1259
1276
|
}
|
|
1260
1277
|
/**
|
|
1261
1278
|
* A generic collection parsing method that can be extended
|
|
@@ -1267,7 +1284,7 @@ class P extends Gt {
|
|
|
1267
1284
|
c = r.call(t, a, c);
|
|
1268
1285
|
else if (Array.isArray(r) && !r.includes(a))
|
|
1269
1286
|
return;
|
|
1270
|
-
(c !== void 0 || i) && o.items.push(
|
|
1287
|
+
(c !== void 0 || i) && o.items.push(mt(a, c, n));
|
|
1271
1288
|
};
|
|
1272
1289
|
if (t instanceof Map)
|
|
1273
1290
|
for (const [a, c] of t)
|
|
@@ -1286,12 +1303,12 @@ class P extends Gt {
|
|
|
1286
1303
|
add(e, t) {
|
|
1287
1304
|
var o;
|
|
1288
1305
|
let n;
|
|
1289
|
-
|
|
1290
|
-
const i =
|
|
1306
|
+
T(e) ? n = e : !e || typeof e != "object" || !("key" in e) ? n = new v(e, e == null ? void 0 : e.value) : n = new v(e.key, e.value);
|
|
1307
|
+
const i = X(this.items, n.key), r = (o = this.schema) == null ? void 0 : o.sortMapEntries;
|
|
1291
1308
|
if (i) {
|
|
1292
1309
|
if (!t)
|
|
1293
1310
|
throw new Error(`Key ${n.key} already set`);
|
|
1294
|
-
E(i.value) &&
|
|
1311
|
+
E(i.value) && Qt(n.value) ? i.value.value = n.value : i.value = n.value;
|
|
1295
1312
|
} else if (r) {
|
|
1296
1313
|
const l = this.items.findIndex((a) => r(n, a) < 0);
|
|
1297
1314
|
l === -1 ? this.items.push(n) : this.items.splice(l, 0, n);
|
|
@@ -1299,15 +1316,15 @@ class P extends Gt {
|
|
|
1299
1316
|
this.items.push(n);
|
|
1300
1317
|
}
|
|
1301
1318
|
delete(e) {
|
|
1302
|
-
const t =
|
|
1319
|
+
const t = X(this.items, e);
|
|
1303
1320
|
return t ? this.items.splice(this.items.indexOf(t), 1).length > 0 : !1;
|
|
1304
1321
|
}
|
|
1305
1322
|
get(e, t) {
|
|
1306
|
-
const n =
|
|
1323
|
+
const n = X(this.items, e), i = n == null ? void 0 : n.value;
|
|
1307
1324
|
return (!t && E(i) ? i.value : i) ?? void 0;
|
|
1308
1325
|
}
|
|
1309
1326
|
has(e) {
|
|
1310
|
-
return !!
|
|
1327
|
+
return !!X(this.items, e);
|
|
1311
1328
|
}
|
|
1312
1329
|
set(e, t) {
|
|
1313
1330
|
this.add(new v(e, t), !0);
|
|
@@ -1321,16 +1338,16 @@ class P extends Gt {
|
|
|
1321
1338
|
const i = n ? new n() : t != null && t.mapAsMap ? /* @__PURE__ */ new Map() : {};
|
|
1322
1339
|
t != null && t.onCreate && t.onCreate(i);
|
|
1323
1340
|
for (const r of this.items)
|
|
1324
|
-
|
|
1341
|
+
xt(t, i, r);
|
|
1325
1342
|
return i;
|
|
1326
1343
|
}
|
|
1327
1344
|
toString(e, t, n) {
|
|
1328
1345
|
if (!e)
|
|
1329
1346
|
return JSON.stringify(this);
|
|
1330
1347
|
for (const i of this.items)
|
|
1331
|
-
if (!
|
|
1348
|
+
if (!T(i))
|
|
1332
1349
|
throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);
|
|
1333
|
-
return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })),
|
|
1350
|
+
return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })), es(this, e, {
|
|
1334
1351
|
blockItemPrefix: "",
|
|
1335
1352
|
flowChars: { start: "{", end: "}" },
|
|
1336
1353
|
itemIndent: e.indent || "",
|
|
@@ -1339,22 +1356,22 @@ class P extends Gt {
|
|
|
1339
1356
|
});
|
|
1340
1357
|
}
|
|
1341
1358
|
}
|
|
1342
|
-
const
|
|
1359
|
+
const me = {
|
|
1343
1360
|
collection: "map",
|
|
1344
1361
|
default: !0,
|
|
1345
|
-
nodeClass:
|
|
1362
|
+
nodeClass: K,
|
|
1346
1363
|
tag: "tag:yaml.org,2002:map",
|
|
1347
1364
|
resolve(s, e) {
|
|
1348
|
-
return
|
|
1365
|
+
return de(s) || e("Expected a mapping for this tag"), s;
|
|
1349
1366
|
},
|
|
1350
|
-
createNode: (s, e, t) =>
|
|
1367
|
+
createNode: (s, e, t) => K.from(s, e, t)
|
|
1351
1368
|
};
|
|
1352
|
-
class
|
|
1369
|
+
class Q extends Wt {
|
|
1353
1370
|
static get tagName() {
|
|
1354
1371
|
return "tag:yaml.org,2002:seq";
|
|
1355
1372
|
}
|
|
1356
1373
|
constructor(e) {
|
|
1357
|
-
super(
|
|
1374
|
+
super(he, e), this.items = [];
|
|
1358
1375
|
}
|
|
1359
1376
|
add(e) {
|
|
1360
1377
|
this.items.push(e);
|
|
@@ -1368,11 +1385,11 @@ class J extends Gt {
|
|
|
1368
1385
|
* @returns `true` if the item was found and removed.
|
|
1369
1386
|
*/
|
|
1370
1387
|
delete(e) {
|
|
1371
|
-
const t =
|
|
1388
|
+
const t = Le(e);
|
|
1372
1389
|
return typeof t != "number" ? !1 : this.items.splice(t, 1).length > 0;
|
|
1373
1390
|
}
|
|
1374
1391
|
get(e, t) {
|
|
1375
|
-
const n =
|
|
1392
|
+
const n = Le(e);
|
|
1376
1393
|
if (typeof n != "number")
|
|
1377
1394
|
return;
|
|
1378
1395
|
const i = this.items[n];
|
|
@@ -1385,7 +1402,7 @@ class J extends Gt {
|
|
|
1385
1402
|
* It may be wrapped in a `Scalar`.
|
|
1386
1403
|
*/
|
|
1387
1404
|
has(e) {
|
|
1388
|
-
const t =
|
|
1405
|
+
const t = Le(e);
|
|
1389
1406
|
return typeof t == "number" && t < this.items.length;
|
|
1390
1407
|
}
|
|
1391
1408
|
/**
|
|
@@ -1396,22 +1413,22 @@ class J extends Gt {
|
|
|
1396
1413
|
* It may be wrapped in a `Scalar`.
|
|
1397
1414
|
*/
|
|
1398
1415
|
set(e, t) {
|
|
1399
|
-
const n =
|
|
1416
|
+
const n = Le(e);
|
|
1400
1417
|
if (typeof n != "number")
|
|
1401
1418
|
throw new Error(`Expected a valid index, not ${e}.`);
|
|
1402
1419
|
const i = this.items[n];
|
|
1403
|
-
E(i) &&
|
|
1420
|
+
E(i) && Qt(t) ? i.value = t : this.items[n] = t;
|
|
1404
1421
|
}
|
|
1405
1422
|
toJSON(e, t) {
|
|
1406
1423
|
const n = [];
|
|
1407
1424
|
t != null && t.onCreate && t.onCreate(n);
|
|
1408
1425
|
let i = 0;
|
|
1409
1426
|
for (const r of this.items)
|
|
1410
|
-
n.push(
|
|
1427
|
+
n.push(P(r, String(i++), t));
|
|
1411
1428
|
return n;
|
|
1412
1429
|
}
|
|
1413
1430
|
toString(e, t, n) {
|
|
1414
|
-
return e ?
|
|
1431
|
+
return e ? es(this, e, {
|
|
1415
1432
|
blockItemPrefix: "- ",
|
|
1416
1433
|
flowChars: { start: "[", end: "]" },
|
|
1417
1434
|
itemIndent: (e.indent || "") + " ",
|
|
@@ -1428,49 +1445,49 @@ class J extends Gt {
|
|
|
1428
1445
|
const a = t instanceof Set ? l : String(o++);
|
|
1429
1446
|
l = i.call(t, a, l);
|
|
1430
1447
|
}
|
|
1431
|
-
r.items.push(
|
|
1448
|
+
r.items.push(ke(l, void 0, n));
|
|
1432
1449
|
}
|
|
1433
1450
|
}
|
|
1434
1451
|
return r;
|
|
1435
1452
|
}
|
|
1436
1453
|
}
|
|
1437
|
-
function
|
|
1454
|
+
function Le(s) {
|
|
1438
1455
|
let e = E(s) ? s.value : s;
|
|
1439
1456
|
return e && typeof e == "string" && (e = Number(e)), typeof e == "number" && Number.isInteger(e) && e >= 0 ? e : null;
|
|
1440
1457
|
}
|
|
1441
|
-
const
|
|
1458
|
+
const ye = {
|
|
1442
1459
|
collection: "seq",
|
|
1443
1460
|
default: !0,
|
|
1444
|
-
nodeClass:
|
|
1461
|
+
nodeClass: Q,
|
|
1445
1462
|
tag: "tag:yaml.org,2002:seq",
|
|
1446
1463
|
resolve(s, e) {
|
|
1447
|
-
return
|
|
1464
|
+
return pe(s) || e("Expected a sequence for this tag"), s;
|
|
1448
1465
|
},
|
|
1449
|
-
createNode: (s, e, t) =>
|
|
1450
|
-
},
|
|
1466
|
+
createNode: (s, e, t) => Q.from(s, e, t)
|
|
1467
|
+
}, Je = {
|
|
1451
1468
|
identify: (s) => typeof s == "string",
|
|
1452
1469
|
default: !0,
|
|
1453
1470
|
tag: "tag:yaml.org,2002:str",
|
|
1454
1471
|
resolve: (s) => s,
|
|
1455
1472
|
stringify(s, e, t, n) {
|
|
1456
|
-
return e = Object.assign({ actualString: !0 }, e),
|
|
1473
|
+
return e = Object.assign({ actualString: !0 }, e), Ae(s, e, t, n);
|
|
1457
1474
|
}
|
|
1458
|
-
},
|
|
1475
|
+
}, Ge = {
|
|
1459
1476
|
identify: (s) => s == null,
|
|
1460
1477
|
createNode: () => new O(null),
|
|
1461
1478
|
default: !0,
|
|
1462
1479
|
tag: "tag:yaml.org,2002:null",
|
|
1463
1480
|
test: /^(?:~|[Nn]ull|NULL)?$/,
|
|
1464
1481
|
resolve: () => new O(null),
|
|
1465
|
-
stringify: ({ source: s }, e) => typeof s == "string" &&
|
|
1466
|
-
},
|
|
1482
|
+
stringify: ({ source: s }, e) => typeof s == "string" && Ge.test.test(s) ? s : e.options.nullStr
|
|
1483
|
+
}, yt = {
|
|
1467
1484
|
identify: (s) => typeof s == "boolean",
|
|
1468
1485
|
default: !0,
|
|
1469
1486
|
tag: "tag:yaml.org,2002:bool",
|
|
1470
1487
|
test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
|
|
1471
1488
|
resolve: (s) => new O(s[0] === "t" || s[0] === "T"),
|
|
1472
1489
|
stringify({ source: s, value: e }, t) {
|
|
1473
|
-
if (s &&
|
|
1490
|
+
if (s && yt.test.test(s)) {
|
|
1474
1491
|
const n = s[0] === "t" || s[0] === "T";
|
|
1475
1492
|
if (e === n)
|
|
1476
1493
|
return s;
|
|
@@ -1494,14 +1511,14 @@ function q({ format: s, minFractionDigits: e, tag: t, value: n }) {
|
|
|
1494
1511
|
}
|
|
1495
1512
|
return r;
|
|
1496
1513
|
}
|
|
1497
|
-
const
|
|
1514
|
+
const ts = {
|
|
1498
1515
|
identify: (s) => typeof s == "number",
|
|
1499
1516
|
default: !0,
|
|
1500
1517
|
tag: "tag:yaml.org,2002:float",
|
|
1501
1518
|
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
1502
1519
|
resolve: (s) => s.slice(-3).toLowerCase() === "nan" ? NaN : s[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
|
1503
1520
|
stringify: q
|
|
1504
|
-
},
|
|
1521
|
+
}, ss = {
|
|
1505
1522
|
identify: (s) => typeof s == "number",
|
|
1506
1523
|
default: !0,
|
|
1507
1524
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1512,7 +1529,7 @@ const Zt = {
|
|
|
1512
1529
|
const e = Number(s.value);
|
|
1513
1530
|
return isFinite(e) ? e.toExponential() : q(s);
|
|
1514
1531
|
}
|
|
1515
|
-
},
|
|
1532
|
+
}, ns = {
|
|
1516
1533
|
identify: (s) => typeof s == "number",
|
|
1517
1534
|
default: !0,
|
|
1518
1535
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1522,57 +1539,57 @@ const Zt = {
|
|
|
1522
1539
|
return t !== -1 && s[s.length - 1] === "0" && (e.minFractionDigits = s.length - t - 1), e;
|
|
1523
1540
|
},
|
|
1524
1541
|
stringify: q
|
|
1525
|
-
},
|
|
1526
|
-
function
|
|
1542
|
+
}, Qe = (s) => typeof s == "bigint" || Number.isInteger(s), gt = (s, e, t, { intAsBigInt: n }) => n ? BigInt(s) : parseInt(s.substring(e), t);
|
|
1543
|
+
function is(s, e, t) {
|
|
1527
1544
|
const { value: n } = s;
|
|
1528
|
-
return
|
|
1545
|
+
return Qe(n) && n >= 0 ? t + n.toString(e) : q(s);
|
|
1529
1546
|
}
|
|
1530
|
-
const
|
|
1531
|
-
identify: (s) =>
|
|
1547
|
+
const rs = {
|
|
1548
|
+
identify: (s) => Qe(s) && s >= 0,
|
|
1532
1549
|
default: !0,
|
|
1533
1550
|
tag: "tag:yaml.org,2002:int",
|
|
1534
1551
|
format: "OCT",
|
|
1535
1552
|
test: /^0o[0-7]+$/,
|
|
1536
|
-
resolve: (s, e, t) =>
|
|
1537
|
-
stringify: (s) =>
|
|
1538
|
-
},
|
|
1539
|
-
identify:
|
|
1553
|
+
resolve: (s, e, t) => gt(s, 2, 8, t),
|
|
1554
|
+
stringify: (s) => is(s, 8, "0o")
|
|
1555
|
+
}, os = {
|
|
1556
|
+
identify: Qe,
|
|
1540
1557
|
default: !0,
|
|
1541
1558
|
tag: "tag:yaml.org,2002:int",
|
|
1542
1559
|
test: /^[-+]?[0-9]+$/,
|
|
1543
|
-
resolve: (s, e, t) =>
|
|
1560
|
+
resolve: (s, e, t) => gt(s, 0, 10, t),
|
|
1544
1561
|
stringify: q
|
|
1545
|
-
},
|
|
1546
|
-
identify: (s) =>
|
|
1562
|
+
}, ls = {
|
|
1563
|
+
identify: (s) => Qe(s) && s >= 0,
|
|
1547
1564
|
default: !0,
|
|
1548
1565
|
tag: "tag:yaml.org,2002:int",
|
|
1549
1566
|
format: "HEX",
|
|
1550
1567
|
test: /^0x[0-9a-fA-F]+$/,
|
|
1551
|
-
resolve: (s, e, t) =>
|
|
1552
|
-
stringify: (s) =>
|
|
1553
|
-
},
|
|
1554
|
-
pe,
|
|
1568
|
+
resolve: (s, e, t) => gt(s, 2, 16, t),
|
|
1569
|
+
stringify: (s) => is(s, 16, "0x")
|
|
1570
|
+
}, Ws = [
|
|
1555
1571
|
me,
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1572
|
+
ye,
|
|
1573
|
+
Je,
|
|
1574
|
+
Ge,
|
|
1575
|
+
yt,
|
|
1576
|
+
rs,
|
|
1577
|
+
os,
|
|
1578
|
+
ls,
|
|
1579
|
+
ts,
|
|
1559
1580
|
ss,
|
|
1560
|
-
ns
|
|
1561
|
-
is,
|
|
1562
|
-
Zt,
|
|
1563
|
-
xt,
|
|
1564
|
-
es
|
|
1581
|
+
ns
|
|
1565
1582
|
];
|
|
1566
|
-
function
|
|
1583
|
+
function _t(s) {
|
|
1567
1584
|
return typeof s == "bigint" || Number.isInteger(s);
|
|
1568
1585
|
}
|
|
1569
|
-
const
|
|
1586
|
+
const $e = ({ value: s }) => JSON.stringify(s), Hs = [
|
|
1570
1587
|
{
|
|
1571
1588
|
identify: (s) => typeof s == "string",
|
|
1572
1589
|
default: !0,
|
|
1573
1590
|
tag: "tag:yaml.org,2002:str",
|
|
1574
1591
|
resolve: (s) => s,
|
|
1575
|
-
stringify:
|
|
1592
|
+
stringify: $e
|
|
1576
1593
|
},
|
|
1577
1594
|
{
|
|
1578
1595
|
identify: (s) => s == null,
|
|
@@ -1581,7 +1598,7 @@ const Te = ({ value: s }) => JSON.stringify(s), Gs = [
|
|
|
1581
1598
|
tag: "tag:yaml.org,2002:null",
|
|
1582
1599
|
test: /^null$/,
|
|
1583
1600
|
resolve: () => null,
|
|
1584
|
-
stringify:
|
|
1601
|
+
stringify: $e
|
|
1585
1602
|
},
|
|
1586
1603
|
{
|
|
1587
1604
|
identify: (s) => typeof s == "boolean",
|
|
@@ -1589,15 +1606,15 @@ const Te = ({ value: s }) => JSON.stringify(s), Gs = [
|
|
|
1589
1606
|
tag: "tag:yaml.org,2002:bool",
|
|
1590
1607
|
test: /^true|false$/,
|
|
1591
1608
|
resolve: (s) => s === "true",
|
|
1592
|
-
stringify:
|
|
1609
|
+
stringify: $e
|
|
1593
1610
|
},
|
|
1594
1611
|
{
|
|
1595
|
-
identify:
|
|
1612
|
+
identify: _t,
|
|
1596
1613
|
default: !0,
|
|
1597
1614
|
tag: "tag:yaml.org,2002:int",
|
|
1598
1615
|
test: /^-?(?:0|[1-9][0-9]*)$/,
|
|
1599
1616
|
resolve: (s, e, { intAsBigInt: t }) => t ? BigInt(s) : parseInt(s, 10),
|
|
1600
|
-
stringify: ({ value: s }) =>
|
|
1617
|
+
stringify: ({ value: s }) => _t(s) ? s.toString() : JSON.stringify(s)
|
|
1601
1618
|
},
|
|
1602
1619
|
{
|
|
1603
1620
|
identify: (s) => typeof s == "number",
|
|
@@ -1605,16 +1622,16 @@ const Te = ({ value: s }) => JSON.stringify(s), Gs = [
|
|
|
1605
1622
|
tag: "tag:yaml.org,2002:float",
|
|
1606
1623
|
test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
|
|
1607
1624
|
resolve: (s) => parseFloat(s),
|
|
1608
|
-
stringify:
|
|
1625
|
+
stringify: $e
|
|
1609
1626
|
}
|
|
1610
|
-
],
|
|
1627
|
+
], Xs = {
|
|
1611
1628
|
default: !0,
|
|
1612
1629
|
tag: "",
|
|
1613
1630
|
test: /^/,
|
|
1614
1631
|
resolve(s, e) {
|
|
1615
1632
|
return e(`Unresolved plain scalar ${JSON.stringify(s)}`), s;
|
|
1616
1633
|
}
|
|
1617
|
-
},
|
|
1634
|
+
}, zs = [me, ye].concat(Hs, Xs), bt = {
|
|
1618
1635
|
identify: (s) => s instanceof Uint8Array,
|
|
1619
1636
|
// Buffer inherits from Uint8Array
|
|
1620
1637
|
default: !1,
|
|
@@ -1651,21 +1668,21 @@ const Te = ({ value: s }) => JSON.stringify(s), Gs = [
|
|
|
1651
1668
|
} else
|
|
1652
1669
|
throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
|
|
1653
1670
|
if (e || (e = O.BLOCK_LITERAL), e !== O.QUOTE_DOUBLE) {
|
|
1654
|
-
const a = Math.max(n.options.lineWidth - n.indent.length, n.options.minContentWidth), c = Math.ceil(l.length / a),
|
|
1671
|
+
const a = Math.max(n.options.lineWidth - n.indent.length, n.options.minContentWidth), c = Math.ceil(l.length / a), p = new Array(c);
|
|
1655
1672
|
for (let f = 0, d = 0; f < c; ++f, d += a)
|
|
1656
|
-
|
|
1657
|
-
l =
|
|
1673
|
+
p[f] = l.substr(d, a);
|
|
1674
|
+
l = p.join(e === O.BLOCK_LITERAL ? `
|
|
1658
1675
|
` : " ");
|
|
1659
1676
|
}
|
|
1660
|
-
return
|
|
1677
|
+
return Ae({ comment: s, type: e, value: l }, n, i, r);
|
|
1661
1678
|
}
|
|
1662
1679
|
};
|
|
1663
|
-
function
|
|
1664
|
-
if (
|
|
1680
|
+
function as(s, e) {
|
|
1681
|
+
if (pe(s))
|
|
1665
1682
|
for (let t = 0; t < s.items.length; ++t) {
|
|
1666
1683
|
let n = s.items[t];
|
|
1667
|
-
if (!
|
|
1668
|
-
if (
|
|
1684
|
+
if (!T(n)) {
|
|
1685
|
+
if (de(n)) {
|
|
1669
1686
|
n.items.length > 1 && e("Each pair must have its own sequence indicator");
|
|
1670
1687
|
const i = n.items[0] || new v(new O(null));
|
|
1671
1688
|
if (n.commentBefore && (i.key.commentBefore = i.key.commentBefore ? `${n.commentBefore}
|
|
@@ -1676,15 +1693,15 @@ ${r.comment}` : n.comment;
|
|
|
1676
1693
|
}
|
|
1677
1694
|
n = i;
|
|
1678
1695
|
}
|
|
1679
|
-
s.items[t] =
|
|
1696
|
+
s.items[t] = T(n) ? n : new v(n);
|
|
1680
1697
|
}
|
|
1681
1698
|
}
|
|
1682
1699
|
else
|
|
1683
1700
|
e("Expected a sequence for this tag");
|
|
1684
1701
|
return s;
|
|
1685
1702
|
}
|
|
1686
|
-
function
|
|
1687
|
-
const { replacer: n } = t, i = new
|
|
1703
|
+
function cs(s, e, t) {
|
|
1704
|
+
const { replacer: n } = t, i = new Q(s);
|
|
1688
1705
|
i.tag = "tag:yaml.org,2002:pairs";
|
|
1689
1706
|
let r = 0;
|
|
1690
1707
|
if (e && Symbol.iterator in Object(e))
|
|
@@ -1704,20 +1721,20 @@ function os(s, e, t) {
|
|
|
1704
1721
|
throw new TypeError(`Expected tuple with one key, not ${c.length} keys`);
|
|
1705
1722
|
} else
|
|
1706
1723
|
l = o;
|
|
1707
|
-
i.items.push(
|
|
1724
|
+
i.items.push(mt(l, a, t));
|
|
1708
1725
|
}
|
|
1709
1726
|
return i;
|
|
1710
1727
|
}
|
|
1711
|
-
const
|
|
1728
|
+
const wt = {
|
|
1712
1729
|
collection: "seq",
|
|
1713
1730
|
default: !1,
|
|
1714
1731
|
tag: "tag:yaml.org,2002:pairs",
|
|
1715
|
-
resolve:
|
|
1716
|
-
createNode:
|
|
1732
|
+
resolve: as,
|
|
1733
|
+
createNode: cs
|
|
1717
1734
|
};
|
|
1718
|
-
class
|
|
1735
|
+
class ae extends Q {
|
|
1719
1736
|
constructor() {
|
|
1720
|
-
super(), this.add =
|
|
1737
|
+
super(), this.add = K.prototype.add.bind(this), this.delete = K.prototype.delete.bind(this), this.get = K.prototype.get.bind(this), this.has = K.prototype.has.bind(this), this.set = K.prototype.set.bind(this), this.tag = ae.tag;
|
|
1721
1738
|
}
|
|
1722
1739
|
/**
|
|
1723
1740
|
* If `ctx` is given, the return type is actually `Map<unknown, unknown>`,
|
|
@@ -1730,57 +1747,57 @@ class oe extends J {
|
|
|
1730
1747
|
t != null && t.onCreate && t.onCreate(n);
|
|
1731
1748
|
for (const i of this.items) {
|
|
1732
1749
|
let r, o;
|
|
1733
|
-
if (
|
|
1750
|
+
if (T(i) ? (r = P(i.key, "", t), o = P(i.value, r, t)) : r = P(i, "", t), n.has(r))
|
|
1734
1751
|
throw new Error("Ordered maps must not include duplicate keys");
|
|
1735
1752
|
n.set(r, o);
|
|
1736
1753
|
}
|
|
1737
1754
|
return n;
|
|
1738
1755
|
}
|
|
1739
1756
|
static from(e, t, n) {
|
|
1740
|
-
const i =
|
|
1757
|
+
const i = cs(e, t, n), r = new this();
|
|
1741
1758
|
return r.items = i.items, r;
|
|
1742
1759
|
}
|
|
1743
1760
|
}
|
|
1744
|
-
|
|
1745
|
-
const
|
|
1761
|
+
ae.tag = "tag:yaml.org,2002:omap";
|
|
1762
|
+
const St = {
|
|
1746
1763
|
collection: "seq",
|
|
1747
1764
|
identify: (s) => s instanceof Map,
|
|
1748
|
-
nodeClass:
|
|
1765
|
+
nodeClass: ae,
|
|
1749
1766
|
default: !1,
|
|
1750
1767
|
tag: "tag:yaml.org,2002:omap",
|
|
1751
1768
|
resolve(s, e) {
|
|
1752
|
-
const t =
|
|
1769
|
+
const t = as(s, e), n = [];
|
|
1753
1770
|
for (const { key: i } of t.items)
|
|
1754
1771
|
E(i) && (n.includes(i.value) ? e(`Ordered maps must not include duplicate keys: ${i.value}`) : n.push(i.value));
|
|
1755
|
-
return Object.assign(new
|
|
1772
|
+
return Object.assign(new ae(), t);
|
|
1756
1773
|
},
|
|
1757
|
-
createNode: (s, e, t) =>
|
|
1774
|
+
createNode: (s, e, t) => ae.from(s, e, t)
|
|
1758
1775
|
};
|
|
1759
|
-
function
|
|
1760
|
-
return e && (s ?
|
|
1776
|
+
function fs({ value: s, source: e }, t) {
|
|
1777
|
+
return e && (s ? us : hs).test.test(e) ? e : s ? t.options.trueStr : t.options.falseStr;
|
|
1761
1778
|
}
|
|
1762
|
-
const
|
|
1779
|
+
const us = {
|
|
1763
1780
|
identify: (s) => s === !0,
|
|
1764
1781
|
default: !0,
|
|
1765
1782
|
tag: "tag:yaml.org,2002:bool",
|
|
1766
1783
|
test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
|
|
1767
1784
|
resolve: () => new O(!0),
|
|
1768
|
-
stringify:
|
|
1769
|
-
},
|
|
1785
|
+
stringify: fs
|
|
1786
|
+
}, hs = {
|
|
1770
1787
|
identify: (s) => s === !1,
|
|
1771
1788
|
default: !0,
|
|
1772
1789
|
tag: "tag:yaml.org,2002:bool",
|
|
1773
1790
|
test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
|
|
1774
1791
|
resolve: () => new O(!1),
|
|
1775
|
-
stringify:
|
|
1776
|
-
},
|
|
1792
|
+
stringify: fs
|
|
1793
|
+
}, Zs = {
|
|
1777
1794
|
identify: (s) => typeof s == "number",
|
|
1778
1795
|
default: !0,
|
|
1779
1796
|
tag: "tag:yaml.org,2002:float",
|
|
1780
1797
|
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
1781
1798
|
resolve: (s) => s.slice(-3).toLowerCase() === "nan" ? NaN : s[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
|
1782
1799
|
stringify: q
|
|
1783
|
-
},
|
|
1800
|
+
}, xs = {
|
|
1784
1801
|
identify: (s) => typeof s == "number",
|
|
1785
1802
|
default: !0,
|
|
1786
1803
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1791,7 +1808,7 @@ const as = {
|
|
|
1791
1808
|
const e = Number(s.value);
|
|
1792
1809
|
return isFinite(e) ? e.toExponential() : q(s);
|
|
1793
1810
|
}
|
|
1794
|
-
},
|
|
1811
|
+
}, en = {
|
|
1795
1812
|
identify: (s) => typeof s == "number",
|
|
1796
1813
|
default: !0,
|
|
1797
1814
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1805,8 +1822,8 @@ const as = {
|
|
|
1805
1822
|
return e;
|
|
1806
1823
|
},
|
|
1807
1824
|
stringify: q
|
|
1808
|
-
},
|
|
1809
|
-
function
|
|
1825
|
+
}, Ee = (s) => typeof s == "bigint" || Number.isInteger(s);
|
|
1826
|
+
function We(s, e, t, { intAsBigInt: n }) {
|
|
1810
1827
|
const i = s[0];
|
|
1811
1828
|
if ((i === "-" || i === "+") && (e += 1), s = s.substring(e).replace(/_/g, ""), n) {
|
|
1812
1829
|
switch (t) {
|
|
@@ -1826,66 +1843,66 @@ function Ge(s, e, t, { intAsBigInt: n }) {
|
|
|
1826
1843
|
const r = parseInt(s, t);
|
|
1827
1844
|
return i === "-" ? -1 * r : r;
|
|
1828
1845
|
}
|
|
1829
|
-
function
|
|
1846
|
+
function kt(s, e, t) {
|
|
1830
1847
|
const { value: n } = s;
|
|
1831
|
-
if (
|
|
1848
|
+
if (Ee(n)) {
|
|
1832
1849
|
const i = n.toString(e);
|
|
1833
1850
|
return n < 0 ? "-" + t + i.substr(1) : t + i;
|
|
1834
1851
|
}
|
|
1835
1852
|
return q(s);
|
|
1836
1853
|
}
|
|
1837
|
-
const
|
|
1838
|
-
identify:
|
|
1854
|
+
const tn = {
|
|
1855
|
+
identify: Ee,
|
|
1839
1856
|
default: !0,
|
|
1840
1857
|
tag: "tag:yaml.org,2002:int",
|
|
1841
1858
|
format: "BIN",
|
|
1842
1859
|
test: /^[-+]?0b[0-1_]+$/,
|
|
1843
|
-
resolve: (s, e, t) =>
|
|
1844
|
-
stringify: (s) =>
|
|
1845
|
-
},
|
|
1846
|
-
identify:
|
|
1860
|
+
resolve: (s, e, t) => We(s, 2, 2, t),
|
|
1861
|
+
stringify: (s) => kt(s, 2, "0b")
|
|
1862
|
+
}, sn = {
|
|
1863
|
+
identify: Ee,
|
|
1847
1864
|
default: !0,
|
|
1848
1865
|
tag: "tag:yaml.org,2002:int",
|
|
1849
1866
|
format: "OCT",
|
|
1850
1867
|
test: /^[-+]?0[0-7_]+$/,
|
|
1851
|
-
resolve: (s, e, t) =>
|
|
1852
|
-
stringify: (s) =>
|
|
1853
|
-
},
|
|
1854
|
-
identify:
|
|
1868
|
+
resolve: (s, e, t) => We(s, 1, 8, t),
|
|
1869
|
+
stringify: (s) => kt(s, 8, "0")
|
|
1870
|
+
}, nn = {
|
|
1871
|
+
identify: Ee,
|
|
1855
1872
|
default: !0,
|
|
1856
1873
|
tag: "tag:yaml.org,2002:int",
|
|
1857
1874
|
test: /^[-+]?[0-9][0-9_]*$/,
|
|
1858
|
-
resolve: (s, e, t) =>
|
|
1875
|
+
resolve: (s, e, t) => We(s, 0, 10, t),
|
|
1859
1876
|
stringify: q
|
|
1860
|
-
},
|
|
1861
|
-
identify:
|
|
1877
|
+
}, rn = {
|
|
1878
|
+
identify: Ee,
|
|
1862
1879
|
default: !0,
|
|
1863
1880
|
tag: "tag:yaml.org,2002:int",
|
|
1864
1881
|
format: "HEX",
|
|
1865
1882
|
test: /^[-+]?0x[0-9a-fA-F_]+$/,
|
|
1866
|
-
resolve: (s, e, t) =>
|
|
1867
|
-
stringify: (s) =>
|
|
1883
|
+
resolve: (s, e, t) => We(s, 2, 16, t),
|
|
1884
|
+
stringify: (s) => kt(s, 16, "0x")
|
|
1868
1885
|
};
|
|
1869
|
-
class
|
|
1886
|
+
class ce extends K {
|
|
1870
1887
|
constructor(e) {
|
|
1871
|
-
super(e), this.tag =
|
|
1888
|
+
super(e), this.tag = ce.tag;
|
|
1872
1889
|
}
|
|
1873
1890
|
add(e) {
|
|
1874
1891
|
let t;
|
|
1875
|
-
|
|
1892
|
+
T(e) ? t = e : e && typeof e == "object" && "key" in e && "value" in e && e.value === null ? t = new v(e.key, null) : t = new v(e, null), X(this.items, t.key) || this.items.push(t);
|
|
1876
1893
|
}
|
|
1877
1894
|
/**
|
|
1878
1895
|
* If `keepPair` is `true`, returns the Pair matching `key`.
|
|
1879
1896
|
* Otherwise, returns the value of that Pair's key.
|
|
1880
1897
|
*/
|
|
1881
1898
|
get(e, t) {
|
|
1882
|
-
const n =
|
|
1883
|
-
return !t &&
|
|
1899
|
+
const n = X(this.items, e);
|
|
1900
|
+
return !t && T(n) ? E(n.key) ? n.key.value : n.key : n;
|
|
1884
1901
|
}
|
|
1885
1902
|
set(e, t) {
|
|
1886
1903
|
if (typeof t != "boolean")
|
|
1887
1904
|
throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);
|
|
1888
|
-
const n =
|
|
1905
|
+
const n = X(this.items, e);
|
|
1889
1906
|
n && !t ? this.items.splice(this.items.indexOf(n), 1) : !n && t && this.items.push(new v(e));
|
|
1890
1907
|
}
|
|
1891
1908
|
toJSON(e, t) {
|
|
@@ -1902,33 +1919,33 @@ class le extends P {
|
|
|
1902
1919
|
const { replacer: i } = n, r = new this(e);
|
|
1903
1920
|
if (t && Symbol.iterator in Object(t))
|
|
1904
1921
|
for (let o of t)
|
|
1905
|
-
typeof i == "function" && (o = i.call(t, o, o)), r.items.push(
|
|
1922
|
+
typeof i == "function" && (o = i.call(t, o, o)), r.items.push(mt(o, null, n));
|
|
1906
1923
|
return r;
|
|
1907
1924
|
}
|
|
1908
1925
|
}
|
|
1909
|
-
|
|
1910
|
-
const
|
|
1926
|
+
ce.tag = "tag:yaml.org,2002:set";
|
|
1927
|
+
const Nt = {
|
|
1911
1928
|
collection: "map",
|
|
1912
1929
|
identify: (s) => s instanceof Set,
|
|
1913
|
-
nodeClass:
|
|
1930
|
+
nodeClass: ce,
|
|
1914
1931
|
default: !1,
|
|
1915
1932
|
tag: "tag:yaml.org,2002:set",
|
|
1916
|
-
createNode: (s, e, t) =>
|
|
1933
|
+
createNode: (s, e, t) => ce.from(s, e, t),
|
|
1917
1934
|
resolve(s, e) {
|
|
1918
|
-
if (
|
|
1935
|
+
if (de(s)) {
|
|
1919
1936
|
if (s.hasAllNullValues(!0))
|
|
1920
|
-
return Object.assign(new
|
|
1937
|
+
return Object.assign(new ce(), s);
|
|
1921
1938
|
e("Set items must all have null values");
|
|
1922
1939
|
} else
|
|
1923
1940
|
e("Expected a mapping for this tag");
|
|
1924
1941
|
return s;
|
|
1925
1942
|
}
|
|
1926
1943
|
};
|
|
1927
|
-
function
|
|
1944
|
+
function Ot(s, e) {
|
|
1928
1945
|
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));
|
|
1929
1946
|
return t === "-" ? i(-1) * r : r;
|
|
1930
1947
|
}
|
|
1931
|
-
function
|
|
1948
|
+
function ds(s) {
|
|
1932
1949
|
let { value: e } = s, t = (o) => o;
|
|
1933
1950
|
if (typeof e == "bigint")
|
|
1934
1951
|
t = (o) => BigInt(o);
|
|
@@ -1939,23 +1956,23 @@ function fs(s) {
|
|
|
1939
1956
|
const i = t(60), r = [e % i];
|
|
1940
1957
|
return e < 60 ? r.unshift(0) : (e = (e - r[0]) / i, r.unshift(e % i), e >= 60 && (e = (e - r[0]) / i, r.unshift(e))), n + r.map((o) => String(o).padStart(2, "0")).join(":").replace(/000000\d*$/, "");
|
|
1941
1958
|
}
|
|
1942
|
-
const
|
|
1959
|
+
const ps = {
|
|
1943
1960
|
identify: (s) => typeof s == "bigint" || Number.isInteger(s),
|
|
1944
1961
|
default: !0,
|
|
1945
1962
|
tag: "tag:yaml.org,2002:int",
|
|
1946
1963
|
format: "TIME",
|
|
1947
1964
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
|
|
1948
|
-
resolve: (s, e, { intAsBigInt: t }) =>
|
|
1949
|
-
stringify:
|
|
1950
|
-
},
|
|
1965
|
+
resolve: (s, e, { intAsBigInt: t }) => Ot(s, t),
|
|
1966
|
+
stringify: ds
|
|
1967
|
+
}, ms = {
|
|
1951
1968
|
identify: (s) => typeof s == "number",
|
|
1952
1969
|
default: !0,
|
|
1953
1970
|
tag: "tag:yaml.org,2002:float",
|
|
1954
1971
|
format: "TIME",
|
|
1955
1972
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
|
|
1956
|
-
resolve: (s) =>
|
|
1957
|
-
stringify:
|
|
1958
|
-
},
|
|
1973
|
+
resolve: (s) => Ot(s, !1),
|
|
1974
|
+
stringify: ds
|
|
1975
|
+
}, He = {
|
|
1959
1976
|
identify: (s) => s instanceof Date,
|
|
1960
1977
|
default: !0,
|
|
1961
1978
|
tag: "tag:yaml.org,2002:timestamp",
|
|
@@ -1964,105 +1981,110 @@ const us = {
|
|
|
1964
1981
|
// assumed to be 00:00:00Z (start of day, UTC).
|
|
1965
1982
|
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})?))?)?$"),
|
|
1966
1983
|
resolve(s) {
|
|
1967
|
-
const e = s.match(
|
|
1984
|
+
const e = s.match(He.test);
|
|
1968
1985
|
if (!e)
|
|
1969
1986
|
throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
|
|
1970
1987
|
const [, t, n, i, r, o, l] = e.map(Number), a = e[7] ? Number((e[7] + "00").substr(1, 3)) : 0;
|
|
1971
1988
|
let c = Date.UTC(t, n - 1, i, r || 0, o || 0, l || 0, a);
|
|
1972
|
-
const
|
|
1973
|
-
if (
|
|
1974
|
-
let f =
|
|
1989
|
+
const p = e[8];
|
|
1990
|
+
if (p && p !== "Z") {
|
|
1991
|
+
let f = Ot(p, !1);
|
|
1975
1992
|
Math.abs(f) < 30 && (f *= 60), c -= 6e4 * f;
|
|
1976
1993
|
}
|
|
1977
1994
|
return new Date(c);
|
|
1978
1995
|
},
|
|
1979
1996
|
stringify: ({ value: s }) => s.toISOString().replace(/((T00:00)?:00)?\.000Z$/, "")
|
|
1980
|
-
},
|
|
1981
|
-
pe,
|
|
1997
|
+
}, Ct = [
|
|
1982
1998
|
me,
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1999
|
+
ye,
|
|
2000
|
+
Je,
|
|
2001
|
+
Ge,
|
|
2002
|
+
us,
|
|
2003
|
+
hs,
|
|
2004
|
+
tn,
|
|
2005
|
+
sn,
|
|
2006
|
+
nn,
|
|
2007
|
+
rn,
|
|
1987
2008
|
Zs,
|
|
1988
2009
|
xs,
|
|
1989
2010
|
en,
|
|
1990
|
-
tn,
|
|
1991
|
-
Hs,
|
|
1992
|
-
Xs,
|
|
1993
|
-
zs,
|
|
1994
|
-
yt,
|
|
1995
2011
|
bt,
|
|
1996
|
-
|
|
2012
|
+
V,
|
|
1997
2013
|
St,
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
["
|
|
2005
|
-
["
|
|
2006
|
-
["
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
"tag:yaml.org,2002:
|
|
2030
|
-
"tag:yaml.org,2002:
|
|
2014
|
+
wt,
|
|
2015
|
+
Nt,
|
|
2016
|
+
ps,
|
|
2017
|
+
ms,
|
|
2018
|
+
He
|
|
2019
|
+
], vt = /* @__PURE__ */ new Map([
|
|
2020
|
+
["core", Ws],
|
|
2021
|
+
["failsafe", [me, ye, Je]],
|
|
2022
|
+
["json", zs],
|
|
2023
|
+
["yaml11", Ct],
|
|
2024
|
+
["yaml-1.1", Ct]
|
|
2025
|
+
]), Bt = {
|
|
2026
|
+
binary: bt,
|
|
2027
|
+
bool: yt,
|
|
2028
|
+
float: ns,
|
|
2029
|
+
floatExp: ss,
|
|
2030
|
+
floatNaN: ts,
|
|
2031
|
+
floatTime: ms,
|
|
2032
|
+
int: os,
|
|
2033
|
+
intHex: ls,
|
|
2034
|
+
intOct: rs,
|
|
2035
|
+
intTime: ps,
|
|
2036
|
+
map: me,
|
|
2037
|
+
merge: V,
|
|
2038
|
+
null: Ge,
|
|
2039
|
+
omap: St,
|
|
2040
|
+
pairs: wt,
|
|
2041
|
+
seq: ye,
|
|
2042
|
+
set: Nt,
|
|
2043
|
+
timestamp: He
|
|
2044
|
+
}, on = {
|
|
2045
|
+
"tag:yaml.org,2002:binary": bt,
|
|
2046
|
+
"tag:yaml.org,2002:merge": V,
|
|
2047
|
+
"tag:yaml.org,2002:omap": St,
|
|
2048
|
+
"tag:yaml.org,2002:pairs": wt,
|
|
2049
|
+
"tag:yaml.org,2002:set": Nt,
|
|
2050
|
+
"tag:yaml.org,2002:timestamp": He
|
|
2031
2051
|
};
|
|
2032
|
-
function
|
|
2033
|
-
|
|
2034
|
-
if (!
|
|
2052
|
+
function tt(s, e, t) {
|
|
2053
|
+
const n = vt.get(e);
|
|
2054
|
+
if (n && !s)
|
|
2055
|
+
return t && !n.includes(V) ? n.concat(V) : n.slice();
|
|
2056
|
+
let i = n;
|
|
2057
|
+
if (!i)
|
|
2035
2058
|
if (Array.isArray(s))
|
|
2036
|
-
|
|
2059
|
+
i = [];
|
|
2037
2060
|
else {
|
|
2038
|
-
const
|
|
2039
|
-
throw new Error(`Unknown schema "${e}"; use one of ${
|
|
2061
|
+
const r = Array.from(vt.keys()).filter((o) => o !== "yaml11").map((o) => JSON.stringify(o)).join(", ");
|
|
2062
|
+
throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`);
|
|
2040
2063
|
}
|
|
2041
2064
|
if (Array.isArray(s))
|
|
2042
|
-
for (const
|
|
2043
|
-
|
|
2044
|
-
else typeof s == "function" && (
|
|
2045
|
-
return t.
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
});
|
|
2065
|
+
for (const r of s)
|
|
2066
|
+
i = i.concat(r);
|
|
2067
|
+
else typeof s == "function" && (i = s(i.slice()));
|
|
2068
|
+
return t && (i = i.concat(V)), i.reduce((r, o) => {
|
|
2069
|
+
const l = typeof o == "string" ? Bt[o] : o;
|
|
2070
|
+
if (!l) {
|
|
2071
|
+
const a = JSON.stringify(o), c = Object.keys(Bt).map((p) => JSON.stringify(p)).join(", ");
|
|
2072
|
+
throw new Error(`Unknown custom tag ${a}; use one of ${c}`);
|
|
2073
|
+
}
|
|
2074
|
+
return r.includes(l) || r.push(l), r;
|
|
2075
|
+
}, []);
|
|
2054
2076
|
}
|
|
2055
|
-
const
|
|
2056
|
-
class
|
|
2077
|
+
const ln = (s, e) => s.key < e.key ? -1 : s.key > e.key ? 1 : 0;
|
|
2078
|
+
class Xe {
|
|
2057
2079
|
constructor({ compat: e, customTags: t, merge: n, resolveKnownTags: i, schema: r, sortMapEntries: o, toStringDefaults: l }) {
|
|
2058
|
-
this.compat = Array.isArray(e) ?
|
|
2080
|
+
this.compat = Array.isArray(e) ? tt(e, "compat") : e ? tt(null, e) : null, this.name = typeof r == "string" && r || "core", this.knownTags = i ? on : {}, this.tags = tt(t, this.name, n), this.toStringOptions = l ?? null, Object.defineProperty(this, J, { value: me }), Object.defineProperty(this, U, { value: Je }), Object.defineProperty(this, he, { value: ye }), this.sortMapEntries = typeof o == "function" ? o : o === !0 ? ln : null;
|
|
2059
2081
|
}
|
|
2060
2082
|
clone() {
|
|
2061
|
-
const e = Object.create(
|
|
2083
|
+
const e = Object.create(Xe.prototype, Object.getOwnPropertyDescriptors(this));
|
|
2062
2084
|
return e.tags = this.tags.slice(), e;
|
|
2063
2085
|
}
|
|
2064
2086
|
}
|
|
2065
|
-
function
|
|
2087
|
+
function an(s, e) {
|
|
2066
2088
|
var a;
|
|
2067
2089
|
const t = [];
|
|
2068
2090
|
let n = e.directives === !0;
|
|
@@ -2071,7 +2093,7 @@ function rn(s, e) {
|
|
|
2071
2093
|
c ? (t.push(c), n = !0) : s.directives.docStart && (n = !0);
|
|
2072
2094
|
}
|
|
2073
2095
|
n && t.push("---");
|
|
2074
|
-
const i =
|
|
2096
|
+
const i = Xt(s, e), { commentString: r } = i.options;
|
|
2075
2097
|
if (s.commentBefore) {
|
|
2076
2098
|
t.length !== 1 && t.unshift("");
|
|
2077
2099
|
const c = r(s.commentBefore);
|
|
@@ -2087,10 +2109,10 @@ function rn(s, e) {
|
|
|
2087
2109
|
i.forceBlockIndent = !!s.comment, l = s.contents.comment;
|
|
2088
2110
|
}
|
|
2089
2111
|
const c = l ? void 0 : () => o = !0;
|
|
2090
|
-
let
|
|
2091
|
-
l && (
|
|
2112
|
+
let p = fe(s.contents, i, () => l = null, c);
|
|
2113
|
+
l && (p += H(p, "", r(l))), (p[0] === "|" || p[0] === ">") && t[t.length - 1] === "---" ? t[t.length - 1] = `--- ${p}` : t.push(p);
|
|
2092
2114
|
} else
|
|
2093
|
-
t.push(
|
|
2115
|
+
t.push(fe(s.contents, i));
|
|
2094
2116
|
if ((a = s.directives) != null && a.docEnd)
|
|
2095
2117
|
if (s.comment) {
|
|
2096
2118
|
const c = r(s.comment);
|
|
@@ -2106,9 +2128,9 @@ function rn(s, e) {
|
|
|
2106
2128
|
`) + `
|
|
2107
2129
|
`;
|
|
2108
2130
|
}
|
|
2109
|
-
class
|
|
2131
|
+
class ge {
|
|
2110
2132
|
constructor(e, t, n) {
|
|
2111
|
-
this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this,
|
|
2133
|
+
this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, D, { value: lt });
|
|
2112
2134
|
let i = null;
|
|
2113
2135
|
typeof t == "function" || Array.isArray(t) ? i = t : n === void 0 && t && (n = t, t = void 0);
|
|
2114
2136
|
const r = Object.assign({
|
|
@@ -2117,6 +2139,7 @@ class ye {
|
|
|
2117
2139
|
logLevel: "warn",
|
|
2118
2140
|
prettyErrors: !0,
|
|
2119
2141
|
strict: !0,
|
|
2142
|
+
stringKeys: !1,
|
|
2120
2143
|
uniqueKeys: !0,
|
|
2121
2144
|
version: "1.2"
|
|
2122
2145
|
}, n);
|
|
@@ -2130,18 +2153,18 @@ class ye {
|
|
|
2130
2153
|
* Custom Node values that inherit from `Object` still refer to their original instances.
|
|
2131
2154
|
*/
|
|
2132
2155
|
clone() {
|
|
2133
|
-
const e = Object.create(
|
|
2134
|
-
[
|
|
2156
|
+
const e = Object.create(ge.prototype, {
|
|
2157
|
+
[D]: { value: lt }
|
|
2135
2158
|
});
|
|
2136
2159
|
return e.commentBefore = this.commentBefore, e.comment = this.comment, e.errors = this.errors.slice(), e.warnings = this.warnings.slice(), e.options = Object.assign({}, this.options), this.directives && (e.directives = this.directives.clone()), e.schema = this.schema.clone(), e.contents = $(this.contents) ? this.contents.clone(e.schema) : this.contents, this.range && (e.range = this.range.slice()), e;
|
|
2137
2160
|
}
|
|
2138
2161
|
/** Adds a value to the document. */
|
|
2139
2162
|
add(e) {
|
|
2140
|
-
|
|
2163
|
+
se(this.contents) && this.contents.add(e);
|
|
2141
2164
|
}
|
|
2142
2165
|
/** Adds a value to the document. */
|
|
2143
2166
|
addIn(e, t) {
|
|
2144
|
-
|
|
2167
|
+
se(this.contents) && this.contents.addIn(e, t);
|
|
2145
2168
|
}
|
|
2146
2169
|
/**
|
|
2147
2170
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -2154,21 +2177,21 @@ class ye {
|
|
|
2154
2177
|
*/
|
|
2155
2178
|
createAlias(e, t) {
|
|
2156
2179
|
if (!e.anchor) {
|
|
2157
|
-
const n =
|
|
2180
|
+
const n = Jt(this);
|
|
2158
2181
|
e.anchor = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
2159
|
-
!t || n.has(t) ?
|
|
2182
|
+
!t || n.has(t) ? Gt(t || "a", n) : t;
|
|
2160
2183
|
}
|
|
2161
|
-
return new
|
|
2184
|
+
return new Ue(e.anchor);
|
|
2162
2185
|
}
|
|
2163
2186
|
createNode(e, t, n) {
|
|
2164
2187
|
let i;
|
|
2165
2188
|
if (typeof t == "function")
|
|
2166
2189
|
e = t.call({ "": e }, "", e), i = t;
|
|
2167
2190
|
else if (Array.isArray(t)) {
|
|
2168
|
-
const
|
|
2169
|
-
|
|
2191
|
+
const m = (w) => typeof w == "number" || w instanceof String || w instanceof Number, b = t.filter(m).map(String);
|
|
2192
|
+
b.length > 0 && (t = t.concat(b)), i = t;
|
|
2170
2193
|
} else n === void 0 && t && (n = t, t = void 0);
|
|
2171
|
-
const { aliasDuplicateObjects: r, anchorPrefix: o, flow: l, keepUndefined: a, onTagObj: c, tag:
|
|
2194
|
+
const { aliasDuplicateObjects: r, anchorPrefix: o, flow: l, keepUndefined: a, onTagObj: c, tag: p } = n ?? {}, { onAnchor: f, setAnchors: d, sourceObjects: h } = Ks(
|
|
2172
2195
|
this,
|
|
2173
2196
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
2174
2197
|
o || "a"
|
|
@@ -2180,7 +2203,7 @@ class ye {
|
|
|
2180
2203
|
replacer: i,
|
|
2181
2204
|
schema: this.schema,
|
|
2182
2205
|
sourceObjects: h
|
|
2183
|
-
}, u =
|
|
2206
|
+
}, u = ke(e, p, y);
|
|
2184
2207
|
return l && L(u) && (u.flow = !0), d(), u;
|
|
2185
2208
|
}
|
|
2186
2209
|
/**
|
|
@@ -2196,14 +2219,14 @@ class ye {
|
|
|
2196
2219
|
* @returns `true` if the item was found and removed.
|
|
2197
2220
|
*/
|
|
2198
2221
|
delete(e) {
|
|
2199
|
-
return
|
|
2222
|
+
return se(this.contents) ? this.contents.delete(e) : !1;
|
|
2200
2223
|
}
|
|
2201
2224
|
/**
|
|
2202
2225
|
* Removes a value from the document.
|
|
2203
2226
|
* @returns `true` if the item was found and removed.
|
|
2204
2227
|
*/
|
|
2205
2228
|
deleteIn(e) {
|
|
2206
|
-
return
|
|
2229
|
+
return we(e) ? this.contents == null ? !1 : (this.contents = null, !0) : se(this.contents) ? this.contents.deleteIn(e) : !1;
|
|
2207
2230
|
}
|
|
2208
2231
|
/**
|
|
2209
2232
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -2219,7 +2242,7 @@ class ye {
|
|
|
2219
2242
|
* `true` (collections are always returned intact).
|
|
2220
2243
|
*/
|
|
2221
2244
|
getIn(e, t) {
|
|
2222
|
-
return
|
|
2245
|
+
return we(e) ? !t && E(this.contents) ? this.contents.value : this.contents : L(this.contents) ? this.contents.getIn(e, t) : void 0;
|
|
2223
2246
|
}
|
|
2224
2247
|
/**
|
|
2225
2248
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -2231,21 +2254,21 @@ class ye {
|
|
|
2231
2254
|
* Checks if the document includes a value at `path`.
|
|
2232
2255
|
*/
|
|
2233
2256
|
hasIn(e) {
|
|
2234
|
-
return
|
|
2257
|
+
return we(e) ? this.contents !== void 0 : L(this.contents) ? this.contents.hasIn(e) : !1;
|
|
2235
2258
|
}
|
|
2236
2259
|
/**
|
|
2237
2260
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
2238
2261
|
* boolean to add/remove the item from the set.
|
|
2239
2262
|
*/
|
|
2240
2263
|
set(e, t) {
|
|
2241
|
-
this.contents == null ? this.contents =
|
|
2264
|
+
this.contents == null ? this.contents = Pe(this.schema, [e], t) : se(this.contents) && this.contents.set(e, t);
|
|
2242
2265
|
}
|
|
2243
2266
|
/**
|
|
2244
2267
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
2245
2268
|
* boolean to add/remove the item from the set.
|
|
2246
2269
|
*/
|
|
2247
2270
|
setIn(e, t) {
|
|
2248
|
-
|
|
2271
|
+
we(e) ? this.contents = t : this.contents == null ? this.contents = Pe(this.schema, Array.from(e), t) : se(this.contents) && this.contents.setIn(e, t);
|
|
2249
2272
|
}
|
|
2250
2273
|
/**
|
|
2251
2274
|
* Change the YAML version and schema used by the document.
|
|
@@ -2259,11 +2282,11 @@ class ye {
|
|
|
2259
2282
|
let n;
|
|
2260
2283
|
switch (e) {
|
|
2261
2284
|
case "1.1":
|
|
2262
|
-
this.directives ? this.directives.yaml.version = "1.1" : this.directives = new B({ version: "1.1" }), n = {
|
|
2285
|
+
this.directives ? this.directives.yaml.version = "1.1" : this.directives = new B({ version: "1.1" }), n = { resolveKnownTags: !1, schema: "yaml-1.1" };
|
|
2263
2286
|
break;
|
|
2264
2287
|
case "1.2":
|
|
2265
2288
|
case "next":
|
|
2266
|
-
this.directives ? this.directives.yaml.version = e : this.directives = new B({ version: e }), n = {
|
|
2289
|
+
this.directives ? this.directives.yaml.version = e : this.directives = new B({ version: e }), n = { resolveKnownTags: !0, schema: "core" };
|
|
2267
2290
|
break;
|
|
2268
2291
|
case null:
|
|
2269
2292
|
this.directives && delete this.directives, n = null;
|
|
@@ -2276,7 +2299,7 @@ class ye {
|
|
|
2276
2299
|
if (t.schema instanceof Object)
|
|
2277
2300
|
this.schema = t.schema;
|
|
2278
2301
|
else if (n)
|
|
2279
|
-
this.schema = new
|
|
2302
|
+
this.schema = new Xe(Object.assign(n, t));
|
|
2280
2303
|
else
|
|
2281
2304
|
throw new Error("With a null YAML version, the { schema: Schema } option is required");
|
|
2282
2305
|
}
|
|
@@ -2289,11 +2312,11 @@ class ye {
|
|
|
2289
2312
|
mapAsMap: n === !0,
|
|
2290
2313
|
mapKeyWarned: !1,
|
|
2291
2314
|
maxAliasCount: typeof i == "number" ? i : 100
|
|
2292
|
-
}, a =
|
|
2315
|
+
}, a = P(this.contents, t ?? "", l);
|
|
2293
2316
|
if (typeof r == "function")
|
|
2294
|
-
for (const { count: c, res:
|
|
2295
|
-
r(
|
|
2296
|
-
return typeof o == "function" ?
|
|
2317
|
+
for (const { count: c, res: p } of l.anchors.values())
|
|
2318
|
+
r(p, c);
|
|
2319
|
+
return typeof o == "function" ? oe(o, { "": a }, "", a) : a;
|
|
2297
2320
|
}
|
|
2298
2321
|
/**
|
|
2299
2322
|
* A JSON representation of the document `contents`.
|
|
@@ -2312,30 +2335,30 @@ class ye {
|
|
|
2312
2335
|
const t = JSON.stringify(e.indent);
|
|
2313
2336
|
throw new Error(`"indent" option must be a positive integer, not ${t}`);
|
|
2314
2337
|
}
|
|
2315
|
-
return
|
|
2338
|
+
return an(this, e);
|
|
2316
2339
|
}
|
|
2317
2340
|
}
|
|
2318
|
-
function
|
|
2341
|
+
function se(s) {
|
|
2319
2342
|
if (L(s))
|
|
2320
2343
|
return !0;
|
|
2321
2344
|
throw new Error("Expected a YAML collection as document contents");
|
|
2322
2345
|
}
|
|
2323
|
-
class
|
|
2346
|
+
class At extends Error {
|
|
2324
2347
|
constructor(e, t, n, i) {
|
|
2325
2348
|
super(), this.name = e, this.code = n, this.message = i, this.pos = t;
|
|
2326
2349
|
}
|
|
2327
2350
|
}
|
|
2328
|
-
class
|
|
2351
|
+
class z extends At {
|
|
2329
2352
|
constructor(e, t, n) {
|
|
2330
2353
|
super("YAMLParseError", e, t, n);
|
|
2331
2354
|
}
|
|
2332
2355
|
}
|
|
2333
|
-
class
|
|
2356
|
+
class ys extends At {
|
|
2334
2357
|
constructor(e, t, n) {
|
|
2335
2358
|
super("YAMLWarning", e, t, n);
|
|
2336
2359
|
}
|
|
2337
2360
|
}
|
|
2338
|
-
const
|
|
2361
|
+
const je = (s, e) => (t) => {
|
|
2339
2362
|
if (t.pos[0] === -1)
|
|
2340
2363
|
return;
|
|
2341
2364
|
t.linePos = t.pos.map((l) => e.linePos(l));
|
|
@@ -2363,55 +2386,55 @@ ${c}
|
|
|
2363
2386
|
`;
|
|
2364
2387
|
}
|
|
2365
2388
|
};
|
|
2366
|
-
function
|
|
2367
|
-
let a = !1, c = l,
|
|
2368
|
-
for (const
|
|
2369
|
-
switch (y && (
|
|
2389
|
+
function ue(s, { flow: e, indicator: t, next: n, offset: i, onError: r, parentIndent: o, startOnNewline: l }) {
|
|
2390
|
+
let a = !1, c = l, p = l, f = "", d = "", h = !1, y = !1, u = null, m = null, b = null, w = null, N = null, S = null, A = null;
|
|
2391
|
+
for (const g of s)
|
|
2392
|
+
switch (y && (g.type !== "space" && g.type !== "newline" && g.type !== "comma" && r(g.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), y = !1), u && (c && g.type !== "comment" && g.type !== "newline" && r(u, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), u = null), g.type) {
|
|
2370
2393
|
case "space":
|
|
2371
|
-
!e && (t !== "doc-start" || (n == null ? void 0 : n.type) !== "flow-collection") &&
|
|
2394
|
+
!e && (t !== "doc-start" || (n == null ? void 0 : n.type) !== "flow-collection") && g.source.includes(" ") && (u = g), p = !0;
|
|
2372
2395
|
break;
|
|
2373
2396
|
case "comment": {
|
|
2374
|
-
|
|
2375
|
-
const _ =
|
|
2397
|
+
p || r(g, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
|
|
2398
|
+
const _ = g.source.substring(1) || " ";
|
|
2376
2399
|
f ? f += d + _ : f = _, d = "", c = !1;
|
|
2377
2400
|
break;
|
|
2378
2401
|
}
|
|
2379
2402
|
case "newline":
|
|
2380
|
-
c ? f ? f +=
|
|
2403
|
+
c ? f ? f += g.source : a = !0 : d += g.source, c = !0, h = !0, (m || b) && (w = g), p = !0;
|
|
2381
2404
|
break;
|
|
2382
2405
|
case "anchor":
|
|
2383
|
-
|
|
2406
|
+
m && r(g, "MULTIPLE_ANCHORS", "A node can have at most one anchor"), g.source.endsWith(":") && r(g.offset + g.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", !0), m = g, A === null && (A = g.offset), c = !1, p = !1, y = !0;
|
|
2384
2407
|
break;
|
|
2385
2408
|
case "tag": {
|
|
2386
|
-
|
|
2409
|
+
b && r(g, "MULTIPLE_TAGS", "A node can have at most one tag"), b = g, A === null && (A = g.offset), c = !1, p = !1, y = !0;
|
|
2387
2410
|
break;
|
|
2388
2411
|
}
|
|
2389
2412
|
case t:
|
|
2390
|
-
(
|
|
2413
|
+
(m || b) && r(g, "BAD_PROP_ORDER", `Anchors and tags must be after the ${g.source} indicator`), S && r(g, "UNEXPECTED_TOKEN", `Unexpected ${g.source} in ${e ?? "collection"}`), S = g, c = t === "seq-item-ind" || t === "explicit-key-ind", p = !1;
|
|
2391
2414
|
break;
|
|
2392
2415
|
case "comma":
|
|
2393
2416
|
if (e) {
|
|
2394
|
-
N && r(
|
|
2417
|
+
N && r(g, "UNEXPECTED_TOKEN", `Unexpected , in ${e}`), N = g, c = !1, p = !1;
|
|
2395
2418
|
break;
|
|
2396
2419
|
}
|
|
2397
2420
|
default:
|
|
2398
|
-
r(
|
|
2421
|
+
r(g, "UNEXPECTED_TOKEN", `Unexpected ${g.type} token`), c = !1, p = !1;
|
|
2399
2422
|
}
|
|
2400
|
-
const k = s[s.length - 1],
|
|
2423
|
+
const k = s[s.length - 1], I = k ? k.offset + k.source.length : i;
|
|
2401
2424
|
return y && n && n.type !== "space" && n.type !== "newline" && n.type !== "comma" && (n.type !== "scalar" || n.source !== "") && r(n.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), u && (c && u.indent <= o || (n == null ? void 0 : n.type) === "block-map" || (n == null ? void 0 : n.type) === "block-seq") && r(u, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), {
|
|
2402
2425
|
comma: N,
|
|
2403
2426
|
found: S,
|
|
2404
2427
|
spaceBefore: a,
|
|
2405
2428
|
comment: f,
|
|
2406
2429
|
hasNewline: h,
|
|
2407
|
-
anchor:
|
|
2408
|
-
tag:
|
|
2430
|
+
anchor: m,
|
|
2431
|
+
tag: b,
|
|
2409
2432
|
newlineAfterProp: w,
|
|
2410
|
-
end:
|
|
2411
|
-
start: A ??
|
|
2433
|
+
end: I,
|
|
2434
|
+
start: A ?? I
|
|
2412
2435
|
};
|
|
2413
2436
|
}
|
|
2414
|
-
function
|
|
2437
|
+
function Ne(s) {
|
|
2415
2438
|
if (!s)
|
|
2416
2439
|
return null;
|
|
2417
2440
|
switch (s.type) {
|
|
@@ -2438,7 +2461,7 @@ function ke(s) {
|
|
|
2438
2461
|
if (t.type === "newline")
|
|
2439
2462
|
return !0;
|
|
2440
2463
|
}
|
|
2441
|
-
if (
|
|
2464
|
+
if (Ne(e.key) || Ne(e.value))
|
|
2442
2465
|
return !0;
|
|
2443
2466
|
}
|
|
2444
2467
|
return !1;
|
|
@@ -2446,45 +2469,46 @@ function ke(s) {
|
|
|
2446
2469
|
return !0;
|
|
2447
2470
|
}
|
|
2448
2471
|
}
|
|
2449
|
-
function
|
|
2472
|
+
function ut(s, e, t) {
|
|
2450
2473
|
if ((e == null ? void 0 : e.type) === "flow-collection") {
|
|
2451
2474
|
const n = e.end[0];
|
|
2452
|
-
n.indent === s && (n.source === "]" || n.source === "}") &&
|
|
2475
|
+
n.indent === s && (n.source === "]" || n.source === "}") && Ne(e) && t(n, "BAD_INDENT", "Flow end indicator should be more indented than parent", !0);
|
|
2453
2476
|
}
|
|
2454
2477
|
}
|
|
2455
|
-
function
|
|
2478
|
+
function gs(s, e, t) {
|
|
2456
2479
|
const { uniqueKeys: n } = s.options;
|
|
2457
2480
|
if (n === !1)
|
|
2458
2481
|
return !1;
|
|
2459
|
-
const i = typeof n == "function" ? n : (r, o) => r === o || E(r) && E(o) && r.value === o.value
|
|
2482
|
+
const i = typeof n == "function" ? n : (r, o) => r === o || E(r) && E(o) && r.value === o.value;
|
|
2460
2483
|
return e.some((r) => i(r.key, t));
|
|
2461
2484
|
}
|
|
2462
|
-
const
|
|
2463
|
-
function
|
|
2464
|
-
var
|
|
2465
|
-
const o = (r == null ? void 0 : r.nodeClass) ??
|
|
2485
|
+
const Mt = "All mapping items must start at the same column";
|
|
2486
|
+
function cn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
2487
|
+
var p;
|
|
2488
|
+
const o = (r == null ? void 0 : r.nodeClass) ?? K, l = new o(t.schema);
|
|
2466
2489
|
t.atRoot && (t.atRoot = !1);
|
|
2467
2490
|
let a = n.offset, c = null;
|
|
2468
2491
|
for (const f of n.items) {
|
|
2469
|
-
const { start: d, key: h, sep: y, value: u } = f,
|
|
2492
|
+
const { start: d, key: h, sep: y, value: u } = f, m = ue(d, {
|
|
2470
2493
|
indicator: "explicit-key-ind",
|
|
2471
2494
|
next: h ?? (y == null ? void 0 : y[0]),
|
|
2472
2495
|
offset: a,
|
|
2473
2496
|
onError: i,
|
|
2474
2497
|
parentIndent: n.indent,
|
|
2475
2498
|
startOnNewline: !0
|
|
2476
|
-
}),
|
|
2477
|
-
if (
|
|
2478
|
-
if (h && (h.type === "block-seq" ? i(a, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in h && h.indent !== n.indent && i(a, "BAD_INDENT",
|
|
2479
|
-
c =
|
|
2480
|
-
` +
|
|
2499
|
+
}), b = !m.found;
|
|
2500
|
+
if (b) {
|
|
2501
|
+
if (h && (h.type === "block-seq" ? i(a, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in h && h.indent !== n.indent && i(a, "BAD_INDENT", Mt)), !m.anchor && !m.tag && !y) {
|
|
2502
|
+
c = m.end, m.comment && (l.comment ? l.comment += `
|
|
2503
|
+
` + m.comment : l.comment = m.comment);
|
|
2481
2504
|
continue;
|
|
2482
2505
|
}
|
|
2483
|
-
(
|
|
2484
|
-
} else ((
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2506
|
+
(m.newlineAfterProp || Ne(h)) && i(h ?? d[d.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
|
2507
|
+
} else ((p = m.found) == null ? void 0 : p.indent) !== n.indent && i(a, "BAD_INDENT", Mt);
|
|
2508
|
+
t.atKey = !0;
|
|
2509
|
+
const w = m.end, N = h ? s(t, h, m, i) : e(t, w, d, null, m, i);
|
|
2510
|
+
t.schema.compat && ut(n.indent, h, i), t.atKey = !1, gs(t, l.items, N) && i(w, "DUPLICATE_KEY", "Map keys must be unique");
|
|
2511
|
+
const S = ue(y ?? [], {
|
|
2488
2512
|
indicator: "map-value-ind",
|
|
2489
2513
|
next: u,
|
|
2490
2514
|
offset: N.range[2],
|
|
@@ -2493,13 +2517,13 @@ function on({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2493
2517
|
startOnNewline: !h || h.type === "block-scalar"
|
|
2494
2518
|
});
|
|
2495
2519
|
if (a = S.end, S.found) {
|
|
2496
|
-
|
|
2520
|
+
b && ((u == null ? void 0 : u.type) === "block-map" && !S.hasNewline && i(a, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"), t.options.strict && m.start < S.found.offset - 1024 && i(N.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));
|
|
2497
2521
|
const A = u ? s(t, u, S, i) : e(t, a, y, null, S, i);
|
|
2498
|
-
t.schema.compat &&
|
|
2522
|
+
t.schema.compat && ut(n.indent, u, i), a = A.range[2];
|
|
2499
2523
|
const k = new v(N, A);
|
|
2500
2524
|
t.options.keepSourceTokens && (k.srcToken = f), l.items.push(k);
|
|
2501
2525
|
} else {
|
|
2502
|
-
|
|
2526
|
+
b && i(N.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"), S.comment && (N.comment ? N.comment += `
|
|
2503
2527
|
` + S.comment : N.comment = S.comment);
|
|
2504
2528
|
const A = new v(N);
|
|
2505
2529
|
t.options.keepSourceTokens && (A.srcToken = f), l.items.push(A);
|
|
@@ -2507,12 +2531,12 @@ function on({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2507
2531
|
}
|
|
2508
2532
|
return c && c < a && i(c, "IMPOSSIBLE", "Map comment with trailing content"), l.range = [n.offset, a, c ?? a], l;
|
|
2509
2533
|
}
|
|
2510
|
-
function
|
|
2511
|
-
const o = (r == null ? void 0 : r.nodeClass) ??
|
|
2512
|
-
t.atRoot && (t.atRoot = !1);
|
|
2534
|
+
function fn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
2535
|
+
const o = (r == null ? void 0 : r.nodeClass) ?? Q, l = new o(t.schema);
|
|
2536
|
+
t.atRoot && (t.atRoot = !1), t.atKey && (t.atKey = !1);
|
|
2513
2537
|
let a = n.offset, c = null;
|
|
2514
|
-
for (const { start:
|
|
2515
|
-
const d =
|
|
2538
|
+
for (const { start: p, value: f } of n.items) {
|
|
2539
|
+
const d = ue(p, {
|
|
2516
2540
|
indicator: "seq-item-ind",
|
|
2517
2541
|
next: f,
|
|
2518
2542
|
offset: a,
|
|
@@ -2527,12 +2551,12 @@ function ln({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2527
2551
|
c = d.end, d.comment && (l.comment = d.comment);
|
|
2528
2552
|
continue;
|
|
2529
2553
|
}
|
|
2530
|
-
const h = f ? s(t, f, d, i) : e(t, d.end,
|
|
2531
|
-
t.schema.compat &&
|
|
2554
|
+
const h = f ? s(t, f, d, i) : e(t, d.end, p, null, d, i);
|
|
2555
|
+
t.schema.compat && ut(n.indent, f, i), a = h.range[2], l.items.push(h);
|
|
2532
2556
|
}
|
|
2533
2557
|
return l.range = [n.offset, a, c ?? a], l;
|
|
2534
2558
|
}
|
|
2535
|
-
function
|
|
2559
|
+
function Te(s, e, t, n) {
|
|
2536
2560
|
let i = "";
|
|
2537
2561
|
if (s) {
|
|
2538
2562
|
let r = !1, o = "";
|
|
@@ -2544,8 +2568,8 @@ function Ee(s, e, t, n) {
|
|
|
2544
2568
|
break;
|
|
2545
2569
|
case "comment": {
|
|
2546
2570
|
t && !r && n(l, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
|
|
2547
|
-
const
|
|
2548
|
-
i ? i += o +
|
|
2571
|
+
const p = a.substring(1) || " ";
|
|
2572
|
+
i ? i += o + p : i = p, o = "";
|
|
2549
2573
|
break;
|
|
2550
2574
|
}
|
|
2551
2575
|
case "newline":
|
|
@@ -2559,15 +2583,15 @@ function Ee(s, e, t, n) {
|
|
|
2559
2583
|
}
|
|
2560
2584
|
return { comment: i, offset: e };
|
|
2561
2585
|
}
|
|
2562
|
-
const
|
|
2563
|
-
function
|
|
2564
|
-
const o = n.start.source === "{", l = o ? "flow map" : "flow sequence", a = (r == null ? void 0 : r.nodeClass) ?? (o ?
|
|
2586
|
+
const st = "Block collections are not allowed within flow collections", nt = (s) => s && (s.type === "block-map" || s.type === "block-seq");
|
|
2587
|
+
function un({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
2588
|
+
const o = n.start.source === "{", l = o ? "flow map" : "flow sequence", a = (r == null ? void 0 : r.nodeClass) ?? (o ? K : Q), c = new a(t.schema);
|
|
2565
2589
|
c.flow = !0;
|
|
2566
|
-
const
|
|
2567
|
-
|
|
2590
|
+
const p = t.atRoot;
|
|
2591
|
+
p && (t.atRoot = !1), t.atKey && (t.atKey = !1);
|
|
2568
2592
|
let f = n.offset + n.start.source.length;
|
|
2569
|
-
for (let
|
|
2570
|
-
const
|
|
2593
|
+
for (let m = 0; m < n.items.length; ++m) {
|
|
2594
|
+
const b = n.items[m], { start: w, key: N, sep: S, value: A } = b, k = ue(w, {
|
|
2571
2595
|
flow: l,
|
|
2572
2596
|
indicator: "explicit-key-ind",
|
|
2573
2597
|
next: N ?? (S == null ? void 0 : S[0]),
|
|
@@ -2578,49 +2602,50 @@ function an({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2578
2602
|
});
|
|
2579
2603
|
if (!k.found) {
|
|
2580
2604
|
if (!k.anchor && !k.tag && !S && !A) {
|
|
2581
|
-
|
|
2605
|
+
m === 0 && k.comma ? i(k.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${l}`) : m < n.items.length - 1 && i(k.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${l}`), k.comment && (c.comment ? c.comment += `
|
|
2582
2606
|
` + k.comment : c.comment = k.comment), f = k.end;
|
|
2583
2607
|
continue;
|
|
2584
2608
|
}
|
|
2585
|
-
!o && t.options.strict &&
|
|
2609
|
+
!o && t.options.strict && Ne(N) && i(
|
|
2586
2610
|
N,
|
|
2587
2611
|
// checked by containsNewline()
|
|
2588
2612
|
"MULTILINE_IMPLICIT_KEY",
|
|
2589
2613
|
"Implicit keys of flow sequence pairs need to be on a single line"
|
|
2590
2614
|
);
|
|
2591
2615
|
}
|
|
2592
|
-
if (
|
|
2616
|
+
if (m === 0)
|
|
2593
2617
|
k.comma && i(k.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${l}`);
|
|
2594
2618
|
else if (k.comma || i(k.start, "MISSING_CHAR", `Missing , between ${l} items`), k.comment) {
|
|
2595
|
-
let
|
|
2596
|
-
e: for (const
|
|
2597
|
-
switch (
|
|
2619
|
+
let I = "";
|
|
2620
|
+
e: for (const g of w)
|
|
2621
|
+
switch (g.type) {
|
|
2598
2622
|
case "comma":
|
|
2599
2623
|
case "space":
|
|
2600
2624
|
break;
|
|
2601
2625
|
case "comment":
|
|
2602
|
-
|
|
2626
|
+
I = g.source.substring(1);
|
|
2603
2627
|
break e;
|
|
2604
2628
|
default:
|
|
2605
2629
|
break e;
|
|
2606
2630
|
}
|
|
2607
|
-
if (
|
|
2608
|
-
let
|
|
2609
|
-
|
|
2610
|
-
` +
|
|
2631
|
+
if (I) {
|
|
2632
|
+
let g = c.items[c.items.length - 1];
|
|
2633
|
+
T(g) && (g = g.value ?? g.key), g.comment ? g.comment += `
|
|
2634
|
+
` + I : g.comment = I, k.comment = k.comment.substring(I.length + 1);
|
|
2611
2635
|
}
|
|
2612
2636
|
}
|
|
2613
2637
|
if (!o && !S && !k.found) {
|
|
2614
|
-
const
|
|
2615
|
-
c.items.push(
|
|
2638
|
+
const I = A ? s(t, A, k, i) : e(t, k.end, S, null, k, i);
|
|
2639
|
+
c.items.push(I), f = I.range[2], nt(A) && i(I.range, "BLOCK_IN_FLOW", st);
|
|
2616
2640
|
} else {
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2641
|
+
t.atKey = !0;
|
|
2642
|
+
const I = k.end, g = N ? s(t, N, k, i) : e(t, I, w, null, k, i);
|
|
2643
|
+
nt(N) && i(g.range, "BLOCK_IN_FLOW", st), t.atKey = !1;
|
|
2644
|
+
const _ = ue(S ?? [], {
|
|
2620
2645
|
flow: l,
|
|
2621
2646
|
indicator: "map-value-ind",
|
|
2622
2647
|
next: A,
|
|
2623
|
-
offset:
|
|
2648
|
+
offset: g.range[2],
|
|
2624
2649
|
onError: i,
|
|
2625
2650
|
parentIndent: n.indent,
|
|
2626
2651
|
startOnNewline: !1
|
|
@@ -2639,18 +2664,20 @@ function an({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2639
2664
|
k.start < _.found.offset - 1024 && i(_.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");
|
|
2640
2665
|
}
|
|
2641
2666
|
} else A && ("source" in A && A.source && A.source[0] === ":" ? i(A, "MISSING_CHAR", `Missing space after : in ${l}`) : i(_.start, "MISSING_CHAR", `Missing , or : between ${l} items`));
|
|
2642
|
-
const
|
|
2643
|
-
|
|
2644
|
-
` + _.comment :
|
|
2645
|
-
const
|
|
2646
|
-
if (t.options.keepSourceTokens && (
|
|
2667
|
+
const Y = A ? s(t, A, _, i) : _.found ? e(t, _.end, S, null, _, i) : null;
|
|
2668
|
+
Y ? nt(A) && i(Y.range, "BLOCK_IN_FLOW", st) : _.comment && (g.comment ? g.comment += `
|
|
2669
|
+
` + _.comment : g.comment = _.comment);
|
|
2670
|
+
const te = new v(g, Y);
|
|
2671
|
+
if (t.options.keepSourceTokens && (te.srcToken = b), o) {
|
|
2647
2672
|
const C = c;
|
|
2648
|
-
|
|
2673
|
+
gs(t, C.items, g) && i(I, "DUPLICATE_KEY", "Map keys must be unique"), C.items.push(te);
|
|
2649
2674
|
} else {
|
|
2650
|
-
const C = new
|
|
2651
|
-
C.flow = !0, C.items.push(
|
|
2675
|
+
const C = new K(t.schema);
|
|
2676
|
+
C.flow = !0, C.items.push(te);
|
|
2677
|
+
const Lt = (Y ?? g).range;
|
|
2678
|
+
C.range = [g.range[0], Lt[1], Lt[2]], c.items.push(C);
|
|
2652
2679
|
}
|
|
2653
|
-
f =
|
|
2680
|
+
f = Y ? Y.range[2] : _.end;
|
|
2654
2681
|
}
|
|
2655
2682
|
}
|
|
2656
2683
|
const d = o ? "}" : "]", [h, ...y] = n.end;
|
|
@@ -2658,22 +2685,22 @@ function an({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2658
2685
|
if (h && h.source === d)
|
|
2659
2686
|
u = h.offset + h.source.length;
|
|
2660
2687
|
else {
|
|
2661
|
-
const
|
|
2662
|
-
i(f,
|
|
2688
|
+
const m = l[0].toUpperCase() + l.substring(1), b = p ? `${m} must end with a ${d}` : `${m} in block collection must be sufficiently indented and end with a ${d}`;
|
|
2689
|
+
i(f, p ? "MISSING_CHAR" : "BAD_INDENT", b), h && h.source.length !== 1 && y.unshift(h);
|
|
2663
2690
|
}
|
|
2664
2691
|
if (y.length > 0) {
|
|
2665
|
-
const
|
|
2666
|
-
|
|
2667
|
-
` +
|
|
2692
|
+
const m = Te(y, u, t.options.strict, i);
|
|
2693
|
+
m.comment && (c.comment ? c.comment += `
|
|
2694
|
+
` + m.comment : c.comment = m.comment), c.range = [n.offset, u, m.offset];
|
|
2668
2695
|
} else
|
|
2669
2696
|
c.range = [n.offset, u, u];
|
|
2670
2697
|
return c;
|
|
2671
2698
|
}
|
|
2672
|
-
function
|
|
2673
|
-
const o = t.type === "block-map" ?
|
|
2699
|
+
function it(s, e, t, n, i, r) {
|
|
2700
|
+
const o = t.type === "block-map" ? cn(s, e, t, n, r) : t.type === "block-seq" ? fn(s, e, t, n, r) : un(s, e, t, n, r), l = o.constructor;
|
|
2674
2701
|
return i === "!" || i === l.tagName ? (o.tag = l.tagName, o) : (i && (o.tag = i), o);
|
|
2675
2702
|
}
|
|
2676
|
-
function
|
|
2703
|
+
function hn(s, e, t, n, i) {
|
|
2677
2704
|
var d;
|
|
2678
2705
|
const r = n.tag, o = r ? e.directives.tagName(r.source, (h) => i(r, "TAG_RESOLVE_FAILED", h)) : null;
|
|
2679
2706
|
if (t.type === "block-seq") {
|
|
@@ -2681,28 +2708,28 @@ function cn(s, e, t, n, i) {
|
|
|
2681
2708
|
u && (!y || y.offset < u.offset) && i(u, "MISSING_CHAR", "Missing newline after block sequence props");
|
|
2682
2709
|
}
|
|
2683
2710
|
const l = t.type === "block-map" ? "map" : t.type === "block-seq" ? "seq" : t.start.source === "{" ? "map" : "seq";
|
|
2684
|
-
if (!r || !o || o === "!" || o ===
|
|
2685
|
-
return
|
|
2711
|
+
if (!r || !o || o === "!" || o === K.tagName && l === "map" || o === Q.tagName && l === "seq")
|
|
2712
|
+
return it(s, e, t, i, o);
|
|
2686
2713
|
let a = e.schema.tags.find((h) => h.tag === o && h.collection === l);
|
|
2687
2714
|
if (!a) {
|
|
2688
2715
|
const h = e.schema.knownTags[o];
|
|
2689
2716
|
if (h && h.collection === l)
|
|
2690
2717
|
e.schema.tags.push(Object.assign({}, h, { default: !1 })), a = h;
|
|
2691
2718
|
else
|
|
2692
|
-
return h != null && h.collection ? i(r, "BAD_COLLECTION_TYPE", `${h.tag} used for ${l} collection, but expects ${h.collection}`, !0) : i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0),
|
|
2719
|
+
return h != null && h.collection ? i(r, "BAD_COLLECTION_TYPE", `${h.tag} used for ${l} collection, but expects ${h.collection}`, !0) : i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0), it(s, e, t, i, o);
|
|
2693
2720
|
}
|
|
2694
|
-
const c =
|
|
2721
|
+
const c = it(s, e, t, i, o, a), p = ((d = a.resolve) == null ? void 0 : d.call(a, c, (h) => i(r, "TAG_RESOLVE_FAILED", h), e.options)) ?? c, f = $(p) ? p : new O(p);
|
|
2695
2722
|
return f.range = c.range, f.tag = o, a != null && a.format && (f.format = a.format), f;
|
|
2696
2723
|
}
|
|
2697
|
-
function
|
|
2698
|
-
const n = e.offset, i =
|
|
2724
|
+
function bs(s, e, t) {
|
|
2725
|
+
const n = e.offset, i = dn(e, s.options.strict, t);
|
|
2699
2726
|
if (!i)
|
|
2700
2727
|
return { value: "", type: null, comment: "", range: [n, n, n] };
|
|
2701
|
-
const r = i.mode === ">" ? O.BLOCK_FOLDED : O.BLOCK_LITERAL, o = e.source ?
|
|
2728
|
+
const r = i.mode === ">" ? O.BLOCK_FOLDED : O.BLOCK_LITERAL, o = e.source ? pn(e.source) : [];
|
|
2702
2729
|
let l = o.length;
|
|
2703
2730
|
for (let u = o.length - 1; u >= 0; --u) {
|
|
2704
|
-
const
|
|
2705
|
-
if (
|
|
2731
|
+
const m = o[u][1];
|
|
2732
|
+
if (m === "" || m === "\r")
|
|
2706
2733
|
l = u;
|
|
2707
2734
|
else
|
|
2708
2735
|
break;
|
|
@@ -2710,44 +2737,44 @@ function ms(s, e, t) {
|
|
|
2710
2737
|
if (l === 0) {
|
|
2711
2738
|
const u = i.chomp === "+" && o.length > 0 ? `
|
|
2712
2739
|
`.repeat(Math.max(1, o.length - 1)) : "";
|
|
2713
|
-
let
|
|
2714
|
-
return e.source && (
|
|
2740
|
+
let m = n + i.length;
|
|
2741
|
+
return e.source && (m += e.source.length), { value: u, type: r, comment: i.comment, range: [n, m, m] };
|
|
2715
2742
|
}
|
|
2716
|
-
let a = e.indent + i.indent, c = e.offset + i.length,
|
|
2743
|
+
let a = e.indent + i.indent, c = e.offset + i.length, p = 0;
|
|
2717
2744
|
for (let u = 0; u < l; ++u) {
|
|
2718
|
-
const [
|
|
2719
|
-
if (
|
|
2720
|
-
i.indent === 0 &&
|
|
2745
|
+
const [m, b] = o[u];
|
|
2746
|
+
if (b === "" || b === "\r")
|
|
2747
|
+
i.indent === 0 && m.length > a && (a = m.length);
|
|
2721
2748
|
else {
|
|
2722
|
-
|
|
2749
|
+
m.length < a && t(c + m.length, "MISSING_CHAR", "Block scalars with more-indented leading empty lines must use an explicit indentation indicator"), i.indent === 0 && (a = m.length), p = u, a === 0 && !s.atRoot && t(c, "BAD_INDENT", "Block scalar values in collections must be indented");
|
|
2723
2750
|
break;
|
|
2724
2751
|
}
|
|
2725
|
-
c +=
|
|
2752
|
+
c += m.length + b.length + 1;
|
|
2726
2753
|
}
|
|
2727
2754
|
for (let u = o.length - 1; u >= l; --u)
|
|
2728
2755
|
o[u][0].length > a && (l = u + 1);
|
|
2729
2756
|
let f = "", d = "", h = !1;
|
|
2730
|
-
for (let u = 0; u <
|
|
2757
|
+
for (let u = 0; u < p; ++u)
|
|
2731
2758
|
f += o[u][0].slice(a) + `
|
|
2732
2759
|
`;
|
|
2733
|
-
for (let u =
|
|
2734
|
-
let [
|
|
2735
|
-
c +=
|
|
2736
|
-
const w =
|
|
2737
|
-
if (w && (
|
|
2760
|
+
for (let u = p; u < l; ++u) {
|
|
2761
|
+
let [m, b] = o[u];
|
|
2762
|
+
c += m.length + b.length + 1;
|
|
2763
|
+
const w = b[b.length - 1] === "\r";
|
|
2764
|
+
if (w && (b = b.slice(0, -1)), b && m.length < a) {
|
|
2738
2765
|
const S = `Block scalar lines must not be less indented than their ${i.indent ? "explicit indentation indicator" : "first line"}`;
|
|
2739
|
-
t(c -
|
|
2766
|
+
t(c - b.length - (w ? 2 : 1), "BAD_INDENT", S), m = "";
|
|
2740
2767
|
}
|
|
2741
|
-
r === O.BLOCK_LITERAL ? (f += d +
|
|
2742
|
-
`) :
|
|
2768
|
+
r === O.BLOCK_LITERAL ? (f += d + m.slice(a) + b, d = `
|
|
2769
|
+
`) : m.length > a || b[0] === " " ? (d === " " ? d = `
|
|
2743
2770
|
` : !h && d === `
|
|
2744
2771
|
` && (d = `
|
|
2745
2772
|
|
|
2746
|
-
`), f += d +
|
|
2747
|
-
`, h = !0) :
|
|
2773
|
+
`), f += d + m.slice(a) + b, d = `
|
|
2774
|
+
`, h = !0) : b === "" ? d === `
|
|
2748
2775
|
` ? f += `
|
|
2749
2776
|
` : d = `
|
|
2750
|
-
` : (f += d +
|
|
2777
|
+
` : (f += d + b, d = " ", h = !1);
|
|
2751
2778
|
}
|
|
2752
2779
|
switch (i.chomp) {
|
|
2753
2780
|
case "-":
|
|
@@ -2767,7 +2794,7 @@ function ms(s, e, t) {
|
|
|
2767
2794
|
const y = n + i.length + e.source.length;
|
|
2768
2795
|
return { value: f, type: r, comment: i.comment, range: [n, y, y] };
|
|
2769
2796
|
}
|
|
2770
|
-
function
|
|
2797
|
+
function dn({ offset: s, props: e }, t, n) {
|
|
2771
2798
|
if (e[0].type !== "block-scalar-header")
|
|
2772
2799
|
return n(e[0], "IMPOSSIBLE", "Block scalar header not found"), null;
|
|
2773
2800
|
const { source: i } = e[0], r = i[0];
|
|
@@ -2782,7 +2809,7 @@ function fn({ offset: s, props: e }, t, n) {
|
|
|
2782
2809
|
}
|
|
2783
2810
|
}
|
|
2784
2811
|
a !== -1 && n(a, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${i}`);
|
|
2785
|
-
let c = !1,
|
|
2812
|
+
let c = !1, p = "", f = i.length;
|
|
2786
2813
|
for (let d = 1; d < e.length; ++d) {
|
|
2787
2814
|
const h = e[d];
|
|
2788
2815
|
switch (h.type) {
|
|
@@ -2792,7 +2819,7 @@ function fn({ offset: s, props: e }, t, n) {
|
|
|
2792
2819
|
f += h.source.length;
|
|
2793
2820
|
break;
|
|
2794
2821
|
case "comment":
|
|
2795
|
-
t && !c && n(h, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"), f += h.source.length,
|
|
2822
|
+
t && !c && n(h, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"), f += h.source.length, p = h.source.substring(1);
|
|
2796
2823
|
break;
|
|
2797
2824
|
case "error":
|
|
2798
2825
|
n(h, "UNEXPECTED_TOKEN", h.message), f += h.source.length;
|
|
@@ -2805,27 +2832,27 @@ function fn({ offset: s, props: e }, t, n) {
|
|
|
2805
2832
|
}
|
|
2806
2833
|
}
|
|
2807
2834
|
}
|
|
2808
|
-
return { mode: r, indent: o, chomp: l, comment:
|
|
2835
|
+
return { mode: r, indent: o, chomp: l, comment: p, length: f };
|
|
2809
2836
|
}
|
|
2810
|
-
function
|
|
2837
|
+
function pn(s) {
|
|
2811
2838
|
const e = s.split(/\n( *)/), t = e[0], n = t.match(/^( *)/), r = [n != null && n[1] ? [n[1], t.slice(n[1].length)] : ["", t]];
|
|
2812
2839
|
for (let o = 1; o < e.length; o += 2)
|
|
2813
2840
|
r.push([e[o], e[o + 1]]);
|
|
2814
2841
|
return r;
|
|
2815
2842
|
}
|
|
2816
|
-
function
|
|
2843
|
+
function ws(s, e, t) {
|
|
2817
2844
|
const { offset: n, type: i, source: r, end: o } = s;
|
|
2818
2845
|
let l, a;
|
|
2819
2846
|
const c = (d, h, y) => t(n + d, h, y);
|
|
2820
2847
|
switch (i) {
|
|
2821
2848
|
case "scalar":
|
|
2822
|
-
l = O.PLAIN, a =
|
|
2849
|
+
l = O.PLAIN, a = mn(r, c);
|
|
2823
2850
|
break;
|
|
2824
2851
|
case "single-quoted-scalar":
|
|
2825
|
-
l = O.QUOTE_SINGLE, a =
|
|
2852
|
+
l = O.QUOTE_SINGLE, a = yn(r, c);
|
|
2826
2853
|
break;
|
|
2827
2854
|
case "double-quoted-scalar":
|
|
2828
|
-
l = O.QUOTE_DOUBLE, a =
|
|
2855
|
+
l = O.QUOTE_DOUBLE, a = gn(r, c);
|
|
2829
2856
|
break;
|
|
2830
2857
|
default:
|
|
2831
2858
|
return t(s, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${i}`), {
|
|
@@ -2835,15 +2862,15 @@ function ys(s, e, t) {
|
|
|
2835
2862
|
range: [n, n + r.length, n + r.length]
|
|
2836
2863
|
};
|
|
2837
2864
|
}
|
|
2838
|
-
const
|
|
2865
|
+
const p = n + r.length, f = Te(o, p, e, t);
|
|
2839
2866
|
return {
|
|
2840
2867
|
value: a,
|
|
2841
2868
|
type: l,
|
|
2842
2869
|
comment: f.comment,
|
|
2843
|
-
range: [n,
|
|
2870
|
+
range: [n, p, f.offset]
|
|
2844
2871
|
};
|
|
2845
2872
|
}
|
|
2846
|
-
function
|
|
2873
|
+
function mn(s, e) {
|
|
2847
2874
|
let t = "";
|
|
2848
2875
|
switch (s[0]) {
|
|
2849
2876
|
case " ":
|
|
@@ -2866,12 +2893,12 @@ function hn(s, e) {
|
|
|
2866
2893
|
break;
|
|
2867
2894
|
}
|
|
2868
2895
|
}
|
|
2869
|
-
return t && e(0, "BAD_SCALAR_START", `Plain value cannot start with ${t}`),
|
|
2896
|
+
return t && e(0, "BAD_SCALAR_START", `Plain value cannot start with ${t}`), Ss(s);
|
|
2870
2897
|
}
|
|
2871
|
-
function
|
|
2872
|
-
return (s[s.length - 1] !== "'" || s.length === 1) && e(s.length, "MISSING_CHAR", "Missing closing 'quote"),
|
|
2898
|
+
function yn(s, e) {
|
|
2899
|
+
return (s[s.length - 1] !== "'" || s.length === 1) && e(s.length, "MISSING_CHAR", "Missing closing 'quote"), Ss(s.slice(1, -1)).replace(/''/g, "'");
|
|
2873
2900
|
}
|
|
2874
|
-
function
|
|
2901
|
+
function Ss(s) {
|
|
2875
2902
|
let e, t;
|
|
2876
2903
|
try {
|
|
2877
2904
|
e = new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
@@ -2891,7 +2918,7 @@ function gs(s) {
|
|
|
2891
2918
|
const l = /[ \t]*(.*)/sy;
|
|
2892
2919
|
return l.lastIndex = o, n = l.exec(s), i + r + ((n == null ? void 0 : n[1]) ?? "");
|
|
2893
2920
|
}
|
|
2894
|
-
function
|
|
2921
|
+
function gn(s, e) {
|
|
2895
2922
|
let t = "";
|
|
2896
2923
|
for (let n = 1; n < s.length - 1; ++n) {
|
|
2897
2924
|
const i = s[n];
|
|
@@ -2899,11 +2926,11 @@ function pn(s, e) {
|
|
|
2899
2926
|
`))
|
|
2900
2927
|
if (i === `
|
|
2901
2928
|
`) {
|
|
2902
|
-
const { fold: r, offset: o } =
|
|
2929
|
+
const { fold: r, offset: o } = bn(s, n);
|
|
2903
2930
|
t += r, n = o;
|
|
2904
2931
|
} else if (i === "\\") {
|
|
2905
2932
|
let r = s[++n];
|
|
2906
|
-
const o =
|
|
2933
|
+
const o = wn[r];
|
|
2907
2934
|
if (o)
|
|
2908
2935
|
t += o;
|
|
2909
2936
|
else if (r === `
|
|
@@ -2916,7 +2943,7 @@ function pn(s, e) {
|
|
|
2916
2943
|
r = s[++n + 1];
|
|
2917
2944
|
else if (r === "x" || r === "u" || r === "U") {
|
|
2918
2945
|
const l = { x: 2, u: 4, U: 8 }[r];
|
|
2919
|
-
t +=
|
|
2946
|
+
t += Sn(s, n + 1, l, e), n += l;
|
|
2920
2947
|
} else {
|
|
2921
2948
|
const l = s.substr(n - 1, 2);
|
|
2922
2949
|
e(n - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${l}`), t += l;
|
|
@@ -2934,7 +2961,7 @@ function pn(s, e) {
|
|
|
2934
2961
|
}
|
|
2935
2962
|
return (s[s.length - 1] !== '"' || s.length === 1) && e(s.length, "MISSING_CHAR", 'Missing closing "quote'), t;
|
|
2936
2963
|
}
|
|
2937
|
-
function
|
|
2964
|
+
function bn(s, e) {
|
|
2938
2965
|
let t = "", n = s[e + 1];
|
|
2939
2966
|
for (; (n === " " || n === " " || n === `
|
|
2940
2967
|
` || n === "\r") && !(n === "\r" && s[e + 2] !== `
|
|
@@ -2944,7 +2971,7 @@ function mn(s, e) {
|
|
|
2944
2971
|
`), e += 1, n = s[e + 1];
|
|
2945
2972
|
return t || (t = " "), { fold: t, offset: e };
|
|
2946
2973
|
}
|
|
2947
|
-
const
|
|
2974
|
+
const wn = {
|
|
2948
2975
|
0: "\0",
|
|
2949
2976
|
// null character
|
|
2950
2977
|
a: "\x07",
|
|
@@ -2978,7 +3005,7 @@ const yn = {
|
|
|
2978
3005
|
"\\": "\\",
|
|
2979
3006
|
" ": " "
|
|
2980
3007
|
};
|
|
2981
|
-
function
|
|
3008
|
+
function Sn(s, e, t, n) {
|
|
2982
3009
|
const i = s.substr(e, t), o = i.length === t && /^[0-9a-fA-F]+$/.test(i) ? parseInt(i, 16) : NaN;
|
|
2983
3010
|
if (isNaN(o)) {
|
|
2984
3011
|
const l = s.substr(e - 2, t + 2);
|
|
@@ -2986,22 +3013,24 @@ function gn(s, e, t, n) {
|
|
|
2986
3013
|
}
|
|
2987
3014
|
return String.fromCodePoint(o);
|
|
2988
3015
|
}
|
|
2989
|
-
function
|
|
2990
|
-
const { value: i, type: r, comment: o, range: l } = e.type === "block-scalar" ?
|
|
2991
|
-
let
|
|
3016
|
+
function ks(s, e, t, n) {
|
|
3017
|
+
const { value: i, type: r, comment: o, range: l } = e.type === "block-scalar" ? bs(s, e, n) : ws(e, s.options.strict, n), a = t ? s.directives.tagName(t.source, (f) => n(t, "TAG_RESOLVE_FAILED", f)) : null;
|
|
3018
|
+
let c;
|
|
3019
|
+
s.options.stringKeys && s.atKey ? c = s.schema[U] : a ? c = kn(s.schema, i, a, t, n) : e.type === "scalar" ? c = Nn(s, i, e, n) : c = s.schema[U];
|
|
3020
|
+
let p;
|
|
2992
3021
|
try {
|
|
2993
3022
|
const f = c.resolve(i, (d) => n(t ?? e, "TAG_RESOLVE_FAILED", d), s.options);
|
|
2994
|
-
|
|
3023
|
+
p = E(f) ? f : new O(f);
|
|
2995
3024
|
} catch (f) {
|
|
2996
3025
|
const d = f instanceof Error ? f.message : String(f);
|
|
2997
|
-
n(t ?? e, "TAG_RESOLVE_FAILED", d),
|
|
3026
|
+
n(t ?? e, "TAG_RESOLVE_FAILED", d), p = new O(i);
|
|
2998
3027
|
}
|
|
2999
|
-
return
|
|
3028
|
+
return p.range = l, p.source = i, r && (p.type = r), a && (p.tag = a), c.format && (p.format = c.format), o && (p.comment = o), p;
|
|
3000
3029
|
}
|
|
3001
|
-
function
|
|
3030
|
+
function kn(s, e, t, n, i) {
|
|
3002
3031
|
var l;
|
|
3003
3032
|
if (t === "!")
|
|
3004
|
-
return s[
|
|
3033
|
+
return s[U];
|
|
3005
3034
|
const r = [];
|
|
3006
3035
|
for (const a of s.tags)
|
|
3007
3036
|
if (!a.collection && a.tag === t)
|
|
@@ -3013,26 +3042,26 @@ function bn(s, e, t, n, i) {
|
|
|
3013
3042
|
if ((l = a.test) != null && l.test(e))
|
|
3014
3043
|
return a;
|
|
3015
3044
|
const o = s.knownTags[t];
|
|
3016
|
-
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[
|
|
3017
|
-
}
|
|
3018
|
-
function
|
|
3019
|
-
const
|
|
3020
|
-
var
|
|
3021
|
-
return
|
|
3022
|
-
}) ||
|
|
3023
|
-
if (
|
|
3024
|
-
const
|
|
3025
|
-
var
|
|
3026
|
-
return
|
|
3027
|
-
}) ??
|
|
3028
|
-
if (
|
|
3029
|
-
const
|
|
3030
|
-
i
|
|
3045
|
+
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[U]);
|
|
3046
|
+
}
|
|
3047
|
+
function Nn({ atKey: s, directives: e, schema: t }, n, i, r) {
|
|
3048
|
+
const o = t.tags.find((l) => {
|
|
3049
|
+
var a;
|
|
3050
|
+
return (l.default === !0 || s && l.default === "key") && ((a = l.test) == null ? void 0 : a.test(n));
|
|
3051
|
+
}) || t[U];
|
|
3052
|
+
if (t.compat) {
|
|
3053
|
+
const l = t.compat.find((a) => {
|
|
3054
|
+
var c;
|
|
3055
|
+
return a.default && ((c = a.test) == null ? void 0 : c.test(n));
|
|
3056
|
+
}) ?? t[U];
|
|
3057
|
+
if (o.tag !== l.tag) {
|
|
3058
|
+
const a = e.tagString(o.tag), c = e.tagString(l.tag), p = `Value may be parsed as either ${a} or ${c}`;
|
|
3059
|
+
r(i, "TAG_RESOLVE_FAILED", p, !0);
|
|
3031
3060
|
}
|
|
3032
3061
|
}
|
|
3033
|
-
return
|
|
3062
|
+
return o;
|
|
3034
3063
|
}
|
|
3035
|
-
function
|
|
3064
|
+
function On(s, e, t) {
|
|
3036
3065
|
if (e) {
|
|
3037
3066
|
t === null && (t = e.length);
|
|
3038
3067
|
for (let n = t - 1; n >= 0; --n) {
|
|
@@ -3051,54 +3080,55 @@ function Sn(s, e, t) {
|
|
|
3051
3080
|
}
|
|
3052
3081
|
return s;
|
|
3053
3082
|
}
|
|
3054
|
-
const
|
|
3055
|
-
function
|
|
3056
|
-
const { spaceBefore:
|
|
3057
|
-
let
|
|
3083
|
+
const An = { composeNode: Ns, composeEmptyNode: Et };
|
|
3084
|
+
function Ns(s, e, t, n) {
|
|
3085
|
+
const i = s.atKey, { spaceBefore: r, comment: o, anchor: l, tag: a } = t;
|
|
3086
|
+
let c, p = !0;
|
|
3058
3087
|
switch (e.type) {
|
|
3059
3088
|
case "alias":
|
|
3060
|
-
|
|
3089
|
+
c = En(s, e, n), (l || a) && n(e, "ALIAS_PROPS", "An alias node must not specify any properties");
|
|
3061
3090
|
break;
|
|
3062
3091
|
case "scalar":
|
|
3063
3092
|
case "single-quoted-scalar":
|
|
3064
3093
|
case "double-quoted-scalar":
|
|
3065
3094
|
case "block-scalar":
|
|
3066
|
-
|
|
3095
|
+
c = ks(s, e, a, n), l && (c.anchor = l.source.substring(1));
|
|
3067
3096
|
break;
|
|
3068
3097
|
case "block-map":
|
|
3069
3098
|
case "block-seq":
|
|
3070
3099
|
case "flow-collection":
|
|
3071
|
-
|
|
3100
|
+
c = hn(An, s, e, t, n), l && (c.anchor = l.source.substring(1));
|
|
3072
3101
|
break;
|
|
3073
3102
|
default: {
|
|
3074
|
-
const
|
|
3075
|
-
n(e, "UNEXPECTED_TOKEN",
|
|
3103
|
+
const f = e.type === "error" ? e.message : `Unsupported token (type: ${e.type})`;
|
|
3104
|
+
n(e, "UNEXPECTED_TOKEN", f), c = Et(s, e.offset, void 0, null, t, n), p = !1;
|
|
3076
3105
|
}
|
|
3077
3106
|
}
|
|
3078
|
-
return
|
|
3107
|
+
return l && c.anchor === "" && n(l, "BAD_ALIAS", "Anchor cannot be an empty string"), i && s.options.stringKeys && (!E(c) || typeof c.value != "string" || c.tag && c.tag !== "tag:yaml.org,2002:str") && n(a ?? e, "NON_STRING_KEY", "With stringKeys, all keys must be strings"), r && (c.spaceBefore = !0), o && (e.type === "scalar" && e.source === "" ? c.comment = o : c.commentBefore = o), s.options.keepSourceTokens && p && (c.srcToken = e), c;
|
|
3079
3108
|
}
|
|
3080
|
-
function
|
|
3081
|
-
const
|
|
3109
|
+
function Et(s, e, t, n, { spaceBefore: i, comment: r, anchor: o, tag: l, end: a }, c) {
|
|
3110
|
+
const p = {
|
|
3082
3111
|
type: "scalar",
|
|
3083
|
-
offset:
|
|
3112
|
+
offset: On(e, t, n),
|
|
3084
3113
|
indent: -1,
|
|
3085
3114
|
source: ""
|
|
3086
|
-
}, f =
|
|
3115
|
+
}, f = ks(s, p, l, c);
|
|
3087
3116
|
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;
|
|
3088
3117
|
}
|
|
3089
|
-
function
|
|
3090
|
-
const r = new
|
|
3118
|
+
function En({ options: s }, { offset: e, source: t, end: n }, i) {
|
|
3119
|
+
const r = new Ue(t.substring(1));
|
|
3091
3120
|
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);
|
|
3092
|
-
const o = e + t.length, l =
|
|
3121
|
+
const o = e + t.length, l = Te(n, o, s.strict, i);
|
|
3093
3122
|
return r.range = [e, o, l.offset], l.comment && (r.comment = l.comment), r;
|
|
3094
3123
|
}
|
|
3095
|
-
function
|
|
3096
|
-
const l = Object.assign({ _directives: e }, s), a = new
|
|
3124
|
+
function Tn(s, e, { offset: t, start: n, value: i, end: r }, o) {
|
|
3125
|
+
const l = Object.assign({ _directives: e }, s), a = new ge(void 0, l), c = {
|
|
3126
|
+
atKey: !1,
|
|
3097
3127
|
atRoot: !0,
|
|
3098
3128
|
directives: a.directives,
|
|
3099
3129
|
options: a.options,
|
|
3100
3130
|
schema: a.schema
|
|
3101
|
-
},
|
|
3131
|
+
}, p = ue(n, {
|
|
3102
3132
|
indicator: "doc-start",
|
|
3103
3133
|
next: i ?? (r == null ? void 0 : r[0]),
|
|
3104
3134
|
offset: t,
|
|
@@ -3106,11 +3136,11 @@ function On(s, e, { offset: t, start: n, value: i, end: r }, o) {
|
|
|
3106
3136
|
parentIndent: 0,
|
|
3107
3137
|
startOnNewline: !0
|
|
3108
3138
|
});
|
|
3109
|
-
|
|
3110
|
-
const f = a.contents.range[2], d =
|
|
3139
|
+
p.found && (a.directives.docStart = !0, i && (i.type === "block-map" || i.type === "block-seq") && !p.hasNewline && o(p.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), a.contents = i ? Ns(c, i, p, o) : Et(c, p.end, n, null, p, o);
|
|
3140
|
+
const f = a.contents.range[2], d = Te(r, f, !1, o);
|
|
3111
3141
|
return d.comment && (a.comment = d.comment), a.range = [t, f, d.offset], a;
|
|
3112
3142
|
}
|
|
3113
|
-
function
|
|
3143
|
+
function be(s) {
|
|
3114
3144
|
if (typeof s == "number")
|
|
3115
3145
|
return [s, s + 1];
|
|
3116
3146
|
if (Array.isArray(s))
|
|
@@ -3118,7 +3148,7 @@ function ge(s) {
|
|
|
3118
3148
|
const { offset: e, source: t } = s;
|
|
3119
3149
|
return [e, e + (typeof t == "string" ? t.length : 1)];
|
|
3120
3150
|
}
|
|
3121
|
-
function
|
|
3151
|
+
function Kt(s) {
|
|
3122
3152
|
var i;
|
|
3123
3153
|
let e = "", t = !1, n = !1;
|
|
3124
3154
|
for (let r = 0; r < s.length; ++r) {
|
|
@@ -3139,15 +3169,15 @@ function Bt(s) {
|
|
|
3139
3169
|
}
|
|
3140
3170
|
return { comment: e, afterEmptyLine: n };
|
|
3141
3171
|
}
|
|
3142
|
-
class
|
|
3172
|
+
class Tt {
|
|
3143
3173
|
constructor(e = {}) {
|
|
3144
3174
|
this.doc = null, this.atDirectives = !1, this.prelude = [], this.errors = [], this.warnings = [], this.onError = (t, n, i, r) => {
|
|
3145
|
-
const o =
|
|
3146
|
-
r ? this.warnings.push(new
|
|
3175
|
+
const o = be(t);
|
|
3176
|
+
r ? this.warnings.push(new ys(o, n, i)) : this.errors.push(new z(o, n, i));
|
|
3147
3177
|
}, this.directives = new B({ version: e.version || "1.2" }), this.options = e;
|
|
3148
3178
|
}
|
|
3149
3179
|
decorate(e, t) {
|
|
3150
|
-
const { comment: n, afterEmptyLine: i } =
|
|
3180
|
+
const { comment: n, afterEmptyLine: i } = Kt(this.prelude);
|
|
3151
3181
|
if (n) {
|
|
3152
3182
|
const r = e.contents;
|
|
3153
3183
|
if (t)
|
|
@@ -3157,7 +3187,7 @@ ${n}` : n;
|
|
|
3157
3187
|
e.commentBefore = n;
|
|
3158
3188
|
else if (L(r) && !r.flow && r.items.length > 0) {
|
|
3159
3189
|
let o = r.items[0];
|
|
3160
|
-
|
|
3190
|
+
T(o) && (o = o.key);
|
|
3161
3191
|
const l = o.commentBefore;
|
|
3162
3192
|
o.commentBefore = l ? `${n}
|
|
3163
3193
|
${l}` : n;
|
|
@@ -3176,7 +3206,7 @@ ${o}` : n;
|
|
|
3176
3206
|
*/
|
|
3177
3207
|
streamInfo() {
|
|
3178
3208
|
return {
|
|
3179
|
-
comment:
|
|
3209
|
+
comment: Kt(this.prelude).comment,
|
|
3180
3210
|
directives: this.directives,
|
|
3181
3211
|
errors: this.errors,
|
|
3182
3212
|
warnings: this.warnings
|
|
@@ -3198,12 +3228,12 @@ ${o}` : n;
|
|
|
3198
3228
|
switch (e.type) {
|
|
3199
3229
|
case "directive":
|
|
3200
3230
|
this.directives.add(e.source, (t, n, i) => {
|
|
3201
|
-
const r =
|
|
3231
|
+
const r = be(e);
|
|
3202
3232
|
r[0] += t, this.onError(r, "BAD_DIRECTIVE", n, i);
|
|
3203
3233
|
}), this.prelude.push(e.source), this.atDirectives = !0;
|
|
3204
3234
|
break;
|
|
3205
3235
|
case "document": {
|
|
3206
|
-
const t =
|
|
3236
|
+
const t = Tn(this.options, this.directives, e, this.onError);
|
|
3207
3237
|
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;
|
|
3208
3238
|
break;
|
|
3209
3239
|
}
|
|
@@ -3215,18 +3245,18 @@ ${o}` : n;
|
|
|
3215
3245
|
this.prelude.push(e.source);
|
|
3216
3246
|
break;
|
|
3217
3247
|
case "error": {
|
|
3218
|
-
const t = e.source ? `${e.message}: ${JSON.stringify(e.source)}` : e.message, n = new
|
|
3248
|
+
const t = e.source ? `${e.message}: ${JSON.stringify(e.source)}` : e.message, n = new z(be(e), "UNEXPECTED_TOKEN", t);
|
|
3219
3249
|
this.atDirectives || !this.doc ? this.errors.push(n) : this.doc.errors.push(n);
|
|
3220
3250
|
break;
|
|
3221
3251
|
}
|
|
3222
3252
|
case "doc-end": {
|
|
3223
3253
|
if (!this.doc) {
|
|
3224
3254
|
const n = "Unexpected doc-end without preceding document";
|
|
3225
|
-
this.errors.push(new
|
|
3255
|
+
this.errors.push(new z(be(e), "UNEXPECTED_TOKEN", n));
|
|
3226
3256
|
break;
|
|
3227
3257
|
}
|
|
3228
3258
|
this.doc.directives.docEnd = !0;
|
|
3229
|
-
const t =
|
|
3259
|
+
const t = Te(e.end, e.offset + e.source.length, this.doc.options.strict, this.onError);
|
|
3230
3260
|
if (this.decorate(this.doc, !0), t.comment) {
|
|
3231
3261
|
const n = this.doc.comment;
|
|
3232
3262
|
this.doc.comment = n ? `${n}
|
|
@@ -3236,7 +3266,7 @@ ${t.comment}` : t.comment;
|
|
|
3236
3266
|
break;
|
|
3237
3267
|
}
|
|
3238
3268
|
default:
|
|
3239
|
-
this.errors.push(new
|
|
3269
|
+
this.errors.push(new z(be(e), "UNEXPECTED_TOKEN", `Unsupported token ${e.type}`));
|
|
3240
3270
|
}
|
|
3241
3271
|
}
|
|
3242
3272
|
/**
|
|
@@ -3249,33 +3279,33 @@ ${t.comment}` : t.comment;
|
|
|
3249
3279
|
if (this.doc)
|
|
3250
3280
|
this.decorate(this.doc, !0), yield this.doc, this.doc = null;
|
|
3251
3281
|
else if (e) {
|
|
3252
|
-
const n = Object.assign({ _directives: this.directives }, this.options), i = new
|
|
3282
|
+
const n = Object.assign({ _directives: this.directives }, this.options), i = new ge(void 0, n);
|
|
3253
3283
|
this.atDirectives && this.onError(t, "MISSING_CHAR", "Missing directives-end indicator line"), i.range = [0, t, t], this.decorate(i, !1), yield i;
|
|
3254
3284
|
}
|
|
3255
3285
|
}
|
|
3256
3286
|
}
|
|
3257
|
-
function
|
|
3287
|
+
function In(s, e = !0, t) {
|
|
3258
3288
|
if (s) {
|
|
3259
3289
|
const n = (i, r, o) => {
|
|
3260
3290
|
const l = typeof i == "number" ? i : Array.isArray(i) ? i[0] : i.offset;
|
|
3261
3291
|
if (t)
|
|
3262
3292
|
t(l, r, o);
|
|
3263
3293
|
else
|
|
3264
|
-
throw new
|
|
3294
|
+
throw new z([l, l + 1], r, o);
|
|
3265
3295
|
};
|
|
3266
3296
|
switch (s.type) {
|
|
3267
3297
|
case "scalar":
|
|
3268
3298
|
case "single-quoted-scalar":
|
|
3269
3299
|
case "double-quoted-scalar":
|
|
3270
|
-
return
|
|
3300
|
+
return ws(s, e, n);
|
|
3271
3301
|
case "block-scalar":
|
|
3272
|
-
return
|
|
3302
|
+
return bs({ options: { strict: e } }, s, n);
|
|
3273
3303
|
}
|
|
3274
3304
|
}
|
|
3275
3305
|
return null;
|
|
3276
3306
|
}
|
|
3277
|
-
function
|
|
3278
|
-
const { implicitKey: t = !1, indent: n, inFlow: i = !1, offset: r = -1, type: o = "PLAIN" } = e, l =
|
|
3307
|
+
function Ln(s, e) {
|
|
3308
|
+
const { implicitKey: t = !1, indent: n, inFlow: i = !1, offset: r = -1, type: o = "PLAIN" } = e, l = Ae({ type: o, value: s }, {
|
|
3279
3309
|
implicitKey: t,
|
|
3280
3310
|
indent: n > 0 ? " ".repeat(n) : "",
|
|
3281
3311
|
inFlow: i,
|
|
@@ -3288,11 +3318,11 @@ function En(s, e) {
|
|
|
3288
3318
|
case "|":
|
|
3289
3319
|
case ">": {
|
|
3290
3320
|
const c = l.indexOf(`
|
|
3291
|
-
`),
|
|
3321
|
+
`), p = l.substring(0, c), f = l.substring(c + 1) + `
|
|
3292
3322
|
`, d = [
|
|
3293
|
-
{ type: "block-scalar-header", offset: r, indent: n, source:
|
|
3323
|
+
{ type: "block-scalar-header", offset: r, indent: n, source: p }
|
|
3294
3324
|
];
|
|
3295
|
-
return
|
|
3325
|
+
return Os(d, a) || d.push({ type: "newline", offset: -1, indent: n, source: `
|
|
3296
3326
|
` }), { type: "block-scalar", offset: r, indent: n, props: d, source: f };
|
|
3297
3327
|
}
|
|
3298
3328
|
case '"':
|
|
@@ -3303,7 +3333,7 @@ function En(s, e) {
|
|
|
3303
3333
|
return { type: "scalar", offset: r, indent: n, source: l, end: a };
|
|
3304
3334
|
}
|
|
3305
3335
|
}
|
|
3306
|
-
function
|
|
3336
|
+
function $n(s, e, t = {}) {
|
|
3307
3337
|
let { afterKey: n = !1, implicitKey: i = !1, inFlow: r = !1, type: o } = t, l = "indent" in s ? s.indent : null;
|
|
3308
3338
|
if (n && typeof l == "number" && (l += 2), !o)
|
|
3309
3339
|
switch (s.type) {
|
|
@@ -3323,7 +3353,7 @@ function In(s, e, t = {}) {
|
|
|
3323
3353
|
default:
|
|
3324
3354
|
o = "PLAIN";
|
|
3325
3355
|
}
|
|
3326
|
-
const a =
|
|
3356
|
+
const a = Ae({ type: o, value: e }, {
|
|
3327
3357
|
implicitKey: i || l === null,
|
|
3328
3358
|
indent: l !== null && l > 0 ? " ".repeat(l) : "",
|
|
3329
3359
|
inFlow: r,
|
|
@@ -3332,19 +3362,19 @@ function In(s, e, t = {}) {
|
|
|
3332
3362
|
switch (a[0]) {
|
|
3333
3363
|
case "|":
|
|
3334
3364
|
case ">":
|
|
3335
|
-
|
|
3365
|
+
_n(s, a);
|
|
3336
3366
|
break;
|
|
3337
3367
|
case '"':
|
|
3338
|
-
|
|
3368
|
+
rt(s, a, "double-quoted-scalar");
|
|
3339
3369
|
break;
|
|
3340
3370
|
case "'":
|
|
3341
|
-
|
|
3371
|
+
rt(s, a, "single-quoted-scalar");
|
|
3342
3372
|
break;
|
|
3343
3373
|
default:
|
|
3344
|
-
|
|
3374
|
+
rt(s, a, "scalar");
|
|
3345
3375
|
}
|
|
3346
3376
|
}
|
|
3347
|
-
function
|
|
3377
|
+
function _n(s, e) {
|
|
3348
3378
|
const t = e.indexOf(`
|
|
3349
3379
|
`), n = e.substring(0, t), i = e.substring(t + 1) + `
|
|
3350
3380
|
`;
|
|
@@ -3357,14 +3387,14 @@ function Tn(s, e) {
|
|
|
3357
3387
|
const { offset: r } = s, o = "indent" in s ? s.indent : -1, l = [
|
|
3358
3388
|
{ type: "block-scalar-header", offset: r, indent: o, source: n }
|
|
3359
3389
|
];
|
|
3360
|
-
|
|
3390
|
+
Os(l, "end" in s ? s.end : void 0) || l.push({ type: "newline", offset: -1, indent: o, source: `
|
|
3361
3391
|
` });
|
|
3362
3392
|
for (const a of Object.keys(s))
|
|
3363
3393
|
a !== "type" && a !== "offset" && delete s[a];
|
|
3364
3394
|
Object.assign(s, { type: "block-scalar", indent: o, props: l, source: i });
|
|
3365
3395
|
}
|
|
3366
3396
|
}
|
|
3367
|
-
function
|
|
3397
|
+
function Os(s, e) {
|
|
3368
3398
|
if (e)
|
|
3369
3399
|
for (const t of e)
|
|
3370
3400
|
switch (t.type) {
|
|
@@ -3377,7 +3407,7 @@ function Ss(s, e) {
|
|
|
3377
3407
|
}
|
|
3378
3408
|
return !1;
|
|
3379
3409
|
}
|
|
3380
|
-
function
|
|
3410
|
+
function rt(s, e, t) {
|
|
3381
3411
|
switch (s.type) {
|
|
3382
3412
|
case "scalar":
|
|
3383
3413
|
case "double-quoted-scalar":
|
|
@@ -3408,32 +3438,32 @@ function nt(s, e, t) {
|
|
|
3408
3438
|
}
|
|
3409
3439
|
}
|
|
3410
3440
|
}
|
|
3411
|
-
const
|
|
3412
|
-
function
|
|
3441
|
+
const Cn = (s) => "type" in s ? qe(s) : Ke(s);
|
|
3442
|
+
function qe(s) {
|
|
3413
3443
|
switch (s.type) {
|
|
3414
3444
|
case "block-scalar": {
|
|
3415
3445
|
let e = "";
|
|
3416
3446
|
for (const t of s.props)
|
|
3417
|
-
e +=
|
|
3447
|
+
e += qe(t);
|
|
3418
3448
|
return e + s.source;
|
|
3419
3449
|
}
|
|
3420
3450
|
case "block-map":
|
|
3421
3451
|
case "block-seq": {
|
|
3422
3452
|
let e = "";
|
|
3423
3453
|
for (const t of s.items)
|
|
3424
|
-
e +=
|
|
3454
|
+
e += Ke(t);
|
|
3425
3455
|
return e;
|
|
3426
3456
|
}
|
|
3427
3457
|
case "flow-collection": {
|
|
3428
3458
|
let e = s.start.source;
|
|
3429
3459
|
for (const t of s.items)
|
|
3430
|
-
e +=
|
|
3460
|
+
e += Ke(t);
|
|
3431
3461
|
for (const t of s.end)
|
|
3432
3462
|
e += t.source;
|
|
3433
3463
|
return e;
|
|
3434
3464
|
}
|
|
3435
3465
|
case "document": {
|
|
3436
|
-
let e =
|
|
3466
|
+
let e = Ke(s);
|
|
3437
3467
|
if (s.end)
|
|
3438
3468
|
for (const t of s.end)
|
|
3439
3469
|
e += t.source;
|
|
@@ -3448,23 +3478,23 @@ function je(s) {
|
|
|
3448
3478
|
}
|
|
3449
3479
|
}
|
|
3450
3480
|
}
|
|
3451
|
-
function
|
|
3481
|
+
function Ke({ start: s, key: e, sep: t, value: n }) {
|
|
3452
3482
|
let i = "";
|
|
3453
3483
|
for (const r of s)
|
|
3454
3484
|
i += r.source;
|
|
3455
|
-
if (e && (i +=
|
|
3485
|
+
if (e && (i += qe(e)), t)
|
|
3456
3486
|
for (const r of t)
|
|
3457
3487
|
i += r.source;
|
|
3458
|
-
return n && (i +=
|
|
3488
|
+
return n && (i += qe(n)), i;
|
|
3459
3489
|
}
|
|
3460
|
-
const
|
|
3461
|
-
function
|
|
3462
|
-
"type" in s && s.type === "document" && (s = { start: s.start, value: s.value }),
|
|
3490
|
+
const ht = Symbol("break visit"), vn = Symbol("skip children"), As = Symbol("remove item");
|
|
3491
|
+
function Z(s, e) {
|
|
3492
|
+
"type" in s && s.type === "document" && (s = { start: s.start, value: s.value }), Es(Object.freeze([]), s, e);
|
|
3463
3493
|
}
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3494
|
+
Z.BREAK = ht;
|
|
3495
|
+
Z.SKIP = vn;
|
|
3496
|
+
Z.REMOVE = As;
|
|
3497
|
+
Z.itemAtPath = (s, e) => {
|
|
3468
3498
|
let t = s;
|
|
3469
3499
|
for (const [n, i] of e) {
|
|
3470
3500
|
const r = t == null ? void 0 : t[n];
|
|
@@ -3475,13 +3505,13 @@ z.itemAtPath = (s, e) => {
|
|
|
3475
3505
|
}
|
|
3476
3506
|
return t;
|
|
3477
3507
|
};
|
|
3478
|
-
|
|
3479
|
-
const t =
|
|
3508
|
+
Z.parentCollection = (s, e) => {
|
|
3509
|
+
const t = Z.itemAtPath(s, e.slice(0, -1)), n = e[e.length - 1][0], i = t == null ? void 0 : t[n];
|
|
3480
3510
|
if (i && "items" in i)
|
|
3481
3511
|
return i;
|
|
3482
3512
|
throw new Error("Parent collection not found");
|
|
3483
3513
|
};
|
|
3484
|
-
function
|
|
3514
|
+
function Es(s, e, t) {
|
|
3485
3515
|
let n = t(e, s);
|
|
3486
3516
|
if (typeof n == "symbol")
|
|
3487
3517
|
return n;
|
|
@@ -3489,13 +3519,13 @@ function Ns(s, e, t) {
|
|
|
3489
3519
|
const r = e[i];
|
|
3490
3520
|
if (r && "items" in r) {
|
|
3491
3521
|
for (let o = 0; o < r.items.length; ++o) {
|
|
3492
|
-
const l =
|
|
3522
|
+
const l = Es(Object.freeze(s.concat([[i, o]])), r.items[o], t);
|
|
3493
3523
|
if (typeof l == "number")
|
|
3494
3524
|
o = l - 1;
|
|
3495
3525
|
else {
|
|
3496
|
-
if (l ===
|
|
3497
|
-
return
|
|
3498
|
-
l ===
|
|
3526
|
+
if (l === ht)
|
|
3527
|
+
return ht;
|
|
3528
|
+
l === As && (r.items.splice(o, 1), o -= 1);
|
|
3499
3529
|
}
|
|
3500
3530
|
}
|
|
3501
3531
|
typeof n == "function" && i === "key" && (n = n(e, s));
|
|
@@ -3503,30 +3533,30 @@ function Ns(s, e, t) {
|
|
|
3503
3533
|
}
|
|
3504
3534
|
return typeof n == "function" ? n(e, s) : n;
|
|
3505
3535
|
}
|
|
3506
|
-
const
|
|
3507
|
-
function
|
|
3536
|
+
const ze = "\uFEFF", Ze = "", xe = "", Oe = "", Bn = (s) => !!s && "items" in s, Mn = (s) => !!s && (s.type === "scalar" || s.type === "single-quoted-scalar" || s.type === "double-quoted-scalar" || s.type === "block-scalar");
|
|
3537
|
+
function Kn(s) {
|
|
3508
3538
|
switch (s) {
|
|
3509
|
-
case
|
|
3539
|
+
case ze:
|
|
3510
3540
|
return "<BOM>";
|
|
3511
|
-
case
|
|
3541
|
+
case Ze:
|
|
3512
3542
|
return "<DOC>";
|
|
3513
|
-
case
|
|
3543
|
+
case xe:
|
|
3514
3544
|
return "<FLOW_END>";
|
|
3515
|
-
case
|
|
3545
|
+
case Oe:
|
|
3516
3546
|
return "<SCALAR>";
|
|
3517
3547
|
default:
|
|
3518
3548
|
return JSON.stringify(s);
|
|
3519
3549
|
}
|
|
3520
3550
|
}
|
|
3521
|
-
function
|
|
3551
|
+
function Ts(s) {
|
|
3522
3552
|
switch (s) {
|
|
3523
|
-
case
|
|
3553
|
+
case ze:
|
|
3524
3554
|
return "byte-order-mark";
|
|
3525
|
-
case
|
|
3555
|
+
case Ze:
|
|
3526
3556
|
return "doc-mode";
|
|
3527
|
-
case
|
|
3557
|
+
case xe:
|
|
3528
3558
|
return "flow-error-end";
|
|
3529
|
-
case
|
|
3559
|
+
case Oe:
|
|
3530
3560
|
return "scalar";
|
|
3531
3561
|
case "---":
|
|
3532
3562
|
return "doc-start";
|
|
@@ -3579,23 +3609,23 @@ function Os(s) {
|
|
|
3579
3609
|
}
|
|
3580
3610
|
return null;
|
|
3581
3611
|
}
|
|
3582
|
-
var
|
|
3612
|
+
var Pn = /* @__PURE__ */ Object.freeze({
|
|
3583
3613
|
__proto__: null,
|
|
3584
|
-
BOM:
|
|
3585
|
-
DOCUMENT:
|
|
3586
|
-
FLOW_END:
|
|
3587
|
-
SCALAR:
|
|
3588
|
-
createScalarToken:
|
|
3589
|
-
isCollection:
|
|
3590
|
-
isScalar:
|
|
3591
|
-
prettyToken:
|
|
3592
|
-
resolveAsScalar:
|
|
3593
|
-
setScalarValue:
|
|
3594
|
-
stringify:
|
|
3595
|
-
tokenType:
|
|
3596
|
-
visit:
|
|
3614
|
+
BOM: ze,
|
|
3615
|
+
DOCUMENT: Ze,
|
|
3616
|
+
FLOW_END: xe,
|
|
3617
|
+
SCALAR: Oe,
|
|
3618
|
+
createScalarToken: Ln,
|
|
3619
|
+
isCollection: Bn,
|
|
3620
|
+
isScalar: Mn,
|
|
3621
|
+
prettyToken: Kn,
|
|
3622
|
+
resolveAsScalar: In,
|
|
3623
|
+
setScalarValue: $n,
|
|
3624
|
+
stringify: Cn,
|
|
3625
|
+
tokenType: Ts,
|
|
3626
|
+
visit: Z
|
|
3597
3627
|
});
|
|
3598
|
-
function
|
|
3628
|
+
function j(s) {
|
|
3599
3629
|
switch (s) {
|
|
3600
3630
|
case void 0:
|
|
3601
3631
|
case " ":
|
|
@@ -3608,9 +3638,9 @@ function K(s) {
|
|
|
3608
3638
|
return !1;
|
|
3609
3639
|
}
|
|
3610
3640
|
}
|
|
3611
|
-
const
|
|
3612
|
-
\r `),
|
|
3613
|
-
class
|
|
3641
|
+
const Pt = new Set("0123456789ABCDEFabcdef"), Dn = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), _e = new Set(",[]{}"), jn = new Set(` ,[]{}
|
|
3642
|
+
\r `), ot = (s) => !s || jn.has(s);
|
|
3643
|
+
class Is {
|
|
3614
3644
|
constructor() {
|
|
3615
3645
|
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;
|
|
3616
3646
|
}
|
|
@@ -3659,7 +3689,7 @@ class As {
|
|
|
3659
3689
|
}
|
|
3660
3690
|
if (t === "-" || t === ".") {
|
|
3661
3691
|
const n = this.buffer.substr(e, 3);
|
|
3662
|
-
if ((n === "---" || n === "...") &&
|
|
3692
|
+
if ((n === "---" || n === "...") && j(this.buffer[e + 3]))
|
|
3663
3693
|
return -1;
|
|
3664
3694
|
}
|
|
3665
3695
|
return e;
|
|
@@ -3702,7 +3732,7 @@ class As {
|
|
|
3702
3732
|
let e = this.getLine();
|
|
3703
3733
|
if (e === null)
|
|
3704
3734
|
return this.setNext("stream");
|
|
3705
|
-
if (e[0] ===
|
|
3735
|
+
if (e[0] === ze && (yield* this.pushCount(1), e = e.substring(1)), e[0] === "%") {
|
|
3706
3736
|
let t = e.length, n = e.indexOf("#");
|
|
3707
3737
|
for (; n !== -1; ) {
|
|
3708
3738
|
const r = e[n - 1];
|
|
@@ -3726,7 +3756,7 @@ class As {
|
|
|
3726
3756
|
const t = yield* this.pushSpaces(!0);
|
|
3727
3757
|
return yield* this.pushCount(e.length - t), yield* this.pushNewline(), "stream";
|
|
3728
3758
|
}
|
|
3729
|
-
return yield
|
|
3759
|
+
return yield Ze, yield* this.parseLineStart();
|
|
3730
3760
|
}
|
|
3731
3761
|
*parseLineStart() {
|
|
3732
3762
|
const e = this.charAt(0);
|
|
@@ -3736,16 +3766,16 @@ class As {
|
|
|
3736
3766
|
if (!this.atEnd && !this.hasChars(4))
|
|
3737
3767
|
return this.setNext("line-start");
|
|
3738
3768
|
const t = this.peek(3);
|
|
3739
|
-
if ((t === "---" || t === "...") &&
|
|
3769
|
+
if ((t === "---" || t === "...") && j(this.charAt(3)))
|
|
3740
3770
|
return yield* this.pushCount(3), this.indentValue = 0, this.indentNext = 0, t === "---" ? "doc" : "stream";
|
|
3741
3771
|
}
|
|
3742
|
-
return this.indentValue = yield* this.pushSpaces(!1), this.indentNext > this.indentValue && !
|
|
3772
|
+
return this.indentValue = yield* this.pushSpaces(!1), this.indentNext > this.indentValue && !j(this.charAt(1)) && (this.indentNext = this.indentValue), yield* this.parseBlockStart();
|
|
3743
3773
|
}
|
|
3744
3774
|
*parseBlockStart() {
|
|
3745
3775
|
const [e, t] = this.peek(2);
|
|
3746
3776
|
if (!t && !this.atEnd)
|
|
3747
3777
|
return this.setNext("block-start");
|
|
3748
|
-
if ((e === "-" || e === "?" || e === ":") &&
|
|
3778
|
+
if ((e === "-" || e === "?" || e === ":") && j(t)) {
|
|
3749
3779
|
const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(!0));
|
|
3750
3780
|
return this.indentNext = this.indentValue + 1, this.indentValue += n, yield* this.parseBlockStart();
|
|
3751
3781
|
}
|
|
@@ -3769,7 +3799,7 @@ class As {
|
|
|
3769
3799
|
case "]":
|
|
3770
3800
|
return yield* this.pushCount(1), "doc";
|
|
3771
3801
|
case "*":
|
|
3772
|
-
return yield* this.pushUntil(
|
|
3802
|
+
return yield* this.pushUntil(ot), "doc";
|
|
3773
3803
|
case '"':
|
|
3774
3804
|
case "'":
|
|
3775
3805
|
return yield* this.parseQuotedScalar();
|
|
@@ -3788,8 +3818,8 @@ class As {
|
|
|
3788
3818
|
const i = this.getLine();
|
|
3789
3819
|
if (i === null)
|
|
3790
3820
|
return this.setNext("flow");
|
|
3791
|
-
if ((n !== -1 && n < this.indentNext && i[0] !== "#" || n === 0 && (i.startsWith("---") || i.startsWith("...")) &&
|
|
3792
|
-
return this.flowLevel = 0, yield
|
|
3821
|
+
if ((n !== -1 && n < this.indentNext && i[0] !== "#" || n === 0 && (i.startsWith("---") || i.startsWith("...")) && j(i[3])) && !(n === this.indentNext - 1 && this.flowLevel === 1 && (i[0] === "]" || i[0] === "}")))
|
|
3822
|
+
return this.flowLevel = 0, yield xe, yield* this.parseLineStart();
|
|
3793
3823
|
let r = 0;
|
|
3794
3824
|
for (; i[r] === ","; )
|
|
3795
3825
|
r += yield* this.pushCount(1), r += yield* this.pushSpaces(!0), this.flowKey = !1;
|
|
@@ -3805,13 +3835,13 @@ class As {
|
|
|
3805
3835
|
case "]":
|
|
3806
3836
|
return yield* this.pushCount(1), this.flowKey = !0, this.flowLevel -= 1, this.flowLevel ? "flow" : "doc";
|
|
3807
3837
|
case "*":
|
|
3808
|
-
return yield* this.pushUntil(
|
|
3838
|
+
return yield* this.pushUntil(ot), "flow";
|
|
3809
3839
|
case '"':
|
|
3810
3840
|
case "'":
|
|
3811
3841
|
return this.flowKey = !0, yield* this.parseQuotedScalar();
|
|
3812
3842
|
case ":": {
|
|
3813
3843
|
const o = this.charAt(1);
|
|
3814
|
-
if (this.flowKey ||
|
|
3844
|
+
if (this.flowKey || j(o) || o === ",")
|
|
3815
3845
|
return this.flowKey = !1, yield* this.pushCount(1), yield* this.pushSpaces(!0), "flow";
|
|
3816
3846
|
}
|
|
3817
3847
|
default:
|
|
@@ -3865,7 +3895,7 @@ class As {
|
|
|
3865
3895
|
else if (t !== "-")
|
|
3866
3896
|
break;
|
|
3867
3897
|
}
|
|
3868
|
-
return yield* this.pushUntil((t) =>
|
|
3898
|
+
return yield* this.pushUntil((t) => j(t) || t === "#");
|
|
3869
3899
|
}
|
|
3870
3900
|
*parseBlockScalar() {
|
|
3871
3901
|
let e = this.pos - 1, t = 0, n;
|
|
@@ -3927,7 +3957,7 @@ class As {
|
|
|
3927
3957
|
else
|
|
3928
3958
|
break;
|
|
3929
3959
|
} while (!0);
|
|
3930
|
-
return yield
|
|
3960
|
+
return yield Oe, yield* this.pushToIndex(e + 1, !0), yield* this.parseLineStart();
|
|
3931
3961
|
}
|
|
3932
3962
|
*parsePlainScalar() {
|
|
3933
3963
|
const e = this.flowLevel > 0;
|
|
@@ -3935,14 +3965,14 @@ class As {
|
|
|
3935
3965
|
for (; i = this.buffer[++n]; )
|
|
3936
3966
|
if (i === ":") {
|
|
3937
3967
|
const r = this.buffer[n + 1];
|
|
3938
|
-
if (
|
|
3968
|
+
if (j(r) || e && _e.has(r))
|
|
3939
3969
|
break;
|
|
3940
3970
|
t = n;
|
|
3941
|
-
} else if (
|
|
3971
|
+
} else if (j(i)) {
|
|
3942
3972
|
let r = this.buffer[n + 1];
|
|
3943
3973
|
if (i === "\r" && (r === `
|
|
3944
3974
|
` ? (n += 1, i = `
|
|
3945
|
-
`, r = this.buffer[n + 1]) : t = n), r === "#" || e &&
|
|
3975
|
+
`, r = this.buffer[n + 1]) : t = n), r === "#" || e && _e.has(r))
|
|
3946
3976
|
break;
|
|
3947
3977
|
if (i === `
|
|
3948
3978
|
`) {
|
|
@@ -3952,11 +3982,11 @@ class As {
|
|
|
3952
3982
|
n = Math.max(n, o - 2);
|
|
3953
3983
|
}
|
|
3954
3984
|
} else {
|
|
3955
|
-
if (e &&
|
|
3985
|
+
if (e && _e.has(i))
|
|
3956
3986
|
break;
|
|
3957
3987
|
t = n;
|
|
3958
3988
|
}
|
|
3959
|
-
return !i && !this.atEnd ? this.setNext("plain-scalar") : (yield
|
|
3989
|
+
return !i && !this.atEnd ? this.setNext("plain-scalar") : (yield Oe, yield* this.pushToIndex(t + 1, !0), e ? "flow" : "doc");
|
|
3960
3990
|
}
|
|
3961
3991
|
*pushCount(e) {
|
|
3962
3992
|
return e > 0 ? (yield this.buffer.substr(this.pos, e), this.pos += e, e) : 0;
|
|
@@ -3970,12 +4000,12 @@ class As {
|
|
|
3970
4000
|
case "!":
|
|
3971
4001
|
return (yield* this.pushTag()) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
|
|
3972
4002
|
case "&":
|
|
3973
|
-
return (yield* this.pushUntil(
|
|
4003
|
+
return (yield* this.pushUntil(ot)) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
|
|
3974
4004
|
case "-":
|
|
3975
4005
|
case "?":
|
|
3976
4006
|
case ":": {
|
|
3977
4007
|
const e = this.flowLevel > 0, t = this.charAt(1);
|
|
3978
|
-
if (
|
|
4008
|
+
if (j(t) || e && _e.has(t))
|
|
3979
4009
|
return e ? this.flowKey && (this.flowKey = !1) : this.indentNext = this.indentValue + 1, (yield* this.pushCount(1)) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
|
|
3980
4010
|
}
|
|
3981
4011
|
}
|
|
@@ -3984,15 +4014,15 @@ class As {
|
|
|
3984
4014
|
*pushTag() {
|
|
3985
4015
|
if (this.charAt(1) === "<") {
|
|
3986
4016
|
let e = this.pos + 2, t = this.buffer[e];
|
|
3987
|
-
for (; !
|
|
4017
|
+
for (; !j(t) && t !== ">"; )
|
|
3988
4018
|
t = this.buffer[++e];
|
|
3989
4019
|
return yield* this.pushToIndex(t === ">" ? e + 1 : e, !1);
|
|
3990
4020
|
} else {
|
|
3991
4021
|
let e = this.pos + 1, t = this.buffer[e];
|
|
3992
4022
|
for (; t; )
|
|
3993
|
-
if (
|
|
4023
|
+
if (Dn.has(t))
|
|
3994
4024
|
t = this.buffer[++e];
|
|
3995
|
-
else if (t === "%" &&
|
|
4025
|
+
else if (t === "%" && Pt.has(this.buffer[e + 1]) && Pt.has(this.buffer[e + 2]))
|
|
3996
4026
|
t = this.buffer[e += 3];
|
|
3997
4027
|
else
|
|
3998
4028
|
break;
|
|
@@ -4020,7 +4050,7 @@ class As {
|
|
|
4020
4050
|
return yield* this.pushToIndex(t, !1);
|
|
4021
4051
|
}
|
|
4022
4052
|
}
|
|
4023
|
-
class
|
|
4053
|
+
class Ls {
|
|
4024
4054
|
constructor() {
|
|
4025
4055
|
this.lineStarts = [], this.addNewLine = (e) => this.lineStarts.push(e), this.linePos = (e) => {
|
|
4026
4056
|
let t = 0, n = this.lineStarts.length;
|
|
@@ -4037,13 +4067,13 @@ class Es {
|
|
|
4037
4067
|
};
|
|
4038
4068
|
}
|
|
4039
4069
|
}
|
|
4040
|
-
function
|
|
4070
|
+
function W(s, e) {
|
|
4041
4071
|
for (let t = 0; t < s.length; ++t)
|
|
4042
4072
|
if (s[t].type === e)
|
|
4043
4073
|
return !0;
|
|
4044
4074
|
return !1;
|
|
4045
4075
|
}
|
|
4046
|
-
function
|
|
4076
|
+
function Dt(s) {
|
|
4047
4077
|
for (let e = 0; e < s.length; ++e)
|
|
4048
4078
|
switch (s[e].type) {
|
|
4049
4079
|
case "space":
|
|
@@ -4055,7 +4085,7 @@ function Pt(s) {
|
|
|
4055
4085
|
}
|
|
4056
4086
|
return -1;
|
|
4057
4087
|
}
|
|
4058
|
-
function
|
|
4088
|
+
function $s(s) {
|
|
4059
4089
|
switch (s == null ? void 0 : s.type) {
|
|
4060
4090
|
case "alias":
|
|
4061
4091
|
case "scalar":
|
|
@@ -4067,7 +4097,7 @@ function Is(s) {
|
|
|
4067
4097
|
return !1;
|
|
4068
4098
|
}
|
|
4069
4099
|
}
|
|
4070
|
-
function
|
|
4100
|
+
function Ce(s) {
|
|
4071
4101
|
switch (s.type) {
|
|
4072
4102
|
case "document":
|
|
4073
4103
|
return s.start;
|
|
@@ -4081,7 +4111,7 @@ function $e(s) {
|
|
|
4081
4111
|
return [];
|
|
4082
4112
|
}
|
|
4083
4113
|
}
|
|
4084
|
-
function
|
|
4114
|
+
function ne(s) {
|
|
4085
4115
|
var t;
|
|
4086
4116
|
if (s.length === 0)
|
|
4087
4117
|
return [];
|
|
@@ -4099,18 +4129,18 @@ function te(s) {
|
|
|
4099
4129
|
;
|
|
4100
4130
|
return s.splice(e, s.length);
|
|
4101
4131
|
}
|
|
4102
|
-
function
|
|
4132
|
+
function jt(s) {
|
|
4103
4133
|
if (s.start.type === "flow-seq-start")
|
|
4104
4134
|
for (const e of s.items)
|
|
4105
|
-
e.sep && !e.value && !
|
|
4135
|
+
e.sep && !e.value && !W(e.start, "explicit-key-ind") && !W(e.sep, "map-value-ind") && (e.key && (e.value = e.key), delete e.key, $s(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);
|
|
4106
4136
|
}
|
|
4107
|
-
class
|
|
4137
|
+
class It {
|
|
4108
4138
|
/**
|
|
4109
4139
|
* @param onNewLine - If defined, called separately with the start position of
|
|
4110
4140
|
* each new line (in `parse()`, including the start of input).
|
|
4111
4141
|
*/
|
|
4112
4142
|
constructor(e) {
|
|
4113
|
-
this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new
|
|
4143
|
+
this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new Is(), this.onNewLine = e;
|
|
4114
4144
|
}
|
|
4115
4145
|
/**
|
|
4116
4146
|
* Parse `source` as a YAML stream.
|
|
@@ -4134,7 +4164,7 @@ class Et {
|
|
|
4134
4164
|
this.atScalar = !1, yield* this.step(), this.offset += e.length;
|
|
4135
4165
|
return;
|
|
4136
4166
|
}
|
|
4137
|
-
const t =
|
|
4167
|
+
const t = Ts(e);
|
|
4138
4168
|
if (t)
|
|
4139
4169
|
if (t === "scalar")
|
|
4140
4170
|
this.atNewLine = !1, this.atScalar = !0, this.type = "scalar";
|
|
@@ -4223,7 +4253,7 @@ class Et {
|
|
|
4223
4253
|
yield t;
|
|
4224
4254
|
else {
|
|
4225
4255
|
const n = this.peek(1);
|
|
4226
|
-
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" &&
|
|
4256
|
+
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" && jt(t), n.type) {
|
|
4227
4257
|
case "document":
|
|
4228
4258
|
n.value = t;
|
|
4229
4259
|
break;
|
|
@@ -4258,7 +4288,7 @@ class Et {
|
|
|
4258
4288
|
}
|
|
4259
4289
|
if ((n.type === "document" || n.type === "block-map" || n.type === "block-seq") && (t.type === "block-map" || t.type === "block-seq")) {
|
|
4260
4290
|
const i = t.items[t.items.length - 1];
|
|
4261
|
-
i && !i.sep && !i.value && i.start.length > 0 &&
|
|
4291
|
+
i && !i.sep && !i.value && i.start.length > 0 && Dt(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));
|
|
4262
4292
|
}
|
|
4263
4293
|
}
|
|
4264
4294
|
}
|
|
@@ -4296,7 +4326,7 @@ class Et {
|
|
|
4296
4326
|
return yield* this.lineEnd(e);
|
|
4297
4327
|
switch (this.type) {
|
|
4298
4328
|
case "doc-start": {
|
|
4299
|
-
|
|
4329
|
+
Dt(e.start) !== -1 ? (yield* this.pop(), yield* this.step()) : e.start.push(this.sourceToken);
|
|
4300
4330
|
return;
|
|
4301
4331
|
}
|
|
4302
4332
|
case "anchor":
|
|
@@ -4317,7 +4347,7 @@ class Et {
|
|
|
4317
4347
|
}
|
|
4318
4348
|
*scalar(e) {
|
|
4319
4349
|
if (this.type === "map-value-ind") {
|
|
4320
|
-
const t =
|
|
4350
|
+
const t = Ce(this.peek(2)), n = ne(t);
|
|
4321
4351
|
let i;
|
|
4322
4352
|
e.end ? (i = e.end, i.push(this.sourceToken), delete e.end) : i = [this.sourceToken];
|
|
4323
4353
|
const r = {
|
|
@@ -4419,15 +4449,15 @@ class Et {
|
|
|
4419
4449
|
if (t.sep)
|
|
4420
4450
|
if (t.value)
|
|
4421
4451
|
e.items.push({ start: [], key: null, sep: [this.sourceToken] });
|
|
4422
|
-
else if (
|
|
4452
|
+
else if (W(t.sep, "map-value-ind"))
|
|
4423
4453
|
this.stack.push({
|
|
4424
4454
|
type: "block-map",
|
|
4425
4455
|
offset: this.offset,
|
|
4426
4456
|
indent: this.indent,
|
|
4427
4457
|
items: [{ start: o, key: null, sep: [this.sourceToken] }]
|
|
4428
4458
|
});
|
|
4429
|
-
else if (
|
|
4430
|
-
const l =
|
|
4459
|
+
else if ($s(t.key) && !W(t.sep, "newline")) {
|
|
4460
|
+
const l = ne(t.start), a = t.key, c = t.sep;
|
|
4431
4461
|
c.push(this.sourceToken), delete t.key, delete t.sep, this.stack.push({
|
|
4432
4462
|
type: "block-map",
|
|
4433
4463
|
offset: this.offset,
|
|
@@ -4435,10 +4465,10 @@ class Et {
|
|
|
4435
4465
|
items: [{ start: l, key: a, sep: c }]
|
|
4436
4466
|
});
|
|
4437
4467
|
} else o.length > 0 ? t.sep = t.sep.concat(o, this.sourceToken) : t.sep.push(this.sourceToken);
|
|
4438
|
-
else if (
|
|
4468
|
+
else if (W(t.start, "newline"))
|
|
4439
4469
|
Object.assign(t, { key: null, sep: [this.sourceToken] });
|
|
4440
4470
|
else {
|
|
4441
|
-
const l =
|
|
4471
|
+
const l = ne(t.start);
|
|
4442
4472
|
this.stack.push({
|
|
4443
4473
|
type: "block-map",
|
|
4444
4474
|
offset: this.offset,
|
|
@@ -4447,7 +4477,7 @@ class Et {
|
|
|
4447
4477
|
});
|
|
4448
4478
|
}
|
|
4449
4479
|
else
|
|
4450
|
-
t.sep ? t.value || r ? e.items.push({ start: o, key: null, sep: [this.sourceToken] }) :
|
|
4480
|
+
t.sep ? t.value || r ? e.items.push({ start: o, key: null, sep: [this.sourceToken] }) : W(t.sep, "map-value-ind") ? this.stack.push({
|
|
4451
4481
|
type: "block-map",
|
|
4452
4482
|
offset: this.offset,
|
|
4453
4483
|
indent: this.indent,
|
|
@@ -4509,7 +4539,7 @@ class Et {
|
|
|
4509
4539
|
case "seq-item-ind":
|
|
4510
4540
|
if (this.indent !== e.indent)
|
|
4511
4541
|
break;
|
|
4512
|
-
t.value ||
|
|
4542
|
+
t.value || W(t.start, "seq-item-ind") ? e.items.push({ start: [this.sourceToken] }) : t.start.push(this.sourceToken);
|
|
4513
4543
|
return;
|
|
4514
4544
|
}
|
|
4515
4545
|
if (this.indent > e.indent) {
|
|
@@ -4564,8 +4594,8 @@ class Et {
|
|
|
4564
4594
|
if (n.type === "block-map" && (this.type === "map-value-ind" && n.indent === e.indent || this.type === "newline" && !n.items[n.items.length - 1].sep))
|
|
4565
4595
|
yield* this.pop(), yield* this.step();
|
|
4566
4596
|
else if (this.type === "map-value-ind" && n.type !== "flow-collection") {
|
|
4567
|
-
const i =
|
|
4568
|
-
|
|
4597
|
+
const i = Ce(n), r = ne(i);
|
|
4598
|
+
jt(e);
|
|
4569
4599
|
const o = e.end.splice(1, e.end.length);
|
|
4570
4600
|
o.push(this.sourceToken);
|
|
4571
4601
|
const l = {
|
|
@@ -4628,7 +4658,7 @@ class Et {
|
|
|
4628
4658
|
};
|
|
4629
4659
|
case "explicit-key-ind": {
|
|
4630
4660
|
this.onKeyLine = !0;
|
|
4631
|
-
const t =
|
|
4661
|
+
const t = Ce(e), n = ne(t);
|
|
4632
4662
|
return n.push(this.sourceToken), {
|
|
4633
4663
|
type: "block-map",
|
|
4634
4664
|
offset: this.offset,
|
|
@@ -4638,7 +4668,7 @@ class Et {
|
|
|
4638
4668
|
}
|
|
4639
4669
|
case "map-value-ind": {
|
|
4640
4670
|
this.onKeyLine = !0;
|
|
4641
|
-
const t =
|
|
4671
|
+
const t = Ce(e), n = ne(t);
|
|
4642
4672
|
return {
|
|
4643
4673
|
type: "block-map",
|
|
4644
4674
|
offset: this.offset,
|
|
@@ -4674,43 +4704,43 @@ class Et {
|
|
|
4674
4704
|
}
|
|
4675
4705
|
}
|
|
4676
4706
|
}
|
|
4677
|
-
function
|
|
4707
|
+
function _s(s) {
|
|
4678
4708
|
const e = s.prettyErrors !== !1;
|
|
4679
|
-
return { lineCounter: s.lineCounter || e && new
|
|
4709
|
+
return { lineCounter: s.lineCounter || e && new Ls() || null, prettyErrors: e };
|
|
4680
4710
|
}
|
|
4681
|
-
function
|
|
4682
|
-
const { lineCounter: t, prettyErrors: n } =
|
|
4711
|
+
function qn(s, e = {}) {
|
|
4712
|
+
const { lineCounter: t, prettyErrors: n } = _s(e), i = new It(t == null ? void 0 : t.addNewLine), r = new Tt(e), o = Array.from(r.compose(i.parse(s)));
|
|
4683
4713
|
if (n && t)
|
|
4684
4714
|
for (const l of o)
|
|
4685
|
-
l.errors.forEach(
|
|
4715
|
+
l.errors.forEach(je(s, t)), l.warnings.forEach(je(s, t));
|
|
4686
4716
|
return o.length > 0 ? o : Object.assign([], { empty: !0 }, r.streamInfo());
|
|
4687
4717
|
}
|
|
4688
|
-
function
|
|
4689
|
-
const { lineCounter: t, prettyErrors: n } =
|
|
4718
|
+
function Cs(s, e = {}) {
|
|
4719
|
+
const { lineCounter: t, prettyErrors: n } = _s(e), i = new It(t == null ? void 0 : t.addNewLine), r = new Tt(e);
|
|
4690
4720
|
let o = null;
|
|
4691
4721
|
for (const l of r.compose(i.parse(s), !0, s.length))
|
|
4692
4722
|
if (!o)
|
|
4693
4723
|
o = l;
|
|
4694
4724
|
else if (o.options.logLevel !== "silent") {
|
|
4695
|
-
o.errors.push(new
|
|
4725
|
+
o.errors.push(new z(l.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
|
|
4696
4726
|
break;
|
|
4697
4727
|
}
|
|
4698
|
-
return n && t && (o.errors.forEach(
|
|
4728
|
+
return n && t && (o.errors.forEach(je(s, t)), o.warnings.forEach(je(s, t))), o;
|
|
4699
4729
|
}
|
|
4700
|
-
function
|
|
4730
|
+
function Rn(s, e, t) {
|
|
4701
4731
|
let n;
|
|
4702
4732
|
typeof e == "function" ? n = e : t === void 0 && e && typeof e == "object" && (t = e);
|
|
4703
|
-
const i =
|
|
4733
|
+
const i = Cs(s, t);
|
|
4704
4734
|
if (!i)
|
|
4705
4735
|
return null;
|
|
4706
|
-
if (i.warnings.forEach((r) =>
|
|
4736
|
+
if (i.warnings.forEach((r) => zt(i.options.logLevel, r)), i.errors.length > 0) {
|
|
4707
4737
|
if (i.options.logLevel !== "silent")
|
|
4708
4738
|
throw i.errors[0];
|
|
4709
4739
|
i.errors = [];
|
|
4710
4740
|
}
|
|
4711
4741
|
return i.toJS(Object.assign({ reviver: n }, t));
|
|
4712
4742
|
}
|
|
4713
|
-
function
|
|
4743
|
+
function Un(s, e, t) {
|
|
4714
4744
|
let n = null;
|
|
4715
4745
|
if (typeof e == "function" || Array.isArray(e) ? n = e : t === void 0 && e && (t = e), typeof t == "string" && (t = t.length), typeof t == "number") {
|
|
4716
4746
|
const i = Math.round(t);
|
|
@@ -4721,70 +4751,70 @@ function Kn(s, e, t) {
|
|
|
4721
4751
|
if (!i)
|
|
4722
4752
|
return;
|
|
4723
4753
|
}
|
|
4724
|
-
return new
|
|
4754
|
+
return ee(s) && !n ? s.toString(t) : new ge(s, n, t).toString(t);
|
|
4725
4755
|
}
|
|
4726
|
-
var
|
|
4756
|
+
var Fn = /* @__PURE__ */ Object.freeze({
|
|
4727
4757
|
__proto__: null,
|
|
4728
|
-
Alias:
|
|
4729
|
-
CST:
|
|
4730
|
-
Composer:
|
|
4731
|
-
Document:
|
|
4732
|
-
Lexer:
|
|
4733
|
-
LineCounter:
|
|
4758
|
+
Alias: Ue,
|
|
4759
|
+
CST: Pn,
|
|
4760
|
+
Composer: Tt,
|
|
4761
|
+
Document: ge,
|
|
4762
|
+
Lexer: Is,
|
|
4763
|
+
LineCounter: Ls,
|
|
4734
4764
|
Pair: v,
|
|
4735
|
-
Parser:
|
|
4765
|
+
Parser: It,
|
|
4736
4766
|
Scalar: O,
|
|
4737
|
-
Schema:
|
|
4738
|
-
YAMLError:
|
|
4739
|
-
YAMLMap:
|
|
4740
|
-
YAMLParseError:
|
|
4741
|
-
YAMLSeq:
|
|
4742
|
-
YAMLWarning:
|
|
4743
|
-
isAlias:
|
|
4767
|
+
Schema: Xe,
|
|
4768
|
+
YAMLError: At,
|
|
4769
|
+
YAMLMap: K,
|
|
4770
|
+
YAMLParseError: z,
|
|
4771
|
+
YAMLSeq: Q,
|
|
4772
|
+
YAMLWarning: ys,
|
|
4773
|
+
isAlias: x,
|
|
4744
4774
|
isCollection: L,
|
|
4745
|
-
isDocument:
|
|
4746
|
-
isMap:
|
|
4775
|
+
isDocument: ee,
|
|
4776
|
+
isMap: de,
|
|
4747
4777
|
isNode: $,
|
|
4748
|
-
isPair:
|
|
4778
|
+
isPair: T,
|
|
4749
4779
|
isScalar: E,
|
|
4750
|
-
isSeq:
|
|
4751
|
-
parse:
|
|
4752
|
-
parseAllDocuments:
|
|
4753
|
-
parseDocument:
|
|
4754
|
-
stringify:
|
|
4755
|
-
visit:
|
|
4756
|
-
visitAsync:
|
|
4780
|
+
isSeq: pe,
|
|
4781
|
+
parse: Rn,
|
|
4782
|
+
parseAllDocuments: qn,
|
|
4783
|
+
parseDocument: Cs,
|
|
4784
|
+
stringify: Un,
|
|
4785
|
+
visit: G,
|
|
4786
|
+
visitAsync: Re
|
|
4757
4787
|
});
|
|
4758
4788
|
export {
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4789
|
+
Ue as Alias,
|
|
4790
|
+
Pn as CST,
|
|
4791
|
+
Tt as Composer,
|
|
4792
|
+
ge as Document,
|
|
4793
|
+
Is as Lexer,
|
|
4794
|
+
Ls as LineCounter,
|
|
4765
4795
|
v as Pair,
|
|
4766
|
-
|
|
4796
|
+
It as Parser,
|
|
4767
4797
|
O as Scalar,
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4798
|
+
Xe as Schema,
|
|
4799
|
+
At as YAMLError,
|
|
4800
|
+
K as YAMLMap,
|
|
4801
|
+
z as YAMLParseError,
|
|
4802
|
+
Q as YAMLSeq,
|
|
4803
|
+
ys as YAMLWarning,
|
|
4804
|
+
Fn as default,
|
|
4805
|
+
x as isAlias,
|
|
4776
4806
|
L as isCollection,
|
|
4777
|
-
|
|
4778
|
-
|
|
4807
|
+
ee as isDocument,
|
|
4808
|
+
de as isMap,
|
|
4779
4809
|
$ as isNode,
|
|
4780
|
-
|
|
4810
|
+
T as isPair,
|
|
4781
4811
|
E as isScalar,
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4812
|
+
pe as isSeq,
|
|
4813
|
+
Rn as parse,
|
|
4814
|
+
qn as parseAllDocuments,
|
|
4815
|
+
Cs as parseDocument,
|
|
4816
|
+
Un as stringify,
|
|
4817
|
+
G as visit,
|
|
4818
|
+
Re as visitAsync
|
|
4789
4819
|
};
|
|
4790
|
-
//# sourceMappingURL=index-
|
|
4820
|
+
//# sourceMappingURL=index-B_Jk_Yzp.js.map
|