@depup/js-yaml 5.2.1-depup.9 → 5.2.2-depup.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/changes.json +1 -1
- package/dist/browser/js-yaml.esm.min.mjs +357 -346
- package/dist/browser/js-yaml.esm.min.mjs.map +1 -1
- package/dist/browser/js-yaml.umd.min.js +13 -13
- package/dist/browser/js-yaml.umd.min.js.map +1 -1
- package/dist/js-yaml.cjs.js +17 -11
- package/dist/js-yaml.cjs.js.map +1 -1
- package/dist/js-yaml.mjs +17 -11
- package/dist/js-yaml.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! js-yaml 5.2.
|
|
1
|
+
/*! js-yaml 5.2.2 https://github.com/nodeca/js-yaml @license MIT */
|
|
2
2
|
//#region src/tag.ts
|
|
3
3
|
var e = Symbol("NOT_RESOLVED"), t = Symbol("MERGE_KEY");
|
|
4
4
|
function n(e, t) {
|
|
@@ -1107,7 +1107,7 @@ function Cn(e, t, n, r, i, a, o) {
|
|
|
1107
1107
|
style: o
|
|
1108
1108
|
});
|
|
1109
1109
|
}
|
|
1110
|
-
function
|
|
1110
|
+
function wn(e, t, n, r, i, a, o) {
|
|
1111
1111
|
e.events.push({
|
|
1112
1112
|
type: 3,
|
|
1113
1113
|
start: t,
|
|
@@ -1118,7 +1118,18 @@ function T(e, t, n, r, i, a, o) {
|
|
|
1118
1118
|
style: o
|
|
1119
1119
|
});
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function Tn(e, t) {
|
|
1122
|
+
e.events.splice(t.eventsLength, 0, {
|
|
1123
|
+
type: 3,
|
|
1124
|
+
start: t.position,
|
|
1125
|
+
anchorStart: C,
|
|
1126
|
+
anchorEnd: C,
|
|
1127
|
+
tagStart: C,
|
|
1128
|
+
tagEnd: C,
|
|
1129
|
+
style: 2
|
|
1130
|
+
});
|
|
1131
|
+
}
|
|
1132
|
+
function T(e, t, n, r, i, a, o, s, c = 1, l = -1, u = !1) {
|
|
1122
1133
|
e.events.push({
|
|
1123
1134
|
type: 4,
|
|
1124
1135
|
valueStart: t,
|
|
@@ -1133,20 +1144,20 @@ function E(e, t, n, r, i, a, o, s, c = 1, l = -1, u = !1) {
|
|
|
1133
1144
|
fast: u
|
|
1134
1145
|
});
|
|
1135
1146
|
}
|
|
1136
|
-
function
|
|
1147
|
+
function En(e, t, n) {
|
|
1137
1148
|
e.events.push({
|
|
1138
1149
|
type: 5,
|
|
1139
1150
|
anchorStart: t,
|
|
1140
1151
|
anchorEnd: n
|
|
1141
1152
|
});
|
|
1142
1153
|
}
|
|
1143
|
-
function
|
|
1154
|
+
function E(e) {
|
|
1144
1155
|
e.events.push({ type: 6 });
|
|
1145
1156
|
}
|
|
1146
|
-
function
|
|
1147
|
-
|
|
1157
|
+
function D(e) {
|
|
1158
|
+
T(e, C, C, C, C, C, C, 1);
|
|
1148
1159
|
}
|
|
1149
|
-
function
|
|
1160
|
+
function Dn() {
|
|
1150
1161
|
return {
|
|
1151
1162
|
anchorStart: C,
|
|
1152
1163
|
anchorEnd: C,
|
|
@@ -1154,7 +1165,7 @@ function Tn() {
|
|
|
1154
1165
|
tagEnd: C
|
|
1155
1166
|
};
|
|
1156
1167
|
}
|
|
1157
|
-
function
|
|
1168
|
+
function O(e) {
|
|
1158
1169
|
return {
|
|
1159
1170
|
position: e.position,
|
|
1160
1171
|
line: e.line,
|
|
@@ -1164,104 +1175,104 @@ function k(e) {
|
|
|
1164
1175
|
eventsLength: e.events.length
|
|
1165
1176
|
};
|
|
1166
1177
|
}
|
|
1167
|
-
function
|
|
1178
|
+
function k(e, t) {
|
|
1168
1179
|
e.position = t.position, e.line = t.line, e.lineStart = t.lineStart, e.lineIndent = t.lineIndent, e.firstTabInLine = t.firstTabInLine, e.events.length = t.eventsLength;
|
|
1169
1180
|
}
|
|
1170
|
-
function
|
|
1181
|
+
function A(e, t) {
|
|
1171
1182
|
pt(e.input.slice(0, e.length), e.position, t, e.filename);
|
|
1172
1183
|
}
|
|
1173
|
-
function
|
|
1184
|
+
function j(e) {
|
|
1174
1185
|
return e === 10 || e === 13;
|
|
1175
1186
|
}
|
|
1176
|
-
function
|
|
1187
|
+
function M(e) {
|
|
1177
1188
|
return e === 9 || e === 32;
|
|
1178
1189
|
}
|
|
1190
|
+
function N(e) {
|
|
1191
|
+
return M(e) || j(e);
|
|
1192
|
+
}
|
|
1179
1193
|
function P(e) {
|
|
1180
|
-
return
|
|
1194
|
+
return e === 0 || N(e);
|
|
1181
1195
|
}
|
|
1182
1196
|
function F(e) {
|
|
1183
|
-
return e === 0 || P(e);
|
|
1184
|
-
}
|
|
1185
|
-
function I(e) {
|
|
1186
1197
|
return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
|
|
1187
1198
|
}
|
|
1188
|
-
function
|
|
1199
|
+
function On(e) {
|
|
1189
1200
|
return e >= 48 && e <= 57 ? e - 48 : -1;
|
|
1190
1201
|
}
|
|
1191
|
-
function
|
|
1202
|
+
function kn(e) {
|
|
1192
1203
|
if (e >= 48 && e <= 57) return e - 48;
|
|
1193
1204
|
let t = e | 32;
|
|
1194
1205
|
return t >= 97 && t <= 102 ? t - 97 + 10 : -1;
|
|
1195
1206
|
}
|
|
1196
|
-
function
|
|
1207
|
+
function An(e) {
|
|
1197
1208
|
return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
|
|
1198
1209
|
}
|
|
1199
|
-
function
|
|
1210
|
+
function jn(e) {
|
|
1200
1211
|
return e === 48 || e === 97 || e === 98 || e === 116 || e === 9 || e === 110 || e === 118 || e === 102 || e === 114 || e === 101 || e === 32 || e === 34 || e === 47 || e === 92 || e === 78 || e === 95 || e === 76 || e === 80;
|
|
1201
1212
|
}
|
|
1202
|
-
function
|
|
1213
|
+
function Mn(e) {
|
|
1203
1214
|
e.input.charCodeAt(e.position) === 10 ? e.position++ : (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++), e.line++, e.lineStart = e.position, e.lineIndent = 0, e.firstTabInLine = -1;
|
|
1204
1215
|
}
|
|
1205
|
-
function
|
|
1206
|
-
let n = 0, r = e.input.charCodeAt(e.position), i = e.position === e.lineStart ||
|
|
1216
|
+
function I(e, t) {
|
|
1217
|
+
let n = 0, r = e.input.charCodeAt(e.position), i = e.position === e.lineStart || N(e.input.charCodeAt(e.position - 1));
|
|
1207
1218
|
for (; r !== 0;) {
|
|
1208
|
-
for (;
|
|
1219
|
+
for (; M(r);) i = !0, r === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), r = e.input.charCodeAt(++e.position);
|
|
1209
1220
|
if (t && i && r === 35) do
|
|
1210
1221
|
r = e.input.charCodeAt(++e.position);
|
|
1211
|
-
while (!
|
|
1212
|
-
if (!
|
|
1213
|
-
for (
|
|
1222
|
+
while (!j(r) && r !== 0);
|
|
1223
|
+
if (!j(r)) break;
|
|
1224
|
+
for (Mn(e), n++, i = !0, r = e.input.charCodeAt(e.position); r === 32;) e.lineIndent++, r = e.input.charCodeAt(++e.position);
|
|
1214
1225
|
}
|
|
1215
1226
|
return n;
|
|
1216
1227
|
}
|
|
1217
|
-
function
|
|
1228
|
+
function L(e, t = e.position) {
|
|
1218
1229
|
let n = e.input.charCodeAt(t);
|
|
1219
1230
|
if ((n === 45 || n === 46) && n === e.input.charCodeAt(t + 1) && n === e.input.charCodeAt(t + 2)) {
|
|
1220
1231
|
let n = e.input.charCodeAt(t + 3);
|
|
1221
|
-
return n === 0 ||
|
|
1232
|
+
return n === 0 || N(n);
|
|
1222
1233
|
}
|
|
1223
1234
|
return !1;
|
|
1224
1235
|
}
|
|
1225
|
-
function
|
|
1236
|
+
function Nn(e) {
|
|
1226
1237
|
let t = e.input.charCodeAt(e.position);
|
|
1227
|
-
for (; t !== 0 && !
|
|
1238
|
+
for (; t !== 0 && !j(t);) t = e.input.charCodeAt(++e.position);
|
|
1228
1239
|
}
|
|
1229
|
-
function
|
|
1230
|
-
pn.test(e.input.slice(t, n)) &&
|
|
1240
|
+
function Pn(e, t, n) {
|
|
1241
|
+
pn.test(e.input.slice(t, n)) && A(e, "the stream contains non-printable characters");
|
|
1231
1242
|
}
|
|
1232
|
-
function
|
|
1243
|
+
function Fn(e, t, n) {
|
|
1233
1244
|
if (e.input.charCodeAt(e.position) !== 33) return !1;
|
|
1234
|
-
t.tagStart !== C &&
|
|
1245
|
+
t.tagStart !== C && A(e, "duplication of a tag property");
|
|
1235
1246
|
let r = e.position, i = !1, a = !1, o = "!", s = e.input.charCodeAt(++e.position);
|
|
1236
1247
|
s === 60 ? (i = !0, s = e.input.charCodeAt(++e.position)) : s === 33 && (a = !0, o = "!!", s = e.input.charCodeAt(++e.position));
|
|
1237
1248
|
let c = e.position, l;
|
|
1238
1249
|
if (i) {
|
|
1239
1250
|
for (; s !== 0 && s !== 62;) s = e.input.charCodeAt(++e.position);
|
|
1240
|
-
s !== 62 &&
|
|
1251
|
+
s !== 62 && A(e, "unexpected end of the stream within a verbatim tag"), l = e.input.slice(c, e.position), e.position++;
|
|
1241
1252
|
} else {
|
|
1242
|
-
for (; s !== 0 && !
|
|
1243
|
-
l = e.input.slice(c, e.position), mn.test(l) &&
|
|
1253
|
+
for (; s !== 0 && !N(s) && !(n && F(s));) s === 33 && (a ? A(e, "tag suffix cannot contain exclamation marks") : (o = e.input.slice(c - 1, e.position + 1), hn.test(o) || A(e, "named tag handle cannot contain such characters"), a = !0, c = e.position + 1)), s = e.input.charCodeAt(++e.position);
|
|
1254
|
+
l = e.input.slice(c, e.position), mn.test(l) && A(e, "tag suffix cannot contain flow indicator characters");
|
|
1244
1255
|
}
|
|
1245
|
-
return l && !(i ? vn.test(l) : yn.test(l)) &&
|
|
1256
|
+
return l && !(i ? vn.test(l) : yn.test(l)) && A(e, `tag name cannot contain such characters: ${l}`), !i && o !== "!" && o !== "!!" && !ln.call(e.tagHandlers, o) && A(e, `undeclared tag handle "${o}"`), t.tagStart = r, t.tagEnd = e.position, !0;
|
|
1246
1257
|
}
|
|
1247
|
-
function
|
|
1258
|
+
function In(e, t) {
|
|
1248
1259
|
if (e.input.charCodeAt(e.position) !== 38) return !1;
|
|
1249
|
-
t.anchorStart !== C &&
|
|
1260
|
+
t.anchorStart !== C && A(e, "duplication of an anchor property"), e.position++;
|
|
1250
1261
|
let n = e.position;
|
|
1251
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1252
|
-
return e.position === n &&
|
|
1262
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !N(e.input.charCodeAt(e.position)) && !F(e.input.charCodeAt(e.position));) e.position++;
|
|
1263
|
+
return e.position === n && A(e, "name of an anchor node must contain at least one character"), t.anchorStart = n, t.anchorEnd = e.position, !0;
|
|
1253
1264
|
}
|
|
1254
|
-
function
|
|
1265
|
+
function Ln(e, t) {
|
|
1255
1266
|
if (e.input.charCodeAt(e.position) !== 42) return !1;
|
|
1256
|
-
(t.anchorStart !== C || t.tagStart !== C) &&
|
|
1267
|
+
(t.anchorStart !== C || t.tagStart !== C) && A(e, "alias node should not have any properties"), e.position++;
|
|
1257
1268
|
let n = e.position;
|
|
1258
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1259
|
-
return e.position === n &&
|
|
1269
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !N(e.input.charCodeAt(e.position)) && !F(e.input.charCodeAt(e.position));) e.position++;
|
|
1270
|
+
return e.position === n && A(e, "name of an alias node must contain at least one character"), En(e, n, e.position), !0;
|
|
1260
1271
|
}
|
|
1261
|
-
function
|
|
1262
|
-
|
|
1272
|
+
function Rn(e, t) {
|
|
1273
|
+
I(e, !1), e.lineIndent < t && A(e, "deficient indentation");
|
|
1263
1274
|
}
|
|
1264
|
-
function
|
|
1275
|
+
function zn(e, t, n) {
|
|
1265
1276
|
if (e.input.charCodeAt(e.position) !== 39) return !1;
|
|
1266
1277
|
e.position++;
|
|
1267
1278
|
let r = e.position, i = !0;
|
|
@@ -1273,13 +1284,13 @@ function Ln(e, t, n) {
|
|
|
1273
1284
|
continue;
|
|
1274
1285
|
}
|
|
1275
1286
|
let t = e.position;
|
|
1276
|
-
return e.position++,
|
|
1287
|
+
return e.position++, T(e, r, t, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2, 1, -1, i), !0;
|
|
1277
1288
|
}
|
|
1278
|
-
|
|
1289
|
+
j(a) ? (i = !1, Rn(e, t)) : e.position === e.lineStart && L(e) ? A(e, "unexpected end of the document within a single quoted scalar") : a !== 9 && a < 32 ? A(e, "expected valid JSON character") : e.position++;
|
|
1279
1290
|
}
|
|
1280
|
-
|
|
1291
|
+
A(e, "unexpected end of the stream within a single quoted scalar");
|
|
1281
1292
|
}
|
|
1282
|
-
function
|
|
1293
|
+
function Bn(e, t, n) {
|
|
1283
1294
|
if (e.input.charCodeAt(e.position) !== 34) return !1;
|
|
1284
1295
|
e.position++;
|
|
1285
1296
|
let r = e.position, i = !0;
|
|
@@ -1287,35 +1298,35 @@ function Rn(e, t, n) {
|
|
|
1287
1298
|
let a = e.input.charCodeAt(e.position);
|
|
1288
1299
|
if (a === 34) {
|
|
1289
1300
|
let t = e.position;
|
|
1290
|
-
return e.position++,
|
|
1301
|
+
return e.position++, T(e, r, t, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 3, 1, -1, i), !0;
|
|
1291
1302
|
}
|
|
1292
1303
|
if (a === 92) {
|
|
1293
1304
|
i = !1;
|
|
1294
1305
|
let n = e.input.charCodeAt(++e.position);
|
|
1295
|
-
if (
|
|
1296
|
-
else if (
|
|
1306
|
+
if (j(n)) Rn(e, t);
|
|
1307
|
+
else if (jn(n)) e.position++;
|
|
1297
1308
|
else {
|
|
1298
|
-
let t =
|
|
1299
|
-
for (t === 0 &&
|
|
1309
|
+
let t = An(n);
|
|
1310
|
+
for (t === 0 && A(e, "unknown escape sequence"); t-- > 0;) e.position++, kn(e.input.charCodeAt(e.position)) < 0 && A(e, "expected hexadecimal character");
|
|
1300
1311
|
e.position++;
|
|
1301
1312
|
}
|
|
1302
|
-
} else
|
|
1313
|
+
} else j(a) ? (i = !1, Rn(e, t)) : e.position === e.lineStart && L(e) ? A(e, "unexpected end of the document within a double quoted scalar") : a !== 9 && a < 32 ? A(e, "expected valid JSON character") : e.position++;
|
|
1303
1314
|
}
|
|
1304
|
-
|
|
1315
|
+
A(e, "unexpected end of the stream within a double quoted scalar");
|
|
1305
1316
|
}
|
|
1306
|
-
function
|
|
1317
|
+
function Vn(e, t, n) {
|
|
1307
1318
|
let r = e.input.charCodeAt(e.position), i = 1, a = -1, o = !1;
|
|
1308
1319
|
if (r !== 124 && r !== 62) return !1;
|
|
1309
1320
|
let s = r === 124 ? 4 : 5;
|
|
1310
1321
|
for (e.position++; e.input.charCodeAt(e.position) !== 0;) {
|
|
1311
|
-
let n = e.input.charCodeAt(e.position), r =
|
|
1312
|
-
if (n === 43 || n === 45) i !== 1 &&
|
|
1313
|
-
else if (r >= 0) r === 0 &&
|
|
1322
|
+
let n = e.input.charCodeAt(e.position), r = On(n);
|
|
1323
|
+
if (n === 43 || n === 45) i !== 1 && A(e, "repeat of a chomping mode identifier"), i = n === 43 ? 3 : 2, e.position++;
|
|
1324
|
+
else if (r >= 0) r === 0 && A(e, "bad explicit indentation width of a block scalar; it cannot be less than one"), o && A(e, "repeat of an indentation width identifier"), a = t + r - 1, o = !0, e.position++;
|
|
1314
1325
|
else break;
|
|
1315
1326
|
}
|
|
1316
1327
|
let c = !1;
|
|
1317
|
-
for (;
|
|
1318
|
-
c && e.input.charCodeAt(e.position) === 35 &&
|
|
1328
|
+
for (; M(e.input.charCodeAt(e.position));) c = !0, e.position++;
|
|
1329
|
+
c && e.input.charCodeAt(e.position) === 35 && Nn(e), j(e.input.charCodeAt(e.position)) ? Mn(e) : e.input.charCodeAt(e.position) !== 0 && A(e, "a line break is expected");
|
|
1319
1330
|
let l = o ? a : -1, u = 0, d = e.position, f = e.position;
|
|
1320
1331
|
for (; e.input.charCodeAt(e.position) !== 0;) {
|
|
1321
1332
|
let n = e.position, r = 0;
|
|
@@ -1325,171 +1336,171 @@ function zn(e, t, n) {
|
|
|
1325
1336
|
l >= 0 ? r > l && (f = n + r) : r > 0 && (f = n + r);
|
|
1326
1337
|
break;
|
|
1327
1338
|
}
|
|
1328
|
-
if (n === e.lineStart &&
|
|
1329
|
-
if (!o && l === -1 &&
|
|
1339
|
+
if (n === e.lineStart && L(e, n)) break;
|
|
1340
|
+
if (!o && l === -1 && j(i) && (u = Math.max(u, r)), !o && l === -1 && !j(i) && (i === 9 && r < t && (e.position = n + r, A(e, "tab characters must not be used in indentation")), r < u && (e.position = n + r, A(e, "bad indentation of a mapping entry"))), l === -1 && i !== 0 && !j(i) && r < t) {
|
|
1330
1341
|
e.lineIndent = r, e.position = n + r;
|
|
1331
1342
|
break;
|
|
1332
1343
|
}
|
|
1333
|
-
!o && i !== 0 && !
|
|
1344
|
+
!o && i !== 0 && !j(i) && l === -1 && (l = r);
|
|
1334
1345
|
let a = l === -1 ? t + 1 : l;
|
|
1335
|
-
if (i !== 0 && !
|
|
1346
|
+
if (i !== 0 && !j(i) && r < a) {
|
|
1336
1347
|
e.lineIndent = r, e.position = n + r;
|
|
1337
1348
|
break;
|
|
1338
1349
|
}
|
|
1339
|
-
|
|
1350
|
+
Nn(e), f = e.position, j(e.input.charCodeAt(e.position)) && (Mn(e), f = e.position);
|
|
1340
1351
|
}
|
|
1341
|
-
return
|
|
1352
|
+
return Pn(e, d, f), T(e, d, f, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, s, i, l), !0;
|
|
1342
1353
|
}
|
|
1343
|
-
function
|
|
1354
|
+
function Hn(e, t) {
|
|
1344
1355
|
let n = e.input.charCodeAt(e.position), r = t === w;
|
|
1345
|
-
if (n === 0 ||
|
|
1356
|
+
if (n === 0 || N(n) || n === 35 || n === 38 || n === 42 || n === 33 || n === 124 || n === 62 || n === 39 || n === 34 || n === 37 || n === 64 || n === 96 || r && F(n)) return !1;
|
|
1346
1357
|
if (n === 63 || n === 45) {
|
|
1347
1358
|
let t = e.input.charCodeAt(e.position + 1);
|
|
1348
|
-
if (
|
|
1359
|
+
if (P(t) || r && F(t)) return !1;
|
|
1349
1360
|
}
|
|
1350
1361
|
return !0;
|
|
1351
1362
|
}
|
|
1352
|
-
function
|
|
1353
|
-
if (!
|
|
1363
|
+
function Un(e, t, n, r) {
|
|
1364
|
+
if (!Hn(e, n)) return !1;
|
|
1354
1365
|
let i = e.position, a = e.position, o = e.input.charCodeAt(e.position), s = n === w, c = !1;
|
|
1355
|
-
for (; o !== 0 && !(e.position === e.lineStart &&
|
|
1366
|
+
for (; o !== 0 && !(e.position === e.lineStart && L(e));) {
|
|
1356
1367
|
if (o === 58) {
|
|
1357
1368
|
let t = e.input.charCodeAt(e.position + 1);
|
|
1358
|
-
if (
|
|
1369
|
+
if (P(t) || s && F(t)) break;
|
|
1359
1370
|
} else if (o === 35) {
|
|
1360
|
-
if (
|
|
1361
|
-
} else if (s &&
|
|
1362
|
-
else if (
|
|
1371
|
+
if (N(e.input.charCodeAt(e.position - 1))) break;
|
|
1372
|
+
} else if (s && F(o)) break;
|
|
1373
|
+
else if (j(o)) {
|
|
1363
1374
|
let n = e.position, r = e.line, i = e.lineStart, a = e.lineIndent;
|
|
1364
|
-
if (
|
|
1375
|
+
if (I(e, !1), e.lineIndent >= t) {
|
|
1365
1376
|
c = !0, o = e.input.charCodeAt(e.position);
|
|
1366
1377
|
continue;
|
|
1367
1378
|
}
|
|
1368
1379
|
e.position = n, e.line = r, e.lineStart = i, e.lineIndent = a;
|
|
1369
1380
|
break;
|
|
1370
1381
|
}
|
|
1371
|
-
|
|
1382
|
+
M(o) || (a = e.position + 1), o = e.input.charCodeAt(++e.position);
|
|
1372
1383
|
}
|
|
1373
|
-
return a === i ? !1 : (
|
|
1384
|
+
return a === i ? !1 : (Pn(e, i, a), T(e, i, a, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1, 1, -1, !c), !0);
|
|
1374
1385
|
}
|
|
1375
|
-
function
|
|
1386
|
+
function R(e, t) {
|
|
1376
1387
|
let n = e.line;
|
|
1377
|
-
|
|
1388
|
+
I(e, !0), (e.line > n && e.lineIndent < t || e.firstTabInLine !== -1 && e.lineIndent < t) && A(e, "deficient indentation");
|
|
1378
1389
|
}
|
|
1379
|
-
function
|
|
1390
|
+
function Wn(e, t, n) {
|
|
1380
1391
|
let r = e.input.charCodeAt(e.position), i = r === 123, a = e.position, o = !0;
|
|
1381
1392
|
if (r !== 91 && r !== 123) return !1;
|
|
1382
1393
|
let s = i ? 125 : 93;
|
|
1383
|
-
for (i ?
|
|
1384
|
-
|
|
1394
|
+
for (i ? wn(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2) : Cn(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2), e.position++; e.input.charCodeAt(e.position) !== 0;) {
|
|
1395
|
+
R(e, t);
|
|
1385
1396
|
let n = e.input.charCodeAt(e.position);
|
|
1386
|
-
if (n === s) return e.position++,
|
|
1387
|
-
o ? n === 44 &&
|
|
1397
|
+
if (n === s) return e.position++, E(e), !0;
|
|
1398
|
+
o ? n === 44 && A(e, "expected the node content, but found ','") : A(e, "missed comma between flow collection entries");
|
|
1388
1399
|
let r = !1, a = !1;
|
|
1389
|
-
n === 63 &&
|
|
1390
|
-
let c = e.line, l =
|
|
1391
|
-
|
|
1400
|
+
n === 63 && N(e.input.charCodeAt(e.position + 1)) && (r = a = !0, e.position += 1, R(e, t));
|
|
1401
|
+
let c = e.line, l = O(e), u = z(e, t, w, !1, !0);
|
|
1402
|
+
R(e, t), n = e.input.charCodeAt(e.position), (i || a || e.line === c) && n === 58 ? (r = !0, e.position++, R(e, t), i || Tn(e, l), u || D(e), z(e, t, w, !1, !0) || D(e), R(e, t), i || E(e)) : i && r ? (u || D(e), D(e)) : i ? D(e) : r && (Tn(e, l), u || D(e), D(e), E(e)), n = e.input.charCodeAt(e.position), n === 44 ? (o = !0, e.position++) : o = !1;
|
|
1392
1403
|
}
|
|
1393
|
-
|
|
1404
|
+
A(e, "unexpected end of the stream within a flow collection");
|
|
1394
1405
|
}
|
|
1395
|
-
function
|
|
1396
|
-
if (e.firstTabInLine !== -1 || e.input.charCodeAt(e.position) !== 45 || !
|
|
1397
|
-
for (Cn(e, e.position, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 1); e.input.charCodeAt(e.position) === 45 &&
|
|
1398
|
-
e.firstTabInLine !== -1 && (e.position = e.firstTabInLine,
|
|
1406
|
+
function Gn(e, t, n) {
|
|
1407
|
+
if (e.firstTabInLine !== -1 || e.input.charCodeAt(e.position) !== 45 || !P(e.input.charCodeAt(e.position + 1))) return !1;
|
|
1408
|
+
for (Cn(e, e.position, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 1); e.input.charCodeAt(e.position) === 45 && P(e.input.charCodeAt(e.position + 1));) {
|
|
1409
|
+
e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, A(e, "tab characters must not be used in indentation"));
|
|
1399
1410
|
let n = e.line;
|
|
1400
1411
|
e.position++;
|
|
1401
|
-
let r =
|
|
1402
|
-
if (e.firstTabInLine !== -1 && e.input.charCodeAt(e.position) === 45 &&
|
|
1403
|
-
e.lineIndent > t &&
|
|
1412
|
+
let r = I(e, !0) > 0;
|
|
1413
|
+
if (e.firstTabInLine !== -1 && e.input.charCodeAt(e.position) === 45 && P(e.input.charCodeAt(e.position + 1)) && A(e, "bad indentation of a sequence entry"), r && e.lineIndent <= t ? D(e) : z(e, t, dn, !1, !0), I(e, !0), e.lineIndent < t || e.position >= e.length) break;
|
|
1414
|
+
e.lineIndent > t && A(e, "bad indentation of a sequence entry"), e.line === n && e.input.charCodeAt(e.position) === 45 && P(e.input.charCodeAt(e.position + 1)) && A(e, "bad indentation of a sequence entry");
|
|
1404
1415
|
}
|
|
1405
|
-
return
|
|
1416
|
+
return E(e), !0;
|
|
1406
1417
|
}
|
|
1407
|
-
function
|
|
1418
|
+
function Kn(e, t, n, r) {
|
|
1408
1419
|
let i = !1, a = !1, o = !1, s = !1;
|
|
1409
1420
|
if (e.firstTabInLine !== -1) return !1;
|
|
1410
1421
|
let c = e.input.charCodeAt(e.position);
|
|
1411
1422
|
for (; c !== 0;) {
|
|
1412
|
-
!i && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine,
|
|
1423
|
+
!i && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, A(e, "tab characters must not be used in indentation"));
|
|
1413
1424
|
let l = e.input.charCodeAt(e.position + 1), u = e.line;
|
|
1414
|
-
if ((c === 63 || c === 58) &&
|
|
1425
|
+
if ((c === 63 || c === 58) && P(l)) o || (wn(e, e.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1), o = !0), c === 63 ? (i && D(e), a = !0, i = !0) : i ? i = !1 : (D(e), a = !0, i = !1), e.position += 1, s = !0;
|
|
1415
1426
|
else {
|
|
1416
|
-
i && (
|
|
1417
|
-
let t =
|
|
1418
|
-
if (!
|
|
1427
|
+
i && (D(e), i = !1);
|
|
1428
|
+
let t = O(e);
|
|
1429
|
+
if (!z(e, n, un, !1, !0)) break;
|
|
1419
1430
|
if (e.line === u) {
|
|
1420
|
-
for (c = e.input.charCodeAt(e.position);
|
|
1431
|
+
for (c = e.input.charCodeAt(e.position); M(c);) c = e.input.charCodeAt(++e.position);
|
|
1421
1432
|
if (c === 58) {
|
|
1422
|
-
if (c = e.input.charCodeAt(++e.position),
|
|
1423
|
-
for (
|
|
1433
|
+
if (c = e.input.charCodeAt(++e.position), P(c) || A(e, "a whitespace character is expected after the key-value separator within a block mapping"), !o) {
|
|
1434
|
+
for (k(e, t), wn(e, t.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1), o = !0, z(e, n, un, !1, !0), c = e.input.charCodeAt(e.position); M(c);) c = e.input.charCodeAt(++e.position);
|
|
1424
1435
|
e.position++;
|
|
1425
1436
|
}
|
|
1426
1437
|
a = !0, i = !1, s = !1;
|
|
1427
|
-
} else if (a)
|
|
1428
|
-
else return r.anchorStart !== C || r.tagStart !== C ? (
|
|
1429
|
-
} else if (a)
|
|
1430
|
-
else return r.anchorStart !== C || r.tagStart !== C ? (
|
|
1438
|
+
} else if (a) A(e, "expected ':' after a mapping key");
|
|
1439
|
+
else return r.anchorStart !== C || r.tagStart !== C ? (k(e, t), !1) : !0;
|
|
1440
|
+
} else if (a) A(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
1441
|
+
else return r.anchorStart !== C || r.tagStart !== C ? (k(e, t), !1) : !0;
|
|
1431
1442
|
}
|
|
1432
|
-
if (
|
|
1443
|
+
if (z(e, t, fn, !0, s) && (s = !1), i || s && (D(e), s = !1), I(e, !0), c = e.input.charCodeAt(e.position), (e.line === u || e.lineIndent > t) && c !== 0) A(e, "bad indentation of a mapping entry");
|
|
1433
1444
|
else if (e.lineIndent < t) break;
|
|
1434
1445
|
}
|
|
1435
|
-
return a ? (i &&
|
|
1446
|
+
return a ? (i && D(e), o && E(e), !0) : !1;
|
|
1436
1447
|
}
|
|
1437
|
-
function
|
|
1438
|
-
e.depth >= e.maxDepth &&
|
|
1439
|
-
let o = 1, s = !1, c = !1, l = null, u =
|
|
1440
|
-
if (r &&
|
|
1448
|
+
function z(e, t, n, r, i, a = !0) {
|
|
1449
|
+
e.depth >= e.maxDepth && A(e, `nesting exceeded maxDepth (${e.maxDepth})`), e.depth++;
|
|
1450
|
+
let o = 1, s = !1, c = !1, l = null, u = Dn(), d = n === fn || n === dn, f = d, p = d;
|
|
1451
|
+
if (r && I(e, !0) && (s = !0, o = e.lineIndent > t ? 1 : e.lineIndent === t ? 0 : -1), e.position === e.lineStart && L(e)) return e.depth--, !1;
|
|
1441
1452
|
if (o === 1) for (;;) {
|
|
1442
|
-
let r = e.input.charCodeAt(e.position), i =
|
|
1453
|
+
let r = e.input.charCodeAt(e.position), i = O(e);
|
|
1443
1454
|
if (s && o !== 1 && (r === 33 || r === 38)) break;
|
|
1444
1455
|
if (s && p && (u.tagStart !== C || u.anchorStart !== C) && (r === 33 || r === 38)) {
|
|
1445
1456
|
var m;
|
|
1446
|
-
let n =
|
|
1447
|
-
if (
|
|
1448
|
-
|
|
1457
|
+
let n = O(e), r = t + 1;
|
|
1458
|
+
if (Kn(e, e.position - e.lineStart, r, u) && ((m = e.events[n.eventsLength]) == null ? void 0 : m.type) === 3) return e.depth--, !0;
|
|
1459
|
+
k(e, n);
|
|
1449
1460
|
}
|
|
1450
|
-
if (s && (r === 33 && u.tagStart !== C || r === 38 && u.anchorStart !== C) || !
|
|
1451
|
-
l === null && (l = i),
|
|
1461
|
+
if (s && (r === 33 && u.tagStart !== C || r === 38 && u.anchorStart !== C) || !Fn(e, u, n === w) && !In(e, u)) break;
|
|
1462
|
+
l === null && (l = i), I(e, !0) ? (s = !0, f = p, o = e.lineIndent > t ? 1 : e.lineIndent === t ? 0 : -1) : f = !1;
|
|
1452
1463
|
}
|
|
1453
1464
|
if (f && (f = s || i), o === 1 || n === fn) {
|
|
1454
1465
|
let r = n === w || n === un ? t : t + 1, i = e.position - e.lineStart;
|
|
1455
|
-
if (o === 1) if (f && (
|
|
1466
|
+
if (o === 1) if (f && (Gn(e, i, u) || Kn(e, i, r, u)) || Wn(e, r, u)) c = !0;
|
|
1456
1467
|
else {
|
|
1457
1468
|
let t = e.input.charCodeAt(e.position);
|
|
1458
1469
|
if (l !== null && a && p && !f && t !== 124 && t !== 62) {
|
|
1459
1470
|
var h;
|
|
1460
|
-
let t =
|
|
1461
|
-
|
|
1471
|
+
let t = O(e), n = l.position - l.lineStart;
|
|
1472
|
+
k(e, l), Kn(e, n, r, Dn()) && ((h = e.events[t.eventsLength]) == null ? void 0 : h.type) === 3 ? c = !0 : k(e, t);
|
|
1462
1473
|
}
|
|
1463
|
-
!c && (d &&
|
|
1474
|
+
!c && (d && Vn(e, r, u) || zn(e, r, u) || Bn(e, r, u) || Ln(e, u) || Un(e, r, n, u)) && (c = !0);
|
|
1464
1475
|
}
|
|
1465
|
-
else o === 0 && (c = f &&
|
|
1476
|
+
else o === 0 && (c = f && Gn(e, i, u));
|
|
1466
1477
|
}
|
|
1467
|
-
return d = d && !c, !c && (u.anchorStart !== C || u.tagStart !== C || d) && (
|
|
1478
|
+
return d = d && !c, !c && (u.anchorStart !== C || u.tagStart !== C || d) && (T(e, C, C, u.anchorStart, u.anchorEnd, u.tagStart, u.tagEnd, 1), c = !0), e.depth--, c || u.anchorStart !== C || u.tagStart !== C;
|
|
1468
1479
|
}
|
|
1469
|
-
function
|
|
1480
|
+
function qn(e) {
|
|
1470
1481
|
if (e.lineIndent > 0 || e.input.charCodeAt(e.position) !== 37) return !1;
|
|
1471
1482
|
e.position++;
|
|
1472
1483
|
let t = e.position;
|
|
1473
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1484
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !N(e.input.charCodeAt(e.position));) e.position++;
|
|
1474
1485
|
let n = e.input.slice(t, e.position), r = [];
|
|
1475
|
-
for (n.length === 0 &&
|
|
1476
|
-
for (;
|
|
1477
|
-
if (e.input.charCodeAt(e.position) === 35 ||
|
|
1486
|
+
for (n.length === 0 && A(e, "directive name must not be less than one character in length"); e.input.charCodeAt(e.position) !== 0 && !j(e.input.charCodeAt(e.position));) {
|
|
1487
|
+
for (; M(e.input.charCodeAt(e.position));) e.position++;
|
|
1488
|
+
if (e.input.charCodeAt(e.position) === 35 || j(e.input.charCodeAt(e.position)) || e.input.charCodeAt(e.position) === 0) break;
|
|
1478
1489
|
let t = e.position;
|
|
1479
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1490
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !N(e.input.charCodeAt(e.position));) e.position++;
|
|
1480
1491
|
r.push(e.input.slice(t, e.position));
|
|
1481
1492
|
}
|
|
1482
|
-
if (
|
|
1483
|
-
e.directives.some((e) => e.kind === "yaml") &&
|
|
1493
|
+
if (j(e.input.charCodeAt(e.position)) && Mn(e), n === "YAML") {
|
|
1494
|
+
e.directives.some((e) => e.kind === "yaml") && A(e, "duplication of %YAML directive"), r.length !== 1 && A(e, "YAML directive accepts exactly one argument");
|
|
1484
1495
|
let t = /^([0-9]+)\.([0-9]+)$/.exec(r[0]);
|
|
1485
|
-
t === null &&
|
|
1496
|
+
t === null && A(e, "ill-formed argument of the YAML directive"), parseInt(t[1], 10) !== 1 && A(e, "unacceptable YAML version of the document"), e.directives.push({
|
|
1486
1497
|
kind: "yaml",
|
|
1487
1498
|
version: r[0]
|
|
1488
1499
|
});
|
|
1489
1500
|
} else if (n === "TAG") {
|
|
1490
|
-
r.length !== 2 &&
|
|
1501
|
+
r.length !== 2 && A(e, "TAG directive accepts exactly two arguments");
|
|
1491
1502
|
let [t, n] = r;
|
|
1492
|
-
hn.test(t) ||
|
|
1503
|
+
hn.test(t) || A(e, "ill-formed tag handle (first argument) of the TAG directive"), ln.call(e.tagHandlers, t) && A(e, `there is a previously declared suffix for "${t}" tag handle`), bn.test(n) || A(e, "ill-formed tag prefix (second argument) of the TAG directive"), e.tagHandlers[t] = n, e.directives.push({
|
|
1493
1504
|
kind: "tag",
|
|
1494
1505
|
handle: t,
|
|
1495
1506
|
prefix: n
|
|
@@ -1497,29 +1508,29 @@ function Gn(e) {
|
|
|
1497
1508
|
}
|
|
1498
1509
|
return !0;
|
|
1499
1510
|
}
|
|
1500
|
-
function
|
|
1511
|
+
function Jn(e) {
|
|
1501
1512
|
e.directives = [], e.tagHandlers = Object.create(null);
|
|
1502
1513
|
let t = !1;
|
|
1503
|
-
for (
|
|
1514
|
+
for (I(e, !0); qn(e);) t = !0, I(e, !0);
|
|
1504
1515
|
let n = !1, r = !1, i = !0;
|
|
1505
|
-
if (e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 &&
|
|
1516
|
+
if (e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 && P(e.input.charCodeAt(e.position + 3))) {
|
|
1506
1517
|
n = !0;
|
|
1507
1518
|
let t = e.line;
|
|
1508
|
-
e.position += 3,
|
|
1509
|
-
} else t &&
|
|
1519
|
+
e.position += 3, I(e, !0), i = e.line > t;
|
|
1520
|
+
} else t && A(e, "directives end mark is expected");
|
|
1510
1521
|
let a = e.events.length;
|
|
1511
|
-
if (!n && e.position === e.lineStart && e.input.charCodeAt(e.position) === 46 &&
|
|
1512
|
-
e.position += 3,
|
|
1522
|
+
if (!n && e.position === e.lineStart && e.input.charCodeAt(e.position) === 46 && L(e)) {
|
|
1523
|
+
e.position += 3, I(e, !0);
|
|
1513
1524
|
return;
|
|
1514
1525
|
}
|
|
1515
|
-
if (Sn(e, n, !1),
|
|
1526
|
+
if (Sn(e, n, !1), z(e, e.lineIndent - 1, fn, !1, i, i) || D(e), I(e, !0), e.position === e.lineStart && L(e) && (r = e.input.charCodeAt(e.position) === 46, r)) {
|
|
1516
1527
|
let t = e.line;
|
|
1517
|
-
e.position += 3,
|
|
1528
|
+
e.position += 3, I(e, !0), e.line === t && e.position < e.length && A(e, "end of the stream or a document separator is expected");
|
|
1518
1529
|
}
|
|
1519
1530
|
let o = e.events[a];
|
|
1520
|
-
(o == null ? void 0 : o.type) === 1 && (o.explicitEnd = r),
|
|
1531
|
+
(o == null ? void 0 : o.type) === 1 && (o.explicitEnd = r), E(e), !r && e.position < e.length && !(e.position === e.lineStart && L(e)) && A(e, "end of the stream or a document separator is expected");
|
|
1521
1532
|
}
|
|
1522
|
-
function
|
|
1533
|
+
function Yn(e, t) {
|
|
1523
1534
|
let n = e.length, r = y(y(y({}, xn), t), {}, {
|
|
1524
1535
|
input: `${e}\0`,
|
|
1525
1536
|
length: n,
|
|
@@ -1533,40 +1544,40 @@ function qn(e, t) {
|
|
|
1533
1544
|
tagHandlers: Object.create(null),
|
|
1534
1545
|
events: []
|
|
1535
1546
|
}), i = e.indexOf("\0");
|
|
1536
|
-
for (i !== -1 && pt(e, i, "null byte is not allowed in input", r.filename), r.input.charCodeAt(r.position) === 65279 && r.position++; r.position < r.length && (
|
|
1547
|
+
for (i !== -1 && pt(e, i, "null byte is not allowed in input", r.filename), r.input.charCodeAt(r.position) === 65279 && r.position++; r.position < r.length && (I(r, !0), !(r.position >= r.length));) {
|
|
1537
1548
|
let e = r.position;
|
|
1538
|
-
|
|
1549
|
+
Jn(r), r.position === e && A(r, "can not read a document");
|
|
1539
1550
|
}
|
|
1540
1551
|
return r.events;
|
|
1541
1552
|
}
|
|
1542
1553
|
//#endregion
|
|
1543
1554
|
//#region src/load.ts
|
|
1544
|
-
var
|
|
1545
|
-
function
|
|
1546
|
-
let n = y(y({},
|
|
1547
|
-
return cn(
|
|
1555
|
+
var Xn = y(y({}, xn), Jt);
|
|
1556
|
+
function Zn(e, t = {}) {
|
|
1557
|
+
let n = y(y({}, Xn), t), r = String(e), i = Object.keys(xn), a = Object.keys(Jt);
|
|
1558
|
+
return cn(Yn(r, We(n, i)), y(y({}, We(n, a)), {}, { source: r }));
|
|
1548
1559
|
}
|
|
1549
|
-
function
|
|
1560
|
+
function Qn(e, t, n) {
|
|
1550
1561
|
let r = null;
|
|
1551
1562
|
typeof t == "function" ? r = t : typeof t == "object" && t && (n = t);
|
|
1552
|
-
let i =
|
|
1563
|
+
let i = Zn(e, n);
|
|
1553
1564
|
if (r === null) return i;
|
|
1554
1565
|
for (let e of i) r(e);
|
|
1555
1566
|
}
|
|
1556
|
-
function
|
|
1557
|
-
let n =
|
|
1567
|
+
function $n(e, t) {
|
|
1568
|
+
let n = Zn(e, t);
|
|
1558
1569
|
if (n.length === 0) throw new b("expected a document, but the input is empty");
|
|
1559
1570
|
if (n.length === 1) return n[0];
|
|
1560
1571
|
throw new b("expected a single document in the stream, but found more");
|
|
1561
1572
|
}
|
|
1562
1573
|
//#endregion
|
|
1563
1574
|
//#region src/ast/nodes.ts
|
|
1564
|
-
var
|
|
1575
|
+
var B = class {
|
|
1565
1576
|
constructor() {
|
|
1566
1577
|
_(this, "tagged", !1), _(this, "flow", !1), _(this, "singleQuoted", !1), _(this, "doubleQuoted", !1), _(this, "literal", !1), _(this, "folded", !1);
|
|
1567
1578
|
}
|
|
1568
|
-
},
|
|
1569
|
-
function
|
|
1579
|
+
}, V = Symbol("INVALID");
|
|
1580
|
+
function er(e) {
|
|
1570
1581
|
let t = new Set([
|
|
1571
1582
|
e.defaultScalarTag,
|
|
1572
1583
|
e.defaultSequenceTag,
|
|
@@ -1587,7 +1598,7 @@ function Qn(e) {
|
|
|
1587
1598
|
}))
|
|
1588
1599
|
];
|
|
1589
1600
|
}
|
|
1590
|
-
function
|
|
1601
|
+
function tr(e, t) {
|
|
1591
1602
|
for (let n = 0, r = e.representTypes.length; n < r; n += 1) {
|
|
1592
1603
|
let { tag: r, implicitTag: i } = e.representTypes[n];
|
|
1593
1604
|
if (r.identify && r.identify(t)) {
|
|
@@ -1601,24 +1612,24 @@ function $n(e, t) {
|
|
|
1601
1612
|
}
|
|
1602
1613
|
return null;
|
|
1603
1614
|
}
|
|
1604
|
-
function
|
|
1615
|
+
function H(e, t) {
|
|
1605
1616
|
if (!e.noRefs && typeof t == "object" && t) {
|
|
1606
1617
|
let n = e.refs.get(t);
|
|
1607
1618
|
if (n) return n.anchor === void 0 && (n.anchor = `ref_${e.refCounter++}`), {
|
|
1608
1619
|
kind: "alias",
|
|
1609
1620
|
tag: "",
|
|
1610
|
-
style: new
|
|
1621
|
+
style: new B(),
|
|
1611
1622
|
anchor: n.anchor
|
|
1612
1623
|
};
|
|
1613
1624
|
}
|
|
1614
|
-
let n =
|
|
1625
|
+
let n = tr(e, t);
|
|
1615
1626
|
if (!n) {
|
|
1616
|
-
if (t === void 0 || e.skipInvalid) return
|
|
1627
|
+
if (t === void 0 || e.skipInvalid) return V;
|
|
1617
1628
|
throw new b(`unacceptable kind of an object to dump ${Object.prototype.toString.call(t)}`);
|
|
1618
1629
|
}
|
|
1619
1630
|
let { tag: r, tagName: i, implicitTag: a } = n, o = a ? i : qt(i);
|
|
1620
1631
|
if (r.nodeKind === "scalar") {
|
|
1621
|
-
let e = new
|
|
1632
|
+
let e = new B();
|
|
1622
1633
|
return e.tagged = !a, {
|
|
1623
1634
|
kind: "scalar",
|
|
1624
1635
|
tag: o,
|
|
@@ -1627,7 +1638,7 @@ function U(e, t) {
|
|
|
1627
1638
|
};
|
|
1628
1639
|
}
|
|
1629
1640
|
if (r.nodeKind === "sequence") {
|
|
1630
|
-
let n = r.represent(t), i = new
|
|
1641
|
+
let n = r.represent(t), i = new B();
|
|
1631
1642
|
i.tagged = !a;
|
|
1632
1643
|
let s = {
|
|
1633
1644
|
kind: "sequence",
|
|
@@ -1637,12 +1648,12 @@ function U(e, t) {
|
|
|
1637
1648
|
};
|
|
1638
1649
|
e.noRefs || e.refs.set(t, s);
|
|
1639
1650
|
for (let t = 0, r = n.length; t < r; t += 1) {
|
|
1640
|
-
let r =
|
|
1641
|
-
r ===
|
|
1651
|
+
let r = H(e, n[t]);
|
|
1652
|
+
r === V && n[t] === void 0 && (r = H(e, null)), r !== V && s.items.push(r);
|
|
1642
1653
|
}
|
|
1643
1654
|
return s;
|
|
1644
1655
|
}
|
|
1645
|
-
let s = r.represent(t), c = new
|
|
1656
|
+
let s = r.represent(t), c = new B();
|
|
1646
1657
|
c.tagged = !a;
|
|
1647
1658
|
let l = {
|
|
1648
1659
|
kind: "mapping",
|
|
@@ -1652,52 +1663,52 @@ function U(e, t) {
|
|
|
1652
1663
|
};
|
|
1653
1664
|
e.noRefs || e.refs.set(t, l);
|
|
1654
1665
|
for (let [t, n] of s) {
|
|
1655
|
-
let r =
|
|
1656
|
-
if (r ===
|
|
1657
|
-
let i =
|
|
1658
|
-
i !==
|
|
1666
|
+
let r = H(e, t);
|
|
1667
|
+
if (r === V) continue;
|
|
1668
|
+
let i = H(e, n);
|
|
1669
|
+
i !== V && l.items.push({
|
|
1659
1670
|
key: r,
|
|
1660
1671
|
value: i
|
|
1661
1672
|
});
|
|
1662
1673
|
}
|
|
1663
1674
|
return l;
|
|
1664
1675
|
}
|
|
1665
|
-
function
|
|
1676
|
+
function nr(e, t, n = {}) {
|
|
1666
1677
|
var r, i;
|
|
1667
|
-
let a =
|
|
1668
|
-
representTypes:
|
|
1678
|
+
let a = H({
|
|
1679
|
+
representTypes: er(t),
|
|
1669
1680
|
noRefs: (r = n.noRefs) == null ? !1 : r,
|
|
1670
1681
|
skipInvalid: (i = n.skipInvalid) == null ? !1 : i,
|
|
1671
1682
|
refs: /* @__PURE__ */ new Map(),
|
|
1672
1683
|
refCounter: 0
|
|
1673
1684
|
}, e);
|
|
1674
1685
|
return [{
|
|
1675
|
-
contents: a ===
|
|
1686
|
+
contents: a === V ? null : a,
|
|
1676
1687
|
directives: []
|
|
1677
1688
|
}];
|
|
1678
1689
|
}
|
|
1679
1690
|
//#endregion
|
|
1680
1691
|
//#region src/ast/visit.ts
|
|
1681
|
-
var
|
|
1682
|
-
function
|
|
1692
|
+
var rr = Symbol("visit:break"), ir = Symbol("visit:skip");
|
|
1693
|
+
function ar(e, t, n) {
|
|
1683
1694
|
let r = t(e, n);
|
|
1684
|
-
if (r ===
|
|
1685
|
-
if (r ===
|
|
1695
|
+
if (r === rr) return !0;
|
|
1696
|
+
if (r === ir) return !1;
|
|
1686
1697
|
let i = n.depth + 1;
|
|
1687
1698
|
switch (e.kind) {
|
|
1688
1699
|
case "sequence":
|
|
1689
|
-
for (let n of e.items) if (
|
|
1700
|
+
for (let n of e.items) if (ar(n, t, {
|
|
1690
1701
|
depth: i,
|
|
1691
1702
|
parent: e,
|
|
1692
1703
|
isKey: !1
|
|
1693
1704
|
})) return !0;
|
|
1694
1705
|
break;
|
|
1695
1706
|
case "mapping":
|
|
1696
|
-
for (let { key: n, value: r } of e.items) if (
|
|
1707
|
+
for (let { key: n, value: r } of e.items) if (ar(n, t, {
|
|
1697
1708
|
depth: i,
|
|
1698
1709
|
parent: e,
|
|
1699
1710
|
isKey: !0
|
|
1700
|
-
}) ||
|
|
1711
|
+
}) || ar(r, t, {
|
|
1701
1712
|
depth: i,
|
|
1702
1713
|
parent: e,
|
|
1703
1714
|
isKey: !1
|
|
@@ -1706,8 +1717,8 @@ function rr(e, t, n) {
|
|
|
1706
1717
|
}
|
|
1707
1718
|
return !1;
|
|
1708
1719
|
}
|
|
1709
|
-
function
|
|
1710
|
-
for (let n of e) if (n.contents &&
|
|
1720
|
+
function or(e, t) {
|
|
1721
|
+
for (let n of e) if (n.contents && ar(n.contents, t, {
|
|
1711
1722
|
depth: 0,
|
|
1712
1723
|
parent: null,
|
|
1713
1724
|
isKey: !1
|
|
@@ -1715,9 +1726,9 @@ function ir(e, t) {
|
|
|
1715
1726
|
}
|
|
1716
1727
|
//#endregion
|
|
1717
1728
|
//#region src/ast/presenter.ts
|
|
1718
|
-
var
|
|
1719
|
-
|
|
1720
|
-
var
|
|
1729
|
+
var sr = 65279, cr = 9, U = 10, lr = 13, ur = 32, dr = 33, fr = 34, pr = 35, mr = 37, hr = 38, gr = 39, _r = 42, vr = 44, yr = 45, W = 58, br = 61, xr = 62, Sr = 63, Cr = 64, wr = 91, Tr = 93, Er = 96, Dr = 123, Or = 124, kr = 125, G = {};
|
|
1730
|
+
G[0] = "\\0", G[7] = "\\a", G[8] = "\\b", G[9] = "\\t", G[10] = "\\n", G[11] = "\\v", G[12] = "\\f", G[13] = "\\r", G[27] = "\\e", G[34] = "\\\"", G[92] = "\\\\", G[133] = "\\N", G[160] = "\\_", G[8232] = "\\L", G[8233] = "\\P";
|
|
1731
|
+
var Ar = {
|
|
1721
1732
|
indent: 2,
|
|
1722
1733
|
seqNoIndent: !1,
|
|
1723
1734
|
seqInlineFirst: !0,
|
|
@@ -1731,21 +1742,21 @@ var Or = {
|
|
|
1731
1742
|
forceQuotes: !1,
|
|
1732
1743
|
tagBeforeAnchor: !1
|
|
1733
1744
|
};
|
|
1734
|
-
function
|
|
1745
|
+
function jr(e) {
|
|
1735
1746
|
return e.style.tagged ? e.tag : qt(e.tag);
|
|
1736
1747
|
}
|
|
1737
|
-
function
|
|
1738
|
-
let t = y(y({},
|
|
1748
|
+
function Mr(e) {
|
|
1749
|
+
let t = y(y({}, Ar), e);
|
|
1739
1750
|
return y(y({}, t), {}, {
|
|
1740
1751
|
defaultScalarTagName: t.schema.defaultScalarTag.tagName,
|
|
1741
1752
|
implicitResolvers: t.schema.implicitScalarTags
|
|
1742
1753
|
});
|
|
1743
1754
|
}
|
|
1744
|
-
function
|
|
1755
|
+
function Nr(e) {
|
|
1745
1756
|
let t = e.toString(16).toUpperCase(), n = e <= 255 ? "x" : "u", r = e <= 255 ? 2 : 4;
|
|
1746
1757
|
return `\\${n}${"0".repeat(r - t.length)}${t}`;
|
|
1747
1758
|
}
|
|
1748
|
-
function
|
|
1759
|
+
function Pr(e, t) {
|
|
1749
1760
|
let n = " ".repeat(t), r = 0, i = "", a = e.length;
|
|
1750
1761
|
for (; r < a;) {
|
|
1751
1762
|
let t, o = e.indexOf("\n", r);
|
|
@@ -1753,10 +1764,10 @@ function Mr(e, t) {
|
|
|
1753
1764
|
}
|
|
1754
1765
|
return i;
|
|
1755
1766
|
}
|
|
1756
|
-
function
|
|
1767
|
+
function Fr(e, t) {
|
|
1757
1768
|
return `\n${" ".repeat(e.indent * t)}`;
|
|
1758
1769
|
}
|
|
1759
|
-
function
|
|
1770
|
+
function Ir(e, t) {
|
|
1760
1771
|
let n = e.indent * Math.max(1, t);
|
|
1761
1772
|
return {
|
|
1762
1773
|
indent: n,
|
|
@@ -1764,100 +1775,100 @@ function Pr(e, t) {
|
|
|
1764
1775
|
lineWidth: e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - n)
|
|
1765
1776
|
};
|
|
1766
1777
|
}
|
|
1767
|
-
function
|
|
1778
|
+
function Lr(t, n) {
|
|
1768
1779
|
for (let r = 0, i = t.implicitResolvers.length; r < i; r += 1) {
|
|
1769
1780
|
let i = t.implicitResolvers[r];
|
|
1770
1781
|
if (i.resolve(n, !1, i.tagName) !== e) return i.tagName;
|
|
1771
1782
|
}
|
|
1772
1783
|
return t.defaultScalarTagName;
|
|
1773
1784
|
}
|
|
1774
|
-
function
|
|
1775
|
-
return e ===
|
|
1785
|
+
function K(e) {
|
|
1786
|
+
return e === ur || e === cr;
|
|
1776
1787
|
}
|
|
1777
|
-
function
|
|
1788
|
+
function Rr(e) {
|
|
1778
1789
|
let t = e.charCodeAt(0);
|
|
1779
|
-
if (t !==
|
|
1790
|
+
if (t !== yr && t !== 46 || e.charCodeAt(1) !== t || e.charCodeAt(2) !== t) return !1;
|
|
1780
1791
|
if (e.length === 3) return !0;
|
|
1781
1792
|
let n = e.charCodeAt(3);
|
|
1782
|
-
return
|
|
1793
|
+
return K(n) || n === lr || n === U;
|
|
1783
1794
|
}
|
|
1784
|
-
function
|
|
1785
|
-
return e >= 32 && e <= 126 || e >= 161 && e <= 55295 && e !== 8232 && e !== 8233 || e >= 57344 && e <= 65533 && e !==
|
|
1795
|
+
function q(e) {
|
|
1796
|
+
return e >= 32 && e <= 126 || e >= 161 && e <= 55295 && e !== 8232 && e !== 8233 || e >= 57344 && e <= 65533 && e !== sr || e >= 65536 && e <= 1114111;
|
|
1786
1797
|
}
|
|
1787
|
-
function
|
|
1788
|
-
return
|
|
1798
|
+
function zr(e) {
|
|
1799
|
+
return q(e) && e !== sr && e !== lr && e !== U;
|
|
1789
1800
|
}
|
|
1790
|
-
function
|
|
1791
|
-
let r =
|
|
1792
|
-
return (n ? r : r && e !==
|
|
1801
|
+
function Br(e, t, n) {
|
|
1802
|
+
let r = zr(e), i = r && !K(e);
|
|
1803
|
+
return (n ? r : r && e !== vr && e !== wr && e !== Tr && e !== Dr && e !== kr) && e !== pr && !(t === W && !i) || zr(t) && !K(t) && e === pr || t === W && i && (n || e !== vr && e !== wr && e !== Tr && e !== Dr && e !== kr);
|
|
1793
1804
|
}
|
|
1794
|
-
function
|
|
1795
|
-
return
|
|
1805
|
+
function Vr(e) {
|
|
1806
|
+
return q(e) && e !== sr && !K(e) && e !== yr && e !== Sr && e !== W && e !== vr && e !== wr && e !== Tr && e !== Dr && e !== kr && e !== pr && e !== hr && e !== _r && e !== dr && e !== Or && e !== br && e !== xr && e !== gr && e !== fr && e !== mr && e !== Cr && e !== Er;
|
|
1796
1807
|
}
|
|
1797
|
-
function
|
|
1798
|
-
let n =
|
|
1799
|
-
if (
|
|
1800
|
-
if (e.length > 1 && (n ===
|
|
1801
|
-
let r =
|
|
1802
|
-
return !
|
|
1808
|
+
function Hr(e, t) {
|
|
1809
|
+
let n = J(e, 0);
|
|
1810
|
+
if (Vr(n)) return !0;
|
|
1811
|
+
if (e.length > 1 && (n === yr || n === Sr || n === W)) {
|
|
1812
|
+
let r = J(e, 1);
|
|
1813
|
+
return !K(r) && Br(r, n, t);
|
|
1803
1814
|
}
|
|
1804
1815
|
return !1;
|
|
1805
1816
|
}
|
|
1806
|
-
function
|
|
1807
|
-
return !
|
|
1817
|
+
function Ur(e) {
|
|
1818
|
+
return !K(e) && e !== W;
|
|
1808
1819
|
}
|
|
1809
|
-
function
|
|
1820
|
+
function J(e, t) {
|
|
1810
1821
|
let n = e.charCodeAt(t), r;
|
|
1811
1822
|
return n >= 55296 && n <= 56319 && t + 1 < e.length && (r = e.charCodeAt(t + 1), r >= 56320 && r <= 57343) ? (n - 55296) * 1024 + r - 56320 + 65536 : n;
|
|
1812
1823
|
}
|
|
1813
|
-
function
|
|
1824
|
+
function Wr(e) {
|
|
1814
1825
|
return /^\n* /.test(e);
|
|
1815
1826
|
}
|
|
1816
|
-
var
|
|
1817
|
-
function
|
|
1818
|
-
let { blockIndent: o, lineWidth: s } = n, c, l = 0, u = -1, d = !1, f = !1, p = s !== -1, m = -1, h = !
|
|
1827
|
+
var Y = 1, X = 2, Gr = 3, Kr = 4, Z = 5;
|
|
1828
|
+
function qr(e, t, n, r, i, a) {
|
|
1829
|
+
let { blockIndent: o, lineWidth: s } = n, c, l = 0, u = -1, d = !1, f = !1, p = s !== -1, m = -1, h = !Rr(t) && Hr(t, a) && Ur(J(t, t.length - 1));
|
|
1819
1830
|
if (r || i) for (c = 0; c < t.length; l >= 65536 ? c += 2 : c++) {
|
|
1820
|
-
if (l =
|
|
1821
|
-
h = h &&
|
|
1831
|
+
if (l = J(t, c), !q(l)) return Z;
|
|
1832
|
+
h = h && Br(l, u, a), u = l;
|
|
1822
1833
|
}
|
|
1823
1834
|
else {
|
|
1824
1835
|
for (c = 0; c < t.length; l >= 65536 ? c += 2 : c++) {
|
|
1825
|
-
if (l =
|
|
1826
|
-
else if (!
|
|
1827
|
-
h = h &&
|
|
1836
|
+
if (l = J(t, c), l === U) d = !0, p && (f = f || c - m - 1 > s && t[m + 1] !== " ", m = c);
|
|
1837
|
+
else if (!q(l)) return Z;
|
|
1838
|
+
h = h && Br(l, u, a), u = l;
|
|
1828
1839
|
}
|
|
1829
1840
|
f = f || p && c - m - 1 > s && t[m + 1] !== " ";
|
|
1830
1841
|
}
|
|
1831
|
-
return !d && !f ? h && !i ?
|
|
1842
|
+
return !d && !f ? h && !i ? Y : e.quoteStyle === "double" ? Z : X : o > 9 && Wr(t) ? Z : f ? Kr : Gr;
|
|
1832
1843
|
}
|
|
1833
|
-
function
|
|
1844
|
+
function Jr(e, t, n) {
|
|
1834
1845
|
let { indent: r, blockIndent: i, lineWidth: a } = n;
|
|
1835
1846
|
switch (t) {
|
|
1836
|
-
case
|
|
1837
|
-
case
|
|
1838
|
-
case
|
|
1839
|
-
case
|
|
1840
|
-
case
|
|
1847
|
+
case Y: return Zr(e, r);
|
|
1848
|
+
case X: return `'${Zr(e, r).replace(/'/g, "''")}'`;
|
|
1849
|
+
case Gr: return "|" + Xr(e, i) + Qr(Pr(e, r));
|
|
1850
|
+
case Kr: return ">" + Xr(e, i) + Qr(Pr($r(e, a), r));
|
|
1851
|
+
case Z: return `"${ti(e)}"`;
|
|
1841
1852
|
}
|
|
1842
1853
|
}
|
|
1843
|
-
function
|
|
1854
|
+
function Yr(e, t, n, r, i) {
|
|
1844
1855
|
let a = r || !i;
|
|
1845
|
-
if (t.style.singleQuoted) return
|
|
1846
|
-
if (t.style.doubleQuoted) return
|
|
1856
|
+
if (t.style.singleQuoted) return X;
|
|
1857
|
+
if (t.style.doubleQuoted) return Z;
|
|
1847
1858
|
if (!a) {
|
|
1848
|
-
if (t.style.literal) return
|
|
1849
|
-
if (t.style.folded) return
|
|
1859
|
+
if (t.style.literal) return Gr;
|
|
1860
|
+
if (t.style.folded) return Kr;
|
|
1850
1861
|
}
|
|
1851
1862
|
let o = t.value;
|
|
1852
|
-
if (o.length === 0) return t.style.tagged ||
|
|
1853
|
-
let s =
|
|
1854
|
-
return s ===
|
|
1863
|
+
if (o.length === 0) return t.style.tagged || Lr(e, o) === t.tag ? Y : e.quoteStyle === "double" ? Z : X;
|
|
1864
|
+
let s = qr(e, o, n, a, e.forceQuotes && !r, i);
|
|
1865
|
+
return s === Y && !t.style.tagged && Lr(e, o) !== t.tag ? e.quoteStyle === "double" ? Z : X : s;
|
|
1855
1866
|
}
|
|
1856
|
-
function
|
|
1857
|
-
let n =
|
|
1867
|
+
function Xr(e, t) {
|
|
1868
|
+
let n = Wr(e) ? String(t) : "", r = e[e.length - 1] === "\n";
|
|
1858
1869
|
return `${n}${r && (e[e.length - 2] === "\n" || e === "\n") ? "+" : r ? "" : "-"}\n`;
|
|
1859
1870
|
}
|
|
1860
|
-
function
|
|
1871
|
+
function Zr(e, t) {
|
|
1861
1872
|
let n = e.indexOf("\n");
|
|
1862
1873
|
if (n === -1) return e;
|
|
1863
1874
|
let r = " ".repeat(t), i = e.slice(0, n), a = /(\n+)([^\n]*)/g;
|
|
@@ -1869,150 +1880,150 @@ function Yr(e, t) {
|
|
|
1869
1880
|
}
|
|
1870
1881
|
return i;
|
|
1871
1882
|
}
|
|
1872
|
-
function
|
|
1883
|
+
function Qr(e) {
|
|
1873
1884
|
return e[e.length - 1] === "\n" ? e.slice(0, -1) : e;
|
|
1874
1885
|
}
|
|
1875
|
-
function
|
|
1886
|
+
function $r(e, t) {
|
|
1876
1887
|
let n = /(\n+)([^\n]*)/g, r = e.indexOf("\n");
|
|
1877
1888
|
r === -1 && (r = e.length), n.lastIndex = r;
|
|
1878
|
-
let i =
|
|
1889
|
+
let i = ei(e.slice(0, r), t), a = e[0] === "\n" || e[0] === " ", o, s;
|
|
1879
1890
|
for (; s = n.exec(e);) {
|
|
1880
1891
|
let e = s[1], n = s[2];
|
|
1881
|
-
o = n[0] === " ", i += e + (!a && !o && n !== "" ? "\n" : "") +
|
|
1892
|
+
o = n[0] === " ", i += e + (!a && !o && n !== "" ? "\n" : "") + ei(n, t), a = o;
|
|
1882
1893
|
}
|
|
1883
1894
|
return i;
|
|
1884
1895
|
}
|
|
1885
|
-
function
|
|
1896
|
+
function ei(e, t) {
|
|
1886
1897
|
if (e === "" || e[0] === " ") return e;
|
|
1887
1898
|
let n = / [^ ]/g, r, i = 0, a, o = 0, s = 0, c = "";
|
|
1888
1899
|
for (; r = n.exec(e);) s = r.index, s - i > t && (a = o > i ? o : s, c += `\n${e.slice(i, a)}`, i = a + 1), o = s;
|
|
1889
1900
|
return c += "\n", e.length - i > t && o > i ? c += `${e.slice(i, o)}\n${e.slice(o + 1)}` : c += e.slice(i), c.slice(1);
|
|
1890
1901
|
}
|
|
1891
|
-
function
|
|
1902
|
+
function ti(e) {
|
|
1892
1903
|
let t = "", n = 0;
|
|
1893
1904
|
for (let r = 0; r < e.length; n >= 65536 ? r += 2 : r++) {
|
|
1894
|
-
n =
|
|
1895
|
-
let i =
|
|
1905
|
+
n = J(e, r);
|
|
1906
|
+
let i = G[n];
|
|
1896
1907
|
if (i) {
|
|
1897
1908
|
t += i;
|
|
1898
1909
|
continue;
|
|
1899
1910
|
}
|
|
1900
|
-
if (
|
|
1911
|
+
if (q(n)) {
|
|
1901
1912
|
t += e[r], n >= 65536 && (t += e[r + 1]);
|
|
1902
1913
|
continue;
|
|
1903
1914
|
}
|
|
1904
|
-
t +=
|
|
1915
|
+
t += Nr(n);
|
|
1905
1916
|
}
|
|
1906
1917
|
return t;
|
|
1907
1918
|
}
|
|
1908
|
-
function
|
|
1919
|
+
function ni(e, t, n) {
|
|
1909
1920
|
let r = "";
|
|
1910
1921
|
for (let i = 0, a = n.items.length; i < a; i += 1) {
|
|
1911
|
-
let a =
|
|
1922
|
+
let a = Q(e, t, n.items[i], {});
|
|
1912
1923
|
r !== "" && (r += `,${e.flowSkipCommaSpace ? "" : " "}`), r += a;
|
|
1913
1924
|
}
|
|
1914
1925
|
let i = e.flowBracketPadding && r !== "" ? " " : "";
|
|
1915
1926
|
return `[${i}${r}${i}]`;
|
|
1916
1927
|
}
|
|
1917
|
-
function
|
|
1928
|
+
function ri(e, t, n, r) {
|
|
1918
1929
|
let i = "";
|
|
1919
1930
|
for (let a = 0, o = n.items.length; a < o; a += 1) {
|
|
1920
|
-
let o =
|
|
1931
|
+
let o = Q(e, t + 1, n.items[a], {
|
|
1921
1932
|
block: !0,
|
|
1922
1933
|
compact: e.seqInlineFirst,
|
|
1923
1934
|
isblockseq: !0
|
|
1924
1935
|
});
|
|
1925
|
-
(!r || i !== "") && (i +=
|
|
1936
|
+
(!r || i !== "") && (i += Fr(e, t)), o === "" || U === o.charCodeAt(0) ? i += "-" : i += "- ", i += o;
|
|
1926
1937
|
}
|
|
1927
1938
|
return i;
|
|
1928
1939
|
}
|
|
1929
|
-
function
|
|
1930
|
-
let r = "", i =
|
|
1940
|
+
function ii(e, t, n) {
|
|
1941
|
+
let r = "", i = oi(e, n.items);
|
|
1931
1942
|
for (let { key: n, value: a } of i) {
|
|
1932
1943
|
let i = "";
|
|
1933
1944
|
r !== "" && (i += `,${e.flowSkipCommaSpace ? "" : " "}`);
|
|
1934
|
-
let o =
|
|
1945
|
+
let o = Q(e, t, n, { iskey: !0 }), s = o.length > 1024;
|
|
1935
1946
|
s ? i += "? " : e.quoteFlowKeys && (i += "\"");
|
|
1936
|
-
let c =
|
|
1947
|
+
let c = Q(e, t, a, {}), l = e.flowSkipColonSpace || c === "" ? "" : " ";
|
|
1937
1948
|
i += `${o}${e.quoteFlowKeys && !s ? "\"" : ""}:${l}${c}`, r += i;
|
|
1938
1949
|
}
|
|
1939
1950
|
let a = e.flowBracketPadding && r !== "" ? " " : "";
|
|
1940
1951
|
return `{${a}${r}${a}}`;
|
|
1941
1952
|
}
|
|
1942
|
-
function
|
|
1953
|
+
function ai(e) {
|
|
1943
1954
|
return e.kind === "scalar" ? e.value : e;
|
|
1944
1955
|
}
|
|
1945
|
-
function
|
|
1956
|
+
function oi(e, t) {
|
|
1946
1957
|
if (!e.sortKeys) return t;
|
|
1947
1958
|
let n = t.slice();
|
|
1948
1959
|
if (e.sortKeys === !0) n.sort((e, t) => {
|
|
1949
|
-
let n =
|
|
1960
|
+
let n = ai(e.key), r = ai(t.key);
|
|
1950
1961
|
return n < r ? -1 : +(n > r);
|
|
1951
1962
|
});
|
|
1952
1963
|
else {
|
|
1953
1964
|
let t = e.sortKeys;
|
|
1954
|
-
n.sort((e, n) => t(
|
|
1965
|
+
n.sort((e, n) => t(ai(e.key), ai(n.key)));
|
|
1955
1966
|
}
|
|
1956
1967
|
return n;
|
|
1957
1968
|
}
|
|
1958
|
-
function
|
|
1959
|
-
let i = "", a =
|
|
1969
|
+
function si(e, t, n, r) {
|
|
1970
|
+
let i = "", a = oi(e, n.items);
|
|
1960
1971
|
for (let n = 0, o = a.length; n < o; n += 1) {
|
|
1961
1972
|
let o = "";
|
|
1962
|
-
(!r || i !== "") && (o +=
|
|
1963
|
-
let { key: s, value: c } = a[n], l = (s.kind === "mapping" || s.kind === "sequence") && !s.style.flow && s.items.length !== 0 || s.kind === "scalar" && (s.style.literal || s.style.folded), u = l ?
|
|
1973
|
+
(!r || i !== "") && (o += Fr(e, t));
|
|
1974
|
+
let { key: s, value: c } = a[n], l = (s.kind === "mapping" || s.kind === "sequence") && !s.style.flow && s.items.length !== 0 || s.kind === "scalar" && (s.style.literal || s.style.folded), u = l ? Q(e, t + 1, s, {
|
|
1964
1975
|
block: !0,
|
|
1965
1976
|
compact: !0,
|
|
1966
|
-
isblockseq: !
|
|
1967
|
-
}) :
|
|
1977
|
+
isblockseq: !ci(e, s, t + 1)
|
|
1978
|
+
}) : Q(e, t + 1, s, {
|
|
1968
1979
|
block: !0,
|
|
1969
1980
|
compact: !0,
|
|
1970
1981
|
iskey: !0
|
|
1971
1982
|
}), d = s.kind === "scalar" && s.value.indexOf("\n") !== -1, f = l || d || u.length > 1024;
|
|
1972
|
-
f && (u &&
|
|
1973
|
-
let p =
|
|
1983
|
+
f && (u && U === u.charCodeAt(0) ? o += "?" : o += "? "), o += u, f && (o += Fr(e, t));
|
|
1984
|
+
let p = Q(e, t + 1, c, {
|
|
1974
1985
|
block: !0,
|
|
1975
1986
|
compact: f,
|
|
1976
|
-
isblockseq: f && !
|
|
1977
|
-
}), m = s.kind === "scalar" && s.value === "" && u !== "" && u.charCodeAt(u.length - 1) !==
|
|
1978
|
-
p === "" ||
|
|
1987
|
+
isblockseq: f && !ci(e, c, t + 1)
|
|
1988
|
+
}), m = s.kind === "scalar" && s.value === "" && u !== "" && u.charCodeAt(u.length - 1) !== gr && u.charCodeAt(u.length - 1) !== fr, h = !f && (s.kind === "alias" || m) ? " " : "";
|
|
1989
|
+
p === "" || U === p.charCodeAt(0) ? o += `${h}:` : o += `${h}: `, o += p, i += o;
|
|
1979
1990
|
}
|
|
1980
1991
|
return i;
|
|
1981
1992
|
}
|
|
1982
|
-
function
|
|
1993
|
+
function ci(e, t, n) {
|
|
1983
1994
|
return t.style.tagged || t.anchor !== void 0 || e.indent < 2 && n > 0;
|
|
1984
1995
|
}
|
|
1985
|
-
function
|
|
1996
|
+
function Q(e, t, n, r) {
|
|
1986
1997
|
var i;
|
|
1987
1998
|
if (n.kind === "alias") return `*${n.anchor}`;
|
|
1988
1999
|
let { block: a = !1, iskey: o = !1, isblockseq: s = !1 } = r, c = (i = r.compact) == null ? !1 : i, l = n.anchor !== void 0;
|
|
1989
|
-
|
|
2000
|
+
ci(e, n, t) && (c = !1);
|
|
1990
2001
|
let u, d = n.style.tagged, f = a && (n.kind === "mapping" || n.kind === "sequence") && !n.style.flow && n.items.length !== 0;
|
|
1991
|
-
if (n.kind === "mapping") u = f ?
|
|
1992
|
-
else if (n.kind === "sequence") u = f ? e.seqNoIndent && !s && t > 0 ?
|
|
2002
|
+
if (n.kind === "mapping") u = f ? si(e, t, n, c) : ii(e, t, n);
|
|
2003
|
+
else if (n.kind === "sequence") u = f ? e.seqNoIndent && !s && t > 0 ? ri(e, t - 1, n, c) : ri(e, t, n, c) : ni(e, t, n);
|
|
1993
2004
|
else {
|
|
1994
|
-
let r =
|
|
1995
|
-
u =
|
|
2005
|
+
let r = Ir(e, t), i = Yr(e, n, r, o, a);
|
|
2006
|
+
u = Jr(n.value, i, r), d = n.style.tagged || i !== Y && n.tag !== e.defaultScalarTagName;
|
|
1996
2007
|
}
|
|
1997
2008
|
if (f && c && t > 0 && e.indent > 2 && (u = `${" ".repeat(e.indent - 2)}${u}`), d || l) {
|
|
1998
|
-
let t = [], r = d ?
|
|
2009
|
+
let t = [], r = d ? jr(n) : null, i = l ? `&${n.anchor}` : null;
|
|
1999
2010
|
e.tagBeforeAnchor ? (r !== null && t.push(r), i !== null && t.push(i)) : (i !== null && t.push(i), r !== null && t.push(r));
|
|
2000
|
-
let a = u === "" || u.charCodeAt(0) ===
|
|
2011
|
+
let a = u === "" || u.charCodeAt(0) === U ? "" : " ";
|
|
2001
2012
|
u = `${t.join(" ")}${a}${u}`;
|
|
2002
2013
|
}
|
|
2003
2014
|
return u;
|
|
2004
2015
|
}
|
|
2005
|
-
function
|
|
2016
|
+
function li(e) {
|
|
2006
2017
|
return (e.kind === "sequence" || e.kind === "mapping") && !e.style.flow && e.items.length !== 0 && !e.style.tagged && e.anchor === void 0;
|
|
2007
2018
|
}
|
|
2008
|
-
function
|
|
2019
|
+
function ui(e) {
|
|
2009
2020
|
let t = e;
|
|
2010
2021
|
for (; (t.kind === "sequence" || t.kind === "mapping") && !t.style.flow && t.items.length !== 0;) t = t.kind === "sequence" ? t.items[t.items.length - 1] : t.items[t.items.length - 1].value;
|
|
2011
2022
|
if (t.kind !== "scalar" || !(t.style.literal || t.style.folded)) return !1;
|
|
2012
2023
|
let { value: n } = t;
|
|
2013
2024
|
return n.endsWith("\n\n") || n === "\n";
|
|
2014
2025
|
}
|
|
2015
|
-
function
|
|
2026
|
+
function di(e) {
|
|
2016
2027
|
let t = "";
|
|
2017
2028
|
for (let n of e.directives) {
|
|
2018
2029
|
if (n.kind === "yaml") {
|
|
@@ -2024,69 +2035,69 @@ function li(e) {
|
|
|
2024
2035
|
}
|
|
2025
2036
|
return t;
|
|
2026
2037
|
}
|
|
2027
|
-
function
|
|
2028
|
-
let n =
|
|
2038
|
+
function fi(e, t) {
|
|
2039
|
+
let n = Mr(t), r = "", i = !1;
|
|
2029
2040
|
for (let t = 0; t < e.length; t += 1) {
|
|
2030
|
-
let a = e[t], o =
|
|
2041
|
+
let a = e[t], o = di(a), s = o !== "", c = a.explicitStart || s || t > 0 && !i;
|
|
2031
2042
|
if (r += o, a.contents === null) c && (r += "---\n");
|
|
2032
2043
|
else if (c) {
|
|
2033
|
-
let e =
|
|
2044
|
+
let e = Q(n, 0, a.contents, {
|
|
2034
2045
|
block: !0,
|
|
2035
2046
|
compact: !0
|
|
2036
|
-
}), t = e === "" ? "" : s ||
|
|
2047
|
+
}), t = e === "" ? "" : s || li(a.contents) ? "\n" : " ";
|
|
2037
2048
|
r += `---${t}${e}\n`;
|
|
2038
|
-
} else r +=
|
|
2049
|
+
} else r += Q(n, 0, a.contents, {
|
|
2039
2050
|
block: !0,
|
|
2040
2051
|
compact: !0
|
|
2041
2052
|
}) + "\n";
|
|
2042
|
-
i = a.explicitEnd || a.contents !== null &&
|
|
2053
|
+
i = a.explicitEnd || a.contents !== null && ui(a.contents), i && (r += "...\n");
|
|
2043
2054
|
}
|
|
2044
2055
|
return r;
|
|
2045
2056
|
}
|
|
2046
2057
|
//#endregion
|
|
2047
2058
|
//#region src/dump.ts
|
|
2048
|
-
var
|
|
2059
|
+
var pi = rt.withTags(y(y({}, _e), {}, { resolve: (t, n, r) => {
|
|
2049
2060
|
let i = _e.resolve(t, n, r);
|
|
2050
2061
|
return i === e ? ce.resolve(t, n, r) : i;
|
|
2051
2062
|
} }), y(y({}, Me), {}, { resolve: (t, n, r) => {
|
|
2052
2063
|
let i = Me.resolve(t, n, r);
|
|
2053
2064
|
return i === e ? Se.resolve(t, n, r) : i;
|
|
2054
|
-
} })),
|
|
2055
|
-
schema:
|
|
2065
|
+
} })), mi = y(y({}, Ar), {}, {
|
|
2066
|
+
schema: pi,
|
|
2056
2067
|
skipInvalid: !1,
|
|
2057
2068
|
noRefs: !1,
|
|
2058
2069
|
flowLevel: -1,
|
|
2059
2070
|
transform: () => {}
|
|
2060
2071
|
});
|
|
2061
|
-
function
|
|
2062
|
-
let n = y(y({},
|
|
2072
|
+
function hi(e, t = {}) {
|
|
2073
|
+
let n = y(y({}, mi), t), r = nr(e, n.schema, {
|
|
2063
2074
|
noRefs: n.noRefs,
|
|
2064
2075
|
skipInvalid: n.skipInvalid
|
|
2065
2076
|
});
|
|
2066
|
-
return n.flowLevel >= 0 &&
|
|
2067
|
-
if (!(t.depth < n.flowLevel)) return e.style.flow = !0,
|
|
2068
|
-
}), n.transform(r),
|
|
2077
|
+
return n.flowLevel >= 0 && or(r, (e, t) => {
|
|
2078
|
+
if (!(t.depth < n.flowLevel)) return e.style.flow = !0, ir;
|
|
2079
|
+
}), n.transform(r), fi(r, y(y({}, We(n, Object.keys(Ar))), {}, { schema: n.schema }));
|
|
2069
2080
|
}
|
|
2070
2081
|
//#endregion
|
|
2071
2082
|
//#region src/ast/from_events.ts
|
|
2072
|
-
var
|
|
2073
|
-
function
|
|
2074
|
-
return "tagStart" in e && e.tagStart !==
|
|
2075
|
-
}
|
|
2076
|
-
function gi(e, t) {
|
|
2077
|
-
return t.tagStart === mi ? "" : e.source.slice(t.tagStart, t.tagEnd);
|
|
2083
|
+
var $ = -1;
|
|
2084
|
+
function gi(e) {
|
|
2085
|
+
return "tagStart" in e && e.tagStart !== $ ? e.tagStart : "anchorStart" in e && e.anchorStart !== $ ? e.anchorStart : "valueStart" in e && e.valueStart !== $ ? e.valueStart : "start" in e ? e.start : 0;
|
|
2078
2086
|
}
|
|
2079
2087
|
function _i(e, t) {
|
|
2080
|
-
return t.
|
|
2088
|
+
return t.tagStart === $ ? "" : e.source.slice(t.tagStart, t.tagEnd);
|
|
2081
2089
|
}
|
|
2082
|
-
function vi(
|
|
2090
|
+
function vi(e, t) {
|
|
2091
|
+
return t.anchorStart === $ ? void 0 : e.source.slice(t.anchorStart, t.anchorEnd);
|
|
2092
|
+
}
|
|
2093
|
+
function yi(t, n) {
|
|
2083
2094
|
var r;
|
|
2084
2095
|
let { schema: i } = t, a = (r = i.implicitScalarByFirstChar.get(n.charAt(0))) == null ? i.implicitScalarAnyFirstChar : r;
|
|
2085
2096
|
for (let t of a) if (t.resolve(n, !1, t.tagName) !== e) return t.tagName;
|
|
2086
2097
|
return i.defaultScalarTag.tagName;
|
|
2087
2098
|
}
|
|
2088
|
-
function
|
|
2089
|
-
let n = Ut(e.source, t), r =
|
|
2099
|
+
function bi(e, t) {
|
|
2100
|
+
let n = Ut(e.source, t), r = _i(e, t), i = new B();
|
|
2090
2101
|
switch (t.style) {
|
|
2091
2102
|
case 2:
|
|
2092
2103
|
i.singleQuoted = !0;
|
|
@@ -2102,32 +2113,32 @@ function yi(e, t) {
|
|
|
2102
2113
|
break;
|
|
2103
2114
|
}
|
|
2104
2115
|
let a;
|
|
2105
|
-
return r === "" ? a = t.style === 1 ?
|
|
2116
|
+
return r === "" ? a = t.style === 1 ? yi(e, n) : e.schema.defaultScalarTag.tagName : (i.tagged = !0, a = r), {
|
|
2106
2117
|
kind: "scalar",
|
|
2107
2118
|
tag: a,
|
|
2108
2119
|
style: i,
|
|
2109
|
-
anchor:
|
|
2120
|
+
anchor: vi(e, t),
|
|
2110
2121
|
value: n
|
|
2111
2122
|
};
|
|
2112
2123
|
}
|
|
2113
|
-
function
|
|
2114
|
-
let r =
|
|
2124
|
+
function xi(e, t, n) {
|
|
2125
|
+
let r = _i(e, t), i = new B();
|
|
2115
2126
|
t.style === 2 && (i.flow = !0);
|
|
2116
2127
|
let a;
|
|
2117
2128
|
return r === "" ? a = n : (a = r, i.tagged = !0), {
|
|
2118
2129
|
tag: a,
|
|
2119
2130
|
style: i,
|
|
2120
|
-
anchor:
|
|
2131
|
+
anchor: vi(e, t)
|
|
2121
2132
|
};
|
|
2122
2133
|
}
|
|
2123
|
-
function
|
|
2134
|
+
function Si(e, t) {
|
|
2124
2135
|
let n = e.frames[e.frames.length - 1];
|
|
2125
2136
|
n.kind === "document" ? n.doc.contents = t : n.kind === "sequence" ? n.node.items.push(t) : n.key ? (n.node.items.push({
|
|
2126
2137
|
key: n.key,
|
|
2127
2138
|
value: t
|
|
2128
2139
|
}), n.key = null) : n.key = t;
|
|
2129
2140
|
}
|
|
2130
|
-
function
|
|
2141
|
+
function Ci(e, t) {
|
|
2131
2142
|
let n = {
|
|
2132
2143
|
source: t.source,
|
|
2133
2144
|
schema: t.schema,
|
|
@@ -2138,7 +2149,7 @@ function Si(e, t) {
|
|
|
2138
2149
|
};
|
|
2139
2150
|
for (; n.eventIndex < e.length;) {
|
|
2140
2151
|
let t = e[n.eventIndex++];
|
|
2141
|
-
switch (n.position =
|
|
2152
|
+
switch (n.position = gi(t), t.type) {
|
|
2142
2153
|
case 1: {
|
|
2143
2154
|
let e = {
|
|
2144
2155
|
contents: null,
|
|
@@ -2153,10 +2164,10 @@ function Si(e, t) {
|
|
|
2153
2164
|
break;
|
|
2154
2165
|
}
|
|
2155
2166
|
case 4:
|
|
2156
|
-
|
|
2167
|
+
Si(n, bi(n, t));
|
|
2157
2168
|
break;
|
|
2158
2169
|
case 2: {
|
|
2159
|
-
let { tag: e, style: r, anchor: i } =
|
|
2170
|
+
let { tag: e, style: r, anchor: i } = xi(n, t, "tag:yaml.org,2002:seq"), a = {
|
|
2160
2171
|
kind: "sequence",
|
|
2161
2172
|
tag: e,
|
|
2162
2173
|
style: r,
|
|
@@ -2170,7 +2181,7 @@ function Si(e, t) {
|
|
|
2170
2181
|
break;
|
|
2171
2182
|
}
|
|
2172
2183
|
case 3: {
|
|
2173
|
-
let { tag: e, style: r, anchor: i } =
|
|
2184
|
+
let { tag: e, style: r, anchor: i } = xi(n, t, "tag:yaml.org,2002:map"), a = {
|
|
2174
2185
|
kind: "mapping",
|
|
2175
2186
|
tag: e,
|
|
2176
2187
|
style: r,
|
|
@@ -2186,17 +2197,17 @@ function Si(e, t) {
|
|
|
2186
2197
|
}
|
|
2187
2198
|
case 5: {
|
|
2188
2199
|
let e = n.source.slice(t.anchorStart, t.anchorEnd);
|
|
2189
|
-
|
|
2200
|
+
Si(n, {
|
|
2190
2201
|
kind: "alias",
|
|
2191
2202
|
tag: "",
|
|
2192
|
-
style: new
|
|
2203
|
+
style: new B(),
|
|
2193
2204
|
anchor: e
|
|
2194
2205
|
});
|
|
2195
2206
|
break;
|
|
2196
2207
|
}
|
|
2197
2208
|
case 6: {
|
|
2198
2209
|
let e = n.frames.pop();
|
|
2199
|
-
e.kind === "document" ? n.documents.push(e.doc) :
|
|
2210
|
+
e.kind === "document" ? n.documents.push(e.doc) : Si(n, e.node);
|
|
2200
2211
|
break;
|
|
2201
2212
|
}
|
|
2202
2213
|
}
|
|
@@ -2204,6 +2215,6 @@ function Si(e, t) {
|
|
|
2204
2215
|
return n.documents;
|
|
2205
2216
|
}
|
|
2206
2217
|
//#endregion
|
|
2207
|
-
export { Dt as CHOMPING_CLIP, kt as CHOMPING_KEEP, Ot as CHOMPING_STRIP, Tt as COLLECTION_STYLE_BLOCK, Et as COLLECTION_STYLE_FLOW, nt as CORE_SCHEMA, vt as EVENT_ALIAS, mt as EVENT_DOCUMENT, gt as EVENT_MAPPING, yt as EVENT_POP, _t as EVENT_SCALAR, ht as EVENT_SEQUENCE, et as FAILSAFE_SCHEMA, tt as JSON_SCHEMA, t as MERGE_KEY, e as NOT_RESOLVED, St as SCALAR_STYLE_DOUBLE_QUOTED, wt as SCALAR_STYLE_FOLDED_BLOCK, Ct as SCALAR_STYLE_LITERAL_BLOCK, bt as SCALAR_STYLE_PLAIN, xt as SCALAR_STYLE_SINGLE_QUOTED, v as Schema,
|
|
2218
|
+
export { Dt as CHOMPING_CLIP, kt as CHOMPING_KEEP, Ot as CHOMPING_STRIP, Tt as COLLECTION_STYLE_BLOCK, Et as COLLECTION_STYLE_FLOW, nt as CORE_SCHEMA, vt as EVENT_ALIAS, mt as EVENT_DOCUMENT, gt as EVENT_MAPPING, yt as EVENT_POP, _t as EVENT_SCALAR, ht as EVENT_SEQUENCE, et as FAILSAFE_SCHEMA, tt as JSON_SCHEMA, t as MERGE_KEY, e as NOT_RESOLVED, St as SCALAR_STYLE_DOUBLE_QUOTED, wt as SCALAR_STYLE_FOLDED_BLOCK, Ct as SCALAR_STYLE_LITERAL_BLOCK, bt as SCALAR_STYLE_PLAIN, xt as SCALAR_STYLE_SINGLE_QUOTED, v as Schema, B as Style, rr as VISIT_BREAK, ir as VISIT_SKIP, rt as YAML11_SCHEMA, b as YAMLException, Le as binaryTag, p as boolCoreTag, ee as boolJsonTag, re as boolYaml11Tag, cn as constructFromEvents, i as defineMappingTag, n as defineScalarTag, r as defineSequenceTag, hi as dump, Ci as eventsToAst, Se as floatCoreTag, De as floatJsonTag, Me as floatYaml11Tag, Ut as getScalarValue, ce as intCoreTag, pe as intJsonTag, _e as intYaml11Tag, nr as jsToAst, ot as legacyMapTag, $n as load, Qn as loadAll, qe as mapTag, Ne as mergeTag, s as nullCoreTag, c as nullJsonTag, u as nullYaml11Tag, Ge as omapTag, Ke as pairsTag, Yn as parseEvents, fi as present, it as realMapTag, He as seqTag, Je as setTag, a as strTag, Ve as timestampTag, or as visit };
|
|
2208
2219
|
|
|
2209
2220
|
//# sourceMappingURL=js-yaml.esm.min.mjs.map
|