@rexeus/typeweaver 0.2.0 → 0.3.0
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 +30 -10
- package/dist/{acorn-CJ4HNU11.js → acorn-TNAGPKCR.js} +1076 -998
- package/dist/angular-3KXBV3WD.js +3030 -0
- package/dist/babel-V7SGJWS6.js +7296 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/chunk-Q6MQC6UP.js +34641 -0
- package/dist/cli.cjs +116222 -0
- package/dist/cli.d.cts +2 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +2 -0
- package/dist/entry.cjs +116942 -0
- package/dist/entry.d.cts +2 -0
- package/dist/entry.d.ts +2 -0
- package/dist/entry.js +30 -0
- package/dist/estree-QSPT5I7I.js +4612 -0
- package/dist/flow-WHVBWPDR.js +27546 -0
- package/dist/{glimmer-DiXjs4DB.js → glimmer-BHRIPYOK.js} +1317 -1051
- package/dist/{graphql-DLJHmbDb.js → graphql-7EJJJFHU.js} +343 -307
- package/dist/html-YM5TKPVB.js +2926 -0
- package/dist/index.cjs +116228 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -16
- package/dist/markdown-FIK6SNTF.js +3551 -0
- package/dist/meriyah-FBUICA5T.js +2684 -0
- package/dist/{postcss-DUOVol6C.js → postcss-ODV7XV5T.js} +1779 -1641
- package/dist/tsx-loader-H3LYLQCE.js +2 -0
- package/dist/typescript-BG63TNYD.js +13203 -0
- package/dist/{yaml-Bd8DkW_K.js → yaml-DV3ZI4ZT.js} +1140 -1058
- package/package.json +33 -33
- package/dist/angular-wXs0C_R2.js +0 -2626
- package/dist/babel-DNmSIBHM.js +0 -7201
- package/dist/cli-Nz3HYFYF.js +0 -20691
- package/dist/estree-BfVT8G2n.js +0 -4301
- package/dist/flow-DgzFy9Js.js +0 -27138
- package/dist/html-BwjSBi_v.js +0 -2677
- package/dist/markdown-DWIPYE8e.js +0 -3363
- package/dist/meriyah-CbAY3E55.js +0 -2603
- package/dist/run-cli-with-tsx.js +0 -18
- package/dist/typescript-DDNbhgng.js +0 -12972
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
1
|
+
import "./chunk-MLKGABMK.js";
|
|
2
|
+
|
|
3
|
+
// ../../node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/plugins/yaml.mjs
|
|
4
|
+
var ki = Object.create;
|
|
5
|
+
var sn = Object.defineProperty;
|
|
6
|
+
var Pi = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var vi = Object.getOwnPropertyNames;
|
|
8
|
+
var Ii = Object.getPrototypeOf;
|
|
9
|
+
var _i = Object.prototype.hasOwnProperty;
|
|
10
|
+
var ne = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
|
|
11
|
+
var or = (t, e) => {
|
|
12
|
+
for (var n in e) sn(t, n, { get: e[n], enumerable: true });
|
|
8
13
|
};
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
for (var n in e) Nt(t, n, { get: e[n], enumerable: true });
|
|
12
|
-
}, Ki = (t, e, n, r) => {
|
|
13
|
-
if (e && typeof e == "object" || typeof e == "function") for (let s of Bi(e)) !qi.call(t, s) && s !== n && Nt(t, s, { get: () => e[s], enumerable: !(r = $i(e, s)) || r.enumerable });
|
|
14
|
+
var xi = (t, e, n, r) => {
|
|
15
|
+
if (e && typeof e == "object" || typeof e == "function") for (let s of vi(e)) !_i.call(t, s) && s !== n && sn(t, s, { get: () => e[s], enumerable: !(r = Pi(e, s)) || r.enumerable });
|
|
14
16
|
return t;
|
|
15
17
|
};
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
function Zr(t) {
|
|
18
|
+
var on = (t, e, n) => (n = t != null ? ki(Ii(t)) : {}, xi(e || !t || !t.__esModule ? sn(n, "default", { value: t, enumerable: true }) : n, t));
|
|
19
|
+
var ce = ne((B) => {
|
|
20
|
+
"use strict";
|
|
21
|
+
var ie = { ANCHOR: "&", COMMENT: "#", TAG: "!", DIRECTIVES_END: "-", DOCUMENT_END: "." }, st = { ALIAS: "ALIAS", BLANK_LINE: "BLANK_LINE", BLOCK_FOLDED: "BLOCK_FOLDED", BLOCK_LITERAL: "BLOCK_LITERAL", COMMENT: "COMMENT", DIRECTIVE: "DIRECTIVE", DOCUMENT: "DOCUMENT", FLOW_MAP: "FLOW_MAP", FLOW_SEQ: "FLOW_SEQ", MAP: "MAP", MAP_KEY: "MAP_KEY", MAP_VALUE: "MAP_VALUE", PLAIN: "PLAIN", QUOTE_DOUBLE: "QUOTE_DOUBLE", QUOTE_SINGLE: "QUOTE_SINGLE", SEQ: "SEQ", SEQ_ITEM: "SEQ_ITEM" }, mo = "tag:yaml.org,2002:", ho = { MAP: "tag:yaml.org,2002:map", SEQ: "tag:yaml.org,2002:seq", STR: "tag:yaml.org,2002:str" };
|
|
22
|
+
function Wr(t) {
|
|
22
23
|
let e = [0], n = t.indexOf(`
|
|
23
24
|
`);
|
|
24
25
|
for (; n !== -1; ) n += 1, e.push(n), n = t.indexOf(`
|
|
25
26
|
`, n);
|
|
26
27
|
return e;
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
+
function Kr(t) {
|
|
29
30
|
let e, n;
|
|
30
|
-
return typeof t == "string" ? (e =
|
|
31
|
+
return typeof t == "string" ? (e = Wr(t), n = t) : (Array.isArray(t) && (t = t[0]), t && t.context && (t.lineStarts || (t.lineStarts = Wr(t.context.src)), e = t.lineStarts, n = t.context.src)), { lineStarts: e, src: n };
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
+
function wn(t, e) {
|
|
33
34
|
if (typeof t != "number" || t < 0) return null;
|
|
34
|
-
let { lineStarts: n, src: r } =
|
|
35
|
+
let { lineStarts: n, src: r } = Kr(e);
|
|
35
36
|
if (!n || !r || t > r.length) return null;
|
|
36
37
|
for (let i = 0; i < n.length; ++i) {
|
|
37
38
|
let o = n[i];
|
|
@@ -41,16 +42,16 @@ var oe = te(($) => {
|
|
|
41
42
|
let s = n.length;
|
|
42
43
|
return { line: s, col: t - n[s - 1] + 1 };
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
-
let { lineStarts: n, src: r } =
|
|
45
|
+
function go(t, e) {
|
|
46
|
+
let { lineStarts: n, src: r } = Kr(e);
|
|
46
47
|
if (!n || !(t >= 1) || t > n.length) return null;
|
|
47
48
|
let s = n[t - 1], i = n[t];
|
|
48
49
|
for (; i && i > s && r[i - 1] === `
|
|
49
50
|
`; ) --i;
|
|
50
51
|
return r.slice(s, i);
|
|
51
52
|
}
|
|
52
|
-
function
|
|
53
|
-
let s =
|
|
53
|
+
function yo({ start: t, end: e }, n, r = 80) {
|
|
54
|
+
let s = go(t.line, n);
|
|
54
55
|
if (!s) return null;
|
|
55
56
|
let { col: i } = t;
|
|
56
57
|
if (s.length > r) if (i <= r - 10) s = s.substr(0, r - 1) + "\u2026";
|
|
@@ -64,7 +65,7 @@ var oe = te(($) => {
|
|
|
64
65
|
return `${s}
|
|
65
66
|
${c}${l}${a}`;
|
|
66
67
|
}
|
|
67
|
-
var
|
|
68
|
+
var xe = class t {
|
|
68
69
|
static copy(e) {
|
|
69
70
|
return new t(e.start, e.end);
|
|
70
71
|
}
|
|
@@ -84,7 +85,7 @@ ${c}${l}${a}`;
|
|
|
84
85
|
for (; i < e.length && !(e[i] >= s); ) ++i;
|
|
85
86
|
return this.origEnd = s + i, o;
|
|
86
87
|
}
|
|
87
|
-
},
|
|
88
|
+
}, oe = class t {
|
|
88
89
|
static addStringTerminator(e, n, r) {
|
|
89
90
|
if (r[r.length - 1] === `
|
|
90
91
|
`) return r;
|
|
@@ -101,7 +102,7 @@ ${c}${l}${a}`;
|
|
|
101
102
|
`) return false;
|
|
102
103
|
if (r) {
|
|
103
104
|
if (s !== r) return false;
|
|
104
|
-
} else if (s !==
|
|
105
|
+
} else if (s !== ie.DIRECTIVES_END && s !== ie.DOCUMENT_END) return false;
|
|
105
106
|
let o = e[n + 1], a = e[n + 2];
|
|
106
107
|
if (o !== s || a !== s) return false;
|
|
107
108
|
let c = e[n + 3];
|
|
@@ -194,7 +195,7 @@ ${c}${l}${a}`;
|
|
|
194
195
|
}
|
|
195
196
|
get anchor() {
|
|
196
197
|
for (let e = 0; e < this.props.length; ++e) {
|
|
197
|
-
let n = this.getPropValue(e,
|
|
198
|
+
let n = this.getPropValue(e, ie.ANCHOR, true);
|
|
198
199
|
if (n != null) return n;
|
|
199
200
|
}
|
|
200
201
|
return null;
|
|
@@ -202,7 +203,7 @@ ${c}${l}${a}`;
|
|
|
202
203
|
get comment() {
|
|
203
204
|
let e = [];
|
|
204
205
|
for (let n = 0; n < this.props.length; ++n) {
|
|
205
|
-
let r = this.getPropValue(n,
|
|
206
|
+
let r = this.getPropValue(n, ie.COMMENT, true);
|
|
206
207
|
r != null && e.push(r);
|
|
207
208
|
}
|
|
208
209
|
return e.length > 0 ? e.join(`
|
|
@@ -217,14 +218,14 @@ ${c}${l}${a}`;
|
|
|
217
218
|
get hasComment() {
|
|
218
219
|
if (this.context) {
|
|
219
220
|
let { src: e } = this.context;
|
|
220
|
-
for (let n = 0; n < this.props.length; ++n) if (e[this.props[n].start] ===
|
|
221
|
+
for (let n = 0; n < this.props.length; ++n) if (e[this.props[n].start] === ie.COMMENT) return true;
|
|
221
222
|
}
|
|
222
223
|
return false;
|
|
223
224
|
}
|
|
224
225
|
get hasProps() {
|
|
225
226
|
if (this.context) {
|
|
226
227
|
let { src: e } = this.context;
|
|
227
|
-
for (let n = 0; n < this.props.length; ++n) if (e[this.props[n].start] !==
|
|
228
|
+
for (let n = 0; n < this.props.length; ++n) if (e[this.props[n].start] !== ie.COMMENT) return true;
|
|
228
229
|
}
|
|
229
230
|
return false;
|
|
230
231
|
}
|
|
@@ -232,13 +233,13 @@ ${c}${l}${a}`;
|
|
|
232
233
|
return false;
|
|
233
234
|
}
|
|
234
235
|
get jsonLike() {
|
|
235
|
-
return [
|
|
236
|
+
return [st.FLOW_MAP, st.FLOW_SEQ, st.QUOTE_DOUBLE, st.QUOTE_SINGLE].indexOf(this.type) !== -1;
|
|
236
237
|
}
|
|
237
238
|
get rangeAsLinePos() {
|
|
238
239
|
if (!this.range || !this.context) return;
|
|
239
|
-
let e =
|
|
240
|
+
let e = wn(this.range.start, this.context.root);
|
|
240
241
|
if (!e) return;
|
|
241
|
-
let n =
|
|
242
|
+
let n = wn(this.range.end, this.context.root);
|
|
242
243
|
return { start: e, end: n };
|
|
243
244
|
}
|
|
244
245
|
get rawValue() {
|
|
@@ -248,7 +249,7 @@ ${c}${l}${a}`;
|
|
|
248
249
|
}
|
|
249
250
|
get tag() {
|
|
250
251
|
for (let e = 0; e < this.props.length; ++e) {
|
|
251
|
-
let n = this.getPropValue(e,
|
|
252
|
+
let n = this.getPropValue(e, ie.TAG, false);
|
|
252
253
|
if (n != null) {
|
|
253
254
|
if (n[1] === "<") return { verbatim: n.slice(2, -1) };
|
|
254
255
|
{
|
|
@@ -268,8 +269,8 @@ ${c}${l}${a}`;
|
|
|
268
269
|
}
|
|
269
270
|
parseComment(e) {
|
|
270
271
|
let { src: n } = this.context;
|
|
271
|
-
if (n[e] ===
|
|
272
|
-
let r = t.endOfLine(n, e + 1), s = new
|
|
272
|
+
if (n[e] === ie.COMMENT) {
|
|
273
|
+
let r = t.endOfLine(n, e + 1), s = new xe(e, r);
|
|
273
274
|
return this.props.push(s), r;
|
|
274
275
|
}
|
|
275
276
|
return e;
|
|
@@ -283,9 +284,9 @@ ${c}${l}${a}`;
|
|
|
283
284
|
let s = e.slice(n.start, n.end);
|
|
284
285
|
return t.addStringTerminator(e, n.end, s);
|
|
285
286
|
}
|
|
286
|
-
},
|
|
287
|
+
}, ge = class extends Error {
|
|
287
288
|
constructor(e, n, r) {
|
|
288
|
-
if (!r || !(n instanceof
|
|
289
|
+
if (!r || !(n instanceof oe)) throw new Error(`Invalid arguments for new ${e}`);
|
|
289
290
|
super(), this.name = e, this.message = r, this.source = n;
|
|
290
291
|
}
|
|
291
292
|
makePretty() {
|
|
@@ -293,8 +294,8 @@ ${c}${l}${a}`;
|
|
|
293
294
|
this.nodeType = this.source.type;
|
|
294
295
|
let e = this.source.context && this.source.context.root;
|
|
295
296
|
if (typeof this.offset == "number") {
|
|
296
|
-
this.range = new
|
|
297
|
-
let n = e &&
|
|
297
|
+
this.range = new xe(this.offset, this.offset + 1);
|
|
298
|
+
let n = e && wn(this.offset, e);
|
|
298
299
|
if (n) {
|
|
299
300
|
let r = { line: n.line, col: n.col + 1 };
|
|
300
301
|
this.linePos = { start: n, end: r };
|
|
@@ -304,7 +305,7 @@ ${c}${l}${a}`;
|
|
|
304
305
|
if (this.linePos) {
|
|
305
306
|
let { line: n, col: r } = this.linePos.start;
|
|
306
307
|
this.message += ` at line ${n}, column ${r}`;
|
|
307
|
-
let s = e &&
|
|
308
|
+
let s = e && yo(this.linePos, e);
|
|
308
309
|
s && (this.message += `:
|
|
309
310
|
|
|
310
311
|
${s}
|
|
@@ -312,27 +313,27 @@ ${s}
|
|
|
312
313
|
}
|
|
313
314
|
delete this.source;
|
|
314
315
|
}
|
|
315
|
-
},
|
|
316
|
+
}, bn = class extends ge {
|
|
316
317
|
constructor(e, n) {
|
|
317
318
|
super("YAMLReferenceError", e, n);
|
|
318
319
|
}
|
|
319
|
-
},
|
|
320
|
+
}, it = class extends ge {
|
|
320
321
|
constructor(e, n) {
|
|
321
322
|
super("YAMLSemanticError", e, n);
|
|
322
323
|
}
|
|
323
|
-
},
|
|
324
|
+
}, Nn = class extends ge {
|
|
324
325
|
constructor(e, n) {
|
|
325
326
|
super("YAMLSyntaxError", e, n);
|
|
326
327
|
}
|
|
327
|
-
},
|
|
328
|
+
}, On = class extends ge {
|
|
328
329
|
constructor(e, n) {
|
|
329
330
|
super("YAMLWarning", e, n);
|
|
330
331
|
}
|
|
331
332
|
};
|
|
332
|
-
function
|
|
333
|
+
function Eo(t, e, n) {
|
|
333
334
|
return e in t ? Object.defineProperty(t, e, { value: n, enumerable: true, configurable: true, writable: true }) : t[e] = n, t;
|
|
334
335
|
}
|
|
335
|
-
var
|
|
336
|
+
var An = class t extends oe {
|
|
336
337
|
static endOfLine(e, n, r) {
|
|
337
338
|
let s = e[n], i = n;
|
|
338
339
|
for (; s && s !== `
|
|
@@ -354,7 +355,7 @@ ${s}
|
|
|
354
355
|
let c = r[a];
|
|
355
356
|
if (c === `
|
|
356
357
|
`) {
|
|
357
|
-
let { fold: l, offset: f } =
|
|
358
|
+
let { fold: l, offset: f } = oe.foldNewline(r, a, -1);
|
|
358
359
|
i += l, a = f;
|
|
359
360
|
} else if (c === " " || c === " ") {
|
|
360
361
|
let l = a, f = r[a + 1];
|
|
@@ -367,12 +368,12 @@ ${s}
|
|
|
367
368
|
switch (o) {
|
|
368
369
|
case " ": {
|
|
369
370
|
let a = "Plain value cannot start with a tab character";
|
|
370
|
-
return { errors: [new
|
|
371
|
+
return { errors: [new it(this, a)], str: i };
|
|
371
372
|
}
|
|
372
373
|
case "@":
|
|
373
374
|
case "`": {
|
|
374
375
|
let a = `Plain value cannot start with reserved character ${o}`;
|
|
375
|
-
return { errors: [new
|
|
376
|
+
return { errors: [new it(this, a)], str: i };
|
|
376
377
|
}
|
|
377
378
|
default:
|
|
378
379
|
return i;
|
|
@@ -381,8 +382,8 @@ ${s}
|
|
|
381
382
|
parseBlockValue(e) {
|
|
382
383
|
let { indent: n, inFlow: r, src: s } = this.context, i = e, o = e;
|
|
383
384
|
for (let a = s[i]; a === `
|
|
384
|
-
` && !
|
|
385
|
-
let c =
|
|
385
|
+
` && !oe.atDocumentBoundary(s, i + 1); a = s[i]) {
|
|
386
|
+
let c = oe.endOfBlockIndent(s, n, i + 1);
|
|
386
387
|
if (c === null || s[c] === "#") break;
|
|
387
388
|
s[c] === `
|
|
388
389
|
` ? i = c : (o = t.endOfLine(s, c, r), i = o);
|
|
@@ -393,25 +394,26 @@ ${s}
|
|
|
393
394
|
this.context = e;
|
|
394
395
|
let { inFlow: r, src: s } = e, i = n, o = s[i];
|
|
395
396
|
return o && o !== "#" && o !== `
|
|
396
|
-
` && (i = t.endOfLine(s, n, r)), this.valueRange = new
|
|
397
|
+
` && (i = t.endOfLine(s, n, r)), this.valueRange = new xe(n, i), i = oe.endOfWhiteSpace(s, i), i = this.parseComment(i), (!this.hasComment || this.valueRange.isEmpty()) && (i = this.parseBlockValue(i)), i;
|
|
397
398
|
}
|
|
398
399
|
};
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
400
|
+
B.Char = ie;
|
|
401
|
+
B.Node = oe;
|
|
402
|
+
B.PlainValue = An;
|
|
403
|
+
B.Range = xe;
|
|
404
|
+
B.Type = st;
|
|
405
|
+
B.YAMLError = ge;
|
|
406
|
+
B.YAMLReferenceError = bn;
|
|
407
|
+
B.YAMLSemanticError = it;
|
|
408
|
+
B.YAMLSyntaxError = Nn;
|
|
409
|
+
B.YAMLWarning = On;
|
|
410
|
+
B._defineProperty = Eo;
|
|
411
|
+
B.defaultTagPrefix = mo;
|
|
412
|
+
B.defaultTags = ho;
|
|
412
413
|
});
|
|
413
|
-
var
|
|
414
|
-
|
|
414
|
+
var Qr = ne((jr) => {
|
|
415
|
+
"use strict";
|
|
416
|
+
var u = ce(), Ee = class extends u.Node {
|
|
415
417
|
constructor() {
|
|
416
418
|
super(u.Type.BLANK_LINE);
|
|
417
419
|
}
|
|
@@ -421,7 +423,7 @@ var ns = te((ts) => {
|
|
|
421
423
|
parse(e, n) {
|
|
422
424
|
return this.context = e, this.range = new u.Range(n, n + 1), n + 1;
|
|
423
425
|
}
|
|
424
|
-
},
|
|
426
|
+
}, ot = class extends u.Node {
|
|
425
427
|
constructor(e, n) {
|
|
426
428
|
super(e, n), this.node = null;
|
|
427
429
|
}
|
|
@@ -432,7 +434,7 @@ var ns = te((ts) => {
|
|
|
432
434
|
this.context = e;
|
|
433
435
|
let { parseNode: r, src: s } = e, { atLineStart: i, lineStart: o } = e;
|
|
434
436
|
!i && this.type === u.Type.SEQ_ITEM && (this.error = new u.YAMLSemanticError(this, "Sequence items must not have preceding content on the same line"));
|
|
435
|
-
let a = i ? n - o : e.indent, c = u.Node.endOfWhiteSpace(s, n + 1), l = s[c], f = l === "#", m = [],
|
|
437
|
+
let a = i ? n - o : e.indent, c = u.Node.endOfWhiteSpace(s, n + 1), l = s[c], f = l === "#", m = [], g = null;
|
|
436
438
|
for (; l === `
|
|
437
439
|
` || l === "#"; ) {
|
|
438
440
|
if (l === "#") {
|
|
@@ -442,14 +444,14 @@ var ns = te((ts) => {
|
|
|
442
444
|
i = true, o = c + 1;
|
|
443
445
|
let h = u.Node.endOfWhiteSpace(s, o);
|
|
444
446
|
s[h] === `
|
|
445
|
-
` && m.length === 0 && (
|
|
447
|
+
` && m.length === 0 && (g = new Ee(), o = g.parse({ src: s }, o)), c = u.Node.endOfIndent(s, o);
|
|
446
448
|
}
|
|
447
449
|
l = s[c];
|
|
448
450
|
}
|
|
449
451
|
if (u.Node.nextNodeIsIndented(l, c - (o + a), this.type !== u.Type.SEQ_ITEM) ? this.node = r({ atLineStart: i, inCollection: false, indent: a, lineStart: o, parent: this }, c) : l && o > n + 1 && (c = o - 1), this.node) {
|
|
450
|
-
if (
|
|
452
|
+
if (g) {
|
|
451
453
|
let h = e.parent.items || e.parent.contents;
|
|
452
|
-
h && h.push(
|
|
454
|
+
h && h.push(g);
|
|
453
455
|
}
|
|
454
456
|
m.length && Array.prototype.push.apply(this.props, m), c = this.node.range.end;
|
|
455
457
|
} else if (f) {
|
|
@@ -468,7 +470,7 @@ var ns = te((ts) => {
|
|
|
468
470
|
let i = n ? e.slice(r.start, n.range.start) + String(n) : e.slice(r.start, r.end);
|
|
469
471
|
return u.Node.addStringTerminator(e, r.end, i);
|
|
470
472
|
}
|
|
471
|
-
},
|
|
473
|
+
}, ye = class extends u.Node {
|
|
472
474
|
constructor() {
|
|
473
475
|
super(u.Type.COMMENT);
|
|
474
476
|
}
|
|
@@ -478,10 +480,10 @@ var ns = te((ts) => {
|
|
|
478
480
|
return this.range = new u.Range(n, r), r;
|
|
479
481
|
}
|
|
480
482
|
};
|
|
481
|
-
function
|
|
483
|
+
function Ln(t) {
|
|
482
484
|
let e = t;
|
|
483
|
-
for (; e instanceof
|
|
484
|
-
if (!(e instanceof
|
|
485
|
+
for (; e instanceof ot; ) e = e.node;
|
|
486
|
+
if (!(e instanceof It)) return null;
|
|
485
487
|
let n = e.items.length, r = -1;
|
|
486
488
|
for (let o = n - 1; o >= 0; --o) {
|
|
487
489
|
let a = e.items[o];
|
|
@@ -497,7 +499,7 @@ var ns = te((ts) => {
|
|
|
497
499
|
for (; e.range.end = i, e.valueRange && e.valueRange.end > i && (e.valueRange.end = i), e !== t; ) e = e.context.parent;
|
|
498
500
|
return s;
|
|
499
501
|
}
|
|
500
|
-
var
|
|
502
|
+
var It = class t extends u.Node {
|
|
501
503
|
static nextContentHasIndent(e, n, r) {
|
|
502
504
|
let s = u.Node.endOfLine(e, n) + 1;
|
|
503
505
|
n = u.Node.endOfWhiteSpace(e, s);
|
|
@@ -514,7 +516,7 @@ var ns = te((ts) => {
|
|
|
514
516
|
break;
|
|
515
517
|
}
|
|
516
518
|
this.items = [e];
|
|
517
|
-
let n =
|
|
519
|
+
let n = Ln(e);
|
|
518
520
|
n && Array.prototype.push.apply(this.items, n);
|
|
519
521
|
}
|
|
520
522
|
get includesTrailingLines() {
|
|
@@ -532,7 +534,7 @@ var ns = te((ts) => {
|
|
|
532
534
|
` || l === "#"; ) {
|
|
533
535
|
if (f && l === `
|
|
534
536
|
` && !m) {
|
|
535
|
-
let h = new
|
|
537
|
+
let h = new Ee();
|
|
536
538
|
if (c = h.parse({ src: s }, c), this.valueRange.end = c, c >= s.length) {
|
|
537
539
|
l = null;
|
|
538
540
|
break;
|
|
@@ -540,16 +542,16 @@ var ns = te((ts) => {
|
|
|
540
542
|
this.items.push(h), c -= 1;
|
|
541
543
|
} else if (l === "#") {
|
|
542
544
|
if (c < i + a && !t.nextContentHasIndent(s, c, a)) return c;
|
|
543
|
-
let h = new
|
|
545
|
+
let h = new ye();
|
|
544
546
|
if (c = h.parse({ indent: a, lineStart: i, src: s }, c), this.items.push(h), this.valueRange.end = c, c >= s.length) {
|
|
545
547
|
l = null;
|
|
546
548
|
break;
|
|
547
549
|
}
|
|
548
550
|
}
|
|
549
551
|
if (i = c + 1, c = u.Node.endOfIndent(s, i), u.Node.atBlank(s, c)) {
|
|
550
|
-
let h = u.Node.endOfWhiteSpace(s, c),
|
|
551
|
-
(!
|
|
552
|
-
` ||
|
|
552
|
+
let h = u.Node.endOfWhiteSpace(s, c), d = s[h];
|
|
553
|
+
(!d || d === `
|
|
554
|
+
` || d === "#") && (c = h);
|
|
553
555
|
}
|
|
554
556
|
l = s[c], f = true;
|
|
555
557
|
}
|
|
@@ -572,19 +574,19 @@ var ns = te((ts) => {
|
|
|
572
574
|
let h = s[c + 1];
|
|
573
575
|
if (!h || h === `
|
|
574
576
|
` || h === " " || h === " ") {
|
|
575
|
-
let
|
|
576
|
-
this.error = new u.YAMLSyntaxError(this,
|
|
577
|
+
let d = "A collection cannot be both a mapping and a sequence";
|
|
578
|
+
this.error = new u.YAMLSyntaxError(this, d);
|
|
577
579
|
}
|
|
578
580
|
}
|
|
579
|
-
let
|
|
580
|
-
if (!
|
|
581
|
-
if (this.items.push(
|
|
582
|
-
let h = c - 1,
|
|
583
|
-
for (;
|
|
584
|
-
|
|
581
|
+
let g = r({ atLineStart: f, inCollection: true, indent: a, lineStart: i, parent: this }, c);
|
|
582
|
+
if (!g) return c;
|
|
583
|
+
if (this.items.push(g), this.valueRange.end = g.valueRange.end, c = u.Node.normalizeOffset(s, g.range.end), l = s[c], f = false, m = g.includesTrailingLines, l) {
|
|
584
|
+
let h = c - 1, d = s[h];
|
|
585
|
+
for (; d === " " || d === " "; ) d = s[--h];
|
|
586
|
+
d === `
|
|
585
587
|
` && (i = h + 1, f = true);
|
|
586
588
|
}
|
|
587
|
-
let y =
|
|
589
|
+
let y = Ln(g);
|
|
588
590
|
y && Array.prototype.push.apply(this.items, y);
|
|
589
591
|
}
|
|
590
592
|
return c;
|
|
@@ -605,7 +607,7 @@ var ns = te((ts) => {
|
|
|
605
607
|
}
|
|
606
608
|
return u.Node.addStringTerminator(e, r.end, i);
|
|
607
609
|
}
|
|
608
|
-
},
|
|
610
|
+
}, Tn = class extends u.Node {
|
|
609
611
|
constructor() {
|
|
610
612
|
super(u.Type.DIRECTIVE), this.name = null;
|
|
611
613
|
}
|
|
@@ -630,7 +632,7 @@ var ns = te((ts) => {
|
|
|
630
632
|
let r = this.parseName(n + 1);
|
|
631
633
|
return r = this.parseParameters(r), r = this.parseComment(r), this.range = new u.Range(n, r), r;
|
|
632
634
|
}
|
|
633
|
-
},
|
|
635
|
+
}, Cn = class t extends u.Node {
|
|
634
636
|
static startCommentOrEndBlankLine(e, n) {
|
|
635
637
|
let r = u.Node.endOfWhiteSpace(e, n), s = e[r];
|
|
636
638
|
return s === "#" || s === `
|
|
@@ -647,19 +649,19 @@ var ns = te((ts) => {
|
|
|
647
649
|
case `
|
|
648
650
|
`:
|
|
649
651
|
if (r) {
|
|
650
|
-
let o = new
|
|
652
|
+
let o = new Ee();
|
|
651
653
|
i = o.parse({ src: n }, i), i < n.length && this.directives.push(o);
|
|
652
654
|
} else i += 1, r = true;
|
|
653
655
|
break;
|
|
654
656
|
case "#":
|
|
655
657
|
{
|
|
656
|
-
let o = new
|
|
658
|
+
let o = new ye();
|
|
657
659
|
i = o.parse({ src: n }, i), this.directives.push(o), r = false;
|
|
658
660
|
}
|
|
659
661
|
break;
|
|
660
662
|
case "%":
|
|
661
663
|
{
|
|
662
|
-
let o = new
|
|
664
|
+
let o = new Tn();
|
|
663
665
|
i = o.parse({ parent: this, src: n }, i), this.directives.push(o), s = true, r = false;
|
|
664
666
|
}
|
|
665
667
|
break;
|
|
@@ -679,14 +681,14 @@ var ns = te((ts) => {
|
|
|
679
681
|
case `
|
|
680
682
|
`:
|
|
681
683
|
if (o) {
|
|
682
|
-
let a = new
|
|
684
|
+
let a = new Ee();
|
|
683
685
|
i = a.parse({ src: r }, i), i < r.length && this.contents.push(a);
|
|
684
686
|
} else i += 1, o = true;
|
|
685
687
|
s = i;
|
|
686
688
|
break;
|
|
687
689
|
case "#":
|
|
688
690
|
{
|
|
689
|
-
let a = new
|
|
691
|
+
let a = new ye();
|
|
690
692
|
i = a.parse({ src: r }, i), this.contents.push(a), o = false;
|
|
691
693
|
}
|
|
692
694
|
break;
|
|
@@ -694,7 +696,7 @@ var ns = te((ts) => {
|
|
|
694
696
|
let a = u.Node.endOfIndent(r, i), l = n({ atLineStart: o, indent: -1, inFlow: false, inCollection: false, lineStart: s, parent: this }, a);
|
|
695
697
|
if (!l) return this.valueRange.end = a;
|
|
696
698
|
this.contents.push(l), i = l.range.end, o = false;
|
|
697
|
-
let f =
|
|
699
|
+
let f = Ln(l);
|
|
698
700
|
f && Array.prototype.push.apply(this.contents, f);
|
|
699
701
|
}
|
|
700
702
|
}
|
|
@@ -702,7 +704,7 @@ var ns = te((ts) => {
|
|
|
702
704
|
}
|
|
703
705
|
if (this.valueRange.end = i, r[i] && (this.documentEndMarker = new u.Range(i, i + 3), i += 3, r[i])) {
|
|
704
706
|
if (i = u.Node.endOfWhiteSpace(r, i), r[i] === "#") {
|
|
705
|
-
let a = new
|
|
707
|
+
let a = new ye();
|
|
706
708
|
i = a.parse({ src: r }, i), this.contents.push(a);
|
|
707
709
|
}
|
|
708
710
|
switch (r[i]) {
|
|
@@ -739,18 +741,18 @@ var ns = te((ts) => {
|
|
|
739
741
|
` && (s += `
|
|
740
742
|
`), s;
|
|
741
743
|
}
|
|
742
|
-
},
|
|
744
|
+
}, Mn = class extends u.Node {
|
|
743
745
|
parse(e, n) {
|
|
744
746
|
this.context = e;
|
|
745
747
|
let { src: r } = e, s = u.Node.endOfIdentifier(r, n + 1);
|
|
746
748
|
return this.valueRange = new u.Range(n + 1, s), s = u.Node.endOfWhiteSpace(r, s), s = this.parseComment(s), s;
|
|
747
749
|
}
|
|
748
|
-
},
|
|
750
|
+
}, le = { CLIP: "CLIP", KEEP: "KEEP", STRIP: "STRIP" }, kn = class extends u.Node {
|
|
749
751
|
constructor(e, n) {
|
|
750
|
-
super(e, n), this.blockIndent = null, this.chomping =
|
|
752
|
+
super(e, n), this.blockIndent = null, this.chomping = le.CLIP, this.header = null;
|
|
751
753
|
}
|
|
752
754
|
get includesTrailingLines() {
|
|
753
|
-
return this.chomping ===
|
|
755
|
+
return this.chomping === le.KEEP;
|
|
754
756
|
}
|
|
755
757
|
get strValue() {
|
|
756
758
|
if (!this.valueRange || !this.context) return null;
|
|
@@ -760,34 +762,34 @@ var ns = te((ts) => {
|
|
|
760
762
|
for (; o === `
|
|
761
763
|
` || o === " " || o === " "; ) {
|
|
762
764
|
if (n -= 1, n <= e) {
|
|
763
|
-
if (this.chomping ===
|
|
765
|
+
if (this.chomping === le.KEEP) break;
|
|
764
766
|
return "";
|
|
765
767
|
}
|
|
766
768
|
o === `
|
|
767
769
|
` && (i = n), o = s[n - 1];
|
|
768
770
|
}
|
|
769
771
|
let a = n + 1;
|
|
770
|
-
i && (this.chomping ===
|
|
771
|
-
let c = r + this.blockIndent, l = this.type === u.Type.BLOCK_FOLDED, f = true, m = "",
|
|
772
|
+
i && (this.chomping === le.KEEP ? (a = i, n = this.valueRange.end) : n = i);
|
|
773
|
+
let c = r + this.blockIndent, l = this.type === u.Type.BLOCK_FOLDED, f = true, m = "", g = "", y = false;
|
|
772
774
|
for (let h = e; h < n; ++h) {
|
|
773
775
|
for (let w = 0; w < c && s[h] === " "; ++w) h += 1;
|
|
774
|
-
let
|
|
775
|
-
if (
|
|
776
|
-
`)
|
|
776
|
+
let d = s[h];
|
|
777
|
+
if (d === `
|
|
778
|
+
`) g === `
|
|
777
779
|
` ? m += `
|
|
778
|
-
` :
|
|
780
|
+
` : g = `
|
|
779
781
|
`;
|
|
780
782
|
else {
|
|
781
|
-
let w = u.Node.endOfLine(s, h),
|
|
782
|
-
h = w, l && (
|
|
783
|
-
` : !y && !f &&
|
|
784
|
-
` && (
|
|
783
|
+
let w = u.Node.endOfLine(s, h), P = s.slice(h, w);
|
|
784
|
+
h = w, l && (d === " " || d === " ") && h < a ? (g === " " ? g = `
|
|
785
|
+
` : !y && !f && g === `
|
|
786
|
+
` && (g = `
|
|
785
787
|
|
|
786
|
-
`), m +=
|
|
787
|
-
`, y = false), f &&
|
|
788
|
+
`), m += g + P, g = w < n && s[w] || "", y = true) : (m += g + P, g = l && h < a ? " " : `
|
|
789
|
+
`, y = false), f && P !== "" && (f = false);
|
|
788
790
|
}
|
|
789
791
|
}
|
|
790
|
-
return this.chomping ===
|
|
792
|
+
return this.chomping === le.STRIP ? m : m + `
|
|
791
793
|
`;
|
|
792
794
|
}
|
|
793
795
|
parseBlockHeader(e) {
|
|
@@ -796,10 +798,10 @@ var ns = te((ts) => {
|
|
|
796
798
|
let i = n[r];
|
|
797
799
|
switch (i) {
|
|
798
800
|
case "-":
|
|
799
|
-
this.chomping =
|
|
801
|
+
this.chomping = le.STRIP;
|
|
800
802
|
break;
|
|
801
803
|
case "+":
|
|
802
|
-
this.chomping =
|
|
804
|
+
this.chomping = le.KEEP;
|
|
803
805
|
break;
|
|
804
806
|
case "0":
|
|
805
807
|
case "1":
|
|
@@ -838,15 +840,15 @@ var ns = te((ts) => {
|
|
|
838
840
|
} else if (r[l] !== `
|
|
839
841
|
`) {
|
|
840
842
|
if (m < a) {
|
|
841
|
-
let
|
|
842
|
-
this.error = new u.YAMLSemanticError(this,
|
|
843
|
+
let g = "Block scalars with more-indented leading empty lines must use an explicit indentation indicator";
|
|
844
|
+
this.error = new u.YAMLSemanticError(this, g);
|
|
843
845
|
}
|
|
844
846
|
this.blockIndent = m;
|
|
845
847
|
} else m > a && (a = m);
|
|
846
848
|
r[l] === `
|
|
847
849
|
` ? i = l : i = o = u.Node.endOfLine(r, l);
|
|
848
850
|
}
|
|
849
|
-
return this.chomping !==
|
|
851
|
+
return this.chomping !== le.KEEP && (i = r[o] ? o + 1 : o), this.valueRange = new u.Range(e + 1, i), i;
|
|
850
852
|
}
|
|
851
853
|
parse(e, n) {
|
|
852
854
|
this.context = e;
|
|
@@ -856,7 +858,7 @@ var ns = te((ts) => {
|
|
|
856
858
|
setOrigRanges(e, n) {
|
|
857
859
|
return n = super.setOrigRanges(e, n), this.header ? this.header.setOrigRange(e, n) : n;
|
|
858
860
|
}
|
|
859
|
-
},
|
|
861
|
+
}, Pn = class extends u.Node {
|
|
860
862
|
constructor(e, n) {
|
|
861
863
|
super(e, n), this.items = null;
|
|
862
864
|
}
|
|
@@ -878,7 +880,7 @@ var ns = te((ts) => {
|
|
|
878
880
|
let l = u.Node.endOfWhiteSpace(s, o);
|
|
879
881
|
if (s[l] === `
|
|
880
882
|
`) {
|
|
881
|
-
let f = new
|
|
883
|
+
let f = new Ee();
|
|
882
884
|
o = f.parse({ src: s }, o), this.items.push(f);
|
|
883
885
|
}
|
|
884
886
|
if (c = u.Node.endOfIndent(s, o), c <= o + i && (a = s[c], c < o + i || a !== "]" && a !== "}")) {
|
|
@@ -892,7 +894,7 @@ var ns = te((ts) => {
|
|
|
892
894
|
break;
|
|
893
895
|
case "#":
|
|
894
896
|
{
|
|
895
|
-
let l = new
|
|
897
|
+
let l = new ye();
|
|
896
898
|
c = l.parse({ src: s }, c), this.items.push(l);
|
|
897
899
|
}
|
|
898
900
|
break;
|
|
@@ -938,7 +940,7 @@ var ns = te((ts) => {
|
|
|
938
940
|
` && (a += 1);
|
|
939
941
|
}), o += e.slice(a, r.end), u.Node.addStringTerminator(e, r.end, o);
|
|
940
942
|
}
|
|
941
|
-
},
|
|
943
|
+
}, vn = class t extends u.Node {
|
|
942
944
|
static endOfQuote(e, n) {
|
|
943
945
|
let r = e[n];
|
|
944
946
|
for (; r && r !== '"'; ) n += r === "\\" ? 2 : 1, r = e[n];
|
|
@@ -1046,7 +1048,7 @@ var ns = te((ts) => {
|
|
|
1046
1048
|
let { src: r } = e, s = t.endOfQuote(r, n + 1);
|
|
1047
1049
|
return this.valueRange = new u.Range(n, s), s = u.Node.endOfWhiteSpace(r, s), s = this.parseComment(s), s;
|
|
1048
1050
|
}
|
|
1049
|
-
},
|
|
1051
|
+
}, In = class t extends u.Node {
|
|
1050
1052
|
static endOfQuote(e, n) {
|
|
1051
1053
|
let r = e[n];
|
|
1052
1054
|
for (; r; ) if (r === "'") {
|
|
@@ -1083,32 +1085,32 @@ var ns = te((ts) => {
|
|
|
1083
1085
|
return this.valueRange = new u.Range(n, s), s = u.Node.endOfWhiteSpace(r, s), s = this.parseComment(s), s;
|
|
1084
1086
|
}
|
|
1085
1087
|
};
|
|
1086
|
-
function
|
|
1088
|
+
function So(t, e) {
|
|
1087
1089
|
switch (t) {
|
|
1088
1090
|
case u.Type.ALIAS:
|
|
1089
|
-
return new
|
|
1091
|
+
return new Mn(t, e);
|
|
1090
1092
|
case u.Type.BLOCK_FOLDED:
|
|
1091
1093
|
case u.Type.BLOCK_LITERAL:
|
|
1092
|
-
return new
|
|
1094
|
+
return new kn(t, e);
|
|
1093
1095
|
case u.Type.FLOW_MAP:
|
|
1094
1096
|
case u.Type.FLOW_SEQ:
|
|
1095
|
-
return new
|
|
1097
|
+
return new Pn(t, e);
|
|
1096
1098
|
case u.Type.MAP_KEY:
|
|
1097
1099
|
case u.Type.MAP_VALUE:
|
|
1098
1100
|
case u.Type.SEQ_ITEM:
|
|
1099
|
-
return new
|
|
1101
|
+
return new ot(t, e);
|
|
1100
1102
|
case u.Type.COMMENT:
|
|
1101
1103
|
case u.Type.PLAIN:
|
|
1102
1104
|
return new u.PlainValue(t, e);
|
|
1103
1105
|
case u.Type.QUOTE_DOUBLE:
|
|
1104
|
-
return new
|
|
1106
|
+
return new vn(t, e);
|
|
1105
1107
|
case u.Type.QUOTE_SINGLE:
|
|
1106
|
-
return new
|
|
1108
|
+
return new In(t, e);
|
|
1107
1109
|
default:
|
|
1108
1110
|
return null;
|
|
1109
1111
|
}
|
|
1110
1112
|
}
|
|
1111
|
-
var
|
|
1113
|
+
var _n = class t {
|
|
1112
1114
|
static parseType(e, n, r) {
|
|
1113
1115
|
switch (e[n]) {
|
|
1114
1116
|
case "*":
|
|
@@ -1138,11 +1140,11 @@ var ns = te((ts) => {
|
|
|
1138
1140
|
constructor(e = {}, { atLineStart: n, inCollection: r, inFlow: s, indent: i, lineStart: o, parent: a } = {}) {
|
|
1139
1141
|
u._defineProperty(this, "parseNode", (c, l) => {
|
|
1140
1142
|
if (u.Node.atDocumentBoundary(this.src, l)) return null;
|
|
1141
|
-
let f = new t(this, c), { props: m, type:
|
|
1142
|
-
if (h.range = new u.Range(l,
|
|
1143
|
+
let f = new t(this, c), { props: m, type: g, valueStart: y } = f.parseProps(l), h = So(g, m), d = h.parse(f, y);
|
|
1144
|
+
if (h.range = new u.Range(l, d), d <= l && (h.error = new Error("Node#parse consumed no characters"), h.error.parseEnd = d, h.error.source = h, h.range.end = l + 1), f.nodeStartsCollection(h)) {
|
|
1143
1145
|
!h.error && !f.atLineStart && f.parent.type === u.Type.DOCUMENT && (h.error = new u.YAMLSyntaxError(h, "Block collection must not have preceding content here (e.g. directives-end indicator)"));
|
|
1144
|
-
let w = new
|
|
1145
|
-
return
|
|
1146
|
+
let w = new It(h);
|
|
1147
|
+
return d = w.parse(new t(f), d), w.range = new u.Range(l, d), w;
|
|
1146
1148
|
}
|
|
1147
1149
|
return h;
|
|
1148
1150
|
}), this.atLineStart = n ?? (e.atLineStart || false), this.inCollection = r ?? (e.inCollection || false), this.inFlow = s ?? (e.inFlow || false), this.indent = i ?? e.indent, this.lineStart = o ?? e.lineStart, this.parent = a ?? (e.parent || {}), this.root = e.root, this.src = e.src;
|
|
@@ -1150,7 +1152,7 @@ var ns = te((ts) => {
|
|
|
1150
1152
|
nodeStartsCollection(e) {
|
|
1151
1153
|
let { inCollection: n, inFlow: r, src: s } = this;
|
|
1152
1154
|
if (n || r) return false;
|
|
1153
|
-
if (e instanceof
|
|
1155
|
+
if (e instanceof ot) return true;
|
|
1154
1156
|
let i = e.range.end;
|
|
1155
1157
|
return s[i] === `
|
|
1156
1158
|
` || s[i - 1] === `
|
|
@@ -1169,8 +1171,8 @@ var ns = te((ts) => {
|
|
|
1169
1171
|
f = l + 1, l = u.Node.endOfIndent(s, f);
|
|
1170
1172
|
while (s[l] === `
|
|
1171
1173
|
`);
|
|
1172
|
-
let m = l - (f + this.indent),
|
|
1173
|
-
if (s[l] !== "#" && !u.Node.nextNodeIsIndented(s[l], m, !
|
|
1174
|
+
let m = l - (f + this.indent), g = r.type === u.Type.SEQ_ITEM && r.context.atLineStart;
|
|
1175
|
+
if (s[l] !== "#" && !u.Node.nextNodeIsIndented(s[l], m, !g)) break;
|
|
1174
1176
|
this.atLineStart = true, this.lineStart = f, o = false, e = l;
|
|
1175
1177
|
} else if (a === u.Char.COMMENT) {
|
|
1176
1178
|
let l = u.Node.endOfLine(s, e + 1);
|
|
@@ -1186,13 +1188,13 @@ var ns = te((ts) => {
|
|
|
1186
1188
|
return { props: i, type: c, valueStart: e };
|
|
1187
1189
|
}
|
|
1188
1190
|
};
|
|
1189
|
-
function
|
|
1191
|
+
function wo(t) {
|
|
1190
1192
|
let e = [];
|
|
1191
1193
|
t.indexOf("\r") !== -1 && (t = t.replace(/\r\n?/g, (s, i) => (s.length > 1 && e.push(i), `
|
|
1192
1194
|
`)));
|
|
1193
1195
|
let n = [], r = 0;
|
|
1194
1196
|
do {
|
|
1195
|
-
let s = new
|
|
1197
|
+
let s = new Cn(), i = new _n({ src: t });
|
|
1196
1198
|
r = s.parse(i, r), n.push(s);
|
|
1197
1199
|
} while (r < t.length);
|
|
1198
1200
|
return n.setOrigRanges = () => {
|
|
@@ -1204,23 +1206,24 @@ var ns = te((ts) => {
|
|
|
1204
1206
|
}, n.toString = () => n.join(`...
|
|
1205
1207
|
`), n;
|
|
1206
1208
|
}
|
|
1207
|
-
|
|
1209
|
+
jr.parse = wo;
|
|
1208
1210
|
});
|
|
1209
|
-
var
|
|
1210
|
-
|
|
1211
|
-
|
|
1211
|
+
var De = ne((M) => {
|
|
1212
|
+
"use strict";
|
|
1213
|
+
var p = ce();
|
|
1214
|
+
function bo(t, e, n) {
|
|
1212
1215
|
return n ? `#${n.replace(/[\s\S]^/gm, `$&${e}#`)}
|
|
1213
1216
|
${e}${t}` : t;
|
|
1214
1217
|
}
|
|
1215
|
-
function
|
|
1218
|
+
function Re(t, e, n) {
|
|
1216
1219
|
return n ? n.indexOf(`
|
|
1217
1220
|
`) === -1 ? `${t} #${n}` : `${t}
|
|
1218
1221
|
` + n.replace(/^/gm, `${e || ""}#`) : t;
|
|
1219
1222
|
}
|
|
1220
1223
|
var j = class {
|
|
1221
1224
|
};
|
|
1222
|
-
function
|
|
1223
|
-
if (Array.isArray(t)) return t.map((r, s) =>
|
|
1225
|
+
function fe(t, e, n) {
|
|
1226
|
+
if (Array.isArray(t)) return t.map((r, s) => fe(r, String(s), n));
|
|
1224
1227
|
if (t && typeof t.toJSON == "function") {
|
|
1225
1228
|
let r = n && n.anchors && n.anchors.get(t);
|
|
1226
1229
|
r && (n.onCreate = (i) => {
|
|
@@ -1231,18 +1234,18 @@ ${e}${t}` : t;
|
|
|
1231
1234
|
}
|
|
1232
1235
|
return (!n || !n.keep) && typeof t == "bigint" ? Number(t) : t;
|
|
1233
1236
|
}
|
|
1234
|
-
var
|
|
1237
|
+
var x = class extends j {
|
|
1235
1238
|
constructor(e) {
|
|
1236
1239
|
super(), this.value = e;
|
|
1237
1240
|
}
|
|
1238
1241
|
toJSON(e, n) {
|
|
1239
|
-
return n && n.keep ? this.value :
|
|
1242
|
+
return n && n.keep ? this.value : fe(this.value, e, n);
|
|
1240
1243
|
}
|
|
1241
1244
|
toString() {
|
|
1242
1245
|
return String(this.value);
|
|
1243
1246
|
}
|
|
1244
1247
|
};
|
|
1245
|
-
function
|
|
1248
|
+
function Gr(t, e, n) {
|
|
1246
1249
|
let r = n;
|
|
1247
1250
|
for (let s = e.length - 1; s >= 0; --s) {
|
|
1248
1251
|
let i = e[s];
|
|
@@ -1256,16 +1259,16 @@ ${e}${t}` : t;
|
|
|
1256
1259
|
}
|
|
1257
1260
|
return t.createNode(r, false);
|
|
1258
1261
|
}
|
|
1259
|
-
var
|
|
1262
|
+
var Xr = (t) => t == null || typeof t == "object" && t[Symbol.iterator]().next().done, Q = class t extends j {
|
|
1260
1263
|
constructor(e) {
|
|
1261
1264
|
super(), p._defineProperty(this, "items", []), this.schema = e;
|
|
1262
1265
|
}
|
|
1263
1266
|
addIn(e, n) {
|
|
1264
|
-
if (
|
|
1267
|
+
if (Xr(e)) this.add(n);
|
|
1265
1268
|
else {
|
|
1266
1269
|
let [r, ...s] = e, i = this.get(r, true);
|
|
1267
1270
|
if (i instanceof t) i.addIn(s, n);
|
|
1268
|
-
else if (i === void 0 && this.schema) this.set(r,
|
|
1271
|
+
else if (i === void 0 && this.schema) this.set(r, Gr(this.schema, s, n));
|
|
1269
1272
|
else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`);
|
|
1270
1273
|
}
|
|
1271
1274
|
}
|
|
@@ -1277,13 +1280,13 @@ ${e}${t}` : t;
|
|
|
1277
1280
|
}
|
|
1278
1281
|
getIn([e, ...n], r) {
|
|
1279
1282
|
let s = this.get(e, true);
|
|
1280
|
-
return n.length === 0 ? !r && s instanceof
|
|
1283
|
+
return n.length === 0 ? !r && s instanceof x ? s.value : s : s instanceof t ? s.getIn(n, r) : void 0;
|
|
1281
1284
|
}
|
|
1282
1285
|
hasAllNullValues() {
|
|
1283
1286
|
return this.items.every((e) => {
|
|
1284
1287
|
if (!e || e.type !== "PAIR") return false;
|
|
1285
1288
|
let n = e.value;
|
|
1286
|
-
return n == null || n instanceof
|
|
1289
|
+
return n == null || n instanceof x && n.value == null && !n.commentBefore && !n.comment && !n.tag;
|
|
1287
1290
|
});
|
|
1288
1291
|
}
|
|
1289
1292
|
hasIn([e, ...n]) {
|
|
@@ -1296,7 +1299,7 @@ ${e}${t}` : t;
|
|
|
1296
1299
|
else {
|
|
1297
1300
|
let s = this.get(e, true);
|
|
1298
1301
|
if (s instanceof t) s.setIn(n, r);
|
|
1299
|
-
else if (s === void 0 && this.schema) this.set(e,
|
|
1302
|
+
else if (s === void 0 && this.schema) this.set(e, Gr(this.schema, n, r));
|
|
1300
1303
|
else throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`);
|
|
1301
1304
|
}
|
|
1302
1305
|
}
|
|
@@ -1306,32 +1309,32 @@ ${e}${t}` : t;
|
|
|
1306
1309
|
toString(e, { blockItem: n, flowChars: r, isMap: s, itemIndent: i }, o, a) {
|
|
1307
1310
|
let { indent: c, indentStep: l, stringify: f } = e, m = this.type === p.Type.FLOW_MAP || this.type === p.Type.FLOW_SEQ || e.inFlow;
|
|
1308
1311
|
m && (i += l);
|
|
1309
|
-
let
|
|
1310
|
-
e = Object.assign({}, e, { allNullValues:
|
|
1311
|
-
let y = false, h = false,
|
|
1312
|
+
let g = s && this.hasAllNullValues();
|
|
1313
|
+
e = Object.assign({}, e, { allNullValues: g, indent: i, inFlow: m, type: null });
|
|
1314
|
+
let y = false, h = false, d = this.items.reduce((P, A, C) => {
|
|
1312
1315
|
let L;
|
|
1313
|
-
A && (!y && A.spaceBefore &&
|
|
1314
|
-
|
|
1316
|
+
A && (!y && A.spaceBefore && P.push({ type: "comment", str: "" }), A.commentBefore && A.commentBefore.match(/^.*$/gm).forEach((Mi) => {
|
|
1317
|
+
P.push({ type: "comment", str: `#${Mi}` });
|
|
1315
1318
|
}), A.comment && (L = A.comment), m && (!y && A.spaceBefore || A.commentBefore || A.comment || A.key && (A.key.commentBefore || A.key.comment) || A.value && (A.value.commentBefore || A.value.comment)) && (h = true)), y = false;
|
|
1316
1319
|
let R = f(A, e, () => L = null, () => y = true);
|
|
1317
1320
|
return m && !h && R.includes(`
|
|
1318
|
-
`) && (h = true), m && C < this.items.length - 1 && (R += ","), R =
|
|
1321
|
+
`) && (h = true), m && C < this.items.length - 1 && (R += ","), R = Re(R, i, L), y && (L || m) && (y = false), P.push({ type: "item", str: R }), P;
|
|
1319
1322
|
}, []), w;
|
|
1320
|
-
if (
|
|
1323
|
+
if (d.length === 0) w = r.start + r.end;
|
|
1321
1324
|
else if (m) {
|
|
1322
|
-
let { start:
|
|
1325
|
+
let { start: P, end: A } = r, C = d.map((L) => L.str);
|
|
1323
1326
|
if (h || C.reduce((L, R) => L + R.length + 2, 2) > t.maxFlowStringSingleLineLength) {
|
|
1324
|
-
w =
|
|
1327
|
+
w = P;
|
|
1325
1328
|
for (let L of C) w += L ? `
|
|
1326
1329
|
${l}${c}${L}` : `
|
|
1327
1330
|
`;
|
|
1328
1331
|
w += `
|
|
1329
1332
|
${c}${A}`;
|
|
1330
|
-
} else w = `${
|
|
1333
|
+
} else w = `${P} ${C.join(" ")} ${A}`;
|
|
1331
1334
|
} else {
|
|
1332
|
-
let
|
|
1333
|
-
w =
|
|
1334
|
-
for (let A of
|
|
1335
|
+
let P = d.map(n);
|
|
1336
|
+
w = P.shift();
|
|
1337
|
+
for (let A of P) w += A ? `
|
|
1335
1338
|
${c}${A}` : `
|
|
1336
1339
|
`;
|
|
1337
1340
|
}
|
|
@@ -1339,31 +1342,31 @@ ${c}${A}` : `
|
|
|
1339
1342
|
` + this.comment.replace(/^/gm, `${c}#`), o && o()) : y && a && a(), w;
|
|
1340
1343
|
}
|
|
1341
1344
|
};
|
|
1342
|
-
p._defineProperty(
|
|
1343
|
-
function
|
|
1344
|
-
let e = t instanceof
|
|
1345
|
+
p._defineProperty(Q, "maxFlowStringSingleLineLength", 60);
|
|
1346
|
+
function _t(t) {
|
|
1347
|
+
let e = t instanceof x ? t.value : t;
|
|
1345
1348
|
return e && typeof e == "string" && (e = Number(e)), Number.isInteger(e) && e >= 0 ? e : null;
|
|
1346
1349
|
}
|
|
1347
|
-
var
|
|
1350
|
+
var ue = class extends Q {
|
|
1348
1351
|
add(e) {
|
|
1349
1352
|
this.items.push(e);
|
|
1350
1353
|
}
|
|
1351
1354
|
delete(e) {
|
|
1352
|
-
let n =
|
|
1355
|
+
let n = _t(e);
|
|
1353
1356
|
return typeof n != "number" ? false : this.items.splice(n, 1).length > 0;
|
|
1354
1357
|
}
|
|
1355
1358
|
get(e, n) {
|
|
1356
|
-
let r =
|
|
1359
|
+
let r = _t(e);
|
|
1357
1360
|
if (typeof r != "number") return;
|
|
1358
1361
|
let s = this.items[r];
|
|
1359
|
-
return !n && s instanceof
|
|
1362
|
+
return !n && s instanceof x ? s.value : s;
|
|
1360
1363
|
}
|
|
1361
1364
|
has(e) {
|
|
1362
|
-
let n =
|
|
1365
|
+
let n = _t(e);
|
|
1363
1366
|
return typeof n == "number" && n < this.items.length;
|
|
1364
1367
|
}
|
|
1365
1368
|
set(e, n) {
|
|
1366
|
-
let r =
|
|
1369
|
+
let r = _t(e);
|
|
1367
1370
|
if (typeof r != "number") throw new Error(`Expected a valid index, not ${e}.`);
|
|
1368
1371
|
this.items[r] = n;
|
|
1369
1372
|
}
|
|
@@ -1371,13 +1374,13 @@ ${c}${A}` : `
|
|
|
1371
1374
|
let r = [];
|
|
1372
1375
|
n && n.onCreate && n.onCreate(r);
|
|
1373
1376
|
let s = 0;
|
|
1374
|
-
for (let i of this.items) r.push(
|
|
1377
|
+
for (let i of this.items) r.push(fe(i, String(s++), n));
|
|
1375
1378
|
return r;
|
|
1376
1379
|
}
|
|
1377
1380
|
toString(e, n, r) {
|
|
1378
1381
|
return e ? super.toString(e, { blockItem: (s) => s.type === "comment" ? s.str : `- ${s.str}`, flowChars: { start: "[", end: "]" }, isMap: false, itemIndent: (e.indent || "") + " " }, n, r) : JSON.stringify(this);
|
|
1379
1382
|
}
|
|
1380
|
-
},
|
|
1383
|
+
}, No = (t, e, n) => e === null ? "" : typeof e != "object" ? String(e) : t instanceof j && n && n.doc ? t.toString({ anchors: /* @__PURE__ */ Object.create(null), doc: n.doc, indent: "", indentStep: n.indentStep, inFlow: true, inStringifyKey: true, stringify: n.stringify }) : JSON.stringify(e), T = class t extends j {
|
|
1381
1384
|
constructor(e, n = null) {
|
|
1382
1385
|
super(), this.key = e, this.value = n, this.type = t.Type.PAIR;
|
|
1383
1386
|
}
|
|
@@ -1385,20 +1388,20 @@ ${c}${A}` : `
|
|
|
1385
1388
|
return this.key instanceof j ? this.key.commentBefore : void 0;
|
|
1386
1389
|
}
|
|
1387
1390
|
set commentBefore(e) {
|
|
1388
|
-
if (this.key == null && (this.key = new
|
|
1391
|
+
if (this.key == null && (this.key = new x(null)), this.key instanceof j) this.key.commentBefore = e;
|
|
1389
1392
|
else {
|
|
1390
1393
|
let n = "Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";
|
|
1391
1394
|
throw new Error(n);
|
|
1392
1395
|
}
|
|
1393
1396
|
}
|
|
1394
1397
|
addToJSMap(e, n) {
|
|
1395
|
-
let r =
|
|
1398
|
+
let r = fe(this.key, "", e);
|
|
1396
1399
|
if (n instanceof Map) {
|
|
1397
|
-
let s =
|
|
1400
|
+
let s = fe(this.value, r, e);
|
|
1398
1401
|
n.set(r, s);
|
|
1399
1402
|
} else if (n instanceof Set) n.add(r);
|
|
1400
1403
|
else {
|
|
1401
|
-
let s =
|
|
1404
|
+
let s = No(this.key, r, e), i = fe(this.value, s, e);
|
|
1402
1405
|
s in n ? Object.defineProperty(n, s, { value: i, writable: true, enumerable: true, configurable: true }) : n[s] = i;
|
|
1403
1406
|
}
|
|
1404
1407
|
return n;
|
|
@@ -1412,58 +1415,58 @@ ${c}${A}` : `
|
|
|
1412
1415
|
let { indent: s, indentSeq: i, simpleKeys: o } = e.doc.options, { key: a, value: c } = this, l = a instanceof j && a.comment;
|
|
1413
1416
|
if (o) {
|
|
1414
1417
|
if (l) throw new Error("With simple keys, key nodes cannot have comments");
|
|
1415
|
-
if (a instanceof
|
|
1418
|
+
if (a instanceof Q) {
|
|
1416
1419
|
let R = "With simple keys, collection cannot be used as a key value";
|
|
1417
1420
|
throw new Error(R);
|
|
1418
1421
|
}
|
|
1419
1422
|
}
|
|
1420
|
-
let f = !o && (!a || l || (a instanceof j ? a instanceof
|
|
1421
|
-
e = Object.assign({}, e, { implicitKey: !f, indent:
|
|
1422
|
-
let
|
|
1423
|
-
if (w =
|
|
1423
|
+
let f = !o && (!a || l || (a instanceof j ? a instanceof Q || a.type === p.Type.BLOCK_FOLDED || a.type === p.Type.BLOCK_LITERAL : typeof a == "object")), { doc: m, indent: g, indentStep: y, stringify: h } = e;
|
|
1424
|
+
e = Object.assign({}, e, { implicitKey: !f, indent: g + y });
|
|
1425
|
+
let d = false, w = h(a, e, () => l = null, () => d = true);
|
|
1426
|
+
if (w = Re(w, e.indent, l), !f && w.length > 1024) {
|
|
1424
1427
|
if (o) throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
|
|
1425
1428
|
f = true;
|
|
1426
1429
|
}
|
|
1427
|
-
if (e.allNullValues && !o) return this.comment ? (w =
|
|
1430
|
+
if (e.allNullValues && !o) return this.comment ? (w = Re(w, e.indent, this.comment), n && n()) : d && !l && r && r(), e.inFlow && !f ? w : `? ${w}`;
|
|
1428
1431
|
w = f ? `? ${w}
|
|
1429
|
-
${
|
|
1430
|
-
let
|
|
1432
|
+
${g}:` : `${w}:`, this.comment && (w = Re(w, e.indent, this.comment), n && n());
|
|
1433
|
+
let P = "", A = null;
|
|
1431
1434
|
if (c instanceof j) {
|
|
1432
|
-
if (c.spaceBefore && (
|
|
1435
|
+
if (c.spaceBefore && (P = `
|
|
1433
1436
|
`), c.commentBefore) {
|
|
1434
1437
|
let R = c.commentBefore.replace(/^/gm, `${e.indent}#`);
|
|
1435
|
-
|
|
1438
|
+
P += `
|
|
1436
1439
|
${R}`;
|
|
1437
1440
|
}
|
|
1438
1441
|
A = c.comment;
|
|
1439
1442
|
} else c && typeof c == "object" && (c = m.schema.createNode(c, true));
|
|
1440
|
-
e.implicitKey = false, !f && !this.comment && c instanceof
|
|
1441
|
-
let C = h(c, e, () => A = null, () =>
|
|
1442
|
-
return
|
|
1443
|
-
${e.indent}` : !f && c instanceof
|
|
1443
|
+
e.implicitKey = false, !f && !this.comment && c instanceof x && (e.indentAtStart = w.length + 1), d = false, !i && s >= 2 && !e.inFlow && !f && c instanceof ue && c.type !== p.Type.FLOW_SEQ && !c.tag && !m.anchors.getName(c) && (e.indent = e.indent.substr(2));
|
|
1444
|
+
let C = h(c, e, () => A = null, () => d = true), L = " ";
|
|
1445
|
+
return P || this.comment ? L = `${P}
|
|
1446
|
+
${e.indent}` : !f && c instanceof Q ? (!(C[0] === "[" || C[0] === "{") || C.includes(`
|
|
1444
1447
|
`)) && (L = `
|
|
1445
1448
|
${e.indent}`) : C[0] === `
|
|
1446
|
-
` && (L = ""),
|
|
1449
|
+
` && (L = ""), d && !A && r && r(), Re(w + L + C, e.indent, A);
|
|
1447
1450
|
}
|
|
1448
1451
|
};
|
|
1449
1452
|
p._defineProperty(T, "Type", { PAIR: "PAIR", MERGE_PAIR: "MERGE_PAIR" });
|
|
1450
|
-
var
|
|
1451
|
-
if (t instanceof
|
|
1453
|
+
var xt = (t, e) => {
|
|
1454
|
+
if (t instanceof we) {
|
|
1452
1455
|
let n = e.get(t.source);
|
|
1453
1456
|
return n.count * n.aliasCount;
|
|
1454
|
-
} else if (t instanceof
|
|
1457
|
+
} else if (t instanceof Q) {
|
|
1455
1458
|
let n = 0;
|
|
1456
1459
|
for (let r of t.items) {
|
|
1457
|
-
let s =
|
|
1460
|
+
let s = xt(r, e);
|
|
1458
1461
|
s > n && (n = s);
|
|
1459
1462
|
}
|
|
1460
1463
|
return n;
|
|
1461
1464
|
} else if (t instanceof T) {
|
|
1462
|
-
let n =
|
|
1465
|
+
let n = xt(t.key, e), r = xt(t.value, e);
|
|
1463
1466
|
return Math.max(n, r);
|
|
1464
1467
|
}
|
|
1465
1468
|
return 1;
|
|
1466
|
-
},
|
|
1469
|
+
}, we = class t extends j {
|
|
1467
1470
|
static stringify({ range: e, source: n }, { anchors: r, doc: s, implicitKey: i, inStringifyKey: o }) {
|
|
1468
1471
|
let a = Object.keys(r).find((l) => r[l] === n);
|
|
1469
1472
|
if (!a && o && (a = s.anchors.getName(n) || s.anchors.newName()), a) return `*${a}${i ? " " : ""}`;
|
|
@@ -1477,13 +1480,13 @@ ${e.indent}`) : C[0] === `
|
|
|
1477
1480
|
throw new Error("Alias nodes cannot have tags");
|
|
1478
1481
|
}
|
|
1479
1482
|
toJSON(e, n) {
|
|
1480
|
-
if (!n) return
|
|
1483
|
+
if (!n) return fe(this.source, e, n);
|
|
1481
1484
|
let { anchors: r, maxAliasCount: s } = n, i = r.get(this.source);
|
|
1482
1485
|
if (!i || i.res === void 0) {
|
|
1483
1486
|
let o = "This should not happen: Alias anchor was not resolved?";
|
|
1484
1487
|
throw this.cstNode ? new p.YAMLReferenceError(this.cstNode, o) : new ReferenceError(o);
|
|
1485
1488
|
}
|
|
1486
|
-
if (s >= 0 && (i.count += 1, i.aliasCount === 0 && (i.aliasCount =
|
|
1489
|
+
if (s >= 0 && (i.count += 1, i.aliasCount === 0 && (i.aliasCount = xt(this.source, r)), i.count * i.aliasCount > s)) {
|
|
1487
1490
|
let o = "Excessive alias count indicates a resource exhaustion attack";
|
|
1488
1491
|
throw this.cstNode ? new p.YAMLReferenceError(this.cstNode, o) : new ReferenceError(o);
|
|
1489
1492
|
}
|
|
@@ -1493,15 +1496,15 @@ ${e.indent}`) : C[0] === `
|
|
|
1493
1496
|
return t.stringify(this, e);
|
|
1494
1497
|
}
|
|
1495
1498
|
};
|
|
1496
|
-
p._defineProperty(
|
|
1497
|
-
function
|
|
1498
|
-
let n = e instanceof
|
|
1499
|
+
p._defineProperty(we, "default", true);
|
|
1500
|
+
function at(t, e) {
|
|
1501
|
+
let n = e instanceof x ? e.value : e;
|
|
1499
1502
|
for (let r of t) if (r instanceof T && (r.key === e || r.key === n || r.key && r.key.value === n)) return r;
|
|
1500
1503
|
}
|
|
1501
|
-
var
|
|
1504
|
+
var ct = class extends Q {
|
|
1502
1505
|
add(e, n) {
|
|
1503
1506
|
e ? e instanceof T || (e = new T(e.key || e, e.value)) : e = new T(e);
|
|
1504
|
-
let r =
|
|
1507
|
+
let r = at(this.items, e.key), s = this.schema && this.schema.sortMapEntries;
|
|
1505
1508
|
if (r) if (n) r.value = e.value;
|
|
1506
1509
|
else throw new Error(`Key ${e.key} already set`);
|
|
1507
1510
|
else if (s) {
|
|
@@ -1510,15 +1513,15 @@ ${e.indent}`) : C[0] === `
|
|
|
1510
1513
|
} else this.items.push(e);
|
|
1511
1514
|
}
|
|
1512
1515
|
delete(e) {
|
|
1513
|
-
let n =
|
|
1516
|
+
let n = at(this.items, e);
|
|
1514
1517
|
return n ? this.items.splice(this.items.indexOf(n), 1).length > 0 : false;
|
|
1515
1518
|
}
|
|
1516
1519
|
get(e, n) {
|
|
1517
|
-
let r =
|
|
1518
|
-
return !n && s instanceof
|
|
1520
|
+
let r = at(this.items, e), s = r && r.value;
|
|
1521
|
+
return !n && s instanceof x ? s.value : s;
|
|
1519
1522
|
}
|
|
1520
1523
|
has(e) {
|
|
1521
|
-
return !!
|
|
1524
|
+
return !!at(this.items, e);
|
|
1522
1525
|
}
|
|
1523
1526
|
set(e, n) {
|
|
1524
1527
|
this.add(new T(e, n), true);
|
|
@@ -1534,17 +1537,17 @@ ${e.indent}`) : C[0] === `
|
|
|
1534
1537
|
for (let s of this.items) if (!(s instanceof T)) throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);
|
|
1535
1538
|
return super.toString(e, { blockItem: (s) => s.str, flowChars: { start: "{", end: "}" }, isMap: true, itemIndent: e.indent || "" }, n, r);
|
|
1536
1539
|
}
|
|
1537
|
-
},
|
|
1540
|
+
}, zr = "<<", $t = class extends T {
|
|
1538
1541
|
constructor(e) {
|
|
1539
1542
|
if (e instanceof T) {
|
|
1540
1543
|
let n = e.value;
|
|
1541
|
-
n instanceof
|
|
1542
|
-
} else super(new
|
|
1544
|
+
n instanceof ue || (n = new ue(), n.items.push(e.value), n.range = e.value.range), super(e.key, n), this.range = e.range;
|
|
1545
|
+
} else super(new x(zr), new ue());
|
|
1543
1546
|
this.type = T.Type.MERGE_PAIR;
|
|
1544
1547
|
}
|
|
1545
1548
|
addToJSMap(e, n) {
|
|
1546
1549
|
for (let { source: r } of this.value.items) {
|
|
1547
|
-
if (!(r instanceof
|
|
1550
|
+
if (!(r instanceof ct)) throw new Error("Merge sources must be maps");
|
|
1548
1551
|
let s = r.toJSON(null, e, Map);
|
|
1549
1552
|
for (let [i, o] of s) n instanceof Map ? n.has(i) || n.set(i, o) : n instanceof Set ? n.add(i) : Object.prototype.hasOwnProperty.call(n, i) || Object.defineProperty(n, i, { value: o, writable: true, enumerable: true, configurable: true });
|
|
1550
1553
|
}
|
|
@@ -1557,18 +1560,18 @@ ${e.indent}`) : C[0] === `
|
|
|
1557
1560
|
let s = super.toString(e, n);
|
|
1558
1561
|
return this.value = r, s;
|
|
1559
1562
|
}
|
|
1560
|
-
},
|
|
1561
|
-
function
|
|
1563
|
+
}, Oo = { defaultType: p.Type.BLOCK_LITERAL, lineWidth: 76 }, Ao = { trueStr: "true", falseStr: "false" }, Lo = { asBigInt: false }, To = { nullStr: "null" }, be = { defaultType: p.Type.PLAIN, doubleQuoted: { jsonEncoding: false, minMultiLineLength: 40 }, fold: { lineWidth: 80, minContentWidth: 20 } };
|
|
1564
|
+
function Rn(t, e, n) {
|
|
1562
1565
|
for (let { format: r, test: s, resolve: i } of e) if (s) {
|
|
1563
1566
|
let o = t.match(s);
|
|
1564
1567
|
if (o) {
|
|
1565
1568
|
let a = i.apply(null, o);
|
|
1566
|
-
return a instanceof
|
|
1569
|
+
return a instanceof x || (a = new x(a)), r && (a.format = r), a;
|
|
1567
1570
|
}
|
|
1568
1571
|
}
|
|
1569
|
-
return n && (t = n(t)), new
|
|
1572
|
+
return n && (t = n(t)), new x(t);
|
|
1570
1573
|
}
|
|
1571
|
-
var
|
|
1574
|
+
var Zr = "flow", xn = "block", Rt = "quoted", Hr = (t, e) => {
|
|
1572
1575
|
let n = t[e + 1];
|
|
1573
1576
|
for (; n === " " || n === " "; ) {
|
|
1574
1577
|
do
|
|
@@ -1579,46 +1582,46 @@ ${e.indent}`) : C[0] === `
|
|
|
1579
1582
|
}
|
|
1580
1583
|
return e;
|
|
1581
1584
|
};
|
|
1582
|
-
function
|
|
1585
|
+
function Yt(t, e, n, { indentAtStart: r, lineWidth: s = 80, minContentWidth: i = 20, onFold: o, onOverflow: a }) {
|
|
1583
1586
|
if (!s || s < 0) return t;
|
|
1584
1587
|
let c = Math.max(1 + i, 1 + s - e.length);
|
|
1585
1588
|
if (t.length <= c) return t;
|
|
1586
1589
|
let l = [], f = {}, m = s - e.length;
|
|
1587
1590
|
typeof r == "number" && (r > s - Math.max(2, i) ? l.push(0) : m = s - r);
|
|
1588
|
-
let
|
|
1589
|
-
n ===
|
|
1590
|
-
for (let C; C = t[
|
|
1591
|
-
if (n ===
|
|
1592
|
-
switch (w =
|
|
1591
|
+
let g, y, h = false, d = -1, w = -1, P = -1;
|
|
1592
|
+
n === xn && (d = Hr(t, d), d !== -1 && (m = d + c));
|
|
1593
|
+
for (let C; C = t[d += 1]; ) {
|
|
1594
|
+
if (n === Rt && C === "\\") {
|
|
1595
|
+
switch (w = d, t[d + 1]) {
|
|
1593
1596
|
case "x":
|
|
1594
|
-
|
|
1597
|
+
d += 3;
|
|
1595
1598
|
break;
|
|
1596
1599
|
case "u":
|
|
1597
|
-
|
|
1600
|
+
d += 5;
|
|
1598
1601
|
break;
|
|
1599
1602
|
case "U":
|
|
1600
|
-
|
|
1603
|
+
d += 9;
|
|
1601
1604
|
break;
|
|
1602
1605
|
default:
|
|
1603
|
-
|
|
1606
|
+
d += 1;
|
|
1604
1607
|
}
|
|
1605
|
-
|
|
1608
|
+
P = d;
|
|
1606
1609
|
}
|
|
1607
1610
|
if (C === `
|
|
1608
|
-
`) n ===
|
|
1611
|
+
`) n === xn && (d = Hr(t, d)), m = d + c, g = void 0;
|
|
1609
1612
|
else {
|
|
1610
1613
|
if (C === " " && y && y !== " " && y !== `
|
|
1611
1614
|
` && y !== " ") {
|
|
1612
|
-
let L = t[
|
|
1615
|
+
let L = t[d + 1];
|
|
1613
1616
|
L && L !== " " && L !== `
|
|
1614
|
-
` && L !== " " && (
|
|
1617
|
+
` && L !== " " && (g = d);
|
|
1615
1618
|
}
|
|
1616
|
-
if (
|
|
1617
|
-
else if (n ===
|
|
1618
|
-
for (; y === " " || y === " "; ) y = C, C = t[
|
|
1619
|
-
let L =
|
|
1619
|
+
if (d >= m) if (g) l.push(g), m = g + c, g = void 0;
|
|
1620
|
+
else if (n === Rt) {
|
|
1621
|
+
for (; y === " " || y === " "; ) y = C, C = t[d += 1], h = true;
|
|
1622
|
+
let L = d > P + 1 ? d - 2 : w - 1;
|
|
1620
1623
|
if (f[L]) return t;
|
|
1621
|
-
l.push(L), f[L] = true, m = L + c,
|
|
1624
|
+
l.push(L), f[L] = true, m = L + c, g = void 0;
|
|
1622
1625
|
} else h = true;
|
|
1623
1626
|
}
|
|
1624
1627
|
y = C;
|
|
@@ -1629,13 +1632,13 @@ ${e.indent}`) : C[0] === `
|
|
|
1629
1632
|
for (let C = 0; C < l.length; ++C) {
|
|
1630
1633
|
let L = l[C], R = l[C + 1] || t.length;
|
|
1631
1634
|
L === 0 ? A = `
|
|
1632
|
-
${e}${t.slice(0, R)}` : (n ===
|
|
1635
|
+
${e}${t.slice(0, R)}` : (n === Rt && f[L] && (A += `${t[L]}\\`), A += `
|
|
1633
1636
|
${e}${t.slice(L + 1, R)}`);
|
|
1634
1637
|
}
|
|
1635
1638
|
return A;
|
|
1636
1639
|
}
|
|
1637
|
-
var
|
|
1638
|
-
function
|
|
1640
|
+
var Dn = ({ indentAtStart: t }) => t ? Object.assign({ indentAtStart: t }, be.fold) : be.fold, Bt = (t) => /^(%|---|\.\.\.)/m.test(t);
|
|
1641
|
+
function Co(t, e, n) {
|
|
1639
1642
|
if (!e || e < 0) return false;
|
|
1640
1643
|
let r = e - n, s = t.length;
|
|
1641
1644
|
if (s <= r) return false;
|
|
@@ -1646,10 +1649,10 @@ ${e}${t.slice(L + 1, R)}`);
|
|
|
1646
1649
|
}
|
|
1647
1650
|
return true;
|
|
1648
1651
|
}
|
|
1649
|
-
function
|
|
1650
|
-
let { implicitKey: n } = e, { jsonEncoding: r, minMultiLineLength: s } =
|
|
1652
|
+
function Se(t, e) {
|
|
1653
|
+
let { implicitKey: n } = e, { jsonEncoding: r, minMultiLineLength: s } = be.doubleQuoted, i = JSON.stringify(t);
|
|
1651
1654
|
if (r) return i;
|
|
1652
|
-
let o = e.indent || (
|
|
1655
|
+
let o = e.indent || (Bt(t) ? " " : ""), a = "", c = 0;
|
|
1653
1656
|
for (let l = 0, f = i[l]; f; f = i[++l]) if (f === " " && i[l + 1] === "\\" && i[l + 2] === "n" && (a += i.slice(c, l) + "\\ ", l += 1, c = l, f = "\\"), f === "\\") switch (i[l + 1]) {
|
|
1654
1657
|
case "u":
|
|
1655
1658
|
{
|
|
@@ -1699,19 +1702,19 @@ ${e}${t.slice(L + 1, R)}`);
|
|
|
1699
1702
|
default:
|
|
1700
1703
|
l += 1;
|
|
1701
1704
|
}
|
|
1702
|
-
return a = c ? a + i.slice(c) : i, n ? a :
|
|
1705
|
+
return a = c ? a + i.slice(c) : i, n ? a : Yt(a, o, Rt, Dn(e));
|
|
1703
1706
|
}
|
|
1704
|
-
function
|
|
1707
|
+
function es(t, e) {
|
|
1705
1708
|
if (e.implicitKey) {
|
|
1706
|
-
if (/\n/.test(t)) return
|
|
1707
|
-
} else if (/[ \t]\n|\n[ \t]/.test(t)) return
|
|
1708
|
-
let n = e.indent || (
|
|
1709
|
+
if (/\n/.test(t)) return Se(t, e);
|
|
1710
|
+
} else if (/[ \t]\n|\n[ \t]/.test(t)) return Se(t, e);
|
|
1711
|
+
let n = e.indent || (Bt(t) ? " " : ""), r = "'" + t.replace(/'/g, "''").replace(/\n+/g, `$&
|
|
1709
1712
|
${n}`) + "'";
|
|
1710
|
-
return e.implicitKey ? r :
|
|
1713
|
+
return e.implicitKey ? r : Yt(r, n, Zr, Dn(e));
|
|
1711
1714
|
}
|
|
1712
|
-
function
|
|
1713
|
-
if (/\n[\t ]+$/.test(n) || /^\s*$/.test(n)) return
|
|
1714
|
-
let o = r.indent || (r.forceBlockIndent ||
|
|
1715
|
+
function Dt({ comment: t, type: e, value: n }, r, s, i) {
|
|
1716
|
+
if (/\n[\t ]+$/.test(n) || /^\s*$/.test(n)) return Se(n, r);
|
|
1717
|
+
let o = r.indent || (r.forceBlockIndent || Bt(n) ? " " : ""), a = o ? "2" : "1", c = e === p.Type.BLOCK_FOLDED ? false : e === p.Type.BLOCK_LITERAL ? true : !Co(n, be.fold.lineWidth, o.length), l = c ? "|" : ">";
|
|
1715
1718
|
if (!n) return l + `
|
|
1716
1719
|
`;
|
|
1717
1720
|
let f = "", m = "";
|
|
@@ -1729,43 +1732,43 @@ ${o}${m}`;
|
|
|
1729
1732
|
${o}${f}${n}${m}`;
|
|
1730
1733
|
n = n.replace(/\n+/g, `
|
|
1731
1734
|
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${o}`);
|
|
1732
|
-
let
|
|
1735
|
+
let g = Yt(`${f}${n}${m}`, o, xn, be.fold);
|
|
1733
1736
|
return `${l}
|
|
1734
|
-
${o}${
|
|
1737
|
+
${o}${g}`;
|
|
1735
1738
|
}
|
|
1736
|
-
function
|
|
1739
|
+
function Mo(t, e, n, r) {
|
|
1737
1740
|
let { comment: s, type: i, value: o } = t, { actualString: a, implicitKey: c, indent: l, inFlow: f } = e;
|
|
1738
|
-
if (c && /[\n[\]{},]/.test(o) || f && /[[\]{},]/.test(o)) return
|
|
1741
|
+
if (c && /[\n[\]{},]/.test(o) || f && /[[\]{},]/.test(o)) return Se(o, e);
|
|
1739
1742
|
if (!o || /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o)) return c || f || o.indexOf(`
|
|
1740
|
-
`) === -1 ? o.indexOf('"') !== -1 && o.indexOf("'") === -1 ?
|
|
1743
|
+
`) === -1 ? o.indexOf('"') !== -1 && o.indexOf("'") === -1 ? es(o, e) : Se(o, e) : Dt(t, e, n, r);
|
|
1741
1744
|
if (!c && !f && i !== p.Type.PLAIN && o.indexOf(`
|
|
1742
|
-
`) !== -1) return
|
|
1743
|
-
if (l === "" &&
|
|
1745
|
+
`) !== -1) return Dt(t, e, n, r);
|
|
1746
|
+
if (l === "" && Bt(o)) return e.forceBlockIndent = true, Dt(t, e, n, r);
|
|
1744
1747
|
let m = o.replace(/\n+/g, `$&
|
|
1745
1748
|
${l}`);
|
|
1746
1749
|
if (a) {
|
|
1747
1750
|
let { tags: y } = e.doc.schema;
|
|
1748
|
-
if (typeof
|
|
1751
|
+
if (typeof Rn(m, y, y.scalarFallback).value != "string") return Se(o, e);
|
|
1749
1752
|
}
|
|
1750
|
-
let
|
|
1751
|
-
return s && !f && (
|
|
1753
|
+
let g = c ? m : Yt(m, l, Zr, Dn(e));
|
|
1754
|
+
return s && !f && (g.indexOf(`
|
|
1752
1755
|
`) !== -1 || s.indexOf(`
|
|
1753
|
-
`) !== -1) ? (n && n(),
|
|
1756
|
+
`) !== -1) ? (n && n(), bo(g, l, s)) : g;
|
|
1754
1757
|
}
|
|
1755
|
-
function
|
|
1756
|
-
let { defaultType: s } =
|
|
1758
|
+
function ko(t, e, n, r) {
|
|
1759
|
+
let { defaultType: s } = be, { implicitKey: i, inFlow: o } = e, { type: a, value: c } = t;
|
|
1757
1760
|
typeof c != "string" && (c = String(c), t = Object.assign({}, t, { value: c }));
|
|
1758
1761
|
let l = (m) => {
|
|
1759
1762
|
switch (m) {
|
|
1760
1763
|
case p.Type.BLOCK_FOLDED:
|
|
1761
1764
|
case p.Type.BLOCK_LITERAL:
|
|
1762
|
-
return
|
|
1765
|
+
return Dt(t, e, n, r);
|
|
1763
1766
|
case p.Type.QUOTE_DOUBLE:
|
|
1764
|
-
return
|
|
1767
|
+
return Se(c, e);
|
|
1765
1768
|
case p.Type.QUOTE_SINGLE:
|
|
1766
|
-
return
|
|
1769
|
+
return es(c, e);
|
|
1767
1770
|
case p.Type.PLAIN:
|
|
1768
|
-
return
|
|
1771
|
+
return Mo(t, e, n, r);
|
|
1769
1772
|
default:
|
|
1770
1773
|
return null;
|
|
1771
1774
|
}
|
|
@@ -1775,7 +1778,7 @@ ${l}`);
|
|
|
1775
1778
|
if (f === null && (f = l(s), f === null)) throw new Error(`Unsupported default string type ${s}`);
|
|
1776
1779
|
return f;
|
|
1777
1780
|
}
|
|
1778
|
-
function
|
|
1781
|
+
function Po({ format: t, minFractionDigits: e, tag: n, value: r }) {
|
|
1779
1782
|
if (typeof r == "bigint") return String(r);
|
|
1780
1783
|
if (!isFinite(r)) return isNaN(r) ? ".nan" : r < 0 ? "-.inf" : ".inf";
|
|
1781
1784
|
let s = JSON.stringify(r);
|
|
@@ -1787,7 +1790,7 @@ ${l}`);
|
|
|
1787
1790
|
}
|
|
1788
1791
|
return s;
|
|
1789
1792
|
}
|
|
1790
|
-
function
|
|
1793
|
+
function ts(t, e) {
|
|
1791
1794
|
let n, r;
|
|
1792
1795
|
switch (e.type) {
|
|
1793
1796
|
case p.Type.FLOW_MAP:
|
|
@@ -1813,7 +1816,7 @@ ${l}`);
|
|
|
1813
1816
|
typeof s.offset == "number" ? (o = new p.YAMLSemanticError(e, i), o.offset = s.offset + 1) : (o = new p.YAMLSemanticError(s, i), s.range && s.range.end && (o.offset = s.range.end - s.range.start)), t.push(o);
|
|
1814
1817
|
}
|
|
1815
1818
|
}
|
|
1816
|
-
function
|
|
1819
|
+
function ns(t, e) {
|
|
1817
1820
|
let n = e.context.src[e.range.start - 1];
|
|
1818
1821
|
if (n !== `
|
|
1819
1822
|
` && n !== " " && n !== " ") {
|
|
@@ -1821,11 +1824,11 @@ ${l}`);
|
|
|
1821
1824
|
t.push(new p.YAMLSemanticError(e, r));
|
|
1822
1825
|
}
|
|
1823
1826
|
}
|
|
1824
|
-
function
|
|
1827
|
+
function rs(t, e) {
|
|
1825
1828
|
let n = String(e), r = n.substr(0, 8) + "..." + n.substr(-8);
|
|
1826
1829
|
return new p.YAMLSemanticError(t, `The "${r}" key is too long`);
|
|
1827
1830
|
}
|
|
1828
|
-
function
|
|
1831
|
+
function ss(t, e) {
|
|
1829
1832
|
for (let { afterKey: n, before: r, comment: s } of e) {
|
|
1830
1833
|
let i = t.items[r];
|
|
1831
1834
|
i ? (n && i.value && (i = i.value), s === void 0 ? (n || !i.commentBefore) && (i.spaceBefore = true) : i.commentBefore ? i.commentBefore += `
|
|
@@ -1833,13 +1836,13 @@ ${l}`);
|
|
|
1833
1836
|
` + s : t.comment = s);
|
|
1834
1837
|
}
|
|
1835
1838
|
}
|
|
1836
|
-
function
|
|
1839
|
+
function $n(t, e) {
|
|
1837
1840
|
let n = e.strValue;
|
|
1838
1841
|
return n ? typeof n == "string" ? n : (n.errors.forEach((r) => {
|
|
1839
1842
|
r.source || (r.source = e), t.errors.push(r);
|
|
1840
1843
|
}), n.str) : "";
|
|
1841
1844
|
}
|
|
1842
|
-
function
|
|
1845
|
+
function vo(t, e) {
|
|
1843
1846
|
let { handle: n, suffix: r } = e.tag, s = t.tagPrefixes.find((i) => i.handle === n);
|
|
1844
1847
|
if (!s) {
|
|
1845
1848
|
let i = t.getDefaults().tagPrefixes;
|
|
@@ -1855,7 +1858,7 @@ ${l}`);
|
|
|
1855
1858
|
}
|
|
1856
1859
|
return s.prefix + decodeURIComponent(r);
|
|
1857
1860
|
}
|
|
1858
|
-
function
|
|
1861
|
+
function Io(t, e) {
|
|
1859
1862
|
let { tag: n, type: r } = e, s = false;
|
|
1860
1863
|
if (n) {
|
|
1861
1864
|
let { handle: i, suffix: o, verbatim: a } = n;
|
|
@@ -1865,7 +1868,7 @@ ${l}`);
|
|
|
1865
1868
|
t.errors.push(new p.YAMLSemanticError(e, c));
|
|
1866
1869
|
} else if (i === "!" && !o) s = true;
|
|
1867
1870
|
else try {
|
|
1868
|
-
return
|
|
1871
|
+
return vo(t, e);
|
|
1869
1872
|
} catch (c) {
|
|
1870
1873
|
t.errors.push(c);
|
|
1871
1874
|
}
|
|
@@ -1888,17 +1891,17 @@ ${l}`);
|
|
|
1888
1891
|
return null;
|
|
1889
1892
|
}
|
|
1890
1893
|
}
|
|
1891
|
-
function
|
|
1894
|
+
function Jr(t, e, n) {
|
|
1892
1895
|
let { tags: r } = t.schema, s = [];
|
|
1893
1896
|
for (let o of r) if (o.tag === n) if (o.test) s.push(o);
|
|
1894
1897
|
else {
|
|
1895
1898
|
let a = o.resolve(t, e);
|
|
1896
|
-
return a instanceof
|
|
1899
|
+
return a instanceof Q ? a : new x(a);
|
|
1897
1900
|
}
|
|
1898
|
-
let i =
|
|
1899
|
-
return typeof i == "string" && s.length > 0 ?
|
|
1901
|
+
let i = $n(t, e);
|
|
1902
|
+
return typeof i == "string" && s.length > 0 ? Rn(i, s, r.scalarFallback) : null;
|
|
1900
1903
|
}
|
|
1901
|
-
function
|
|
1904
|
+
function _o({ type: t }) {
|
|
1902
1905
|
switch (t) {
|
|
1903
1906
|
case p.Type.FLOW_MAP:
|
|
1904
1907
|
case p.Type.MAP:
|
|
@@ -1910,32 +1913,32 @@ ${l}`);
|
|
|
1910
1913
|
return p.defaultTags.STR;
|
|
1911
1914
|
}
|
|
1912
1915
|
}
|
|
1913
|
-
function
|
|
1916
|
+
function xo(t, e, n) {
|
|
1914
1917
|
try {
|
|
1915
|
-
let r =
|
|
1918
|
+
let r = Jr(t, e, n);
|
|
1916
1919
|
if (r) return n && e.tag && (r.tag = n), r;
|
|
1917
1920
|
} catch (r) {
|
|
1918
1921
|
return r.source || (r.source = e), t.errors.push(r), null;
|
|
1919
1922
|
}
|
|
1920
1923
|
try {
|
|
1921
|
-
let r =
|
|
1924
|
+
let r = _o(e);
|
|
1922
1925
|
if (!r) throw new Error(`The tag ${n} is unavailable`);
|
|
1923
1926
|
let s = `The tag ${n} is unavailable, falling back to ${r}`;
|
|
1924
1927
|
t.warnings.push(new p.YAMLWarning(e, s));
|
|
1925
|
-
let i =
|
|
1928
|
+
let i = Jr(t, e, r);
|
|
1926
1929
|
return i.tag = n, i;
|
|
1927
1930
|
} catch (r) {
|
|
1928
1931
|
let s = new p.YAMLReferenceError(e, r.message);
|
|
1929
1932
|
return s.stack = r.stack, t.errors.push(s), null;
|
|
1930
1933
|
}
|
|
1931
1934
|
}
|
|
1932
|
-
var
|
|
1935
|
+
var Ro = (t) => {
|
|
1933
1936
|
if (!t) return false;
|
|
1934
1937
|
let { type: e } = t;
|
|
1935
1938
|
return e === p.Type.MAP_KEY || e === p.Type.MAP_VALUE || e === p.Type.SEQ_ITEM;
|
|
1936
1939
|
};
|
|
1937
|
-
function
|
|
1938
|
-
let n = { before: [], after: [] }, r = false, s = false, i =
|
|
1940
|
+
function Do(t, e) {
|
|
1941
|
+
let n = { before: [], after: [] }, r = false, s = false, i = Ro(e.context.parent) ? e.context.parent.props.concat(e.props) : e.props;
|
|
1939
1942
|
for (let { start: o, end: a } of i) switch (e.context.src[o]) {
|
|
1940
1943
|
case p.Char.COMMENT: {
|
|
1941
1944
|
if (!e.commentHasRequiredWhitespace(o)) {
|
|
@@ -1963,7 +1966,7 @@ ${l}`);
|
|
|
1963
1966
|
}
|
|
1964
1967
|
return { comments: n, hasAnchor: r, hasTag: s };
|
|
1965
1968
|
}
|
|
1966
|
-
function
|
|
1969
|
+
function $o(t, e) {
|
|
1967
1970
|
let { anchors: n, errors: r, schema: s } = t;
|
|
1968
1971
|
if (e.type === p.Type.ALIAS) {
|
|
1969
1972
|
let o = e.rawValue, a = n.getNode(o);
|
|
@@ -1971,26 +1974,26 @@ ${l}`);
|
|
|
1971
1974
|
let l = `Aliased anchor not found: ${o}`;
|
|
1972
1975
|
return r.push(new p.YAMLReferenceError(e, l)), null;
|
|
1973
1976
|
}
|
|
1974
|
-
let c = new
|
|
1977
|
+
let c = new we(a);
|
|
1975
1978
|
return n._cstAliases.push(c), c;
|
|
1976
1979
|
}
|
|
1977
|
-
let i =
|
|
1978
|
-
if (i) return
|
|
1980
|
+
let i = Io(t, e);
|
|
1981
|
+
if (i) return xo(t, e, i);
|
|
1979
1982
|
if (e.type !== p.Type.PLAIN) {
|
|
1980
1983
|
let o = `Failed to resolve ${e.type} node here`;
|
|
1981
1984
|
return r.push(new p.YAMLSyntaxError(e, o)), null;
|
|
1982
1985
|
}
|
|
1983
1986
|
try {
|
|
1984
|
-
let o =
|
|
1985
|
-
return
|
|
1987
|
+
let o = $n(t, e);
|
|
1988
|
+
return Rn(o, s.tags, s.tags.scalarFallback);
|
|
1986
1989
|
} catch (o) {
|
|
1987
1990
|
return o.source || (o.source = e), r.push(o), null;
|
|
1988
1991
|
}
|
|
1989
1992
|
}
|
|
1990
|
-
function
|
|
1993
|
+
function pe(t, e) {
|
|
1991
1994
|
if (!e) return null;
|
|
1992
1995
|
e.error && t.errors.push(e.error);
|
|
1993
|
-
let { comments: n, hasAnchor: r, hasTag: s } =
|
|
1996
|
+
let { comments: n, hasAnchor: r, hasTag: s } = Do(t.errors, e);
|
|
1994
1997
|
if (r) {
|
|
1995
1998
|
let { anchors: o } = t, a = e.anchor, c = o.getNode(a);
|
|
1996
1999
|
c && (o.map[o.newName(a)] = c), o.map[a] = e;
|
|
@@ -1999,7 +2002,7 @@ ${l}`);
|
|
|
1999
2002
|
let o = "An alias node must not specify any properties";
|
|
2000
2003
|
t.errors.push(new p.YAMLSemanticError(e, o));
|
|
2001
2004
|
}
|
|
2002
|
-
let i =
|
|
2005
|
+
let i = $o(t, e);
|
|
2003
2006
|
if (i) {
|
|
2004
2007
|
i.range = [e.range.start, e.range.end], t.options.keepCstNodes && (i.cstNode = e), t.options.keepNodeTypes && (i.type = e.type);
|
|
2005
2008
|
let o = n.before.join(`
|
|
@@ -2013,21 +2016,21 @@ ${a}` : a);
|
|
|
2013
2016
|
}
|
|
2014
2017
|
return e.resolved = i;
|
|
2015
2018
|
}
|
|
2016
|
-
function
|
|
2019
|
+
function Yo(t, e) {
|
|
2017
2020
|
if (e.type !== p.Type.MAP && e.type !== p.Type.FLOW_MAP) {
|
|
2018
2021
|
let o = `A ${e.type} node cannot be resolved as a mapping`;
|
|
2019
2022
|
return t.errors.push(new p.YAMLSyntaxError(e, o)), null;
|
|
2020
2023
|
}
|
|
2021
|
-
let { comments: n, items: r } = e.type === p.Type.FLOW_MAP ?
|
|
2022
|
-
s.items = r,
|
|
2024
|
+
let { comments: n, items: r } = e.type === p.Type.FLOW_MAP ? Uo(t, e) : qo(t, e), s = new ct();
|
|
2025
|
+
s.items = r, ss(s, n);
|
|
2023
2026
|
let i = false;
|
|
2024
2027
|
for (let o = 0; o < r.length; ++o) {
|
|
2025
2028
|
let { key: a } = r[o];
|
|
2026
|
-
if (a instanceof
|
|
2027
|
-
r[o] = new
|
|
2029
|
+
if (a instanceof Q && (i = true), t.schema.merge && a && a.value === zr) {
|
|
2030
|
+
r[o] = new $t(r[o]);
|
|
2028
2031
|
let c = r[o].value.items, l = null;
|
|
2029
2032
|
c.some((f) => {
|
|
2030
|
-
if (f instanceof
|
|
2033
|
+
if (f instanceof we) {
|
|
2031
2034
|
let { type: m } = f.source;
|
|
2032
2035
|
return m === p.Type.MAP || m === p.Type.FLOW_MAP ? false : l = "Merge nodes aliases can only point to maps";
|
|
2033
2036
|
}
|
|
@@ -2048,7 +2051,7 @@ ${a}` : a);
|
|
|
2048
2051
|
}
|
|
2049
2052
|
return e.resolved = s, s;
|
|
2050
2053
|
}
|
|
2051
|
-
var
|
|
2054
|
+
var Bo = ({ context: { lineStart: t, node: e, src: n }, props: r }) => {
|
|
2052
2055
|
if (r.length === 0) return false;
|
|
2053
2056
|
let { start: s } = r[0];
|
|
2054
2057
|
if (e && s > e.valueRange.start || n[s] !== p.Char.COMMENT) return false;
|
|
@@ -2056,8 +2059,8 @@ ${a}` : a);
|
|
|
2056
2059
|
`) return false;
|
|
2057
2060
|
return true;
|
|
2058
2061
|
};
|
|
2059
|
-
function
|
|
2060
|
-
if (!
|
|
2062
|
+
function Fo(t, e) {
|
|
2063
|
+
if (!Bo(t)) return;
|
|
2061
2064
|
let n = t.getPropValue(0, p.Char.COMMENT, true), r = false, s = e.value.commentBefore;
|
|
2062
2065
|
if (s && s.startsWith(n)) e.value.commentBefore = s.substr(n.length + 1), r = true;
|
|
2063
2066
|
else {
|
|
@@ -2066,7 +2069,7 @@ ${a}` : a);
|
|
|
2066
2069
|
}
|
|
2067
2070
|
r && (e.comment = n);
|
|
2068
2071
|
}
|
|
2069
|
-
function
|
|
2072
|
+
function qo(t, e) {
|
|
2070
2073
|
let n = [], r = [], s, i = null;
|
|
2071
2074
|
for (let o = 0; o < e.items.length; ++o) {
|
|
2072
2075
|
let a = e.items[o];
|
|
@@ -2078,7 +2081,7 @@ ${a}` : a);
|
|
|
2078
2081
|
n.push({ afterKey: !!s, before: r.length, comment: a.comment });
|
|
2079
2082
|
break;
|
|
2080
2083
|
case p.Type.MAP_KEY:
|
|
2081
|
-
s !== void 0 && r.push(new T(s)), a.error && t.errors.push(a.error), s =
|
|
2084
|
+
s !== void 0 && r.push(new T(s)), a.error && t.errors.push(a.error), s = pe(t, a.node), i = null;
|
|
2082
2085
|
break;
|
|
2083
2086
|
case p.Type.MAP_VALUE:
|
|
2084
2087
|
{
|
|
@@ -2095,12 +2098,12 @@ ${a}` : a);
|
|
|
2095
2098
|
c.range.origStart = c.range.origEnd = m, c.valueRange.origStart = c.valueRange.origEnd = m;
|
|
2096
2099
|
}
|
|
2097
2100
|
}
|
|
2098
|
-
let l = new T(s,
|
|
2099
|
-
|
|
2101
|
+
let l = new T(s, pe(t, c));
|
|
2102
|
+
Fo(a, l), r.push(l), s && typeof i == "number" && a.range.start > i + 1024 && t.errors.push(rs(e, s)), s = void 0, i = null;
|
|
2100
2103
|
}
|
|
2101
2104
|
break;
|
|
2102
2105
|
default:
|
|
2103
|
-
s !== void 0 && r.push(new T(s)), s =
|
|
2106
|
+
s !== void 0 && r.push(new T(s)), s = pe(t, a), i = a.range.start, a.error && t.errors.push(a.error);
|
|
2104
2107
|
e: for (let c = o + 1; ; ++c) {
|
|
2105
2108
|
let l = e.items[c];
|
|
2106
2109
|
switch (l && l.type) {
|
|
@@ -2124,7 +2127,7 @@ ${a}` : a);
|
|
|
2124
2127
|
}
|
|
2125
2128
|
return s !== void 0 && r.push(new T(s)), { comments: n, items: r };
|
|
2126
2129
|
}
|
|
2127
|
-
function
|
|
2130
|
+
function Uo(t, e) {
|
|
2128
2131
|
let n = [], r = [], s, i = false, o = "{";
|
|
2129
2132
|
for (let a = 0; a < e.items.length; ++a) {
|
|
2130
2133
|
let c = e.items[a];
|
|
@@ -2149,25 +2152,25 @@ ${a}` : a);
|
|
|
2149
2152
|
o = ":";
|
|
2150
2153
|
continue;
|
|
2151
2154
|
}
|
|
2152
|
-
let m = `Flow map contains an unexpected ${l}`,
|
|
2153
|
-
|
|
2154
|
-
} else c.type === p.Type.BLANK_LINE ? n.push({ afterKey: !!s, before: r.length }) : c.type === p.Type.COMMENT ? (
|
|
2155
|
+
let m = `Flow map contains an unexpected ${l}`, g = new p.YAMLSyntaxError(e, m);
|
|
2156
|
+
g.offset = f, t.errors.push(g);
|
|
2157
|
+
} else c.type === p.Type.BLANK_LINE ? n.push({ afterKey: !!s, before: r.length }) : c.type === p.Type.COMMENT ? (ns(t.errors, c), n.push({ afterKey: !!s, before: r.length, comment: c.comment })) : s === void 0 ? (o === "," && t.errors.push(new p.YAMLSemanticError(c, "Separator , missing in flow map")), s = pe(t, c)) : (o !== "," && t.errors.push(new p.YAMLSemanticError(c, "Indicator : missing in flow map entry")), r.push(new T(s, pe(t, c))), s = void 0, i = false);
|
|
2155
2158
|
}
|
|
2156
|
-
return
|
|
2159
|
+
return ts(t.errors, e), s !== void 0 && r.push(new T(s)), { comments: n, items: r };
|
|
2157
2160
|
}
|
|
2158
|
-
function
|
|
2161
|
+
function Vo(t, e) {
|
|
2159
2162
|
if (e.type !== p.Type.SEQ && e.type !== p.Type.FLOW_SEQ) {
|
|
2160
2163
|
let i = `A ${e.type} node cannot be resolved as a sequence`;
|
|
2161
2164
|
return t.errors.push(new p.YAMLSyntaxError(e, i)), null;
|
|
2162
2165
|
}
|
|
2163
|
-
let { comments: n, items: r } = e.type === p.Type.FLOW_SEQ ?
|
|
2164
|
-
if (s.items = r,
|
|
2166
|
+
let { comments: n, items: r } = e.type === p.Type.FLOW_SEQ ? Ko(t, e) : Wo(t, e), s = new ue();
|
|
2167
|
+
if (s.items = r, ss(s, n), !t.options.mapAsMap && r.some((i) => i instanceof T && i.key instanceof Q)) {
|
|
2165
2168
|
let i = "Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";
|
|
2166
2169
|
t.warnings.push(new p.YAMLWarning(e, i));
|
|
2167
2170
|
}
|
|
2168
2171
|
return e.resolved = s, s;
|
|
2169
2172
|
}
|
|
2170
|
-
function
|
|
2173
|
+
function Wo(t, e) {
|
|
2171
2174
|
let n = [], r = [];
|
|
2172
2175
|
for (let s = 0; s < e.items.length; ++s) {
|
|
2173
2176
|
let i = e.items[s];
|
|
@@ -2179,7 +2182,7 @@ ${a}` : a);
|
|
|
2179
2182
|
n.push({ comment: i.comment, before: r.length });
|
|
2180
2183
|
break;
|
|
2181
2184
|
case p.Type.SEQ_ITEM:
|
|
2182
|
-
if (i.error && t.errors.push(i.error), r.push(
|
|
2185
|
+
if (i.error && t.errors.push(i.error), r.push(pe(t, i.node)), i.hasProps) {
|
|
2183
2186
|
let o = "Sequence items cannot have tags or anchors before the - indicator";
|
|
2184
2187
|
t.errors.push(new p.YAMLSemanticError(i, o));
|
|
2185
2188
|
}
|
|
@@ -2190,25 +2193,25 @@ ${a}` : a);
|
|
|
2190
2193
|
}
|
|
2191
2194
|
return { comments: n, items: r };
|
|
2192
2195
|
}
|
|
2193
|
-
function
|
|
2196
|
+
function Ko(t, e) {
|
|
2194
2197
|
let n = [], r = [], s = false, i, o = null, a = "[", c = null;
|
|
2195
2198
|
for (let l = 0; l < e.items.length; ++l) {
|
|
2196
2199
|
let f = e.items[l];
|
|
2197
2200
|
if (typeof f.char == "string") {
|
|
2198
|
-
let { char: m, offset:
|
|
2201
|
+
let { char: m, offset: g } = f;
|
|
2199
2202
|
if (m !== ":" && (s || i !== void 0) && (s && i === void 0 && (i = a ? r.pop() : null), r.push(new T(i)), s = false, i = void 0, o = null), m === a) a = null;
|
|
2200
2203
|
else if (!a && m === "?") s = true;
|
|
2201
2204
|
else if (a !== "[" && m === ":" && i === void 0) {
|
|
2202
2205
|
if (a === ",") {
|
|
2203
2206
|
if (i = r.pop(), i instanceof T) {
|
|
2204
2207
|
let y = "Chaining flow sequence pairs is invalid", h = new p.YAMLSemanticError(e, y);
|
|
2205
|
-
h.offset =
|
|
2208
|
+
h.offset = g, t.errors.push(h);
|
|
2206
2209
|
}
|
|
2207
2210
|
if (!s && typeof o == "number") {
|
|
2208
2211
|
let y = f.range ? f.range.start : f.offset;
|
|
2209
|
-
y > o + 1024 && t.errors.push(
|
|
2212
|
+
y > o + 1024 && t.errors.push(rs(e, i));
|
|
2210
2213
|
let { src: h } = c.context;
|
|
2211
|
-
for (let
|
|
2214
|
+
for (let d = o; d < y; ++d) if (h[d] === `
|
|
2212
2215
|
`) {
|
|
2213
2216
|
let w = "Implicit keys of flow sequence pairs need to be on a single line";
|
|
2214
2217
|
t.errors.push(new p.YAMLSemanticError(c, w));
|
|
@@ -2219,47 +2222,48 @@ ${a}` : a);
|
|
|
2219
2222
|
o = null, s = false, a = null;
|
|
2220
2223
|
} else if (a === "[" || m !== "]" || l < e.items.length - 1) {
|
|
2221
2224
|
let y = `Flow sequence contains an unexpected ${m}`, h = new p.YAMLSyntaxError(e, y);
|
|
2222
|
-
h.offset =
|
|
2225
|
+
h.offset = g, t.errors.push(h);
|
|
2223
2226
|
}
|
|
2224
2227
|
} else if (f.type === p.Type.BLANK_LINE) n.push({ before: r.length });
|
|
2225
|
-
else if (f.type === p.Type.COMMENT)
|
|
2228
|
+
else if (f.type === p.Type.COMMENT) ns(t.errors, f), n.push({ comment: f.comment, before: r.length });
|
|
2226
2229
|
else {
|
|
2227
2230
|
if (a) {
|
|
2228
|
-
let
|
|
2229
|
-
t.errors.push(new p.YAMLSemanticError(f,
|
|
2231
|
+
let g = `Expected a ${a} in flow sequence`;
|
|
2232
|
+
t.errors.push(new p.YAMLSemanticError(f, g));
|
|
2230
2233
|
}
|
|
2231
|
-
let m =
|
|
2234
|
+
let m = pe(t, f);
|
|
2232
2235
|
i === void 0 ? (r.push(m), c = f) : (r.push(new T(i, m)), i = void 0), o = f.range.start, a = ",";
|
|
2233
2236
|
}
|
|
2234
2237
|
}
|
|
2235
|
-
return
|
|
2238
|
+
return ts(t.errors, e), i !== void 0 && r.push(new T(i)), { comments: n, items: r };
|
|
2236
2239
|
}
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2240
|
+
M.Alias = we;
|
|
2241
|
+
M.Collection = Q;
|
|
2242
|
+
M.Merge = $t;
|
|
2243
|
+
M.Node = j;
|
|
2244
|
+
M.Pair = T;
|
|
2245
|
+
M.Scalar = x;
|
|
2246
|
+
M.YAMLMap = ct;
|
|
2247
|
+
M.YAMLSeq = ue;
|
|
2248
|
+
M.addComment = Re;
|
|
2249
|
+
M.binaryOptions = Oo;
|
|
2250
|
+
M.boolOptions = Ao;
|
|
2251
|
+
M.findPair = at;
|
|
2252
|
+
M.intOptions = Lo;
|
|
2253
|
+
M.isEmptyPath = Xr;
|
|
2254
|
+
M.nullOptions = To;
|
|
2255
|
+
M.resolveMap = Yo;
|
|
2256
|
+
M.resolveNode = pe;
|
|
2257
|
+
M.resolveSeq = Vo;
|
|
2258
|
+
M.resolveString = $n;
|
|
2259
|
+
M.strOptions = be;
|
|
2260
|
+
M.stringifyNumber = Po;
|
|
2261
|
+
M.stringifyString = ko;
|
|
2262
|
+
M.toJSON = fe;
|
|
2260
2263
|
});
|
|
2261
|
-
var
|
|
2262
|
-
|
|
2264
|
+
var qn = ne((ee) => {
|
|
2265
|
+
"use strict";
|
|
2266
|
+
var G = ce(), O = De(), jo = { identify: (t) => t instanceof Uint8Array, default: false, tag: "tag:yaml.org,2002:binary", resolve: (t, e) => {
|
|
2263
2267
|
let n = O.resolveString(t, e);
|
|
2264
2268
|
if (typeof Buffer == "function") return Buffer.from(n, "base64");
|
|
2265
2269
|
if (typeof atob == "function") {
|
|
@@ -2268,7 +2272,7 @@ var Gn = te((z) => {
|
|
|
2268
2272
|
return s;
|
|
2269
2273
|
} else {
|
|
2270
2274
|
let r = "This environment does not support reading binary tags; either Buffer or atob is required";
|
|
2271
|
-
return t.errors.push(new
|
|
2275
|
+
return t.errors.push(new G.YAMLReferenceError(e, r)), null;
|
|
2272
2276
|
}
|
|
2273
2277
|
}, options: O.binaryOptions, stringify: ({ comment: t, type: e, value: n }, r, s, i) => {
|
|
2274
2278
|
let o;
|
|
@@ -2278,16 +2282,16 @@ var Gn = te((z) => {
|
|
|
2278
2282
|
for (let c = 0; c < n.length; ++c) a += String.fromCharCode(n[c]);
|
|
2279
2283
|
o = btoa(a);
|
|
2280
2284
|
} else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
|
|
2281
|
-
if (e || (e = O.binaryOptions.defaultType), e ===
|
|
2285
|
+
if (e || (e = O.binaryOptions.defaultType), e === G.Type.QUOTE_DOUBLE) n = o;
|
|
2282
2286
|
else {
|
|
2283
2287
|
let { lineWidth: a } = O.binaryOptions, c = Math.ceil(o.length / a), l = new Array(c);
|
|
2284
2288
|
for (let f = 0, m = 0; f < c; ++f, m += a) l[f] = o.substr(m, a);
|
|
2285
|
-
n = l.join(e ===
|
|
2289
|
+
n = l.join(e === G.Type.BLOCK_LITERAL ? `
|
|
2286
2290
|
` : " ");
|
|
2287
2291
|
}
|
|
2288
2292
|
return O.stringifyString({ comment: t, type: e, value: n }, r, s, i);
|
|
2289
2293
|
} };
|
|
2290
|
-
function
|
|
2294
|
+
function os(t, e) {
|
|
2291
2295
|
let n = O.resolveSeq(t, e);
|
|
2292
2296
|
for (let r = 0; r < n.items.length; ++r) {
|
|
2293
2297
|
let s = n.items[r];
|
|
@@ -2295,7 +2299,7 @@ var Gn = te((z) => {
|
|
|
2295
2299
|
if (s instanceof O.YAMLMap) {
|
|
2296
2300
|
if (s.items.length > 1) {
|
|
2297
2301
|
let o = "Each pair must have its own sequence indicator";
|
|
2298
|
-
throw new
|
|
2302
|
+
throw new G.YAMLSemanticError(e, o);
|
|
2299
2303
|
}
|
|
2300
2304
|
let i = s.items[0] || new O.Pair();
|
|
2301
2305
|
s.commentBefore && (i.commentBefore = i.commentBefore ? `${s.commentBefore}
|
|
@@ -2307,7 +2311,7 @@ ${i.comment}` : s.comment), s = i;
|
|
|
2307
2311
|
}
|
|
2308
2312
|
return n;
|
|
2309
2313
|
}
|
|
2310
|
-
function
|
|
2314
|
+
function as(t, e, n) {
|
|
2311
2315
|
let r = new O.YAMLSeq(t);
|
|
2312
2316
|
r.tag = "tag:yaml.org,2002:pairs";
|
|
2313
2317
|
for (let s of e) {
|
|
@@ -2324,9 +2328,9 @@ ${i.comment}` : s.comment), s = i;
|
|
|
2324
2328
|
}
|
|
2325
2329
|
return r;
|
|
2326
2330
|
}
|
|
2327
|
-
var
|
|
2331
|
+
var Qo = { default: false, tag: "tag:yaml.org,2002:pairs", resolve: os, createNode: as }, $e = class t extends O.YAMLSeq {
|
|
2328
2332
|
constructor() {
|
|
2329
|
-
super(),
|
|
2333
|
+
super(), G._defineProperty(this, "add", O.YAMLMap.prototype.add.bind(this)), G._defineProperty(this, "delete", O.YAMLMap.prototype.delete.bind(this)), G._defineProperty(this, "get", O.YAMLMap.prototype.get.bind(this)), G._defineProperty(this, "has", O.YAMLMap.prototype.has.bind(this)), G._defineProperty(this, "set", O.YAMLMap.prototype.set.bind(this)), this.tag = t.tag;
|
|
2330
2334
|
}
|
|
2331
2335
|
toJSON(e, n) {
|
|
2332
2336
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -2339,20 +2343,20 @@ ${i.comment}` : s.comment), s = i;
|
|
|
2339
2343
|
return r;
|
|
2340
2344
|
}
|
|
2341
2345
|
};
|
|
2342
|
-
|
|
2343
|
-
function
|
|
2344
|
-
let n =
|
|
2346
|
+
G._defineProperty($e, "tag", "tag:yaml.org,2002:omap");
|
|
2347
|
+
function Go(t, e) {
|
|
2348
|
+
let n = os(t, e), r = [];
|
|
2345
2349
|
for (let { key: s } of n.items) if (s instanceof O.Scalar) if (r.includes(s.value)) {
|
|
2346
2350
|
let i = "Ordered maps must not include duplicate keys";
|
|
2347
|
-
throw new
|
|
2351
|
+
throw new G.YAMLSemanticError(e, i);
|
|
2348
2352
|
} else r.push(s.value);
|
|
2349
|
-
return Object.assign(new
|
|
2353
|
+
return Object.assign(new $e(), n);
|
|
2350
2354
|
}
|
|
2351
|
-
function
|
|
2352
|
-
let r =
|
|
2355
|
+
function Ho(t, e, n) {
|
|
2356
|
+
let r = as(t, e, n), s = new $e();
|
|
2353
2357
|
return s.items = r.items, s;
|
|
2354
2358
|
}
|
|
2355
|
-
var
|
|
2359
|
+
var Jo = { identify: (t) => t instanceof Map, nodeClass: $e, default: false, tag: "tag:yaml.org,2002:omap", resolve: Go, createNode: Ho }, Ye = class t extends O.YAMLMap {
|
|
2356
2360
|
constructor() {
|
|
2357
2361
|
super(), this.tag = t.tag;
|
|
2358
2362
|
}
|
|
@@ -2378,77 +2382,78 @@ ${i.comment}` : s.comment), s = i;
|
|
|
2378
2382
|
throw new Error("Set items must all have null values");
|
|
2379
2383
|
}
|
|
2380
2384
|
};
|
|
2381
|
-
|
|
2382
|
-
function
|
|
2385
|
+
G._defineProperty(Ye, "tag", "tag:yaml.org,2002:set");
|
|
2386
|
+
function Xo(t, e) {
|
|
2383
2387
|
let n = O.resolveMap(t, e);
|
|
2384
|
-
if (!n.hasAllNullValues()) throw new
|
|
2385
|
-
return Object.assign(new
|
|
2388
|
+
if (!n.hasAllNullValues()) throw new G.YAMLSemanticError(e, "Set items must all have null values");
|
|
2389
|
+
return Object.assign(new Ye(), n);
|
|
2386
2390
|
}
|
|
2387
|
-
function
|
|
2388
|
-
let r = new
|
|
2391
|
+
function zo(t, e, n) {
|
|
2392
|
+
let r = new Ye();
|
|
2389
2393
|
for (let s of e) r.items.push(t.createPair(s, null, n));
|
|
2390
2394
|
return r;
|
|
2391
2395
|
}
|
|
2392
|
-
var
|
|
2396
|
+
var Zo = { identify: (t) => t instanceof Set, nodeClass: Ye, default: false, tag: "tag:yaml.org,2002:set", resolve: Xo, createNode: zo }, Yn = (t, e) => {
|
|
2393
2397
|
let n = e.split(":").reduce((r, s) => r * 60 + Number(s), 0);
|
|
2394
2398
|
return t === "-" ? -n : n;
|
|
2395
|
-
},
|
|
2399
|
+
}, cs = ({ value: t }) => {
|
|
2396
2400
|
if (isNaN(t) || !isFinite(t)) return O.stringifyNumber(t);
|
|
2397
2401
|
let e = "";
|
|
2398
2402
|
t < 0 && (e = "-", t = Math.abs(t));
|
|
2399
2403
|
let n = [t % 60];
|
|
2400
2404
|
return t < 60 ? n.unshift(0) : (t = Math.round((t - n[0]) / 60), n.unshift(t % 60), t >= 60 && (t = Math.round((t - n[0]) / 60), n.unshift(t))), e + n.map((r) => r < 10 ? "0" + String(r) : String(r)).join(":").replace(/000000\d*$/, "");
|
|
2401
|
-
},
|
|
2405
|
+
}, ea = { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:int", format: "TIME", test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/, resolve: (t, e, n) => Yn(e, n.replace(/_/g, "")), stringify: cs }, ta = { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", format: "TIME", test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/, resolve: (t, e, n) => Yn(e, n.replace(/_/g, "")), stringify: cs }, na = { identify: (t) => t instanceof Date, default: true, tag: "tag:yaml.org,2002:timestamp", 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})?))?)?)$"), resolve: (t, e, n, r, s, i, o, a, c) => {
|
|
2402
2406
|
a && (a = (a + "00").substr(1, 3));
|
|
2403
2407
|
let l = Date.UTC(e, n - 1, r, s || 0, i || 0, o || 0, a || 0);
|
|
2404
2408
|
if (c && c !== "Z") {
|
|
2405
|
-
let f =
|
|
2409
|
+
let f = Yn(c[0], c.slice(1));
|
|
2406
2410
|
Math.abs(f) < 30 && (f *= 60), l -= 6e4 * f;
|
|
2407
2411
|
}
|
|
2408
2412
|
return new Date(l);
|
|
2409
2413
|
}, stringify: ({ value: t }) => t.toISOString().replace(/((T00:00)?:00)?\.000Z$/, "") };
|
|
2410
|
-
function
|
|
2414
|
+
function Bn(t) {
|
|
2411
2415
|
let e = {};
|
|
2412
2416
|
return t ? typeof YAML_SILENCE_DEPRECATION_WARNINGS < "u" ? !YAML_SILENCE_DEPRECATION_WARNINGS : !e.YAML_SILENCE_DEPRECATION_WARNINGS : typeof YAML_SILENCE_WARNINGS < "u" ? !YAML_SILENCE_WARNINGS : !e.YAML_SILENCE_WARNINGS;
|
|
2413
2417
|
}
|
|
2414
|
-
function
|
|
2415
|
-
|
|
2418
|
+
function Fn(t, e) {
|
|
2419
|
+
Bn(false) && console.warn(e ? `${e}: ${t}` : t);
|
|
2416
2420
|
}
|
|
2417
|
-
function
|
|
2418
|
-
if (
|
|
2421
|
+
function ra(t) {
|
|
2422
|
+
if (Bn(true)) {
|
|
2419
2423
|
let e = t.replace(/.*yaml[/\\]/i, "").replace(/\.js$/, "").replace(/\\/g, "/");
|
|
2420
|
-
|
|
2424
|
+
Fn(`The endpoint 'yaml/${e}' will be removed in a future release.`, "DeprecationWarning");
|
|
2421
2425
|
}
|
|
2422
2426
|
}
|
|
2423
|
-
var
|
|
2424
|
-
function
|
|
2425
|
-
if (!
|
|
2426
|
-
|
|
2427
|
+
var is = {};
|
|
2428
|
+
function sa(t, e) {
|
|
2429
|
+
if (!is[t] && Bn(true)) {
|
|
2430
|
+
is[t] = true;
|
|
2427
2431
|
let n = `The option '${t}' will be removed in a future release`;
|
|
2428
|
-
n += e ? `, use '${e}' instead.` : ".",
|
|
2432
|
+
n += e ? `, use '${e}' instead.` : ".", Fn(n, "DeprecationWarning");
|
|
2429
2433
|
}
|
|
2430
2434
|
}
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2435
|
+
ee.binary = jo;
|
|
2436
|
+
ee.floatTime = ta;
|
|
2437
|
+
ee.intTime = ea;
|
|
2438
|
+
ee.omap = Jo;
|
|
2439
|
+
ee.pairs = Qo;
|
|
2440
|
+
ee.set = Zo;
|
|
2441
|
+
ee.timestamp = na;
|
|
2442
|
+
ee.warn = Fn;
|
|
2443
|
+
ee.warnFileDeprecation = ra;
|
|
2444
|
+
ee.warnOptionDeprecation = sa;
|
|
2441
2445
|
});
|
|
2442
|
-
var
|
|
2443
|
-
|
|
2444
|
-
|
|
2446
|
+
var Kn = ne((bs) => {
|
|
2447
|
+
"use strict";
|
|
2448
|
+
var Ut = ce(), E = De(), $ = qn();
|
|
2449
|
+
function ia(t, e, n) {
|
|
2445
2450
|
let r = new E.YAMLMap(t);
|
|
2446
2451
|
if (e instanceof Map) for (let [s, i] of e) r.items.push(t.createPair(s, i, n));
|
|
2447
2452
|
else if (e && typeof e == "object") for (let s of Object.keys(e)) r.items.push(t.createPair(s, e[s], n));
|
|
2448
2453
|
return typeof t.sortMapEntries == "function" && r.items.sort(t.sortMapEntries), r;
|
|
2449
2454
|
}
|
|
2450
|
-
var
|
|
2451
|
-
function
|
|
2455
|
+
var ft = { createNode: ia, default: true, nodeClass: E.YAMLMap, tag: "tag:yaml.org,2002:map", resolve: E.resolveMap };
|
|
2456
|
+
function oa(t, e, n) {
|
|
2452
2457
|
let r = new E.YAMLSeq(t);
|
|
2453
2458
|
if (e && e[Symbol.iterator]) for (let s of e) {
|
|
2454
2459
|
let i = t.createNode(s, n.wrapScalars, null, n);
|
|
@@ -2456,22 +2461,22 @@ var zn = te((Ps) => {
|
|
|
2456
2461
|
}
|
|
2457
2462
|
return r;
|
|
2458
2463
|
}
|
|
2459
|
-
var
|
|
2464
|
+
var Vt = { createNode: oa, default: true, nodeClass: E.YAMLSeq, tag: "tag:yaml.org,2002:seq", resolve: E.resolveSeq }, aa = { identify: (t) => typeof t == "string", default: true, tag: "tag:yaml.org,2002:str", resolve: E.resolveString, stringify(t, e, n, r) {
|
|
2460
2465
|
return e = Object.assign({ actualString: true }, e), E.stringifyString(t, e, n, r);
|
|
2461
|
-
}, options: E.strOptions },
|
|
2462
|
-
function
|
|
2466
|
+
}, options: E.strOptions }, Vn = [ft, Vt, aa], Wt = (t) => typeof t == "bigint" || Number.isInteger(t), Wn = (t, e, n) => E.intOptions.asBigInt ? BigInt(t) : parseInt(e, n);
|
|
2467
|
+
function us(t, e, n) {
|
|
2463
2468
|
let { value: r } = t;
|
|
2464
|
-
return
|
|
2469
|
+
return Wt(r) && r >= 0 ? n + r.toString(e) : E.stringifyNumber(t);
|
|
2465
2470
|
}
|
|
2466
|
-
var
|
|
2471
|
+
var ps = { identify: (t) => t == null, createNode: (t, e, n) => n.wrapScalars ? new E.Scalar(null) : null, default: true, tag: "tag:yaml.org,2002:null", test: /^(?:~|[Nn]ull|NULL)?$/, resolve: () => null, options: E.nullOptions, stringify: () => E.nullOptions.nullStr }, ms = { identify: (t) => typeof t == "boolean", default: true, tag: "tag:yaml.org,2002:bool", test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/, resolve: (t) => t[0] === "t" || t[0] === "T", options: E.boolOptions, stringify: ({ value: t }) => t ? E.boolOptions.trueStr : E.boolOptions.falseStr }, hs = { identify: (t) => Wt(t) && t >= 0, default: true, tag: "tag:yaml.org,2002:int", format: "OCT", test: /^0o([0-7]+)$/, resolve: (t, e) => Wn(t, e, 8), options: E.intOptions, stringify: (t) => us(t, 8, "0o") }, ds = { identify: Wt, default: true, tag: "tag:yaml.org,2002:int", test: /^[-+]?[0-9]+$/, resolve: (t) => Wn(t, t, 10), options: E.intOptions, stringify: E.stringifyNumber }, gs = { identify: (t) => Wt(t) && t >= 0, default: true, tag: "tag:yaml.org,2002:int", format: "HEX", test: /^0x([0-9a-fA-F]+)$/, resolve: (t, e) => Wn(t, e, 16), options: E.intOptions, stringify: (t) => us(t, 16, "0x") }, ys = { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", test: /^(?:[-+]?\.inf|(\.nan))$/i, resolve: (t, e) => e ? NaN : t[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, stringify: E.stringifyNumber }, Es = { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", format: "EXP", test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/, resolve: (t) => parseFloat(t), stringify: ({ value: t }) => Number(t).toExponential() }, Ss = { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", test: /^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/, resolve(t, e, n) {
|
|
2467
2472
|
let r = e || n, s = new E.Scalar(parseFloat(t));
|
|
2468
2473
|
return r && r[r.length - 1] === "0" && (s.minFractionDigits = r.length), s;
|
|
2469
|
-
}, stringify: E.stringifyNumber },
|
|
2470
|
-
|
|
2474
|
+
}, stringify: E.stringifyNumber }, ca = Vn.concat([ps, ms, hs, ds, gs, ys, Es, Ss]), ls = (t) => typeof t == "bigint" || Number.isInteger(t), Ft = ({ value: t }) => JSON.stringify(t), ws = [ft, Vt, { identify: (t) => typeof t == "string", default: true, tag: "tag:yaml.org,2002:str", resolve: E.resolveString, stringify: Ft }, { identify: (t) => t == null, createNode: (t, e, n) => n.wrapScalars ? new E.Scalar(null) : null, default: true, tag: "tag:yaml.org,2002:null", test: /^null$/, resolve: () => null, stringify: Ft }, { identify: (t) => typeof t == "boolean", default: true, tag: "tag:yaml.org,2002:bool", test: /^true|false$/, resolve: (t) => t === "true", stringify: Ft }, { identify: ls, default: true, tag: "tag:yaml.org,2002:int", test: /^-?(?:0|[1-9][0-9]*)$/, resolve: (t) => E.intOptions.asBigInt ? BigInt(t) : parseInt(t, 10), stringify: ({ value: t }) => ls(t) ? t.toString() : JSON.stringify(t) }, { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/, resolve: (t) => parseFloat(t), stringify: Ft }];
|
|
2475
|
+
ws.scalarFallback = (t) => {
|
|
2471
2476
|
throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(t)}`);
|
|
2472
2477
|
};
|
|
2473
|
-
var
|
|
2474
|
-
function
|
|
2478
|
+
var fs = ({ value: t }) => t ? E.boolOptions.trueStr : E.boolOptions.falseStr, lt = (t) => typeof t == "bigint" || Number.isInteger(t);
|
|
2479
|
+
function qt(t, e, n) {
|
|
2475
2480
|
let r = e.replace(/_/g, "");
|
|
2476
2481
|
if (E.intOptions.asBigInt) {
|
|
2477
2482
|
switch (n) {
|
|
@@ -2491,23 +2496,23 @@ var zn = te((Ps) => {
|
|
|
2491
2496
|
let s = parseInt(r, n);
|
|
2492
2497
|
return t === "-" ? -1 * s : s;
|
|
2493
2498
|
}
|
|
2494
|
-
function
|
|
2499
|
+
function Un(t, e, n) {
|
|
2495
2500
|
let { value: r } = t;
|
|
2496
|
-
if (
|
|
2501
|
+
if (lt(r)) {
|
|
2497
2502
|
let s = r.toString(e);
|
|
2498
2503
|
return r < 0 ? "-" + n + s.substr(1) : n + s;
|
|
2499
2504
|
}
|
|
2500
2505
|
return E.stringifyNumber(t);
|
|
2501
2506
|
}
|
|
2502
|
-
var
|
|
2507
|
+
var la = Vn.concat([{ identify: (t) => t == null, createNode: (t, e, n) => n.wrapScalars ? new E.Scalar(null) : null, default: true, tag: "tag:yaml.org,2002:null", test: /^(?:~|[Nn]ull|NULL)?$/, resolve: () => null, options: E.nullOptions, stringify: () => E.nullOptions.nullStr }, { identify: (t) => typeof t == "boolean", default: true, tag: "tag:yaml.org,2002:bool", test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/, resolve: () => true, options: E.boolOptions, stringify: fs }, { identify: (t) => typeof t == "boolean", default: true, tag: "tag:yaml.org,2002:bool", test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i, resolve: () => false, options: E.boolOptions, stringify: fs }, { identify: lt, default: true, tag: "tag:yaml.org,2002:int", format: "BIN", test: /^([-+]?)0b([0-1_]+)$/, resolve: (t, e, n) => qt(e, n, 2), stringify: (t) => Un(t, 2, "0b") }, { identify: lt, default: true, tag: "tag:yaml.org,2002:int", format: "OCT", test: /^([-+]?)0([0-7_]+)$/, resolve: (t, e, n) => qt(e, n, 8), stringify: (t) => Un(t, 8, "0") }, { identify: lt, default: true, tag: "tag:yaml.org,2002:int", test: /^([-+]?)([0-9][0-9_]*)$/, resolve: (t, e, n) => qt(e, n, 10), stringify: E.stringifyNumber }, { identify: lt, default: true, tag: "tag:yaml.org,2002:int", format: "HEX", test: /^([-+]?)0x([0-9a-fA-F_]+)$/, resolve: (t, e, n) => qt(e, n, 16), stringify: (t) => Un(t, 16, "0x") }, { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", test: /^(?:[-+]?\.inf|(\.nan))$/i, resolve: (t, e) => e ? NaN : t[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, stringify: E.stringifyNumber }, { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", format: "EXP", test: /^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/, resolve: (t) => parseFloat(t.replace(/_/g, "")), stringify: ({ value: t }) => Number(t).toExponential() }, { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", test: /^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/, resolve(t, e) {
|
|
2503
2508
|
let n = new E.Scalar(parseFloat(t.replace(/_/g, "")));
|
|
2504
2509
|
if (e) {
|
|
2505
2510
|
let r = e.replace(/_/g, "");
|
|
2506
2511
|
r[r.length - 1] === "0" && (n.minFractionDigits = r.length);
|
|
2507
2512
|
}
|
|
2508
2513
|
return n;
|
|
2509
|
-
}, stringify: E.stringifyNumber }],
|
|
2510
|
-
function
|
|
2514
|
+
}, stringify: E.stringifyNumber }], $.binary, $.omap, $.pairs, $.set, $.intTime, $.floatTime, $.timestamp), fa = { core: ca, failsafe: Vn, json: ws, yaml11: la }, ua = { binary: $.binary, bool: ms, float: Ss, floatExp: Es, floatNaN: ys, floatTime: $.floatTime, int: ds, intHex: gs, intOct: hs, intTime: $.intTime, map: ft, null: ps, omap: $.omap, pairs: $.pairs, seq: Vt, set: $.set, timestamp: $.timestamp };
|
|
2515
|
+
function pa(t, e, n) {
|
|
2511
2516
|
if (e) {
|
|
2512
2517
|
let r = n.filter((i) => i.tag === e), s = r.find((i) => !i.format) || r[0];
|
|
2513
2518
|
if (!s) throw new Error(`Tag ${e} not found`);
|
|
@@ -2515,14 +2520,14 @@ var zn = te((Ps) => {
|
|
|
2515
2520
|
}
|
|
2516
2521
|
return n.find((r) => (r.identify && r.identify(t) || r.class && t instanceof r.class) && !r.format);
|
|
2517
2522
|
}
|
|
2518
|
-
function
|
|
2523
|
+
function ma(t, e, n) {
|
|
2519
2524
|
if (t instanceof E.Node) return t;
|
|
2520
2525
|
let { defaultPrefix: r, onTagObj: s, prevObjects: i, schema: o, wrapScalars: a } = n;
|
|
2521
2526
|
e && e.startsWith("!!") && (e = r + e.slice(2));
|
|
2522
|
-
let c =
|
|
2527
|
+
let c = pa(t, e, o.tags);
|
|
2523
2528
|
if (!c) {
|
|
2524
2529
|
if (typeof t.toJSON == "function" && (t = t.toJSON()), !t || typeof t != "object") return a ? new E.Scalar(t) : t;
|
|
2525
|
-
c = t instanceof Map ?
|
|
2530
|
+
c = t instanceof Map ? ft : t[Symbol.iterator] ? Vt : ft;
|
|
2526
2531
|
}
|
|
2527
2532
|
s && (s(c), delete n.onTagObj);
|
|
2528
2533
|
let l = { value: void 0, node: void 0 };
|
|
@@ -2536,7 +2541,7 @@ var zn = te((Ps) => {
|
|
|
2536
2541
|
}
|
|
2537
2542
|
return l.node = c.createNode ? c.createNode(n.schema, t, n) : a ? new E.Scalar(t) : t, e && l.node instanceof E.Node && (l.node.tag = e), l.node;
|
|
2538
2543
|
}
|
|
2539
|
-
function
|
|
2544
|
+
function ha(t, e, n, r) {
|
|
2540
2545
|
let s = t[r.replace(/\W/g, "")];
|
|
2541
2546
|
if (!s) {
|
|
2542
2547
|
let i = Object.keys(t).map((o) => JSON.stringify(o)).join(", ");
|
|
@@ -2557,13 +2562,13 @@ var zn = te((Ps) => {
|
|
|
2557
2562
|
}
|
|
2558
2563
|
return s;
|
|
2559
2564
|
}
|
|
2560
|
-
var
|
|
2565
|
+
var da = (t, e) => t.key < e.key ? -1 : t.key > e.key ? 1 : 0, ut = class t {
|
|
2561
2566
|
constructor({ customTags: e, merge: n, schema: r, sortMapEntries: s, tags: i }) {
|
|
2562
|
-
this.merge = !!n, this.name = r, this.sortMapEntries = s === true ?
|
|
2567
|
+
this.merge = !!n, this.name = r, this.sortMapEntries = s === true ? da : s || null, !e && i && $.warnOptionDeprecation("tags", "customTags"), this.tags = ha(fa, ua, e || i, r);
|
|
2563
2568
|
}
|
|
2564
2569
|
createNode(e, n, r, s) {
|
|
2565
2570
|
let i = { defaultPrefix: t.defaultPrefix, schema: this, wrapScalars: n }, o = s ? Object.assign(s, i) : i;
|
|
2566
|
-
return
|
|
2571
|
+
return ma(e, r, o);
|
|
2567
2572
|
}
|
|
2568
2573
|
createPair(e, n, r) {
|
|
2569
2574
|
r || (r = { wrapScalars: true });
|
|
@@ -2571,12 +2576,13 @@ var zn = te((Ps) => {
|
|
|
2571
2576
|
return new E.Pair(s, i);
|
|
2572
2577
|
}
|
|
2573
2578
|
};
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2579
|
+
Ut._defineProperty(ut, "defaultPrefix", Ut.defaultTagPrefix);
|
|
2580
|
+
Ut._defineProperty(ut, "defaultTags", Ut.defaultTags);
|
|
2581
|
+
bs.Schema = ut;
|
|
2577
2582
|
});
|
|
2578
|
-
var
|
|
2579
|
-
|
|
2583
|
+
var Ls = ne((Gt) => {
|
|
2584
|
+
"use strict";
|
|
2585
|
+
var Y = ce(), S = De(), Ns = Kn(), ga = { anchorPrefix: "a", customTags: null, indent: 2, indentSeq: true, keepCstNodes: false, keepNodeTypes: true, keepBlobsInJSON: true, mapAsMap: false, maxAliasCount: 100, prettyErrors: false, simpleKeys: false, version: "1.2" }, ya = { get binary() {
|
|
2580
2586
|
return S.binaryOptions;
|
|
2581
2587
|
}, set binary(t) {
|
|
2582
2588
|
Object.assign(S.binaryOptions, t);
|
|
@@ -2596,8 +2602,8 @@ var Rs = te((Xt) => {
|
|
|
2596
2602
|
return S.strOptions;
|
|
2597
2603
|
}, set str(t) {
|
|
2598
2604
|
Object.assign(S.strOptions, t);
|
|
2599
|
-
} },
|
|
2600
|
-
function
|
|
2605
|
+
} }, As = { "1.0": { schema: "yaml-1.1", merge: true, tagPrefixes: [{ handle: "!", prefix: Y.defaultTagPrefix }, { handle: "!!", prefix: "tag:private.yaml.org,2002:" }] }, 1.1: { schema: "yaml-1.1", merge: true, tagPrefixes: [{ handle: "!", prefix: "!" }, { handle: "!!", prefix: Y.defaultTagPrefix }] }, 1.2: { schema: "core", merge: false, tagPrefixes: [{ handle: "!", prefix: "!" }, { handle: "!!", prefix: Y.defaultTagPrefix }] } };
|
|
2606
|
+
function Os(t, e) {
|
|
2601
2607
|
if ((t.version || t.options.version) === "1.0") {
|
|
2602
2608
|
let s = e.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);
|
|
2603
2609
|
if (s) return "!" + s[1];
|
|
@@ -2613,7 +2619,7 @@ var Rs = te((Xt) => {
|
|
|
2613
2619
|
let r = e.substr(n.prefix.length).replace(/[!,[\]{}]/g, (s) => ({ "!": "%21", ",": "%2C", "[": "%5B", "]": "%5D", "{": "%7B", "}": "%7D" })[s]);
|
|
2614
2620
|
return n.handle + r;
|
|
2615
2621
|
}
|
|
2616
|
-
function
|
|
2622
|
+
function Ea(t, e) {
|
|
2617
2623
|
if (e instanceof S.Alias) return S.Alias;
|
|
2618
2624
|
if (e.tag) {
|
|
2619
2625
|
let s = t.filter((i) => i.tag === e.tag);
|
|
@@ -2631,11 +2637,11 @@ var Rs = te((Xt) => {
|
|
|
2631
2637
|
}
|
|
2632
2638
|
return n;
|
|
2633
2639
|
}
|
|
2634
|
-
function
|
|
2640
|
+
function Sa(t, e, { anchors: n, doc: r }) {
|
|
2635
2641
|
let s = [], i = r.anchors.getName(t);
|
|
2636
|
-
return i && (n[i] = t, s.push(`&${i}`)), t.tag ? s.push(
|
|
2642
|
+
return i && (n[i] = t, s.push(`&${i}`)), t.tag ? s.push(Os(r, t.tag)) : e.default || s.push(Os(r, e.tag)), s.join(" ");
|
|
2637
2643
|
}
|
|
2638
|
-
function
|
|
2644
|
+
function Kt(t, e, n, r) {
|
|
2639
2645
|
let { anchors: s, schema: i } = e.doc, o;
|
|
2640
2646
|
if (!(t instanceof S.Node)) {
|
|
2641
2647
|
let l = { aliasNodes: [], onTagObj: (f) => o = f, prevObjects: /* @__PURE__ */ new Map() };
|
|
@@ -2647,14 +2653,14 @@ var Rs = te((Xt) => {
|
|
|
2647
2653
|
}
|
|
2648
2654
|
}
|
|
2649
2655
|
if (t instanceof S.Pair) return t.toString(e, n, r);
|
|
2650
|
-
o || (o =
|
|
2651
|
-
let a =
|
|
2656
|
+
o || (o = Ea(i.tags, t));
|
|
2657
|
+
let a = Sa(t, o, e);
|
|
2652
2658
|
a.length > 0 && (e.indentAtStart = (e.indentAtStart || 0) + a.length + 1);
|
|
2653
2659
|
let c = typeof o.stringify == "function" ? o.stringify(t, e, n, r) : t instanceof S.Scalar ? S.stringifyString(t, e, n, r) : t.toString(e, n, r);
|
|
2654
2660
|
return a ? t instanceof S.Scalar || c[0] === "{" || c[0] === "[" ? `${a} ${c}` : `${a}
|
|
2655
2661
|
${e.indent}${c}` : c;
|
|
2656
2662
|
}
|
|
2657
|
-
var
|
|
2663
|
+
var jn = class t {
|
|
2658
2664
|
static validAnchorNode(e) {
|
|
2659
2665
|
return e instanceof S.Scalar || e instanceof S.YAMLSeq || e instanceof S.YAMLMap;
|
|
2660
2666
|
}
|
|
@@ -2714,14 +2720,14 @@ ${e.indent}${c}` : c;
|
|
|
2714
2720
|
}
|
|
2715
2721
|
return n;
|
|
2716
2722
|
}
|
|
2717
|
-
},
|
|
2723
|
+
}, jt = (t, e) => {
|
|
2718
2724
|
if (t && typeof t == "object") {
|
|
2719
2725
|
let { tag: n } = t;
|
|
2720
|
-
t instanceof S.Collection ? (n && (e[n] = true), t.items.forEach((r) =>
|
|
2726
|
+
t instanceof S.Collection ? (n && (e[n] = true), t.items.forEach((r) => jt(r, e))) : t instanceof S.Pair ? (jt(t.key, e), jt(t.value, e)) : t instanceof S.Scalar && n && (e[n] = true);
|
|
2721
2727
|
}
|
|
2722
2728
|
return e;
|
|
2723
|
-
},
|
|
2724
|
-
function
|
|
2729
|
+
}, wa = (t) => Object.keys(jt(t, {}));
|
|
2730
|
+
function ba(t, e) {
|
|
2725
2731
|
let n = { before: [], after: [] }, r, s = false;
|
|
2726
2732
|
for (let i of e) if (i.valueRange) {
|
|
2727
2733
|
if (r !== void 0) {
|
|
@@ -2747,7 +2753,7 @@ ${o.commentBefore}` : i;
|
|
|
2747
2753
|
`) || null;
|
|
2748
2754
|
}
|
|
2749
2755
|
}
|
|
2750
|
-
function
|
|
2756
|
+
function Na({ tagPrefixes: t }, e) {
|
|
2751
2757
|
let [n, r] = e.parameters;
|
|
2752
2758
|
if (!n || !r) {
|
|
2753
2759
|
let s = "Insufficient parameters given for %TAG directive";
|
|
@@ -2759,26 +2765,26 @@ ${o.commentBefore}` : i;
|
|
|
2759
2765
|
}
|
|
2760
2766
|
return { handle: n, prefix: r };
|
|
2761
2767
|
}
|
|
2762
|
-
function
|
|
2768
|
+
function Oa(t, e) {
|
|
2763
2769
|
let [n] = e.parameters;
|
|
2764
2770
|
if (e.name === "YAML:1.0" && (n = "1.0"), !n) {
|
|
2765
2771
|
let r = "Insufficient parameters given for %YAML directive";
|
|
2766
2772
|
throw new Y.YAMLSemanticError(e, r);
|
|
2767
2773
|
}
|
|
2768
|
-
if (!
|
|
2774
|
+
if (!As[n]) {
|
|
2769
2775
|
let s = `Document will be parsed as YAML ${t.version || t.options.version} rather than YAML ${n}`;
|
|
2770
2776
|
t.warnings.push(new Y.YAMLWarning(e, s));
|
|
2771
2777
|
}
|
|
2772
2778
|
return n;
|
|
2773
2779
|
}
|
|
2774
|
-
function
|
|
2780
|
+
function Aa(t, e, n) {
|
|
2775
2781
|
let r = [], s = false;
|
|
2776
2782
|
for (let i of e) {
|
|
2777
2783
|
let { comment: o, name: a } = i;
|
|
2778
2784
|
switch (a) {
|
|
2779
2785
|
case "TAG":
|
|
2780
2786
|
try {
|
|
2781
|
-
t.tagPrefixes.push(
|
|
2787
|
+
t.tagPrefixes.push(Na(t, i));
|
|
2782
2788
|
} catch (c) {
|
|
2783
2789
|
t.errors.push(c);
|
|
2784
2790
|
}
|
|
@@ -2791,7 +2797,7 @@ ${o.commentBefore}` : i;
|
|
|
2791
2797
|
t.errors.push(new Y.YAMLSemanticError(i, c));
|
|
2792
2798
|
}
|
|
2793
2799
|
try {
|
|
2794
|
-
t.version =
|
|
2800
|
+
t.version = Oa(t, i);
|
|
2795
2801
|
} catch (c) {
|
|
2796
2802
|
t.errors.push(c);
|
|
2797
2803
|
}
|
|
@@ -2812,25 +2818,25 @@ ${o.commentBefore}` : i;
|
|
|
2812
2818
|
t.commentBefore = r.join(`
|
|
2813
2819
|
`) || null;
|
|
2814
2820
|
}
|
|
2815
|
-
function
|
|
2821
|
+
function Be(t) {
|
|
2816
2822
|
if (t instanceof S.Collection) return true;
|
|
2817
2823
|
throw new Error("Expected a YAML collection as document contents");
|
|
2818
2824
|
}
|
|
2819
|
-
var
|
|
2825
|
+
var Qt = class t {
|
|
2820
2826
|
constructor(e) {
|
|
2821
|
-
this.anchors = new
|
|
2827
|
+
this.anchors = new jn(e.anchorPrefix), this.commentBefore = null, this.comment = null, this.contents = null, this.directivesEndMarker = null, this.errors = [], this.options = e, this.schema = null, this.tagPrefixes = [], this.version = null, this.warnings = [];
|
|
2822
2828
|
}
|
|
2823
2829
|
add(e) {
|
|
2824
|
-
return
|
|
2830
|
+
return Be(this.contents), this.contents.add(e);
|
|
2825
2831
|
}
|
|
2826
2832
|
addIn(e, n) {
|
|
2827
|
-
|
|
2833
|
+
Be(this.contents), this.contents.addIn(e, n);
|
|
2828
2834
|
}
|
|
2829
2835
|
delete(e) {
|
|
2830
|
-
return
|
|
2836
|
+
return Be(this.contents), this.contents.delete(e);
|
|
2831
2837
|
}
|
|
2832
2838
|
deleteIn(e) {
|
|
2833
|
-
return S.isEmptyPath(e) ? this.contents == null ? false : (this.contents = null, true) : (
|
|
2839
|
+
return S.isEmptyPath(e) ? this.contents == null ? false : (this.contents = null, true) : (Be(this.contents), this.contents.deleteIn(e));
|
|
2834
2840
|
}
|
|
2835
2841
|
getDefaults() {
|
|
2836
2842
|
return t.defaults[this.version] || t.defaults[this.options.version] || {};
|
|
@@ -2848,28 +2854,28 @@ ${o.commentBefore}` : i;
|
|
|
2848
2854
|
return S.isEmptyPath(e) ? this.contents !== void 0 : this.contents instanceof S.Collection ? this.contents.hasIn(e) : false;
|
|
2849
2855
|
}
|
|
2850
2856
|
set(e, n) {
|
|
2851
|
-
|
|
2857
|
+
Be(this.contents), this.contents.set(e, n);
|
|
2852
2858
|
}
|
|
2853
2859
|
setIn(e, n) {
|
|
2854
|
-
S.isEmptyPath(e) ? this.contents = n : (
|
|
2860
|
+
S.isEmptyPath(e) ? this.contents = n : (Be(this.contents), this.contents.setIn(e, n));
|
|
2855
2861
|
}
|
|
2856
2862
|
setSchema(e, n) {
|
|
2857
2863
|
if (!e && !n && this.schema) return;
|
|
2858
2864
|
typeof e == "number" && (e = e.toFixed(1)), e === "1.0" || e === "1.1" || e === "1.2" ? (this.version ? this.version = e : this.options.version = e, delete this.options.schema) : e && typeof e == "string" && (this.options.schema = e), Array.isArray(n) && (this.options.customTags = n);
|
|
2859
2865
|
let r = Object.assign({}, this.getDefaults(), this.options);
|
|
2860
|
-
this.schema = new
|
|
2866
|
+
this.schema = new Ns.Schema(r);
|
|
2861
2867
|
}
|
|
2862
2868
|
parse(e, n) {
|
|
2863
2869
|
this.options.keepCstNodes && (this.cstNode = e), this.options.keepNodeTypes && (this.type = "DOCUMENT");
|
|
2864
2870
|
let { directives: r = [], contents: s = [], directivesEndMarker: i, error: o, valueRange: a } = e;
|
|
2865
|
-
if (o && (o.source || (o.source = this), this.errors.push(o)),
|
|
2871
|
+
if (o && (o.source || (o.source = this), this.errors.push(o)), Aa(this, r, n), i && (this.directivesEndMarker = true), this.range = a ? [a.start, a.end] : null, this.setSchema(), this.anchors._cstAliases = [], ba(this, s), this.anchors.resolveNodes(), this.options.prettyErrors) {
|
|
2866
2872
|
for (let c of this.errors) c instanceof Y.YAMLError && c.makePretty();
|
|
2867
2873
|
for (let c of this.warnings) c instanceof Y.YAMLError && c.makePretty();
|
|
2868
2874
|
}
|
|
2869
2875
|
return this;
|
|
2870
2876
|
}
|
|
2871
2877
|
listNonDefaultTags() {
|
|
2872
|
-
return
|
|
2878
|
+
return wa(this.contents).filter((e) => e.indexOf(Ns.Schema.defaultPrefix) !== 0);
|
|
2873
2879
|
}
|
|
2874
2880
|
setTagPrefix(e, n) {
|
|
2875
2881
|
if (e[0] !== "!" || e[e.length - 1] !== "!") throw new Error("Handle must start and end with !");
|
|
@@ -2879,7 +2885,7 @@ ${o.commentBefore}` : i;
|
|
|
2879
2885
|
} else this.tagPrefixes = this.tagPrefixes.filter((r) => r.handle !== e);
|
|
2880
2886
|
}
|
|
2881
2887
|
toJSON(e, n) {
|
|
2882
|
-
let { keepBlobsInJSON: r, mapAsMap: s, maxAliasCount: i } = this.options, o = r && (typeof e != "string" || !(this.contents instanceof S.Scalar)), a = { doc: this, indentStep: " ", keep: o, mapAsMap: o && !!s, maxAliasCount: i, stringify:
|
|
2888
|
+
let { keepBlobsInJSON: r, mapAsMap: s, maxAliasCount: i } = this.options, o = r && (typeof e != "string" || !(this.contents instanceof S.Scalar)), a = { doc: this, indentStep: " ", keep: o, mapAsMap: o && !!s, maxAliasCount: i, stringify: Kt }, c = Object.keys(this.anchors.map);
|
|
2883
2889
|
c.length > 0 && (a.anchors = new Map(c.map((f) => [this.anchors.map[f], { alias: [], aliasCount: 0, count: 1 }])));
|
|
2884
2890
|
let l = S.toJSON(this.contents, e, a);
|
|
2885
2891
|
if (typeof n == "function" && a.anchors) for (let { count: f, res: m } of a.anchors.values()) n(m, f);
|
|
@@ -2902,117 +2908,147 @@ ${o.commentBefore}` : i;
|
|
|
2902
2908
|
this.tagPrefixes.forEach(({ handle: c, prefix: l }) => {
|
|
2903
2909
|
s.some((f) => f.indexOf(l) === 0) && (n.push(`%TAG ${c} ${l}`), r = true);
|
|
2904
2910
|
}), (r || this.directivesEndMarker) && n.push("---"), this.commentBefore && ((r || !this.directivesEndMarker) && n.unshift(""), n.unshift(this.commentBefore.replace(/^/gm, "#")));
|
|
2905
|
-
let i = { anchors: /* @__PURE__ */ Object.create(null), doc: this, indent: "", indentStep: " ".repeat(e), stringify:
|
|
2911
|
+
let i = { anchors: /* @__PURE__ */ Object.create(null), doc: this, indent: "", indentStep: " ".repeat(e), stringify: Kt }, o = false, a = null;
|
|
2906
2912
|
if (this.contents) {
|
|
2907
2913
|
this.contents instanceof S.Node && (this.contents.spaceBefore && (r || this.directivesEndMarker) && n.push(""), this.contents.commentBefore && n.push(this.contents.commentBefore.replace(/^/gm, "#")), i.forceBlockIndent = !!this.comment, a = this.contents.comment);
|
|
2908
|
-
let c = a ? null : () => o = true, l =
|
|
2914
|
+
let c = a ? null : () => o = true, l = Kt(this.contents, i, () => a = null, c);
|
|
2909
2915
|
n.push(S.addComment(l, "", a));
|
|
2910
|
-
} else this.contents !== void 0 && n.push(
|
|
2916
|
+
} else this.contents !== void 0 && n.push(Kt(this.contents, i));
|
|
2911
2917
|
return this.comment && ((!o || a) && n[n.length - 1] !== "" && n.push(""), n.push(this.comment.replace(/^/gm, "#"))), n.join(`
|
|
2912
2918
|
`) + `
|
|
2913
2919
|
`;
|
|
2914
2920
|
}
|
|
2915
2921
|
};
|
|
2916
|
-
Y._defineProperty(
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2922
|
+
Y._defineProperty(Qt, "defaults", As);
|
|
2923
|
+
Gt.Document = Qt;
|
|
2924
|
+
Gt.defaultOptions = ga;
|
|
2925
|
+
Gt.scalarOptions = ya;
|
|
2920
2926
|
});
|
|
2921
|
-
var
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2927
|
+
var Ms = ne((Cs) => {
|
|
2928
|
+
"use strict";
|
|
2929
|
+
var Qn = Qr(), Ne = Ls(), La = Kn(), Ta = ce(), Ca = qn();
|
|
2930
|
+
De();
|
|
2931
|
+
function Ma(t, e = true, n) {
|
|
2925
2932
|
n === void 0 && typeof e == "string" && (n = e, e = true);
|
|
2926
|
-
let r = Object.assign({},
|
|
2927
|
-
return new
|
|
2933
|
+
let r = Object.assign({}, Ne.Document.defaults[Ne.defaultOptions.version], Ne.defaultOptions);
|
|
2934
|
+
return new La.Schema(r).createNode(t, e, n);
|
|
2928
2935
|
}
|
|
2929
|
-
var
|
|
2936
|
+
var Fe = class extends Ne.Document {
|
|
2930
2937
|
constructor(e) {
|
|
2931
|
-
super(Object.assign({},
|
|
2938
|
+
super(Object.assign({}, Ne.defaultOptions, e));
|
|
2932
2939
|
}
|
|
2933
2940
|
};
|
|
2934
|
-
function
|
|
2941
|
+
function ka(t, e) {
|
|
2935
2942
|
let n = [], r;
|
|
2936
|
-
for (let s of
|
|
2937
|
-
let i = new
|
|
2943
|
+
for (let s of Qn.parse(t)) {
|
|
2944
|
+
let i = new Fe(e);
|
|
2938
2945
|
i.parse(s, r), n.push(i), r = i;
|
|
2939
2946
|
}
|
|
2940
2947
|
return n;
|
|
2941
2948
|
}
|
|
2942
|
-
function
|
|
2943
|
-
let n =
|
|
2949
|
+
function Ts(t, e) {
|
|
2950
|
+
let n = Qn.parse(t), r = new Fe(e).parse(n[0]);
|
|
2944
2951
|
if (n.length > 1) {
|
|
2945
2952
|
let s = "Source contains multiple documents; please use YAML.parseAllDocuments()";
|
|
2946
|
-
r.errors.unshift(new
|
|
2953
|
+
r.errors.unshift(new Ta.YAMLSemanticError(n[1], s));
|
|
2947
2954
|
}
|
|
2948
2955
|
return r;
|
|
2949
2956
|
}
|
|
2950
|
-
function
|
|
2951
|
-
let n =
|
|
2952
|
-
if (n.warnings.forEach((r) =>
|
|
2957
|
+
function Pa(t, e) {
|
|
2958
|
+
let n = Ts(t, e);
|
|
2959
|
+
if (n.warnings.forEach((r) => Ca.warn(r)), n.errors.length > 0) throw n.errors[0];
|
|
2953
2960
|
return n.toJSON();
|
|
2954
2961
|
}
|
|
2955
|
-
function
|
|
2956
|
-
let n = new
|
|
2962
|
+
function va(t, e) {
|
|
2963
|
+
let n = new Fe(e);
|
|
2957
2964
|
return n.contents = t, String(n);
|
|
2958
2965
|
}
|
|
2959
|
-
var
|
|
2960
|
-
|
|
2966
|
+
var Ia = { createNode: Ma, defaultOptions: Ne.defaultOptions, Document: Fe, parse: Pa, parseAllDocuments: ka, parseCST: Qn.parse, parseDocument: Ts, scalarOptions: Ne.scalarOptions, stringify: va };
|
|
2967
|
+
Cs.YAML = Ia;
|
|
2968
|
+
});
|
|
2969
|
+
var Gn = ne((Lf, ks) => {
|
|
2970
|
+
ks.exports = Ms().YAML;
|
|
2961
2971
|
});
|
|
2962
|
-
var
|
|
2963
|
-
|
|
2972
|
+
var Ps = ne((H) => {
|
|
2973
|
+
"use strict";
|
|
2974
|
+
var qe = De(), Ue = ce();
|
|
2975
|
+
H.findPair = qe.findPair;
|
|
2976
|
+
H.parseMap = qe.resolveMap;
|
|
2977
|
+
H.parseSeq = qe.resolveSeq;
|
|
2978
|
+
H.stringifyNumber = qe.stringifyNumber;
|
|
2979
|
+
H.stringifyString = qe.stringifyString;
|
|
2980
|
+
H.toJSON = qe.toJSON;
|
|
2981
|
+
H.Type = Ue.Type;
|
|
2982
|
+
H.YAMLError = Ue.YAMLError;
|
|
2983
|
+
H.YAMLReferenceError = Ue.YAMLReferenceError;
|
|
2984
|
+
H.YAMLSemanticError = Ue.YAMLSemanticError;
|
|
2985
|
+
H.YAMLSyntaxError = Ue.YAMLSyntaxError;
|
|
2986
|
+
H.YAMLWarning = Ue.YAMLWarning;
|
|
2964
2987
|
});
|
|
2965
|
-
var
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
G.Type = Qe.Type;
|
|
2974
|
-
G.YAMLError = Qe.YAMLError;
|
|
2975
|
-
G.YAMLReferenceError = Qe.YAMLReferenceError;
|
|
2976
|
-
G.YAMLSemanticError = Qe.YAMLSemanticError;
|
|
2977
|
-
G.YAMLSyntaxError = Qe.YAMLSyntaxError;
|
|
2978
|
-
G.YAMLWarning = Qe.YAMLWarning;
|
|
2988
|
+
var Ci = {};
|
|
2989
|
+
or(Ci, { __parsePrettierYamlConfig: () => Xa, languages: () => Ur, options: () => Vr, parsers: () => ir, printers: () => Ja });
|
|
2990
|
+
var mt = (t, e) => (n, r, ...s) => n | 1 && r == null ? void 0 : (e.call(r) ?? r[t]).apply(r, s);
|
|
2991
|
+
function Ri(t) {
|
|
2992
|
+
return this[t < 0 ? this.length + t : t];
|
|
2993
|
+
}
|
|
2994
|
+
var Di = mt("at", function() {
|
|
2995
|
+
if (Array.isArray(this) || typeof this == "string") return Ri;
|
|
2979
2996
|
});
|
|
2980
|
-
var
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2997
|
+
var D = Di;
|
|
2998
|
+
var $i = String.prototype.replaceAll ?? function(t, e) {
|
|
2999
|
+
return t.global ? this.replace(t, e) : this.split(t).join(e);
|
|
3000
|
+
};
|
|
3001
|
+
var Yi = mt("replaceAll", function() {
|
|
3002
|
+
if (typeof this == "string") return $i;
|
|
3003
|
+
});
|
|
3004
|
+
var ht = Yi;
|
|
3005
|
+
var Bi = () => {
|
|
3006
|
+
};
|
|
3007
|
+
var je = Bi;
|
|
3008
|
+
var Qe = "string";
|
|
3009
|
+
var Ge = "array";
|
|
3010
|
+
var dt = "cursor";
|
|
3011
|
+
var gt = "indent";
|
|
3012
|
+
var Ae = "align";
|
|
3013
|
+
var yt = "trim";
|
|
3014
|
+
var Le = "group";
|
|
3015
|
+
var Te = "fill";
|
|
3016
|
+
var Ce = "if-break";
|
|
3017
|
+
var Et = "indent-if-break";
|
|
3018
|
+
var Me = "line-suffix";
|
|
3019
|
+
var St = "line-suffix-boundary";
|
|
3020
|
+
var re = "line";
|
|
3021
|
+
var wt = "label";
|
|
3022
|
+
var ke = "break-parent";
|
|
3023
|
+
var bt = /* @__PURE__ */ new Set([dt, gt, Ae, yt, Le, Te, Ce, Et, Me, St, re, wt, ke]);
|
|
3024
|
+
function Fi(t) {
|
|
3025
|
+
if (typeof t == "string") return Qe;
|
|
3026
|
+
if (Array.isArray(t)) return Ge;
|
|
2992
3027
|
if (!t) return;
|
|
2993
3028
|
let { type: e } = t;
|
|
2994
|
-
if (
|
|
3029
|
+
if (bt.has(e)) return e;
|
|
2995
3030
|
}
|
|
2996
|
-
var
|
|
2997
|
-
var
|
|
2998
|
-
function
|
|
3031
|
+
var Nt = Fi;
|
|
3032
|
+
var qi = (t) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(t);
|
|
3033
|
+
function Ui(t) {
|
|
2999
3034
|
let e = t === null ? "null" : typeof t;
|
|
3000
3035
|
if (e !== "string" && e !== "object") return `Unexpected doc '${e}',
|
|
3001
3036
|
Expected it to be 'string' or 'object'.`;
|
|
3002
|
-
if (
|
|
3037
|
+
if (Nt(t)) throw new Error("doc is valid.");
|
|
3003
3038
|
let n = Object.prototype.toString.call(t);
|
|
3004
3039
|
if (n !== "[object Object]") return `Unexpected doc '${n}'.`;
|
|
3005
|
-
let r =
|
|
3040
|
+
let r = qi([...bt].map((s) => `'${s}'`));
|
|
3006
3041
|
return `Unexpected doc.type '${t.type}'.
|
|
3007
3042
|
Expected it to be ${r}.`;
|
|
3008
3043
|
}
|
|
3009
|
-
var
|
|
3044
|
+
var an = class extends Error {
|
|
3010
3045
|
name = "InvalidDocError";
|
|
3011
3046
|
constructor(e) {
|
|
3012
|
-
super(
|
|
3047
|
+
super(Ui(e)), this.doc = e;
|
|
3013
3048
|
}
|
|
3014
|
-
}
|
|
3015
|
-
|
|
3049
|
+
};
|
|
3050
|
+
var ar = an;
|
|
3051
|
+
function Vi(t, e) {
|
|
3016
3052
|
if (typeof t == "string") return e(t);
|
|
3017
3053
|
let n = /* @__PURE__ */ new Map();
|
|
3018
3054
|
return r(t);
|
|
@@ -3022,78 +3058,86 @@ function Ji(t, e) {
|
|
|
3022
3058
|
return n.set(i, o), o;
|
|
3023
3059
|
}
|
|
3024
3060
|
function s(i) {
|
|
3025
|
-
switch (
|
|
3026
|
-
case
|
|
3061
|
+
switch (Nt(i)) {
|
|
3062
|
+
case Ge:
|
|
3027
3063
|
return e(i.map(r));
|
|
3028
|
-
case
|
|
3064
|
+
case Te:
|
|
3029
3065
|
return e({ ...i, parts: i.parts.map(r) });
|
|
3030
|
-
case
|
|
3066
|
+
case Ce:
|
|
3031
3067
|
return e({ ...i, breakContents: r(i.breakContents), flatContents: r(i.flatContents) });
|
|
3032
|
-
case
|
|
3068
|
+
case Le: {
|
|
3033
3069
|
let { expandedStates: o, contents: a } = i;
|
|
3034
3070
|
return o ? (o = o.map(r), a = o[0]) : a = r(a), e({ ...i, contents: a, expandedStates: o });
|
|
3035
3071
|
}
|
|
3036
|
-
case
|
|
3037
|
-
case
|
|
3038
|
-
case
|
|
3039
|
-
case
|
|
3040
|
-
case Ie:
|
|
3041
|
-
return e({ ...i, contents: r(i.contents) });
|
|
3072
|
+
case Ae:
|
|
3073
|
+
case gt:
|
|
3074
|
+
case Et:
|
|
3075
|
+
case wt:
|
|
3042
3076
|
case Me:
|
|
3043
|
-
|
|
3044
|
-
case
|
|
3045
|
-
case
|
|
3046
|
-
case
|
|
3047
|
-
case
|
|
3077
|
+
return e({ ...i, contents: r(i.contents) });
|
|
3078
|
+
case Qe:
|
|
3079
|
+
case dt:
|
|
3080
|
+
case yt:
|
|
3081
|
+
case St:
|
|
3082
|
+
case re:
|
|
3083
|
+
case ke:
|
|
3048
3084
|
return e(i);
|
|
3049
3085
|
default:
|
|
3050
|
-
throw new
|
|
3086
|
+
throw new ar(i);
|
|
3051
3087
|
}
|
|
3052
3088
|
}
|
|
3053
3089
|
}
|
|
3054
|
-
function
|
|
3055
|
-
return
|
|
3090
|
+
function cr(t, e = He) {
|
|
3091
|
+
return Vi(t, (n) => typeof n == "string" ? v(e, n.split(`
|
|
3056
3092
|
`)) : n);
|
|
3057
3093
|
}
|
|
3058
|
-
var
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
return gn(e.expandedStates), { type: ke, id: e.id, contents: t, break: !!e.shouldBreak, expandedStates: e.expandedStates };
|
|
3094
|
+
var Z = je;
|
|
3095
|
+
var Ot = je;
|
|
3096
|
+
var lr = je;
|
|
3097
|
+
var fr = je;
|
|
3098
|
+
function Je(t, e) {
|
|
3099
|
+
return fr(t), Z(e), { type: Ae, contents: e, n: t };
|
|
3065
3100
|
}
|
|
3066
|
-
function
|
|
3067
|
-
return
|
|
3101
|
+
function cn(t) {
|
|
3102
|
+
return Je(Number.NEGATIVE_INFINITY, t);
|
|
3068
3103
|
}
|
|
3069
|
-
function
|
|
3070
|
-
return
|
|
3104
|
+
function ur(t) {
|
|
3105
|
+
return Je({ type: "root" }, t);
|
|
3071
3106
|
}
|
|
3072
|
-
function
|
|
3073
|
-
return
|
|
3107
|
+
function pr(t) {
|
|
3108
|
+
return Je(-1, t);
|
|
3074
3109
|
}
|
|
3075
|
-
|
|
3076
|
-
|
|
3110
|
+
var Xe = { type: ke };
|
|
3111
|
+
function At(t) {
|
|
3112
|
+
return lr(t), { type: Te, parts: t };
|
|
3077
3113
|
}
|
|
3078
|
-
function
|
|
3079
|
-
return { type:
|
|
3114
|
+
function Pe(t, e = {}) {
|
|
3115
|
+
return Z(t), Ot(e.expandedStates, true), { type: Le, id: e.id, contents: t, break: !!e.shouldBreak, expandedStates: e.expandedStates };
|
|
3080
3116
|
}
|
|
3081
|
-
function
|
|
3082
|
-
return
|
|
3117
|
+
function ln(t, e) {
|
|
3118
|
+
return Pe(t[0], { ...e, expandedStates: t });
|
|
3083
3119
|
}
|
|
3084
|
-
function
|
|
3085
|
-
return { type:
|
|
3120
|
+
function ze(t, e = "", n = {}) {
|
|
3121
|
+
return Z(t), e !== "" && Z(e), { type: Ce, breakContents: t, flatContents: e, groupId: n.groupId };
|
|
3086
3122
|
}
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
function P(t, e) {
|
|
3123
|
+
function v(t, e) {
|
|
3124
|
+
Z(t), Ot(e);
|
|
3090
3125
|
let n = [];
|
|
3091
3126
|
for (let r = 0; r < e.length; r++) r !== 0 && n.push(t), n.push(e[r]);
|
|
3092
3127
|
return n;
|
|
3093
3128
|
}
|
|
3094
|
-
|
|
3129
|
+
var se = { type: re };
|
|
3130
|
+
var Lt = { type: re, soft: true };
|
|
3131
|
+
var Wi = { type: re, hard: true };
|
|
3132
|
+
var N = [Wi, Xe];
|
|
3133
|
+
var Ki = { type: re, hard: true, literal: true };
|
|
3134
|
+
var He = [Ki, Xe];
|
|
3135
|
+
function mr(t) {
|
|
3136
|
+
return Z(t), { type: Me, contents: t };
|
|
3137
|
+
}
|
|
3138
|
+
function Tt(t) {
|
|
3095
3139
|
return (e, n, r) => {
|
|
3096
|
-
let s = !!
|
|
3140
|
+
let s = !!r?.backwards;
|
|
3097
3141
|
if (n === false) return false;
|
|
3098
3142
|
let { length: i } = e, o = n;
|
|
3099
3143
|
for (; o >= 0 && o < i; ) {
|
|
@@ -3106,62 +3150,92 @@ function kt(t) {
|
|
|
3106
3150
|
return o === -1 || o === i ? o : false;
|
|
3107
3151
|
};
|
|
3108
3152
|
}
|
|
3109
|
-
var
|
|
3110
|
-
|
|
3111
|
-
|
|
3153
|
+
var sl = Tt(/\s/u);
|
|
3154
|
+
var fn = Tt(" ");
|
|
3155
|
+
var il = Tt(",; ");
|
|
3156
|
+
var ol = Tt(/[^\n\r]/u);
|
|
3157
|
+
var hr = (t) => t === `
|
|
3158
|
+
` || t === "\r" || t === "\u2028" || t === "\u2029";
|
|
3159
|
+
function ji(t, e, n) {
|
|
3160
|
+
let r = !!n?.backwards;
|
|
3112
3161
|
if (e === false) return false;
|
|
3113
3162
|
let s = t.charAt(e);
|
|
3114
3163
|
if (r) {
|
|
3115
3164
|
if (t.charAt(e - 1) === "\r" && s === `
|
|
3116
3165
|
`) return e - 2;
|
|
3117
|
-
if (s
|
|
3118
|
-
` || s === "\r" || s === "\u2028" || s === "\u2029") return e - 1;
|
|
3166
|
+
if (hr(s)) return e - 1;
|
|
3119
3167
|
} else {
|
|
3120
3168
|
if (s === "\r" && t.charAt(e + 1) === `
|
|
3121
3169
|
`) return e + 2;
|
|
3122
|
-
if (s
|
|
3123
|
-
` || s === "\r" || s === "\u2028" || s === "\u2029") return e + 1;
|
|
3170
|
+
if (hr(s)) return e + 1;
|
|
3124
3171
|
}
|
|
3125
3172
|
return e;
|
|
3126
3173
|
}
|
|
3127
|
-
var
|
|
3128
|
-
function
|
|
3174
|
+
var un = ji;
|
|
3175
|
+
function Qi(t, e) {
|
|
3129
3176
|
let n = e - 1;
|
|
3130
|
-
n =
|
|
3131
|
-
let r =
|
|
3177
|
+
n = fn(t, n, { backwards: true }), n = un(t, n, { backwards: true }), n = fn(t, n, { backwards: true });
|
|
3178
|
+
let r = un(t, n, { backwards: true });
|
|
3132
3179
|
return n !== r;
|
|
3133
3180
|
}
|
|
3134
|
-
var
|
|
3135
|
-
var
|
|
3181
|
+
var pn = Qi;
|
|
3182
|
+
var mn = class extends Error {
|
|
3136
3183
|
name = "UnexpectedNodeError";
|
|
3137
3184
|
constructor(e, n, r = "type") {
|
|
3138
3185
|
super(`Unexpected ${n} node ${r}: ${JSON.stringify(e[r])}.`), this.node = e;
|
|
3139
3186
|
}
|
|
3140
|
-
}
|
|
3141
|
-
|
|
3187
|
+
};
|
|
3188
|
+
var dr = mn;
|
|
3189
|
+
var gr = "format";
|
|
3190
|
+
var yr = /^\s*#[^\S\n]*@(?:noformat|noprettier)\s*?(?:\n|$)/u;
|
|
3191
|
+
var Er = /^\s*#[^\S\n]*@(?:format|prettier)\s*?(?:\n|$)/u;
|
|
3192
|
+
var Sr = /^\s*@(?:format|prettier)\s*$/u;
|
|
3193
|
+
var wr = (t) => Sr.test(t);
|
|
3194
|
+
var br = (t) => Er.test(t);
|
|
3195
|
+
var Nr = (t) => yr.test(t);
|
|
3196
|
+
var Or = (t) => `# @${gr}
|
|
3197
|
+
|
|
3198
|
+
${t}`;
|
|
3199
|
+
function Ar(t, e) {
|
|
3200
|
+
switch (t.type) {
|
|
3201
|
+
case "comment":
|
|
3202
|
+
if (wr(t.value)) return null;
|
|
3203
|
+
break;
|
|
3204
|
+
case "quoteDouble":
|
|
3205
|
+
case "quoteSingle":
|
|
3206
|
+
e.type = "quote";
|
|
3207
|
+
break;
|
|
3208
|
+
case "document":
|
|
3209
|
+
e.directivesEndMarker || delete e.directivesEndMarker, e.documentEndMarker || delete e.documentEndMarker;
|
|
3210
|
+
break;
|
|
3211
|
+
}
|
|
3212
|
+
}
|
|
3213
|
+
Ar.ignoredProperties = /* @__PURE__ */ new Set(["position"]);
|
|
3214
|
+
var Lr = Ar;
|
|
3215
|
+
function Tr(t, e) {
|
|
3142
3216
|
let { node: n } = t;
|
|
3143
3217
|
if (n.type === "root" && e.filepath && /(?:[/\\]|^)\.(?:prettier|stylelint|lintstaged)rc$/u.test(e.filepath)) return async (r) => {
|
|
3144
3218
|
let s = await r(e.originalText, { parser: "json" });
|
|
3145
3219
|
return s ? [s, N] : void 0;
|
|
3146
3220
|
};
|
|
3147
3221
|
}
|
|
3148
|
-
|
|
3149
|
-
var
|
|
3150
|
-
var
|
|
3151
|
-
function
|
|
3152
|
-
if (
|
|
3153
|
-
let e =
|
|
3154
|
-
return
|
|
3222
|
+
Tr.getVisitorKeys = () => [];
|
|
3223
|
+
var Cr = Tr;
|
|
3224
|
+
var Ze = null;
|
|
3225
|
+
function et(t) {
|
|
3226
|
+
if (Ze !== null && typeof Ze.property) {
|
|
3227
|
+
let e = Ze;
|
|
3228
|
+
return Ze = et.prototype = null, e;
|
|
3155
3229
|
}
|
|
3156
|
-
return
|
|
3230
|
+
return Ze = et.prototype = t ?? /* @__PURE__ */ Object.create(null), new et();
|
|
3157
3231
|
}
|
|
3158
|
-
var
|
|
3159
|
-
for (let t = 0; t <=
|
|
3160
|
-
function
|
|
3161
|
-
return
|
|
3232
|
+
var Gi = 10;
|
|
3233
|
+
for (let t = 0; t <= Gi; t++) et();
|
|
3234
|
+
function hn(t) {
|
|
3235
|
+
return et(t);
|
|
3162
3236
|
}
|
|
3163
|
-
function
|
|
3164
|
-
|
|
3237
|
+
function Hi(t, e = "type") {
|
|
3238
|
+
hn(t);
|
|
3165
3239
|
function n(r) {
|
|
3166
3240
|
let s = r[e], i = t[s];
|
|
3167
3241
|
if (!Array.isArray(i)) throw Object.assign(new Error(`Missing visitor keys for '${s}'.`), { node: r });
|
|
@@ -3169,45 +3243,27 @@ function no(t, e = "type") {
|
|
|
3169
3243
|
}
|
|
3170
3244
|
return n;
|
|
3171
3245
|
}
|
|
3172
|
-
var Mr =
|
|
3173
|
-
var
|
|
3174
|
-
var
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
}
|
|
3181
|
-
var Ir = "format";
|
|
3182
|
-
var vr = /^\s*#[^\S\n]*@(?:noformat|noprettier)\s*?(?:\n|$)/u, _r = /^\s*#[^\S\n]*@(?:format|prettier)\s*?(?:\n|$)/u, Rr = /^\s*@(?:format|prettier)\s*$/u;
|
|
3183
|
-
function xr(t) {
|
|
3184
|
-
return Rr.test(t);
|
|
3185
|
-
}
|
|
3186
|
-
function Dr(t) {
|
|
3187
|
-
return _r.test(t);
|
|
3188
|
-
}
|
|
3189
|
-
function Yr(t) {
|
|
3190
|
-
return vr.test(t);
|
|
3191
|
-
}
|
|
3192
|
-
function $r(t) {
|
|
3193
|
-
return `# @${Ir}
|
|
3194
|
-
|
|
3195
|
-
${t}`;
|
|
3196
|
-
}
|
|
3197
|
-
function io(t) {
|
|
3246
|
+
var Mr = Hi;
|
|
3247
|
+
var k = [["children", "anchor", "tag", "indicatorComment", "leadingComments", "middleComments", "trailingComment", "endComments"], ["anchor", "tag", "indicatorComment", "leadingComments", "middleComments", "trailingComment", "endComments"], ["key", "value", "children", "anchor", "tag", "indicatorComment", "leadingComments", "middleComments", "trailingComment", "endComments"], ["content", "children", "anchor", "tag", "indicatorComment", "leadingComments", "middleComments", "trailingComment", "endComments"], ["indicatorComment", "leadingComments", "middleComments", "trailingComment", "endComments"]];
|
|
3248
|
+
var kr = { root: k[0], document: ["head", "body", "children", "anchor", "tag", "indicatorComment", "leadingComments", "middleComments", "trailingComment", "endComments"], documentHead: k[0], documentBody: k[0], directive: k[1], alias: k[1], blockLiteral: k[1], blockFolded: k[0], plain: k[0], quoteSingle: k[1], quoteDouble: k[1], mapping: k[0], mappingItem: k[2], mappingKey: k[3], mappingValue: k[3], sequence: k[0], sequenceItem: k[3], flowMapping: k[0], flowMappingItem: k[2], flowSequence: k[0], flowSequenceItem: k[3], comment: k[1], tag: k[4], anchor: k[4] };
|
|
3249
|
+
var Ji = Mr(kr);
|
|
3250
|
+
var Pr = Ji;
|
|
3251
|
+
var tt = (t) => t.position.start.offset;
|
|
3252
|
+
var vr = (t) => t.position.end.offset;
|
|
3253
|
+
function Xi(t) {
|
|
3198
3254
|
return Array.isArray(t) && t.length > 0;
|
|
3199
3255
|
}
|
|
3200
|
-
var
|
|
3201
|
-
function
|
|
3202
|
-
return typeof
|
|
3256
|
+
var ve = Xi;
|
|
3257
|
+
function W(t, e) {
|
|
3258
|
+
return typeof t?.type == "string" && e.includes(t.type);
|
|
3203
3259
|
}
|
|
3204
|
-
function
|
|
3205
|
-
return e("children" in t ? { ...t, children: t.children.map((r) =>
|
|
3260
|
+
function dn(t, e, n) {
|
|
3261
|
+
return e("children" in t ? { ...t, children: t.children.map((r) => dn(r, e, t)) } : t, n);
|
|
3206
3262
|
}
|
|
3207
|
-
function
|
|
3263
|
+
function Ie(t, e, n) {
|
|
3208
3264
|
Object.defineProperty(t, e, { get: n, enumerable: false });
|
|
3209
3265
|
}
|
|
3210
|
-
function
|
|
3266
|
+
function _r(t, e) {
|
|
3211
3267
|
let n = 0, r = e.length;
|
|
3212
3268
|
for (let s = t.position.end.offset - 1; s < r; s++) {
|
|
3213
3269
|
let i = e[s];
|
|
@@ -3217,7 +3273,7 @@ function Fr(t, e) {
|
|
|
3217
3273
|
}
|
|
3218
3274
|
return false;
|
|
3219
3275
|
}
|
|
3220
|
-
function
|
|
3276
|
+
function Ct(t) {
|
|
3221
3277
|
let { node: e } = t;
|
|
3222
3278
|
switch (e.type) {
|
|
3223
3279
|
case "tag":
|
|
@@ -3232,69 +3288,82 @@ function Pt(t) {
|
|
|
3232
3288
|
}
|
|
3233
3289
|
return true;
|
|
3234
3290
|
}
|
|
3235
|
-
function
|
|
3236
|
-
return
|
|
3291
|
+
function Mt(t) {
|
|
3292
|
+
return ve(t.children) ? Mt(D(0, t.children, -1)) : t;
|
|
3237
3293
|
}
|
|
3238
|
-
function
|
|
3294
|
+
function Ir(t) {
|
|
3239
3295
|
return t.value.trim() === "prettier-ignore";
|
|
3240
3296
|
}
|
|
3241
|
-
function
|
|
3297
|
+
function xr(t) {
|
|
3242
3298
|
let { node: e } = t;
|
|
3243
3299
|
if (e.type === "documentBody") {
|
|
3244
3300
|
let n = t.parent.head;
|
|
3245
|
-
return I(n) &&
|
|
3301
|
+
return I(n) && Ir(D(0, n.endComments, -1));
|
|
3246
3302
|
}
|
|
3247
|
-
return
|
|
3303
|
+
return te(e) && Ir(D(0, e.leadingComments, -1));
|
|
3248
3304
|
}
|
|
3249
|
-
function
|
|
3250
|
-
return !
|
|
3305
|
+
function _e(t) {
|
|
3306
|
+
return !ve(t.children) && !zi(t);
|
|
3251
3307
|
}
|
|
3252
|
-
function
|
|
3253
|
-
return
|
|
3308
|
+
function zi(t) {
|
|
3309
|
+
return te(t) || ae(t) || gn(t) || K(t) || I(t);
|
|
3254
3310
|
}
|
|
3255
|
-
function
|
|
3256
|
-
return
|
|
3311
|
+
function te(t) {
|
|
3312
|
+
return ve(t?.leadingComments);
|
|
3257
3313
|
}
|
|
3258
|
-
function
|
|
3259
|
-
return
|
|
3314
|
+
function ae(t) {
|
|
3315
|
+
return ve(t?.middleComments);
|
|
3260
3316
|
}
|
|
3261
|
-
function
|
|
3262
|
-
return t
|
|
3317
|
+
function gn(t) {
|
|
3318
|
+
return t?.indicatorComment;
|
|
3263
3319
|
}
|
|
3264
|
-
function
|
|
3265
|
-
return t
|
|
3320
|
+
function K(t) {
|
|
3321
|
+
return t?.trailingComment;
|
|
3266
3322
|
}
|
|
3267
3323
|
function I(t) {
|
|
3268
|
-
return
|
|
3324
|
+
return ve(t?.endComments);
|
|
3269
3325
|
}
|
|
3270
|
-
function
|
|
3271
|
-
|
|
3272
|
-
for (let r of t.split(/( +)/u)) r !== " " ? n === " " ? e.push(r) : e.push((e.pop() || "") + r) : n === void 0 && e.unshift(""), n = r;
|
|
3273
|
-
return n === " " && e.push((e.pop() || "") + " "), e[0] === "" && (e.shift(), e.unshift(" " + (e.shift() || ""))), e;
|
|
3326
|
+
function Rr(t) {
|
|
3327
|
+
return t ? t.split(/(?<!^| ) (?! |$)/u) : [];
|
|
3274
3328
|
}
|
|
3275
|
-
function
|
|
3329
|
+
function Dr(t, e, n) {
|
|
3276
3330
|
let r = e.split(`
|
|
3277
|
-
`).map((
|
|
3278
|
-
|
|
3331
|
+
`).map((i, o, a) => o === 0 && o === a.length - 1 ? i : o !== 0 && o !== a.length - 1 ? i.trim() : o === 0 ? i.trimEnd() : i.trimStart());
|
|
3332
|
+
if (n.proseWrap === "preserve") return r.map((i) => i ? [i] : []);
|
|
3333
|
+
let s = [];
|
|
3334
|
+
for (let [i, o] of r.entries()) {
|
|
3335
|
+
let a = Rr(o);
|
|
3336
|
+
i > 0 && r[i - 1].length > 0 && a.length > 0 && !(t === "quoteDouble" && D(0, D(0, s, -1), -1).endsWith("\\")) ? s[s.length - 1] = [...D(0, s, -1), ...a] : s.push(a);
|
|
3337
|
+
}
|
|
3338
|
+
return n.proseWrap === "never" ? s.map((i) => [i.join(" ")]) : s;
|
|
3279
3339
|
}
|
|
3280
|
-
function
|
|
3340
|
+
function $r(t, { parentIndent: e, isLastDescendant: n, options: r }) {
|
|
3281
3341
|
let s = t.position.start.line === t.position.end.line ? "" : r.originalText.slice(t.position.start.offset, t.position.end.offset).match(/^[^\n]*\n(.*)$/su)[1], i;
|
|
3282
3342
|
if (t.indent === null) {
|
|
3283
|
-
let
|
|
3284
|
-
i =
|
|
3343
|
+
let l = s.match(/^(?<leadingSpace> *)[^\n\r ]/mu);
|
|
3344
|
+
i = l ? l.groups.leadingSpace.length : Number.POSITIVE_INFINITY;
|
|
3285
3345
|
} else i = t.indent - 1 + e;
|
|
3286
3346
|
let o = s.split(`
|
|
3287
|
-
`).map((
|
|
3288
|
-
if (r.proseWrap === "preserve" || t.type === "blockLiteral") return
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3347
|
+
`).map((l) => l.slice(i));
|
|
3348
|
+
if (r.proseWrap === "preserve" || t.type === "blockLiteral") return c(o.map((l) => l ? [l] : []));
|
|
3349
|
+
let a = [];
|
|
3350
|
+
for (let [l, f] of o.entries()) {
|
|
3351
|
+
let m = Rr(f);
|
|
3352
|
+
l > 0 && m.length > 0 && o[l - 1].length > 0 && !/^\s/u.test(m[0]) && !/^\s|\s$/u.test(D(0, a, -1)) ? a[a.length - 1] = [...D(0, a, -1), ...m] : a.push(m);
|
|
3353
|
+
}
|
|
3354
|
+
return a = a.map((l) => {
|
|
3355
|
+
let f = [];
|
|
3356
|
+
for (let m of l) f.length > 0 && /\s$/u.test(D(0, f, -1)) ? f[f.length - 1] += " " + m : f.push(m);
|
|
3357
|
+
return f;
|
|
3358
|
+
}), r.proseWrap === "never" && (a = a.map((l) => [l.join(" ")])), c(a);
|
|
3359
|
+
function c(l) {
|
|
3360
|
+
if (t.chomping === "keep") return D(0, l, -1).length === 0 ? l.slice(0, -1) : l;
|
|
3361
|
+
let f = 0;
|
|
3362
|
+
for (let m = l.length - 1; m >= 0 && l[m].length === 0; m--) f++;
|
|
3363
|
+
return f === 0 ? l : f >= 2 && !n ? l.slice(0, -(f - 1)) : l.slice(0, -f);
|
|
3295
3364
|
}
|
|
3296
3365
|
}
|
|
3297
|
-
function
|
|
3366
|
+
function nt(t) {
|
|
3298
3367
|
if (!t) return true;
|
|
3299
3368
|
switch (t.type) {
|
|
3300
3369
|
case "plain":
|
|
@@ -3308,50 +3377,49 @@ function ft(t) {
|
|
|
3308
3377
|
return false;
|
|
3309
3378
|
}
|
|
3310
3379
|
}
|
|
3311
|
-
var
|
|
3312
|
-
function
|
|
3380
|
+
var yn = /* @__PURE__ */ new WeakMap();
|
|
3381
|
+
function kt(t, e) {
|
|
3313
3382
|
let { node: n, root: r } = t, s;
|
|
3314
|
-
return
|
|
3383
|
+
return yn.has(r) ? s = yn.get(r) : (s = /* @__PURE__ */ new Set(), yn.set(r, s)), !s.has(n.position.end.line) && (s.add(n.position.end.line), _r(n, e) && !En(t.parent)) ? Lt : "";
|
|
3315
3384
|
}
|
|
3316
|
-
function
|
|
3317
|
-
return I(t) && !
|
|
3385
|
+
function En(t) {
|
|
3386
|
+
return I(t) && !W(t, ["documentHead", "documentBody", "flowMapping", "flowSequence"]);
|
|
3318
3387
|
}
|
|
3319
|
-
function
|
|
3320
|
-
return
|
|
3388
|
+
function _(t, e) {
|
|
3389
|
+
return Je(" ".repeat(t), e);
|
|
3321
3390
|
}
|
|
3322
|
-
function
|
|
3323
|
-
let { node: r } = t, s = t.ancestors.filter((l) => l.type === "sequence" || l.type === "mapping").length, i =
|
|
3324
|
-
r.indent !== null && o.push(r.indent.toString()), r.chomping !== "clip" && o.push(r.chomping === "keep" ? "+" : "-"),
|
|
3325
|
-
let a =
|
|
3326
|
-
for (let [l, f] of a.entries()) l === 0 && c.push(N), c.push(
|
|
3327
|
-
return r.indent === null ? o.push(
|
|
3328
|
-
}
|
|
3329
|
-
var
|
|
3330
|
-
function
|
|
3331
|
-
let { node: r } = t, s = r.type === "flowMapping", i = s ? "{" : "[", o = s ? "}" : "]", a =
|
|
3332
|
-
s && r.children.length > 0 && e.bracketSpacing && (a =
|
|
3333
|
-
let c =
|
|
3334
|
-
return [i,
|
|
3335
|
-
}
|
|
3336
|
-
function
|
|
3337
|
-
return t.map(({ isLast: r, node: s, next: i }) => [n(), r ? "" : [",",
|
|
3338
|
-
}
|
|
3339
|
-
function
|
|
3340
|
-
|
|
3341
|
-
let { node: r, parent: s } = t, { key: i, value: o } = r, a = $e(i), c = $e(o);
|
|
3391
|
+
function Zi(t, e, n) {
|
|
3392
|
+
let { node: r } = t, s = t.ancestors.filter((l) => l.type === "sequence" || l.type === "mapping").length, i = Ct(t), o = [r.type === "blockFolded" ? ">" : "|"];
|
|
3393
|
+
r.indent !== null && o.push(r.indent.toString()), r.chomping !== "clip" && o.push(r.chomping === "keep" ? "+" : "-"), gn(r) && o.push(" ", n("indicatorComment"));
|
|
3394
|
+
let a = $r(r, { parentIndent: s, isLastDescendant: i, options: e }), c = [];
|
|
3395
|
+
for (let [l, f] of a.entries()) l === 0 && c.push(N), c.push(At(v(se, f))), l !== a.length - 1 ? c.push(f.length === 0 ? N : ur(He)) : r.chomping === "keep" && i && c.push(cn(f.length === 0 ? N : He));
|
|
3396
|
+
return r.indent === null ? o.push(pr(_(e.tabWidth, c))) : o.push(cn(_(r.indent - 1 + s, c))), o;
|
|
3397
|
+
}
|
|
3398
|
+
var Yr = Zi;
|
|
3399
|
+
function Pt(t, e, n) {
|
|
3400
|
+
let { node: r } = t, s = r.type === "flowMapping", i = s ? "{" : "[", o = s ? "}" : "]", a = Lt;
|
|
3401
|
+
s && r.children.length > 0 && e.bracketSpacing && (a = se);
|
|
3402
|
+
let c = D(0, r.children, -1), l = c?.type === "flowMappingItem" && _e(c.key) && _e(c.value);
|
|
3403
|
+
return [i, _(e.tabWidth, [a, eo(t, e, n), e.trailingComma === "none" ? "" : ze(","), I(r) ? [N, v(N, t.map(n, "endComments"))] : ""]), l ? "" : a, o];
|
|
3404
|
+
}
|
|
3405
|
+
function eo(t, e, n) {
|
|
3406
|
+
return t.map(({ isLast: r, node: s, next: i }) => [n(), r ? "" : [",", se, s.position.start.line !== i.position.start.line ? kt(t, e.originalText) : ""]], "children");
|
|
3407
|
+
}
|
|
3408
|
+
function to(t, e, n) {
|
|
3409
|
+
let { node: r, parent: s } = t, { key: i, value: o } = r, a = _e(i), c = _e(o);
|
|
3342
3410
|
if (a && c) return ": ";
|
|
3343
|
-
let l = n("key"), f =
|
|
3344
|
-
if (c) return r.type === "flowMappingItem" && s.type === "flowMapping" ? l : r.type === "mappingItem" &&
|
|
3411
|
+
let l = n("key"), f = no(r) ? " " : "";
|
|
3412
|
+
if (c) return r.type === "flowMappingItem" && s.type === "flowMapping" ? l : r.type === "mappingItem" && Sn(i.content, e) && !K(i.content) && s.tag?.value !== "tag:yaml.org,2002:set" ? [l, f, ":"] : ["? ", _(2, l)];
|
|
3345
3413
|
let m = n("value");
|
|
3346
|
-
if (a) return [": ",
|
|
3347
|
-
if (
|
|
3348
|
-
if (
|
|
3349
|
-
let
|
|
3350
|
-
I(o) && o.content &&
|
|
3351
|
-
let w =
|
|
3352
|
-
return
|
|
3353
|
-
}
|
|
3354
|
-
function
|
|
3414
|
+
if (a) return [": ", _(2, m)];
|
|
3415
|
+
if (te(o) || !nt(i.content)) return ["? ", _(2, l), N, ...t.map(() => [n(), N], "value", "leadingComments"), ": ", _(2, m)];
|
|
3416
|
+
if (ro(i.content) && !te(i.content) && !ae(i.content) && !K(i.content) && !I(i) && !te(o.content) && !ae(o.content) && !I(o) && Sn(o.content, e)) return [l, f, ": ", m];
|
|
3417
|
+
let g = /* @__PURE__ */ Symbol("mappingKey"), y = Pe([ze("? "), Pe(_(2, l), { id: g })]), h = [N, ": ", _(2, m)], d = [f, ":"];
|
|
3418
|
+
I(o) && o.content && W(o.content, ["flowMapping", "flowSequence"]) && o.content.children.length === 0 ? d.push(" ") : te(o.content) || I(o) && o.content && !W(o.content, ["mapping", "sequence"]) || s.type === "mapping" && K(i.content) && nt(o.content) || W(o.content, ["mapping", "sequence"]) && o.content.tag === null && o.content.anchor === null ? d.push(N) : o.content ? d.push(se) : K(o) && d.push(" "), d.push(m);
|
|
3419
|
+
let w = _(e.tabWidth, d);
|
|
3420
|
+
return Sn(i.content, e) && !te(i.content) && !ae(i.content) && !K(i.content) && !I(i) ? ln([[l, w]]) : ln([[y, ze(h, w, { groupId: g })]]);
|
|
3421
|
+
}
|
|
3422
|
+
function Sn(t, e) {
|
|
3355
3423
|
if (!t) return true;
|
|
3356
3424
|
switch (t.type) {
|
|
3357
3425
|
case "plain":
|
|
@@ -3375,11 +3443,10 @@ function Tn(t, e) {
|
|
|
3375
3443
|
return false;
|
|
3376
3444
|
}
|
|
3377
3445
|
}
|
|
3378
|
-
function
|
|
3379
|
-
|
|
3380
|
-
return ((e = t.key.content) == null ? void 0 : e.type) === "alias";
|
|
3446
|
+
function no(t) {
|
|
3447
|
+
return t.key.content?.type === "alias";
|
|
3381
3448
|
}
|
|
3382
|
-
function
|
|
3449
|
+
function ro(t) {
|
|
3383
3450
|
if (!t) return true;
|
|
3384
3451
|
switch (t.type) {
|
|
3385
3452
|
case "plain":
|
|
@@ -3392,65 +3459,67 @@ function uo(t) {
|
|
|
3392
3459
|
return false;
|
|
3393
3460
|
}
|
|
3394
3461
|
}
|
|
3395
|
-
var
|
|
3396
|
-
function
|
|
3397
|
-
return
|
|
3462
|
+
var Br = to;
|
|
3463
|
+
function so(t) {
|
|
3464
|
+
return dn(t, io);
|
|
3398
3465
|
}
|
|
3399
|
-
function
|
|
3466
|
+
function io(t) {
|
|
3400
3467
|
switch (t.type) {
|
|
3401
3468
|
case "document":
|
|
3402
|
-
|
|
3469
|
+
Ie(t, "head", () => t.children[0]), Ie(t, "body", () => t.children[1]);
|
|
3403
3470
|
break;
|
|
3404
3471
|
case "documentBody":
|
|
3405
3472
|
case "sequenceItem":
|
|
3406
3473
|
case "flowSequenceItem":
|
|
3407
3474
|
case "mappingKey":
|
|
3408
3475
|
case "mappingValue":
|
|
3409
|
-
|
|
3476
|
+
Ie(t, "content", () => t.children[0]);
|
|
3410
3477
|
break;
|
|
3411
3478
|
case "mappingItem":
|
|
3412
3479
|
case "flowMappingItem":
|
|
3413
|
-
|
|
3480
|
+
Ie(t, "key", () => t.children[0]), Ie(t, "value", () => t.children[1]);
|
|
3414
3481
|
break;
|
|
3415
3482
|
}
|
|
3416
3483
|
return t;
|
|
3417
3484
|
}
|
|
3418
|
-
var
|
|
3419
|
-
function
|
|
3485
|
+
var Fr = so;
|
|
3486
|
+
function oo(t, e, n) {
|
|
3420
3487
|
let { node: r } = t, s = [];
|
|
3421
|
-
r.type !== "mappingValue" &&
|
|
3488
|
+
r.type !== "mappingValue" && te(r) && s.push([v(N, t.map(n, "leadingComments")), N]);
|
|
3422
3489
|
let { tag: i, anchor: o } = r;
|
|
3423
3490
|
i && s.push(n("tag")), i && o && s.push(" "), o && s.push(n("anchor"));
|
|
3424
3491
|
let a = "";
|
|
3425
|
-
return
|
|
3492
|
+
return W(r, ["mapping", "sequence", "comment", "directive", "mappingItem", "sequenceItem"]) && !Ct(t) && (a = kt(t, e.originalText)), (i || o) && (W(r, ["sequence", "mapping"]) && !ae(r) ? s.push(N) : s.push(" ")), ae(r) && s.push([r.middleComments.length === 1 ? "" : N, v(N, t.map(n, "middleComments")), N]), xr(t) ? s.push(cr(e.originalText.slice(r.position.start.offset, r.position.end.offset).trimEnd())) : s.push(Pe(ao(t, e, n))), K(r) && !W(r, ["document", "documentHead"]) && s.push(mr([r.type === "mappingValue" && !r.content ? "" : " ", t.parent.type === "mappingKey" && t.getParentNode(2).type === "mapping" && nt(r) ? "" : Xe, n("trailingComment")])), En(r) && s.push(_(r.type === "sequenceItem" ? 2 : 0, [N, v(N, t.map(({ node: c }) => [pn(e.originalText, tt(c)) ? N : "", n()], "endComments"))])), s.push(a), s;
|
|
3426
3493
|
}
|
|
3427
|
-
function
|
|
3494
|
+
function ao(t, e, n) {
|
|
3428
3495
|
let { node: r } = t;
|
|
3429
3496
|
switch (r.type) {
|
|
3430
3497
|
case "root": {
|
|
3431
|
-
let s = [];
|
|
3432
|
-
t.each(({ node:
|
|
3433
|
-
c ||
|
|
3434
|
-
}, "children");
|
|
3435
|
-
let i = It(r);
|
|
3436
|
-
return (!K(i, ["blockLiteral", "blockFolded"]) || i.chomping !== "keep") && s.push(N), s;
|
|
3498
|
+
let s = Mt(r), i = !(W(s, ["blockLiteral", "blockFolded"]) && s.chomping === "keep"), o = [];
|
|
3499
|
+
return t.each(({ node: a, isFirst: c }) => {
|
|
3500
|
+
c || o.push(N), o.push(n()), lo(t) && (i && o.push(N), o.push("..."), K(a) && o.push(" ", n("trailingComment")));
|
|
3501
|
+
}, "children"), i && o.push(N), o;
|
|
3437
3502
|
}
|
|
3438
3503
|
case "document": {
|
|
3439
3504
|
let s = [];
|
|
3440
|
-
return
|
|
3505
|
+
return fo(t) && ((r.head.children.length > 0 || r.head.endComments.length > 0) && s.push(n("head")), K(r.head) ? s.push(["---", " ", n(["head", "trailingComment"])]) : s.push("---")), co(r) && s.push(n("body")), v(N, s);
|
|
3441
3506
|
}
|
|
3442
3507
|
case "documentHead":
|
|
3443
|
-
return
|
|
3508
|
+
return v(N, [...t.map(n, "children"), ...t.map(n, "endComments")]);
|
|
3444
3509
|
case "documentBody": {
|
|
3445
3510
|
let { children: s, endComments: i } = r, o = "";
|
|
3446
3511
|
if (s.length > 0 && i.length > 0) {
|
|
3447
|
-
let a =
|
|
3448
|
-
|
|
3512
|
+
let a = Mt(r);
|
|
3513
|
+
if (W(a, ["blockFolded", "blockLiteral"])) a.chomping !== "keep" && (o = [N, N]);
|
|
3514
|
+
else {
|
|
3515
|
+
let c = D(0, s, -1);
|
|
3516
|
+
o = W(c, ["mapping"]) && pn(e.originalText, tt(i[0])) ? [N, N] : N;
|
|
3517
|
+
}
|
|
3449
3518
|
}
|
|
3450
|
-
return [
|
|
3519
|
+
return [v(N, t.map(n, "children")), o, v(N, t.map(n, "endComments"))];
|
|
3451
3520
|
}
|
|
3452
3521
|
case "directive":
|
|
3453
|
-
return ["%",
|
|
3522
|
+
return ["%", v(" ", [r.name, ...r.parameters])];
|
|
3454
3523
|
case "comment":
|
|
3455
3524
|
return ["#", r.value];
|
|
3456
3525
|
case "alias":
|
|
@@ -3460,99 +3529,103 @@ function go(t, e, n) {
|
|
|
3460
3529
|
case "anchor":
|
|
3461
3530
|
return ["&", r.value];
|
|
3462
3531
|
case "plain":
|
|
3463
|
-
return
|
|
3532
|
+
return rt(r.type, e.originalText.slice(r.position.start.offset, r.position.end.offset), e);
|
|
3464
3533
|
case "quoteDouble":
|
|
3465
3534
|
case "quoteSingle": {
|
|
3466
|
-
let
|
|
3535
|
+
let o = e.originalText.slice(r.position.start.offset + 1, r.position.end.offset - 1);
|
|
3467
3536
|
if (r.type === "quoteSingle" && o.includes("\\") || r.type === "quoteDouble" && /\\[^"]/u.test(o)) {
|
|
3468
|
-
let c = r.type === "quoteDouble" ?
|
|
3469
|
-
return [c,
|
|
3537
|
+
let c = r.type === "quoteDouble" ? '"' : "'";
|
|
3538
|
+
return [c, rt(r.type, o, e), c];
|
|
3470
3539
|
}
|
|
3471
|
-
if (o.includes(
|
|
3472
|
-
if (o.includes(
|
|
3473
|
-
let a = e.singleQuote ?
|
|
3474
|
-
return [a,
|
|
3540
|
+
if (o.includes('"')) return ["'", rt(r.type, r.type === "quoteDouble" ? ht(0, ht(0, o, '\\"', '"'), "'", "'".repeat(2)) : o, e), "'"];
|
|
3541
|
+
if (o.includes("'")) return ['"', rt(r.type, r.type === "quoteSingle" ? ht(0, o, "''", "'") : o, e), '"'];
|
|
3542
|
+
let a = e.singleQuote ? "'" : '"';
|
|
3543
|
+
return [a, rt(r.type, o, e), a];
|
|
3475
3544
|
}
|
|
3476
3545
|
case "blockFolded":
|
|
3477
3546
|
case "blockLiteral":
|
|
3478
|
-
return
|
|
3547
|
+
return Yr(t, e, n);
|
|
3479
3548
|
case "mapping":
|
|
3480
3549
|
case "sequence":
|
|
3481
|
-
return
|
|
3550
|
+
return v(N, t.map(n, "children"));
|
|
3482
3551
|
case "sequenceItem":
|
|
3483
|
-
return ["- ",
|
|
3552
|
+
return ["- ", _(2, r.content ? n("content") : "")];
|
|
3484
3553
|
case "mappingKey":
|
|
3485
3554
|
case "mappingValue":
|
|
3486
3555
|
return r.content ? n("content") : "";
|
|
3487
3556
|
case "mappingItem":
|
|
3488
3557
|
case "flowMappingItem":
|
|
3489
|
-
return
|
|
3558
|
+
return Br(t, e, n);
|
|
3490
3559
|
case "flowMapping":
|
|
3491
|
-
return
|
|
3560
|
+
return Pt(t, e, n);
|
|
3492
3561
|
case "flowSequence":
|
|
3493
|
-
return
|
|
3562
|
+
return Pt(t, e, n);
|
|
3494
3563
|
case "flowSequenceItem":
|
|
3495
3564
|
return n("content");
|
|
3496
3565
|
default:
|
|
3497
|
-
throw new
|
|
3566
|
+
throw new dr(r, "YAML");
|
|
3498
3567
|
}
|
|
3499
3568
|
}
|
|
3500
|
-
function
|
|
3569
|
+
function co(t) {
|
|
3501
3570
|
return t.body.children.length > 0 || I(t.body);
|
|
3502
3571
|
}
|
|
3503
|
-
function
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
let n = t.
|
|
3508
|
-
|
|
3509
|
-
let r = t.next;
|
|
3510
|
-
return Gr(n, r) ? false : r ? "root" : false;
|
|
3511
|
-
}
|
|
3512
|
-
function ut(t, e, n) {
|
|
3513
|
-
let r = Kr(t, e, n);
|
|
3514
|
-
return P(N, r.map((s) => Tt(P(ne, s))));
|
|
3515
|
-
}
|
|
3516
|
-
function Hr(t, e) {
|
|
3517
|
-
if (K(t)) switch (t.type) {
|
|
3518
|
-
case "comment":
|
|
3519
|
-
if (xr(t.value)) return null;
|
|
3520
|
-
break;
|
|
3521
|
-
case "quoteDouble":
|
|
3522
|
-
case "quoteSingle":
|
|
3523
|
-
e.type = "quote";
|
|
3524
|
-
break;
|
|
3525
|
-
}
|
|
3572
|
+
function lo(t) {
|
|
3573
|
+
let e = t.node;
|
|
3574
|
+
if (e.documentEndMarker || K(e)) return true;
|
|
3575
|
+
if (t.isLast) return false;
|
|
3576
|
+
let n = t.next;
|
|
3577
|
+
return n.head.children.length > 0 || I(n.head);
|
|
3526
3578
|
}
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
var
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
}
|
|
3539
|
-
|
|
3579
|
+
function fo(t) {
|
|
3580
|
+
let e = t.node;
|
|
3581
|
+
return e.directivesEndMarker || e.head.children.length > 0 || I(e.head) || K(e.head);
|
|
3582
|
+
}
|
|
3583
|
+
function rt(t, e, n) {
|
|
3584
|
+
let r = Dr(t, e, n);
|
|
3585
|
+
return v(N, r.map((s) => At(v(se, s))));
|
|
3586
|
+
}
|
|
3587
|
+
var uo = { preprocess: Fr, embed: Cr, print: oo, massageAstNode: Lr, insertPragma: Or, getVisitorKeys: Pr };
|
|
3588
|
+
var qr = uo;
|
|
3589
|
+
var Ur = [{ name: "YAML", type: "data", aceMode: "yaml", extensions: [".yml", ".mir", ".reek", ".rviz", ".sublime-syntax", ".syntax", ".yaml", ".yaml-tmlanguage", ".yaml.sed", ".yml.mysql"], filenames: [".clang-format", ".clang-tidy", ".clangd", ".gemrc", "CITATION.cff", "glide.lock", "pixi.lock", ".prettierrc", ".stylelintrc", ".lintstagedrc"], tmScope: "source.yaml", aliases: ["yml"], codemirrorMode: "yaml", codemirrorMimeType: "text/x-yaml", parsers: ["yaml"], vscodeLanguageIds: ["yaml", "ansible", "dockercompose", "github-actions-workflow", "home-assistant"], linguistLanguageId: 407 }];
|
|
3590
|
+
var vt = { bracketSpacing: { category: "Common", type: "boolean", default: true, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." }, objectWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap object literals.", choices: [{ value: "preserve", description: "Keep as multi-line, if there is a newline between the opening brace and first property." }, { value: "collapse", description: "Fit to a single line when possible." }] }, singleQuote: { category: "Common", type: "boolean", default: false, description: "Use single quotes instead of double quotes." }, proseWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap prose.", choices: [{ value: "always", description: "Wrap prose if it exceeds the print width." }, { value: "never", description: "Do not wrap prose." }, { value: "preserve", description: "Wrap prose as-is." }] }, bracketSameLine: { category: "Common", type: "boolean", default: false, description: "Put > of opening tags on the last line instead of on a new line." }, singleAttributePerLine: { category: "Common", type: "boolean", default: false, description: "Enforce single attribute per line in HTML, Vue and JSX." } };
|
|
3591
|
+
var po = { bracketSpacing: vt.bracketSpacing, singleQuote: vt.singleQuote, proseWrap: vt.proseWrap };
|
|
3592
|
+
var Vr = po;
|
|
3593
|
+
var ir = {};
|
|
3594
|
+
or(ir, { yaml: () => Ha });
|
|
3595
|
+
var sr = on(Gn(), 1);
|
|
3596
|
+
var J = on(Ps(), 1);
|
|
3597
|
+
var Cf = J.default.findPair;
|
|
3598
|
+
var Mf = J.default.toJSON;
|
|
3599
|
+
var kf = J.default.parseMap;
|
|
3600
|
+
var Pf = J.default.parseSeq;
|
|
3601
|
+
var vf = J.default.stringifyNumber;
|
|
3602
|
+
var If = J.default.stringifyString;
|
|
3603
|
+
var _f = J.default.Type;
|
|
3604
|
+
var xf = J.default.YAMLError;
|
|
3605
|
+
var Rf = J.default.YAMLReferenceError;
|
|
3606
|
+
var vs = J.default.YAMLSemanticError;
|
|
3607
|
+
var Df = J.default.YAMLSyntaxError;
|
|
3608
|
+
var $f = J.default.YAMLWarning;
|
|
3609
|
+
function F(t, e = null) {
|
|
3610
|
+
"children" in t && t.children.forEach((n) => F(n, t)), "anchor" in t && t.anchor && F(t.anchor, t), "tag" in t && t.tag && F(t.tag, t), "leadingComments" in t && t.leadingComments.forEach((n) => F(n, t)), "middleComments" in t && t.middleComments.forEach((n) => F(n, t)), "indicatorComment" in t && t.indicatorComment && F(t.indicatorComment, t), "trailingComment" in t && t.trailingComment && F(t.trailingComment, t), "endComments" in t && t.endComments.forEach((n) => F(n, t)), Object.defineProperty(t, "_parent", { value: e, enumerable: false });
|
|
3611
|
+
}
|
|
3612
|
+
function Oe(t) {
|
|
3540
3613
|
return `${t.line}:${t.column}`;
|
|
3541
3614
|
}
|
|
3542
|
-
function
|
|
3543
|
-
|
|
3544
|
-
let e =
|
|
3615
|
+
function Is(t) {
|
|
3616
|
+
F(t);
|
|
3617
|
+
let e = _a(t), n = t.children.slice();
|
|
3545
3618
|
t.comments.sort((r, s) => r.position.start.offset - s.position.end.offset).filter((r) => !r._parent).forEach((r) => {
|
|
3546
3619
|
for (; n.length > 1 && r.position.start.line > n[0].position.end.line; ) n.shift();
|
|
3547
|
-
|
|
3620
|
+
xa(r, e, n[0]);
|
|
3548
3621
|
});
|
|
3549
3622
|
}
|
|
3550
|
-
function
|
|
3623
|
+
function _a(t) {
|
|
3551
3624
|
let e = Array.from(new Array(t.position.end.line), () => ({}));
|
|
3552
3625
|
for (let n of t.comments) e[n.position.start.line - 1].comment = n;
|
|
3553
|
-
return
|
|
3626
|
+
return _s(e, t), e;
|
|
3554
3627
|
}
|
|
3555
|
-
function
|
|
3628
|
+
function _s(t, e) {
|
|
3556
3629
|
if (e.position.start.offset !== e.position.end.offset) {
|
|
3557
3630
|
if ("leadingComments" in e) {
|
|
3558
3631
|
let { start: n } = e.position, { leadingAttachableNode: r } = t[n.line - 1];
|
|
@@ -3570,15 +3643,15 @@ function Us(t, e) {
|
|
|
3570
3643
|
}
|
|
3571
3644
|
}
|
|
3572
3645
|
"children" in e && e.children.forEach((n) => {
|
|
3573
|
-
|
|
3646
|
+
_s(t, n);
|
|
3574
3647
|
});
|
|
3575
3648
|
}
|
|
3576
3649
|
}
|
|
3577
|
-
function
|
|
3650
|
+
function xa(t, e, n) {
|
|
3578
3651
|
let r = t.position.start.line, { trailingAttachableNode: s } = e[r - 1];
|
|
3579
3652
|
if (s) {
|
|
3580
|
-
if (s.trailingComment) throw new Error(`Unexpected multiple trailing comment at ${
|
|
3581
|
-
|
|
3653
|
+
if (s.trailingComment) throw new Error(`Unexpected multiple trailing comment at ${Oe(t.position.start)}`);
|
|
3654
|
+
F(t, s), s.trailingComment = t;
|
|
3582
3655
|
return;
|
|
3583
3656
|
}
|
|
3584
3657
|
for (let o = r; o >= n.position.start.line; o--) {
|
|
@@ -3588,11 +3661,11 @@ function qa(t, e, n) {
|
|
|
3588
3661
|
else continue;
|
|
3589
3662
|
if ((c.type === "sequence" || c.type === "mapping") && (c = c.children[0]), c.type === "mappingItem") {
|
|
3590
3663
|
let [l, f] = c.children;
|
|
3591
|
-
c =
|
|
3664
|
+
c = xs(l) ? l : f;
|
|
3592
3665
|
}
|
|
3593
3666
|
for (; ; ) {
|
|
3594
|
-
if (
|
|
3595
|
-
|
|
3667
|
+
if (Ra(c, t)) {
|
|
3668
|
+
F(t, c), c.endComments.push(t);
|
|
3596
3669
|
return;
|
|
3597
3670
|
}
|
|
3598
3671
|
if (!c._parent) break;
|
|
@@ -3603,14 +3676,14 @@ function qa(t, e, n) {
|
|
|
3603
3676
|
for (let o = r + 1; o <= n.position.end.line; o++) {
|
|
3604
3677
|
let { leadingAttachableNode: a } = e[o - 1];
|
|
3605
3678
|
if (a) {
|
|
3606
|
-
|
|
3679
|
+
F(t, a), a.leadingComments.push(t);
|
|
3607
3680
|
return;
|
|
3608
3681
|
}
|
|
3609
3682
|
}
|
|
3610
3683
|
let i = n.children[1];
|
|
3611
|
-
|
|
3684
|
+
F(t, i), i.endComments.push(t);
|
|
3612
3685
|
}
|
|
3613
|
-
function
|
|
3686
|
+
function Ra(t, e) {
|
|
3614
3687
|
if (t.position.start.offset < e.position.start.offset && t.position.end.offset > e.position.end.offset) switch (t.type) {
|
|
3615
3688
|
case "flowMapping":
|
|
3616
3689
|
case "flowSequence":
|
|
@@ -3622,24 +3695,24 @@ function Ua(t, e) {
|
|
|
3622
3695
|
return e.position.start.column > t.position.start.column;
|
|
3623
3696
|
case "mappingKey":
|
|
3624
3697
|
case "mappingValue":
|
|
3625
|
-
return e.position.start.column > t._parent.position.start.column && (t.children.length === 0 || t.children.length === 1 && t.children[0].type !== "blockFolded" && t.children[0].type !== "blockLiteral") && (t.type === "mappingValue" ||
|
|
3698
|
+
return e.position.start.column > t._parent.position.start.column && (t.children.length === 0 || t.children.length === 1 && t.children[0].type !== "blockFolded" && t.children[0].type !== "blockLiteral") && (t.type === "mappingValue" || xs(t));
|
|
3626
3699
|
default:
|
|
3627
3700
|
return false;
|
|
3628
3701
|
}
|
|
3629
3702
|
}
|
|
3630
|
-
function
|
|
3703
|
+
function xs(t) {
|
|
3631
3704
|
return t.position.start !== t.position.end && (t.children.length === 0 || t.position.start.offset !== t.children[0].position.start.offset);
|
|
3632
3705
|
}
|
|
3633
3706
|
function b(t, e) {
|
|
3634
3707
|
return { type: t, position: e };
|
|
3635
3708
|
}
|
|
3636
|
-
function
|
|
3709
|
+
function Rs(t, e, n) {
|
|
3637
3710
|
return { ...b("root", t), children: e, comments: n };
|
|
3638
3711
|
}
|
|
3639
|
-
function
|
|
3712
|
+
function pt(t) {
|
|
3640
3713
|
switch (t.type) {
|
|
3641
3714
|
case "DOCUMENT":
|
|
3642
|
-
for (let e = t.contents.length - 1; e >= 0; e--) t.contents[e].type === "BLANK_LINE" ? t.contents.splice(e, 1) :
|
|
3715
|
+
for (let e = t.contents.length - 1; e >= 0; e--) t.contents[e].type === "BLANK_LINE" ? t.contents.splice(e, 1) : pt(t.contents[e]);
|
|
3643
3716
|
for (let e = t.directives.length - 1; e >= 0; e--) t.directives[e].type === "BLANK_LINE" && t.directives.splice(e, 1);
|
|
3644
3717
|
break;
|
|
3645
3718
|
case "FLOW_MAP":
|
|
@@ -3648,13 +3721,13 @@ function wt(t) {
|
|
|
3648
3721
|
case "SEQ":
|
|
3649
3722
|
for (let e = t.items.length - 1; e >= 0; e--) {
|
|
3650
3723
|
let n = t.items[e];
|
|
3651
|
-
"char" in n || (n.type === "BLANK_LINE" ? t.items.splice(e, 1) :
|
|
3724
|
+
"char" in n || (n.type === "BLANK_LINE" ? t.items.splice(e, 1) : pt(n));
|
|
3652
3725
|
}
|
|
3653
3726
|
break;
|
|
3654
3727
|
case "MAP_KEY":
|
|
3655
3728
|
case "MAP_VALUE":
|
|
3656
3729
|
case "SEQ_ITEM":
|
|
3657
|
-
t.node &&
|
|
3730
|
+
t.node && pt(t.node);
|
|
3658
3731
|
break;
|
|
3659
3732
|
case "ALIAS":
|
|
3660
3733
|
case "BLANK_LINE":
|
|
@@ -3670,41 +3743,41 @@ function wt(t) {
|
|
|
3670
3743
|
throw new Error(`Unexpected node type ${JSON.stringify(t.type)}`);
|
|
3671
3744
|
}
|
|
3672
3745
|
}
|
|
3673
|
-
function
|
|
3746
|
+
function X(t, e) {
|
|
3674
3747
|
return { start: t, end: e };
|
|
3675
3748
|
}
|
|
3676
|
-
function
|
|
3749
|
+
function Hn(t) {
|
|
3677
3750
|
return { start: t, end: t };
|
|
3678
3751
|
}
|
|
3679
|
-
var
|
|
3752
|
+
var me;
|
|
3680
3753
|
(function(t) {
|
|
3681
3754
|
t.Tag = "!", t.Anchor = "&", t.Comment = "#";
|
|
3682
|
-
})(
|
|
3683
|
-
function
|
|
3755
|
+
})(me || (me = {}));
|
|
3756
|
+
function Ds(t, e) {
|
|
3684
3757
|
return { ...b("anchor", t), value: e };
|
|
3685
3758
|
}
|
|
3686
|
-
function
|
|
3759
|
+
function Ve(t, e) {
|
|
3687
3760
|
return { ...b("comment", t), value: e };
|
|
3688
3761
|
}
|
|
3689
|
-
function
|
|
3762
|
+
function $s(t, e, n) {
|
|
3690
3763
|
return { anchor: e, tag: t, middleComments: n };
|
|
3691
3764
|
}
|
|
3692
|
-
function
|
|
3765
|
+
function Ys(t, e) {
|
|
3693
3766
|
return { ...b("tag", t), value: e };
|
|
3694
3767
|
}
|
|
3695
|
-
function
|
|
3768
|
+
function Ht(t, e, n = () => false) {
|
|
3696
3769
|
let r = t.cstNode, s = [], i = null, o = null, a = null;
|
|
3697
3770
|
for (let c of r.props) {
|
|
3698
3771
|
let l = e.text[c.origStart];
|
|
3699
3772
|
switch (l) {
|
|
3700
|
-
case
|
|
3701
|
-
i = i || c, o =
|
|
3773
|
+
case me.Tag:
|
|
3774
|
+
i = i || c, o = Ys(e.transformRange(c), t.tag);
|
|
3702
3775
|
break;
|
|
3703
|
-
case
|
|
3704
|
-
i = i || c, a =
|
|
3776
|
+
case me.Anchor:
|
|
3777
|
+
i = i || c, a = Ds(e.transformRange(c), r.anchor);
|
|
3705
3778
|
break;
|
|
3706
|
-
case
|
|
3707
|
-
let f =
|
|
3779
|
+
case me.Comment: {
|
|
3780
|
+
let f = Ve(e.transformRange(c), e.text.slice(c.origStart + 1, c.origEnd));
|
|
3708
3781
|
e.comments.push(f), !n(f) && i && i.origEnd <= c.origStart && c.origEnd <= r.valueRange.origStart && s.push(f);
|
|
3709
3782
|
break;
|
|
3710
3783
|
}
|
|
@@ -3712,93 +3785,93 @@ function zt(t, e, n = () => false) {
|
|
|
3712
3785
|
throw new Error(`Unexpected leading character ${JSON.stringify(l)}`);
|
|
3713
3786
|
}
|
|
3714
3787
|
}
|
|
3715
|
-
return
|
|
3788
|
+
return $s(o, a, s);
|
|
3716
3789
|
}
|
|
3717
|
-
function
|
|
3790
|
+
function z() {
|
|
3718
3791
|
return { leadingComments: [] };
|
|
3719
3792
|
}
|
|
3720
|
-
function
|
|
3793
|
+
function he(t = null) {
|
|
3721
3794
|
return { trailingComment: t };
|
|
3722
3795
|
}
|
|
3723
|
-
function
|
|
3724
|
-
return { ...
|
|
3796
|
+
function q() {
|
|
3797
|
+
return { ...z(), ...he() };
|
|
3725
3798
|
}
|
|
3726
|
-
function
|
|
3727
|
-
return { ...b("alias", t), ...
|
|
3799
|
+
function Bs(t, e, n) {
|
|
3800
|
+
return { ...b("alias", t), ...q(), ...e, value: n };
|
|
3728
3801
|
}
|
|
3729
|
-
function
|
|
3802
|
+
function Fs(t, e) {
|
|
3730
3803
|
let n = t.cstNode;
|
|
3731
|
-
return
|
|
3804
|
+
return Bs(e.transformRange({ origStart: n.valueRange.origStart - 1, origEnd: n.valueRange.origEnd }), e.transformContent(t), n.rawValue);
|
|
3732
3805
|
}
|
|
3733
|
-
function
|
|
3806
|
+
function qs(t) {
|
|
3734
3807
|
return { ...t, type: "blockFolded" };
|
|
3735
3808
|
}
|
|
3736
|
-
function
|
|
3737
|
-
return { ...b("blockValue", t), ...
|
|
3809
|
+
function Us(t, e, n, r, s, i) {
|
|
3810
|
+
return { ...b("blockValue", t), ...z(), ...e, chomping: n, indent: r, value: s, indicatorComment: i };
|
|
3738
3811
|
}
|
|
3739
|
-
var
|
|
3812
|
+
var Jn;
|
|
3740
3813
|
(function(t) {
|
|
3741
3814
|
t.CLIP = "clip", t.STRIP = "strip", t.KEEP = "keep";
|
|
3742
|
-
})(
|
|
3743
|
-
function
|
|
3744
|
-
let n = t.cstNode, r = 1, s = n.chomping === "CLIP" ? 0 : 1, o = n.header.origEnd - n.header.origStart - r - s !== 0, a = e.transformRange({ origStart: n.header.origStart, origEnd: n.valueRange.origEnd }), c = null, l =
|
|
3815
|
+
})(Jn || (Jn = {}));
|
|
3816
|
+
function Jt(t, e) {
|
|
3817
|
+
let n = t.cstNode, r = 1, s = n.chomping === "CLIP" ? 0 : 1, o = n.header.origEnd - n.header.origStart - r - s !== 0, a = e.transformRange({ origStart: n.header.origStart, origEnd: n.valueRange.origEnd }), c = null, l = Ht(t, e, (f) => {
|
|
3745
3818
|
if (!(a.start.offset < f.position.start.offset && f.position.end.offset < a.end.offset)) return false;
|
|
3746
|
-
if (c) throw new Error(`Unexpected multiple indicator comments at ${
|
|
3819
|
+
if (c) throw new Error(`Unexpected multiple indicator comments at ${Oe(f.position.start)}`);
|
|
3747
3820
|
return c = f, true;
|
|
3748
3821
|
});
|
|
3749
|
-
return
|
|
3822
|
+
return Us(a, l, Jn[n.chomping], o ? n.blockIndent : null, n.strValue, c);
|
|
3750
3823
|
}
|
|
3751
|
-
function
|
|
3752
|
-
return
|
|
3824
|
+
function Vs(t, e) {
|
|
3825
|
+
return qs(Jt(t, e));
|
|
3753
3826
|
}
|
|
3754
|
-
function
|
|
3827
|
+
function Ws(t) {
|
|
3755
3828
|
return { ...t, type: "blockLiteral" };
|
|
3756
3829
|
}
|
|
3757
|
-
function
|
|
3758
|
-
return
|
|
3830
|
+
function Ks(t, e) {
|
|
3831
|
+
return Ws(Jt(t, e));
|
|
3759
3832
|
}
|
|
3760
|
-
function
|
|
3761
|
-
return
|
|
3833
|
+
function js(t, e) {
|
|
3834
|
+
return Ve(e.transformRange(t.range), t.comment);
|
|
3762
3835
|
}
|
|
3763
|
-
function
|
|
3764
|
-
return { ...b("directive", t), ...
|
|
3836
|
+
function Qs(t, e, n) {
|
|
3837
|
+
return { ...b("directive", t), ...q(), name: e, parameters: n };
|
|
3765
3838
|
}
|
|
3766
|
-
function
|
|
3839
|
+
function We(t, e) {
|
|
3767
3840
|
for (let n of t.props) {
|
|
3768
3841
|
let r = e.text[n.origStart];
|
|
3769
3842
|
switch (r) {
|
|
3770
|
-
case
|
|
3771
|
-
e.comments.push(
|
|
3843
|
+
case me.Comment:
|
|
3844
|
+
e.comments.push(Ve(e.transformRange(n), e.text.slice(n.origStart + 1, n.origEnd)));
|
|
3772
3845
|
break;
|
|
3773
3846
|
default:
|
|
3774
3847
|
throw new Error(`Unexpected leading character ${JSON.stringify(r)}`);
|
|
3775
3848
|
}
|
|
3776
3849
|
}
|
|
3777
3850
|
}
|
|
3778
|
-
function
|
|
3779
|
-
return
|
|
3851
|
+
function Gs(t, e) {
|
|
3852
|
+
return We(t, e), Qs(e.transformRange(t.range), t.name, t.parameters);
|
|
3780
3853
|
}
|
|
3781
|
-
function
|
|
3782
|
-
return { ...b("document", t), ...
|
|
3854
|
+
function Hs(t, e, n, r, s, i) {
|
|
3855
|
+
return { ...b("document", t), ...he(i), directivesEndMarker: e, documentEndMarker: n, children: [r, s] };
|
|
3783
3856
|
}
|
|
3784
|
-
function
|
|
3857
|
+
function U(t = []) {
|
|
3785
3858
|
return { endComments: t };
|
|
3786
3859
|
}
|
|
3787
|
-
function
|
|
3788
|
-
return { ...b("documentBody", t), ...
|
|
3860
|
+
function Js(t, e, n) {
|
|
3861
|
+
return { ...b("documentBody", t), ...U(n), children: e ? [e] : [] };
|
|
3789
3862
|
}
|
|
3790
|
-
function
|
|
3863
|
+
function V(t) {
|
|
3791
3864
|
return t[t.length - 1];
|
|
3792
3865
|
}
|
|
3793
|
-
function
|
|
3866
|
+
function Xt(t, e) {
|
|
3794
3867
|
let n = t.match(e);
|
|
3795
3868
|
return n ? n.index : -1;
|
|
3796
3869
|
}
|
|
3797
|
-
function
|
|
3798
|
-
let r = t.cstNode, { comments: s, endComments: i, documentTrailingComment: o, documentHeadTrailingComment: a } =
|
|
3799
|
-
return e.comments.push(...s, ...i), { documentBody:
|
|
3870
|
+
function Xs(t, e, n) {
|
|
3871
|
+
let r = t.cstNode, { comments: s, endComments: i, documentTrailingComment: o, documentHeadTrailingComment: a } = Da(r, e, n), c = e.transformNode(t.contents), { position: l, documentEndPoint: f } = $a(r, c, e);
|
|
3872
|
+
return e.comments.push(...s, ...i), { documentBody: Js(l, c, i), documentEndPoint: f, documentTrailingComment: o, documentHeadTrailingComment: a };
|
|
3800
3873
|
}
|
|
3801
|
-
function
|
|
3874
|
+
function Da(t, e, n) {
|
|
3802
3875
|
let r = [], s = [], i = [], o = [], a = false;
|
|
3803
3876
|
for (let c = t.contents.length - 1; c >= 0; c--) {
|
|
3804
3877
|
let l = t.contents[c];
|
|
@@ -3807,24 +3880,24 @@ function Ka(t, e, n) {
|
|
|
3807
3880
|
n && n.line === f.position.start.line ? o.unshift(f) : a ? r.unshift(f) : f.position.start.offset >= t.valueRange.origEnd ? i.unshift(f) : r.unshift(f);
|
|
3808
3881
|
} else a = true;
|
|
3809
3882
|
}
|
|
3810
|
-
if (i.length > 1) throw new Error(`Unexpected multiple document trailing comments at ${
|
|
3811
|
-
if (o.length > 1) throw new Error(`Unexpected multiple documentHead trailing comments at ${
|
|
3812
|
-
return { comments: r, endComments: s, documentTrailingComment:
|
|
3883
|
+
if (i.length > 1) throw new Error(`Unexpected multiple document trailing comments at ${Oe(i[1].position.start)}`);
|
|
3884
|
+
if (o.length > 1) throw new Error(`Unexpected multiple documentHead trailing comments at ${Oe(o[1].position.start)}`);
|
|
3885
|
+
return { comments: r, endComments: s, documentTrailingComment: V(i) || null, documentHeadTrailingComment: V(o) || null };
|
|
3813
3886
|
}
|
|
3814
|
-
function
|
|
3815
|
-
let r =
|
|
3887
|
+
function $a(t, e, n) {
|
|
3888
|
+
let r = Xt(n.text.slice(t.valueRange.origEnd), /^\.\.\./), s = r === -1 ? t.valueRange.origEnd : Math.max(0, t.valueRange.origEnd - 1);
|
|
3816
3889
|
n.text[s - 1] === "\r" && s--;
|
|
3817
3890
|
let i = n.transformRange({ origStart: e !== null ? e.position.start.offset : s, origEnd: s }), o = r === -1 ? i.end : n.transformOffset(t.valueRange.origEnd + 3);
|
|
3818
3891
|
return { position: i, documentEndPoint: o };
|
|
3819
3892
|
}
|
|
3820
|
-
function
|
|
3821
|
-
return { ...b("documentHead", t), ...
|
|
3893
|
+
function zs(t, e, n, r) {
|
|
3894
|
+
return { ...b("documentHead", t), ...U(n), ...he(r), children: e };
|
|
3822
3895
|
}
|
|
3823
|
-
function
|
|
3824
|
-
let n = t.cstNode, { directives: r, comments: s, endComments: i } =
|
|
3825
|
-
return e.comments.push(...s, ...i), { createDocumentHeadWithTrailingComment: (l) => (l && e.comments.push(l),
|
|
3896
|
+
function Zs(t, e) {
|
|
3897
|
+
let n = t.cstNode, { directives: r, comments: s, endComments: i } = Ya(n, e), { position: o, documentEndMarkererPoint: a } = Ba(n, r, e);
|
|
3898
|
+
return e.comments.push(...s, ...i), { createDocumentHeadWithTrailingComment: (l) => (l && e.comments.push(l), zs(o, r, i, l)), documentHeadEndMarkerPoint: a };
|
|
3826
3899
|
}
|
|
3827
|
-
function
|
|
3900
|
+
function Ya(t, e) {
|
|
3828
3901
|
let n = [], r = [], s = [], i = false;
|
|
3829
3902
|
for (let o = t.directives.length - 1; o >= 0; o--) {
|
|
3830
3903
|
let a = e.transformNode(t.directives[o]);
|
|
@@ -3832,43 +3905,45 @@ function ja(t, e) {
|
|
|
3832
3905
|
}
|
|
3833
3906
|
return { directives: n, comments: r, endComments: s };
|
|
3834
3907
|
}
|
|
3835
|
-
function
|
|
3836
|
-
let r =
|
|
3908
|
+
function Ba(t, e, n) {
|
|
3909
|
+
let r = Xt(n.text.slice(0, t.valueRange.origStart), /---\s*$/);
|
|
3837
3910
|
r > 0 && !/[\r\n]/.test(n.text[r - 1]) && (r = -1);
|
|
3838
3911
|
let s = r === -1 ? { origStart: t.valueRange.origStart, origEnd: t.valueRange.origStart } : { origStart: r, origEnd: r + 3 };
|
|
3839
|
-
return e.length !== 0 && (s.origStart = e[0].position.start.offset), { position: n.transformRange(s),
|
|
3912
|
+
return e.length !== 0 && (s.origStart = e[0].position.start.offset), { position: n.transformRange(s), documentEndMarkererPoint: r === -1 ? null : n.transformOffset(r) };
|
|
3840
3913
|
}
|
|
3841
|
-
function
|
|
3842
|
-
let { createDocumentHeadWithTrailingComment: n, documentHeadEndMarkerPoint: r } =
|
|
3843
|
-
|
|
3914
|
+
function ei(t, e) {
|
|
3915
|
+
let { createDocumentHeadWithTrailingComment: n, documentHeadEndMarkerPoint: r } = Zs(t, e), { documentBody: s, documentEndPoint: i, documentTrailingComment: o, documentHeadTrailingComment: a } = Xs(t, e, r), c = n(a);
|
|
3916
|
+
o && e.comments.push(o);
|
|
3917
|
+
let l = t.cstNode;
|
|
3918
|
+
return Hs(X(c.position.start, i), !!l.directivesEndMarker, !!l.documentEndMarker, c, s, o);
|
|
3844
3919
|
}
|
|
3845
|
-
function
|
|
3846
|
-
return { ...b("flowCollection", t), ...
|
|
3920
|
+
function zt(t, e, n) {
|
|
3921
|
+
return { ...b("flowCollection", t), ...q(), ...U(), ...e, children: n };
|
|
3847
3922
|
}
|
|
3848
|
-
function
|
|
3849
|
-
return { ...
|
|
3923
|
+
function ti(t, e, n) {
|
|
3924
|
+
return { ...zt(t, e, n), type: "flowMapping" };
|
|
3850
3925
|
}
|
|
3851
|
-
function
|
|
3852
|
-
return { ...b("flowMappingItem", t), ...
|
|
3926
|
+
function Zt(t, e, n) {
|
|
3927
|
+
return { ...b("flowMappingItem", t), ...z(), children: [e, n] };
|
|
3853
3928
|
}
|
|
3854
|
-
function
|
|
3929
|
+
function de(t, e) {
|
|
3855
3930
|
let n = [];
|
|
3856
3931
|
for (let r of t) r && "type" in r && r.type === "COMMENT" ? e.comments.push(e.transformNode(r)) : n.push(r);
|
|
3857
3932
|
return n;
|
|
3858
3933
|
}
|
|
3859
|
-
function
|
|
3934
|
+
function en(t) {
|
|
3860
3935
|
let [e, n] = ["?", ":"].map((r) => {
|
|
3861
3936
|
let s = t.find((i) => "char" in i && i.char === r);
|
|
3862
3937
|
return s ? { origStart: s.origOffset, origEnd: s.origOffset + 1 } : null;
|
|
3863
3938
|
});
|
|
3864
3939
|
return { additionalKeyRange: e, additionalValueRange: n };
|
|
3865
3940
|
}
|
|
3866
|
-
function
|
|
3941
|
+
function tn(t, e) {
|
|
3867
3942
|
let n = e;
|
|
3868
3943
|
return (r) => t.slice(n, n = r);
|
|
3869
3944
|
}
|
|
3870
|
-
function
|
|
3871
|
-
let e = [], n =
|
|
3945
|
+
function nn(t) {
|
|
3946
|
+
let e = [], n = tn(t, 1), r = false;
|
|
3872
3947
|
for (let s = 1; s < t.length - 1; s++) {
|
|
3873
3948
|
let i = t[s];
|
|
3874
3949
|
if ("char" in i && i.char === ",") {
|
|
@@ -3879,58 +3954,58 @@ function on(t) {
|
|
|
3879
3954
|
}
|
|
3880
3955
|
return r && e.push(n(t.length - 1)), e;
|
|
3881
3956
|
}
|
|
3882
|
-
function
|
|
3883
|
-
return { ...b("mappingKey", t), ...
|
|
3957
|
+
function Xn(t, e) {
|
|
3958
|
+
return { ...b("mappingKey", t), ...he(), ...U(), children: e ? [e] : [] };
|
|
3884
3959
|
}
|
|
3885
|
-
function
|
|
3886
|
-
return { ...b("mappingValue", t), ...
|
|
3960
|
+
function zn(t, e) {
|
|
3961
|
+
return { ...b("mappingValue", t), ...q(), ...U(), children: e ? [e] : [] };
|
|
3887
3962
|
}
|
|
3888
|
-
function
|
|
3889
|
-
let i = e.transformNode(t.key), o = e.transformNode(t.value), a = i || r ?
|
|
3890
|
-
return n(
|
|
3963
|
+
function Ke(t, e, n, r, s) {
|
|
3964
|
+
let i = e.transformNode(t.key), o = e.transformNode(t.value), a = i || r ? Xn(e.transformRange({ origStart: r ? r.origStart : i.position.start.offset, origEnd: i ? i.position.end.offset : r.origStart + 1 }), i) : null, c = o || s ? zn(e.transformRange({ origStart: s ? s.origStart : o.position.start.offset, origEnd: o ? o.position.end.offset : s.origStart + 1 }), o) : null;
|
|
3965
|
+
return n(X(a ? a.position.start : c.position.start, c ? c.position.end : a.position.end), a || Xn(Hn(c.position.start), null), c || zn(Hn(a.position.end), null));
|
|
3891
3966
|
}
|
|
3892
|
-
function
|
|
3893
|
-
let n =
|
|
3894
|
-
let l = r[c], { additionalKeyRange: f, additionalValueRange: m } =
|
|
3895
|
-
return
|
|
3896
|
-
}), i = n[0], o =
|
|
3897
|
-
return
|
|
3967
|
+
function ni(t, e) {
|
|
3968
|
+
let n = de(t.cstNode.items, e), r = nn(n), s = t.items.map((a, c) => {
|
|
3969
|
+
let l = r[c], { additionalKeyRange: f, additionalValueRange: m } = en(l);
|
|
3970
|
+
return Ke(a, e, Zt, f, m);
|
|
3971
|
+
}), i = n[0], o = V(n);
|
|
3972
|
+
return ti(e.transformRange({ origStart: i.origOffset, origEnd: o.origOffset + 1 }), e.transformContent(t), s);
|
|
3898
3973
|
}
|
|
3899
|
-
function
|
|
3900
|
-
return { ...
|
|
3974
|
+
function ri(t, e, n) {
|
|
3975
|
+
return { ...zt(t, e, n), type: "flowSequence" };
|
|
3901
3976
|
}
|
|
3902
|
-
function
|
|
3977
|
+
function si(t, e) {
|
|
3903
3978
|
return { ...b("flowSequenceItem", t), children: [e] };
|
|
3904
3979
|
}
|
|
3905
|
-
function
|
|
3906
|
-
let n =
|
|
3980
|
+
function ii(t, e) {
|
|
3981
|
+
let n = de(t.cstNode.items, e), r = nn(n), s = t.items.map((a, c) => {
|
|
3907
3982
|
if (a.type !== "PAIR") {
|
|
3908
3983
|
let l = e.transformNode(a);
|
|
3909
|
-
return
|
|
3984
|
+
return si(X(l.position.start, l.position.end), l);
|
|
3910
3985
|
} else {
|
|
3911
|
-
let l = r[c], { additionalKeyRange: f, additionalValueRange: m } =
|
|
3912
|
-
return
|
|
3986
|
+
let l = r[c], { additionalKeyRange: f, additionalValueRange: m } = en(l);
|
|
3987
|
+
return Ke(a, e, Zt, f, m);
|
|
3913
3988
|
}
|
|
3914
|
-
}), i = n[0], o =
|
|
3915
|
-
return
|
|
3989
|
+
}), i = n[0], o = V(n);
|
|
3990
|
+
return ri(e.transformRange({ origStart: i.origOffset, origEnd: o.origOffset + 1 }), e.transformContent(t), s);
|
|
3916
3991
|
}
|
|
3917
|
-
function
|
|
3918
|
-
return { ...b("mapping", t), ...
|
|
3992
|
+
function oi(t, e, n) {
|
|
3993
|
+
return { ...b("mapping", t), ...z(), ...e, children: n };
|
|
3919
3994
|
}
|
|
3920
|
-
function
|
|
3921
|
-
return { ...b("mappingItem", t), ...
|
|
3995
|
+
function ai(t, e, n) {
|
|
3996
|
+
return { ...b("mappingItem", t), ...z(), children: [e, n] };
|
|
3922
3997
|
}
|
|
3923
|
-
function
|
|
3998
|
+
function ci(t, e) {
|
|
3924
3999
|
let n = t.cstNode;
|
|
3925
|
-
n.items.filter((o) => o.type === "MAP_KEY" || o.type === "MAP_VALUE").forEach((o) =>
|
|
3926
|
-
let r =
|
|
4000
|
+
n.items.filter((o) => o.type === "MAP_KEY" || o.type === "MAP_VALUE").forEach((o) => We(o, e));
|
|
4001
|
+
let r = de(n.items, e), s = Fa(r), i = t.items.map((o, a) => {
|
|
3927
4002
|
let c = s[a], [l, f] = c[0].type === "MAP_VALUE" ? [null, c[0].range] : [c[0].range, c.length === 1 ? null : c[1].range];
|
|
3928
|
-
return
|
|
4003
|
+
return Ke(o, e, ai, l, f);
|
|
3929
4004
|
});
|
|
3930
|
-
return
|
|
4005
|
+
return oi(X(i[0].position.start, V(i).position.end), e.transformContent(t), i);
|
|
3931
4006
|
}
|
|
3932
|
-
function
|
|
3933
|
-
let e = [], n =
|
|
4007
|
+
function Fa(t) {
|
|
4008
|
+
let e = [], n = tn(t, 0), r = false;
|
|
3934
4009
|
for (let s = 0; s < t.length; s++) {
|
|
3935
4010
|
if (t[s].type === "MAP_VALUE") {
|
|
3936
4011
|
e.push(n(s + 1)), r = false;
|
|
@@ -3940,203 +4015,210 @@ function Qa(t) {
|
|
|
3940
4015
|
}
|
|
3941
4016
|
return r && e.push(n(1 / 0)), e;
|
|
3942
4017
|
}
|
|
3943
|
-
function
|
|
3944
|
-
return { ...b("plain", t), ...
|
|
4018
|
+
function li(t, e, n) {
|
|
4019
|
+
return { ...b("plain", t), ...q(), ...e, value: n };
|
|
3945
4020
|
}
|
|
3946
|
-
function
|
|
4021
|
+
function fi(t, e, n) {
|
|
3947
4022
|
for (let r = e; r >= 0; r--) if (n.test(t[r])) return r;
|
|
3948
4023
|
return -1;
|
|
3949
4024
|
}
|
|
3950
|
-
function
|
|
4025
|
+
function ui(t, e) {
|
|
3951
4026
|
let n = t.cstNode;
|
|
3952
|
-
return
|
|
4027
|
+
return li(e.transformRange({ origStart: n.valueRange.origStart, origEnd: fi(e.text, n.valueRange.origEnd - 1, /\S/) + 1 }), e.transformContent(t), n.strValue);
|
|
3953
4028
|
}
|
|
3954
|
-
function
|
|
4029
|
+
function pi(t) {
|
|
3955
4030
|
return { ...t, type: "quoteDouble" };
|
|
3956
4031
|
}
|
|
3957
|
-
function
|
|
3958
|
-
return { ...b("quoteValue", t), ...e, ...
|
|
4032
|
+
function mi(t, e, n) {
|
|
4033
|
+
return { ...b("quoteValue", t), ...e, ...q(), value: n };
|
|
3959
4034
|
}
|
|
3960
|
-
function
|
|
4035
|
+
function rn(t, e) {
|
|
3961
4036
|
let n = t.cstNode;
|
|
3962
|
-
return
|
|
4037
|
+
return mi(e.transformRange(n.valueRange), e.transformContent(t), n.strValue);
|
|
3963
4038
|
}
|
|
3964
|
-
function
|
|
3965
|
-
return
|
|
4039
|
+
function hi(t, e) {
|
|
4040
|
+
return pi(rn(t, e));
|
|
3966
4041
|
}
|
|
3967
|
-
function
|
|
4042
|
+
function di(t) {
|
|
3968
4043
|
return { ...t, type: "quoteSingle" };
|
|
3969
4044
|
}
|
|
3970
|
-
function
|
|
3971
|
-
return
|
|
4045
|
+
function gi(t, e) {
|
|
4046
|
+
return di(rn(t, e));
|
|
3972
4047
|
}
|
|
3973
|
-
function
|
|
3974
|
-
return { ...b("sequence", t), ...
|
|
4048
|
+
function yi(t, e, n) {
|
|
4049
|
+
return { ...b("sequence", t), ...z(), ...U(), ...e, children: n };
|
|
3975
4050
|
}
|
|
3976
|
-
function
|
|
3977
|
-
return { ...b("sequenceItem", t), ...
|
|
4051
|
+
function Ei(t, e) {
|
|
4052
|
+
return { ...b("sequenceItem", t), ...q(), ...U(), children: e ? [e] : [] };
|
|
3978
4053
|
}
|
|
3979
|
-
function
|
|
3980
|
-
let r =
|
|
3981
|
-
|
|
4054
|
+
function Si(t, e) {
|
|
4055
|
+
let r = de(t.cstNode.items, e).map((s, i) => {
|
|
4056
|
+
We(s, e);
|
|
3982
4057
|
let o = e.transformNode(t.items[i]);
|
|
3983
|
-
return
|
|
4058
|
+
return Ei(X(e.transformOffset(s.valueRange.origStart), o === null ? e.transformOffset(s.valueRange.origStart + 1) : o.position.end), o);
|
|
3984
4059
|
});
|
|
3985
|
-
return
|
|
4060
|
+
return yi(X(r[0].position.start, V(r).position.end), e.transformContent(t), r);
|
|
3986
4061
|
}
|
|
3987
|
-
function
|
|
4062
|
+
function wi(t, e) {
|
|
3988
4063
|
if (t === null || t.type === void 0 && t.value === null) return null;
|
|
3989
4064
|
switch (t.type) {
|
|
3990
4065
|
case "ALIAS":
|
|
3991
|
-
return
|
|
4066
|
+
return Fs(t, e);
|
|
3992
4067
|
case "BLOCK_FOLDED":
|
|
3993
|
-
return
|
|
4068
|
+
return Vs(t, e);
|
|
3994
4069
|
case "BLOCK_LITERAL":
|
|
3995
|
-
return
|
|
4070
|
+
return Ks(t, e);
|
|
3996
4071
|
case "COMMENT":
|
|
3997
|
-
return
|
|
4072
|
+
return js(t, e);
|
|
3998
4073
|
case "DIRECTIVE":
|
|
3999
|
-
return
|
|
4074
|
+
return Gs(t, e);
|
|
4000
4075
|
case "DOCUMENT":
|
|
4001
|
-
return
|
|
4076
|
+
return ei(t, e);
|
|
4002
4077
|
case "FLOW_MAP":
|
|
4003
|
-
return
|
|
4078
|
+
return ni(t, e);
|
|
4004
4079
|
case "FLOW_SEQ":
|
|
4005
|
-
return
|
|
4080
|
+
return ii(t, e);
|
|
4006
4081
|
case "MAP":
|
|
4007
|
-
return
|
|
4082
|
+
return ci(t, e);
|
|
4008
4083
|
case "PLAIN":
|
|
4009
|
-
return
|
|
4084
|
+
return ui(t, e);
|
|
4010
4085
|
case "QUOTE_DOUBLE":
|
|
4011
|
-
return
|
|
4086
|
+
return hi(t, e);
|
|
4012
4087
|
case "QUOTE_SINGLE":
|
|
4013
|
-
return
|
|
4088
|
+
return gi(t, e);
|
|
4014
4089
|
case "SEQ":
|
|
4015
|
-
return
|
|
4090
|
+
return Si(t, e);
|
|
4016
4091
|
default:
|
|
4017
4092
|
throw new Error(`Unexpected node type ${t.type}`);
|
|
4018
4093
|
}
|
|
4019
4094
|
}
|
|
4020
|
-
var
|
|
4095
|
+
var Zn;
|
|
4096
|
+
var er = class {
|
|
4097
|
+
text;
|
|
4098
|
+
comments = [];
|
|
4099
|
+
#e;
|
|
4100
|
+
#t;
|
|
4021
4101
|
constructor(e, n) {
|
|
4022
|
-
|
|
4023
|
-
ln(this, "text");
|
|
4024
|
-
ln(this, "comments", []);
|
|
4025
|
-
Ot(this, Le);
|
|
4026
|
-
Ot(this, bt);
|
|
4027
|
-
this.text = n, un(this, Le, e);
|
|
4102
|
+
this.text = n, this.#e = e;
|
|
4028
4103
|
}
|
|
4029
4104
|
setOrigRanges() {
|
|
4030
|
-
if (!
|
|
4105
|
+
if (!this.#e.setOrigRanges()) for (let e of this.#e) e.setOrigRanges([], 0);
|
|
4106
|
+
}
|
|
4107
|
+
#n(e) {
|
|
4108
|
+
if (!Zn) {
|
|
4109
|
+
let [o] = this.#e, a = Object.getPrototypeOf(Object.getPrototypeOf(o));
|
|
4110
|
+
Zn = Object.getOwnPropertyDescriptor(a, "rangeAsLinePos").get;
|
|
4111
|
+
}
|
|
4112
|
+
if (this.#t ?? (this.#t = { root: { context: { src: this.text } } }), this.text === "" && e.origStart === 0 && e.origEnd === 0) return { start: { offset: 0, line: 1, column: 1 }, end: { offset: 0, line: 1, column: 1 } };
|
|
4113
|
+
let { start: { line: n, col: r }, end: { line: s, col: i } } = Zn.call({ range: { start: this.#r(e.origStart), end: this.#r(e.origEnd) }, context: this.#t });
|
|
4114
|
+
return { start: { offset: e.origStart, line: n, column: r }, end: { offset: e.origEnd, line: s, column: i } };
|
|
4115
|
+
}
|
|
4116
|
+
#r(e) {
|
|
4117
|
+
return e < 0 ? 0 : e > this.text.length ? this.text.length : e;
|
|
4031
4118
|
}
|
|
4032
4119
|
transformOffset(e) {
|
|
4033
|
-
return
|
|
4120
|
+
return this.#n({ origStart: e, origEnd: e }).start;
|
|
4034
4121
|
}
|
|
4035
4122
|
transformRange(e) {
|
|
4036
|
-
let { start: n, end: r } =
|
|
4037
|
-
return
|
|
4123
|
+
let { start: n, end: r } = this.#n(e);
|
|
4124
|
+
return X(n, r);
|
|
4038
4125
|
}
|
|
4039
4126
|
transformNode(e) {
|
|
4040
|
-
return
|
|
4127
|
+
return wi(e, this);
|
|
4041
4128
|
}
|
|
4042
4129
|
transformContent(e) {
|
|
4043
|
-
return
|
|
4130
|
+
return Ht(e, this);
|
|
4044
4131
|
}
|
|
4045
4132
|
};
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
let [o] = Te(this, Le), a = Object.getPrototypeOf(Object.getPrototypeOf(o));
|
|
4049
|
-
or = Object.getOwnPropertyDescriptor(a, "rangeAsLinePos").get;
|
|
4050
|
-
}
|
|
4051
|
-
Te(this, bt) ?? un(this, bt, { root: { context: { src: this.text } } });
|
|
4052
|
-
let { start: { line: n, col: r }, end: { line: s, col: i } } = or.call({ range: { start: Xe(this, he, lr).call(this, e.origStart), end: Xe(this, he, lr).call(this, e.origEnd) }, context: Te(this, bt) });
|
|
4053
|
-
return { start: { offset: e.origStart, line: n, column: r }, end: { offset: e.origEnd, line: s, column: i } };
|
|
4054
|
-
}, lr = function(e) {
|
|
4055
|
-
return e < 0 ? 0 : e > this.text.length ? this.text.length : e;
|
|
4056
|
-
};
|
|
4057
|
-
var Pi = ar;
|
|
4058
|
-
function Ii(t, e, n) {
|
|
4133
|
+
var bi = er;
|
|
4134
|
+
function Ni(t, e, n) {
|
|
4059
4135
|
let r = new SyntaxError(t);
|
|
4060
4136
|
return r.name = "YAMLSyntaxError", r.source = e, r.position = n, r;
|
|
4061
4137
|
}
|
|
4062
|
-
function
|
|
4138
|
+
function Oi(t, e) {
|
|
4063
4139
|
let n = t.source.range || t.source.valueRange;
|
|
4064
|
-
return
|
|
4140
|
+
return Ni(t.message, e.text, e.transformRange(n));
|
|
4065
4141
|
}
|
|
4066
|
-
function
|
|
4142
|
+
function tr(t) {
|
|
4067
4143
|
if ("children" in t) {
|
|
4068
4144
|
if (t.children.length === 1) {
|
|
4069
4145
|
let e = t.children[0];
|
|
4070
4146
|
if (e.type === "plain" && e.tag === null && e.anchor === null && e.value === "") return t.children.splice(0, 1), t;
|
|
4071
4147
|
}
|
|
4072
|
-
t.children.forEach(
|
|
4148
|
+
t.children.forEach(tr);
|
|
4073
4149
|
}
|
|
4074
4150
|
return t;
|
|
4075
4151
|
}
|
|
4076
|
-
function
|
|
4152
|
+
function nr(t, e, n, r) {
|
|
4077
4153
|
let s = e(t);
|
|
4078
4154
|
return (i) => {
|
|
4079
4155
|
r(s, i) && n(t, s = i);
|
|
4080
4156
|
};
|
|
4081
4157
|
}
|
|
4082
|
-
function
|
|
4158
|
+
function rr(t) {
|
|
4083
4159
|
if (t === null || !("children" in t)) return;
|
|
4084
4160
|
let e = t.children;
|
|
4085
|
-
if (e.forEach(
|
|
4161
|
+
if (e.forEach(rr), t.type === "document") {
|
|
4086
4162
|
let [i, o] = t.children;
|
|
4087
4163
|
i.position.start.offset === i.position.end.offset ? i.position.start = i.position.end = o.position.start : o.position.start.offset === o.position.end.offset && (o.position.start = o.position.end = i.position.end);
|
|
4088
4164
|
}
|
|
4089
|
-
let n =
|
|
4090
|
-
"endComments" in t && t.endComments.length !== 0 && (n(t.endComments[0].position.start), r(
|
|
4165
|
+
let n = nr(t.position, qa, Ua, Ka), r = nr(t.position, Va, Wa, ja);
|
|
4166
|
+
"endComments" in t && t.endComments.length !== 0 && (n(t.endComments[0].position.start), r(V(t.endComments).position.end));
|
|
4091
4167
|
let s = e.filter((i) => i !== null);
|
|
4092
4168
|
if (s.length !== 0) {
|
|
4093
|
-
let i = s[0], o =
|
|
4169
|
+
let i = s[0], o = V(s);
|
|
4094
4170
|
n(i.position.start), r(o.position.end), "leadingComments" in i && i.leadingComments.length !== 0 && n(i.leadingComments[0].position.start), "tag" in i && i.tag && n(i.tag.position.start), "anchor" in i && i.anchor && n(i.anchor.position.start), "trailingComment" in o && o.trailingComment && r(o.trailingComment.position.end);
|
|
4095
4171
|
}
|
|
4096
4172
|
}
|
|
4097
|
-
function
|
|
4173
|
+
function qa(t) {
|
|
4098
4174
|
return t.start;
|
|
4099
4175
|
}
|
|
4100
|
-
function
|
|
4176
|
+
function Ua(t, e) {
|
|
4101
4177
|
t.start = e;
|
|
4102
4178
|
}
|
|
4103
|
-
function
|
|
4179
|
+
function Va(t) {
|
|
4104
4180
|
return t.end;
|
|
4105
4181
|
}
|
|
4106
|
-
function
|
|
4182
|
+
function Wa(t, e) {
|
|
4107
4183
|
t.end = e;
|
|
4108
4184
|
}
|
|
4109
|
-
function
|
|
4185
|
+
function Ka(t, e) {
|
|
4110
4186
|
return e.offset < t.offset;
|
|
4111
4187
|
}
|
|
4112
|
-
function
|
|
4188
|
+
function ja(t, e) {
|
|
4113
4189
|
return e.offset > t.offset;
|
|
4114
4190
|
}
|
|
4115
|
-
function
|
|
4116
|
-
let e =
|
|
4191
|
+
function Ai(t) {
|
|
4192
|
+
let e = sr.default.parseCST(t), n = new bi(e, t);
|
|
4117
4193
|
n.setOrigRanges();
|
|
4118
|
-
let r = e.map((i) => new
|
|
4119
|
-
for (let i of r) for (let o of i.errors) if (!(o instanceof
|
|
4120
|
-
r.forEach((i) =>
|
|
4121
|
-
let s =
|
|
4122
|
-
return
|
|
4194
|
+
let r = e.map((i) => new sr.default.Document({ merge: false, keepCstNodes: true }).parse(i));
|
|
4195
|
+
for (let i of r) for (let o of i.errors) if (!(o instanceof vs && o.message === 'Map keys must be unique; "<<" is repeated')) throw Oi(o, n);
|
|
4196
|
+
r.forEach((i) => pt(i.cstNode));
|
|
4197
|
+
let s = Rs(n.transformRange({ origStart: 0, origEnd: t.length }), r.map((i) => n.transformNode(i)), n.comments);
|
|
4198
|
+
return Is(s), rr(s), tr(s), s;
|
|
4123
4199
|
}
|
|
4124
|
-
function
|
|
4200
|
+
function Qa(t, e) {
|
|
4125
4201
|
let n = new SyntaxError(t + " (" + e.loc.start.line + ":" + e.loc.start.column + ")");
|
|
4126
4202
|
return Object.assign(n, e);
|
|
4127
4203
|
}
|
|
4128
|
-
var
|
|
4129
|
-
function
|
|
4204
|
+
var Li = Qa;
|
|
4205
|
+
function Ga(t) {
|
|
4130
4206
|
try {
|
|
4131
|
-
let e =
|
|
4207
|
+
let e = Ai(t);
|
|
4132
4208
|
return delete e.comments, e;
|
|
4133
4209
|
} catch (e) {
|
|
4134
|
-
throw e
|
|
4210
|
+
throw e?.position ? Li(e.message, { loc: e.position, cause: e }) : e;
|
|
4135
4211
|
}
|
|
4136
4212
|
}
|
|
4137
|
-
var
|
|
4138
|
-
var
|
|
4139
|
-
var
|
|
4140
|
-
var
|
|
4141
|
-
|
|
4142
|
-
|
|
4213
|
+
var Ha = { astFormat: "yaml", parse: Ga, hasPragma: br, hasIgnorePragma: Nr, locStart: tt, locEnd: vr };
|
|
4214
|
+
var Ja = { yaml: qr };
|
|
4215
|
+
var Ti = on(Gn(), 1);
|
|
4216
|
+
var Xa = Ti.default.parse;
|
|
4217
|
+
export {
|
|
4218
|
+
Xa as __parsePrettierYamlConfig,
|
|
4219
|
+
Ci as default,
|
|
4220
|
+
Ur as languages,
|
|
4221
|
+
Vr as options,
|
|
4222
|
+
ir as parsers,
|
|
4223
|
+
Ja as printers
|
|
4224
|
+
};
|