@node-core/utils 7.1.0 → 7.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/metadata.js +2 -1
- package/lib/ci/build-types/test_build.js +3 -3
- package/lib/ci/failure_aggregator.js +2 -2
- package/lib/ci/run_ci.js +3 -2
- package/lib/cli.js +6 -6
- package/lib/figures.js +6 -6
- package/lib/prepare_security.js +20 -21
- package/lib/request.js +1 -1
- package/lib/update-v8/backport.js +3 -4
- package/lib/utils.js +4 -2
- package/lib/verbosity.js +2 -4
- package/node_modules/@listr2/{prompt-adapter-enquirer → prompt-adapter-inquirer}/README.md +4 -4
- package/node_modules/@listr2/prompt-adapter-inquirer/dist/index.d.mts +21 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/dist/index.mjs +46 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/LICENSE +22 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/index.d.ts +2 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/index.js +2 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/inquirer.d.ts +35 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/inquirer.js +1 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/utils.d.ts +34 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/utils.js +2 -0
- package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/package.json +88 -0
- package/node_modules/@listr2/{prompt-adapter-enquirer → prompt-adapter-inquirer}/package.json +25 -20
- package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/base.d.ts +48 -3
- package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/base.js +58 -19
- package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/package.json +1 -1
- package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/readme.md +36 -1
- package/node_modules/ansi-regex/index.js +9 -4
- package/node_modules/ansi-regex/package.json +1 -1
- package/node_modules/ansi-regex/readme.md +6 -0
- package/node_modules/ansi-styles/index.d.ts +12 -12
- package/node_modules/ansi-styles/index.js +3 -3
- package/node_modules/ansi-styles/package.json +4 -4
- package/node_modules/cli-truncate/index.d.ts +3 -3
- package/node_modules/cli-truncate/index.js +40 -14
- package/node_modules/cli-truncate/node_modules/string-width/index.js +133 -15
- package/node_modules/cli-truncate/node_modules/string-width/package.json +4 -4
- package/node_modules/cli-truncate/node_modules/string-width/readme.md +1 -1
- package/node_modules/cli-truncate/package.json +7 -7
- package/node_modules/cli-truncate/readme.md +2 -3
- package/node_modules/ghauth/.github/dependabot.yml +11 -3
- package/node_modules/ghauth/.github/workflows/depsound.yml +33 -0
- package/node_modules/ghauth/.github/workflows/test-and-release.yml +4 -4
- package/node_modules/ghauth/CHANGELOG.md +60 -0
- package/node_modules/ghauth/package.json +30 -6
- package/node_modules/js-yaml/README.md +20 -187
- package/node_modules/js-yaml/dist/browser/js-yaml.esm.min.mjs +1008 -946
- package/node_modules/js-yaml/dist/browser/js-yaml.esm.min.mjs.map +1 -1
- package/node_modules/js-yaml/dist/browser/js-yaml.umd.min.js +29 -23
- package/node_modules/js-yaml/dist/browser/js-yaml.umd.min.js.map +1 -1
- package/node_modules/js-yaml/dist/js-yaml.cjs.js +1043 -583
- package/node_modules/js-yaml/dist/js-yaml.cjs.js.map +1 -1
- package/node_modules/js-yaml/dist/js-yaml.d.ts +877 -133
- package/node_modules/js-yaml/dist/js-yaml.mjs +995 -556
- package/node_modules/js-yaml/dist/js-yaml.mjs.map +1 -1
- package/node_modules/js-yaml/package.json +8 -7
- package/node_modules/listr2/dist/{index.d.cts → index.d.mts} +90 -60
- package/node_modules/listr2/dist/{index.js → index.mjs} +496 -373
- package/node_modules/listr2/node_modules/string-width/index.d.ts +39 -0
- package/node_modules/listr2/node_modules/string-width/index.js +207 -0
- package/node_modules/listr2/node_modules/string-width/package.json +65 -0
- package/node_modules/listr2/node_modules/string-width/readme.md +66 -0
- package/node_modules/listr2/node_modules/wrap-ansi/index.d.ts +1 -1
- package/node_modules/listr2/node_modules/wrap-ansi/index.js +544 -116
- package/node_modules/listr2/node_modules/wrap-ansi/package.json +10 -13
- package/node_modules/listr2/node_modules/wrap-ansi/readme.md +2 -0
- package/node_modules/listr2/package.json +16 -19
- package/node_modules/log-update/index.d.ts +64 -1
- package/node_modules/log-update/index.js +268 -18
- package/node_modules/log-update/node_modules/string-width/index.d.ts +39 -0
- package/node_modules/log-update/node_modules/string-width/index.js +207 -0
- package/node_modules/log-update/node_modules/string-width/package.json +65 -0
- package/node_modules/log-update/node_modules/string-width/readme.md +66 -0
- package/node_modules/log-update/node_modules/wrap-ansi/index.d.ts +1 -1
- package/node_modules/log-update/node_modules/wrap-ansi/index.js +544 -116
- package/node_modules/log-update/node_modules/wrap-ansi/package.json +10 -13
- package/node_modules/log-update/node_modules/wrap-ansi/readme.md +2 -0
- package/node_modules/log-update/package.json +14 -12
- package/node_modules/log-update/readme.md +61 -0
- package/node_modules/slice-ansi/index.d.ts +2 -2
- package/node_modules/slice-ansi/index.js +260 -112
- package/node_modules/slice-ansi/package.json +10 -9
- package/node_modules/slice-ansi/readme.md +3 -2
- package/node_modules/slice-ansi/tokenize-ansi.js +752 -0
- package/node_modules/smol-toml/README.md +205 -191
- package/node_modules/smol-toml/dist/date.d.ts +0 -1
- package/node_modules/smol-toml/dist/date.js +0 -1
- package/node_modules/smol-toml/dist/error.d.ts +0 -1
- package/node_modules/smol-toml/dist/error.js +0 -1
- package/node_modules/smol-toml/dist/extract.js +32 -65
- package/node_modules/smol-toml/dist/index.cjs +302 -288
- package/node_modules/smol-toml/dist/index.d.ts +0 -1
- package/node_modules/smol-toml/dist/index.js +0 -1
- package/node_modules/smol-toml/dist/parse.d.ts +1 -3
- package/node_modules/smol-toml/dist/parse.js +22 -21
- package/node_modules/smol-toml/dist/primitive.js +75 -76
- package/node_modules/smol-toml/dist/stringify.d.ts +0 -1
- package/node_modules/smol-toml/dist/stringify.js +43 -30
- package/node_modules/smol-toml/dist/struct.js +90 -93
- package/node_modules/smol-toml/dist/util.d.ts +1 -1
- package/node_modules/smol-toml/dist/util.js +36 -39
- package/node_modules/smol-toml/package.json +6 -6
- package/node_modules/strip-ansi/index.js +5 -0
- package/node_modules/strip-ansi/package.json +5 -5
- package/package.json +3 -9
- package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.cjs +0 -127
- package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.d.cts +0 -152
- package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.d.ts +0 -152
- package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.js +0 -92
- package/node_modules/chalk/package.json +0 -92
- package/node_modules/chalk/readme.md +0 -331
- package/node_modules/chalk/source/index.d.ts +0 -437
- package/node_modules/chalk/source/index.js +0 -261
- package/node_modules/chalk/source/utilities.js +0 -33
- package/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -299
- package/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -261
- package/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
- package/node_modules/chalk/source/vendor/supports-color/browser.js +0 -32
- package/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
- package/node_modules/chalk/source/vendor/supports-color/index.js +0 -206
- package/node_modules/colorette/LICENSE.md +0 -7
- package/node_modules/colorette/README.md +0 -134
- package/node_modules/colorette/index.cjs +0 -218
- package/node_modules/colorette/index.d.ts +0 -93
- package/node_modules/colorette/index.js +0 -150
- package/node_modules/colorette/package.json +0 -40
- package/node_modules/eventemitter3/LICENSE +0 -21
- package/node_modules/eventemitter3/README.md +0 -94
- package/node_modules/eventemitter3/dist/eventemitter3.esm.js +0 -347
- package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js +0 -1
- package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js.map +0 -1
- package/node_modules/eventemitter3/dist/eventemitter3.umd.js +0 -355
- package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js +0 -1
- package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js.map +0 -1
- package/node_modules/eventemitter3/index.d.ts +0 -135
- package/node_modules/eventemitter3/index.js +0 -336
- package/node_modules/eventemitter3/index.mjs +0 -4
- package/node_modules/eventemitter3/package.json +0 -67
- package/node_modules/figures/index.d.ts +0 -279
- package/node_modules/figures/index.js +0 -292
- package/node_modules/figures/package.json +0 -49
- package/node_modules/figures/readme.md +0 -337
- package/node_modules/isexe/LICENSE.md +0 -55
- package/node_modules/isexe/README.md +0 -80
- package/node_modules/isexe/dist/commonjs/index.d.ts +0 -14
- package/node_modules/isexe/dist/commonjs/index.d.ts.map +0 -1
- package/node_modules/isexe/dist/commonjs/index.js +0 -56
- package/node_modules/isexe/dist/commonjs/index.js.map +0 -1
- package/node_modules/isexe/dist/commonjs/index.min.js +0 -2
- package/node_modules/isexe/dist/commonjs/index.min.js.map +0 -7
- package/node_modules/isexe/dist/commonjs/options.d.ts +0 -32
- package/node_modules/isexe/dist/commonjs/options.d.ts.map +0 -1
- package/node_modules/isexe/dist/commonjs/options.js +0 -3
- package/node_modules/isexe/dist/commonjs/options.js.map +0 -1
- package/node_modules/isexe/dist/commonjs/package.json +0 -3
- package/node_modules/isexe/dist/commonjs/posix.d.ts +0 -18
- package/node_modules/isexe/dist/commonjs/posix.d.ts.map +0 -1
- package/node_modules/isexe/dist/commonjs/posix.js +0 -67
- package/node_modules/isexe/dist/commonjs/posix.js.map +0 -1
- package/node_modules/isexe/dist/commonjs/win32.d.ts +0 -18
- package/node_modules/isexe/dist/commonjs/win32.d.ts.map +0 -1
- package/node_modules/isexe/dist/commonjs/win32.js +0 -63
- package/node_modules/isexe/dist/commonjs/win32.js.map +0 -1
- package/node_modules/isexe/dist/esm/index.d.ts +0 -14
- package/node_modules/isexe/dist/esm/index.d.ts.map +0 -1
- package/node_modules/isexe/dist/esm/index.js +0 -16
- package/node_modules/isexe/dist/esm/index.js.map +0 -1
- package/node_modules/isexe/dist/esm/index.min.js +0 -2
- package/node_modules/isexe/dist/esm/index.min.js.map +0 -7
- package/node_modules/isexe/dist/esm/options.d.ts +0 -32
- package/node_modules/isexe/dist/esm/options.d.ts.map +0 -1
- package/node_modules/isexe/dist/esm/options.js +0 -2
- package/node_modules/isexe/dist/esm/options.js.map +0 -1
- package/node_modules/isexe/dist/esm/package.json +0 -3
- package/node_modules/isexe/dist/esm/posix.d.ts +0 -18
- package/node_modules/isexe/dist/esm/posix.d.ts.map +0 -1
- package/node_modules/isexe/dist/esm/posix.js +0 -62
- package/node_modules/isexe/dist/esm/posix.js.map +0 -1
- package/node_modules/isexe/dist/esm/win32.d.ts +0 -18
- package/node_modules/isexe/dist/esm/win32.d.ts.map +0 -1
- package/node_modules/isexe/dist/esm/win32.js +0 -58
- package/node_modules/isexe/dist/esm/win32.js.map +0 -1
- package/node_modules/isexe/package.json +0 -78
- package/node_modules/listr2/dist/index.cjs +0 -2189
- package/node_modules/listr2/dist/index.d.ts +0 -1528
- package/node_modules/rfdc/.github/workflows/ci.yml +0 -21
- package/node_modules/rfdc/LICENSE +0 -15
- package/node_modules/rfdc/default.js +0 -3
- package/node_modules/rfdc/index.d.ts +0 -13
- package/node_modules/rfdc/index.js +0 -198
- package/node_modules/rfdc/index.test-d.ts +0 -13
- package/node_modules/rfdc/package.json +0 -73
- package/node_modules/rfdc/readme.md +0 -181
- package/node_modules/rfdc/test/index.js +0 -306
- package/node_modules/smol-toml/dist/date.d.ts.map +0 -1
- package/node_modules/smol-toml/dist/date.js.map +0 -1
- package/node_modules/smol-toml/dist/error.d.ts.map +0 -1
- package/node_modules/smol-toml/dist/error.js.map +0 -1
- package/node_modules/smol-toml/dist/extract.js.map +0 -1
- package/node_modules/smol-toml/dist/index.cjs.map +0 -1
- package/node_modules/smol-toml/dist/index.d.ts.map +0 -1
- package/node_modules/smol-toml/dist/index.js.map +0 -1
- package/node_modules/smol-toml/dist/parse.d.ts.map +0 -1
- package/node_modules/smol-toml/dist/parse.js.map +0 -1
- package/node_modules/smol-toml/dist/primitive.d.ts +0 -29
- package/node_modules/smol-toml/dist/primitive.d.ts.map +0 -1
- package/node_modules/smol-toml/dist/primitive.js.map +0 -1
- package/node_modules/smol-toml/dist/stringify.d.ts.map +0 -1
- package/node_modules/smol-toml/dist/stringify.js.map +0 -1
- package/node_modules/smol-toml/dist/struct.js.map +0 -1
- package/node_modules/smol-toml/dist/util.d.ts.map +0 -1
- package/node_modules/smol-toml/dist/util.js.map +0 -1
- package/node_modules/smol-toml/src/date.ts +0 -152
- package/node_modules/smol-toml/src/error.ts +0 -77
- package/node_modules/smol-toml/src/extract.ts +0 -113
- package/node_modules/smol-toml/src/index.ts +0 -42
- package/node_modules/smol-toml/src/parse.ts +0 -184
- package/node_modules/smol-toml/src/primitive.ts +0 -249
- package/node_modules/smol-toml/src/stringify.ts +0 -191
- package/node_modules/smol-toml/src/struct.ts +0 -202
- package/node_modules/smol-toml/src/util.ts +0 -106
- package/node_modules/which/LICENSE +0 -15
- package/node_modules/which/README.md +0 -51
- package/node_modules/which/bin/which.js +0 -52
- package/node_modules/which/lib/index.js +0 -111
- package/node_modules/which/package.json +0 -52
- /package/node_modules/@listr2/{prompt-adapter-enquirer → prompt-adapter-inquirer}/LICENSE +0 -0
- /package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/index.d.ts +0 -0
- /package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/index.js +0 -0
- /package/node_modules/{chalk → ansi-escapes}/license +0 -0
- /package/node_modules/{figures → listr2/node_modules/string-width}/license +0 -0
- /package/node_modules/log-update/node_modules/{ansi-escapes → string-width}/license +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! js-yaml 5.
|
|
1
|
+
/*! js-yaml 5.4.1 https://github.com/nodeca/js-yaml @license MIT */
|
|
2
2
|
//#region src/tag.ts
|
|
3
|
-
var e = Symbol("NOT_RESOLVED")
|
|
4
|
-
function
|
|
5
|
-
var n, r, i, a, o
|
|
3
|
+
var e = Symbol("NOT_RESOLVED");
|
|
4
|
+
function t(e, t) {
|
|
5
|
+
var n, r, i, a, o;
|
|
6
6
|
return {
|
|
7
7
|
tagName: e,
|
|
8
8
|
nodeKind: "scalar",
|
|
@@ -10,14 +10,14 @@ function n(e, t) {
|
|
|
10
10
|
matchByTagPrefix: (r = t.matchByTagPrefix) == null ? !1 : r,
|
|
11
11
|
implicitFirstChars: (i = t.implicitFirstChars) == null ? null : i,
|
|
12
12
|
resolve: t.resolve,
|
|
13
|
-
identify:
|
|
14
|
-
represent: (
|
|
15
|
-
representTagName: (
|
|
13
|
+
identify: t.identify,
|
|
14
|
+
represent: (a = t.represent) == null ? ((e) => String(e)) : a,
|
|
15
|
+
representTagName: (o = t.representTagName) == null ? (() => e) : o
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
var n, r, i, a
|
|
20
|
-
let
|
|
18
|
+
function n(e, t) {
|
|
19
|
+
var n, r, i, a;
|
|
20
|
+
let o = t.finalize === void 0;
|
|
21
21
|
return {
|
|
22
22
|
tagName: e,
|
|
23
23
|
nodeKind: "sequence",
|
|
@@ -26,15 +26,15 @@ function r(e, t) {
|
|
|
26
26
|
create: t.create,
|
|
27
27
|
addItem: t.addItem,
|
|
28
28
|
finalize: (r = t.finalize) == null ? ((e) => e) : r,
|
|
29
|
-
carrierIsResult:
|
|
30
|
-
identify:
|
|
31
|
-
represent: (
|
|
32
|
-
representTagName: (
|
|
29
|
+
carrierIsResult: o,
|
|
30
|
+
identify: t.identify,
|
|
31
|
+
represent: (i = t.represent) == null ? ((e) => e) : i,
|
|
32
|
+
representTagName: (a = t.representTagName) == null ? (() => e) : a
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
var n, r, i, a
|
|
37
|
-
let
|
|
35
|
+
function r(e, t) {
|
|
36
|
+
var n, r, i, a;
|
|
37
|
+
let o = t.finalize === void 0;
|
|
38
38
|
return {
|
|
39
39
|
tagName: e,
|
|
40
40
|
nodeKind: "mapping",
|
|
@@ -46,24 +46,24 @@ function i(e, t) {
|
|
|
46
46
|
keys: t.keys,
|
|
47
47
|
get: t.get,
|
|
48
48
|
finalize: (r = t.finalize) == null ? ((e) => e) : r,
|
|
49
|
-
carrierIsResult:
|
|
50
|
-
identify:
|
|
51
|
-
represent: (
|
|
52
|
-
representTagName: (
|
|
49
|
+
carrierIsResult: o,
|
|
50
|
+
identify: t.identify,
|
|
51
|
+
represent: (i = t.represent) == null ? ((e) => e) : i,
|
|
52
|
+
representTagName: (a = t.representTagName) == null ? (() => e) : a
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
//#endregion
|
|
56
56
|
//#region src/tag/scalar/str.ts
|
|
57
|
-
var
|
|
57
|
+
var i = t("tag:yaml.org,2002:str", {
|
|
58
58
|
resolve: (e) => e,
|
|
59
59
|
identify: (e) => typeof e == "string"
|
|
60
|
-
}),
|
|
60
|
+
}), a = [
|
|
61
61
|
"",
|
|
62
62
|
"~",
|
|
63
63
|
"null",
|
|
64
64
|
"Null",
|
|
65
65
|
"NULL"
|
|
66
|
-
],
|
|
66
|
+
], o = t("tag:yaml.org,2002:null", {
|
|
67
67
|
implicit: !0,
|
|
68
68
|
implicitFirstChars: [
|
|
69
69
|
"",
|
|
@@ -71,22 +71,22 @@ var a = n("tag:yaml.org,2002:str", {
|
|
|
71
71
|
"n",
|
|
72
72
|
"N"
|
|
73
73
|
],
|
|
74
|
-
resolve: (t) =>
|
|
74
|
+
resolve: (t) => a.indexOf(t) === -1 ? e : null,
|
|
75
75
|
identify: (e) => e === null,
|
|
76
76
|
represent: () => "null"
|
|
77
|
-
}),
|
|
77
|
+
}), s = t("tag:yaml.org,2002:null", {
|
|
78
78
|
implicit: !0,
|
|
79
79
|
implicitFirstChars: ["n"],
|
|
80
80
|
resolve: (t, n) => t === "null" || n && t === "" ? null : e,
|
|
81
81
|
identify: (e) => e === null,
|
|
82
82
|
represent: () => "null"
|
|
83
|
-
}),
|
|
83
|
+
}), c = [
|
|
84
84
|
"",
|
|
85
85
|
"~",
|
|
86
86
|
"null",
|
|
87
87
|
"Null",
|
|
88
88
|
"NULL"
|
|
89
|
-
],
|
|
89
|
+
], l = t("tag:yaml.org,2002:null", {
|
|
90
90
|
implicit: !0,
|
|
91
91
|
implicitFirstChars: [
|
|
92
92
|
"",
|
|
@@ -94,18 +94,18 @@ var a = n("tag:yaml.org,2002:str", {
|
|
|
94
94
|
"n",
|
|
95
95
|
"N"
|
|
96
96
|
],
|
|
97
|
-
resolve: (t) =>
|
|
97
|
+
resolve: (t) => c.indexOf(t) === -1 ? e : null,
|
|
98
98
|
identify: (e) => e === null,
|
|
99
99
|
represent: () => "null"
|
|
100
|
-
}),
|
|
100
|
+
}), u = [
|
|
101
101
|
"true",
|
|
102
102
|
"True",
|
|
103
103
|
"TRUE"
|
|
104
|
-
],
|
|
104
|
+
], d = [
|
|
105
105
|
"false",
|
|
106
106
|
"False",
|
|
107
107
|
"FALSE"
|
|
108
|
-
],
|
|
108
|
+
], f = t("tag:yaml.org,2002:bool", {
|
|
109
109
|
implicit: !0,
|
|
110
110
|
implicitFirstChars: [
|
|
111
111
|
"t",
|
|
@@ -113,16 +113,16 @@ var a = n("tag:yaml.org,2002:str", {
|
|
|
113
113
|
"f",
|
|
114
114
|
"F"
|
|
115
115
|
],
|
|
116
|
-
resolve: (t) =>
|
|
116
|
+
resolve: (t) => u.indexOf(t) === -1 ? d.indexOf(t) === -1 ? e : !1 : !0,
|
|
117
117
|
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
118
118
|
represent: (e) => e ? "true" : "false"
|
|
119
|
-
}),
|
|
119
|
+
}), p = ["true"], m = ["false"], h = t("tag:yaml.org,2002:bool", {
|
|
120
120
|
implicit: !0,
|
|
121
121
|
implicitFirstChars: ["t", "f"],
|
|
122
|
-
resolve: (t) =>
|
|
122
|
+
resolve: (t) => p.indexOf(t) === -1 ? m.indexOf(t) === -1 ? e : !1 : !0,
|
|
123
123
|
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
124
124
|
represent: (e) => e ? "true" : "false"
|
|
125
|
-
}),
|
|
125
|
+
}), ee = [
|
|
126
126
|
"true",
|
|
127
127
|
"True",
|
|
128
128
|
"TRUE",
|
|
@@ -134,7 +134,7 @@ var a = n("tag:yaml.org,2002:str", {
|
|
|
134
134
|
"on",
|
|
135
135
|
"On",
|
|
136
136
|
"ON"
|
|
137
|
-
],
|
|
137
|
+
], te = [
|
|
138
138
|
"false",
|
|
139
139
|
"False",
|
|
140
140
|
"FALSE",
|
|
@@ -146,7 +146,7 @@ var a = n("tag:yaml.org,2002:str", {
|
|
|
146
146
|
"off",
|
|
147
147
|
"Off",
|
|
148
148
|
"OFF"
|
|
149
|
-
],
|
|
149
|
+
], ne = t("tag:yaml.org,2002:bool", {
|
|
150
150
|
implicit: !0,
|
|
151
151
|
implicitFirstChars: [
|
|
152
152
|
"y",
|
|
@@ -160,51 +160,51 @@ var a = n("tag:yaml.org,2002:str", {
|
|
|
160
160
|
"o",
|
|
161
161
|
"O"
|
|
162
162
|
],
|
|
163
|
-
resolve: (t) =>
|
|
163
|
+
resolve: (t) => ee.indexOf(t) === -1 ? te.indexOf(t) === -1 ? e : !1 : !0,
|
|
164
164
|
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
165
165
|
represent: (e) => e ? "true" : "false"
|
|
166
|
-
}),
|
|
167
|
-
function
|
|
166
|
+
}), re = /* @__PURE__ */ RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"), ie = /* @__PURE__ */ RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
|
|
167
|
+
function ae(e) {
|
|
168
168
|
let t = e, n = 1;
|
|
169
169
|
return (t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b") ? n * parseInt(t.slice(2), 2) : t.startsWith("0o") ? n * parseInt(t.slice(2), 8) : t.startsWith("0x") ? n * parseInt(t.slice(2), 16) : n * parseInt(t, 10);
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function oe(t, n) {
|
|
172
172
|
if (n) {
|
|
173
|
-
if (!
|
|
174
|
-
} else if (!
|
|
175
|
-
let r =
|
|
173
|
+
if (!ie.test(t)) return e;
|
|
174
|
+
} else if (!re.test(t)) return e;
|
|
175
|
+
let r = ae(t);
|
|
176
176
|
return Number.isFinite(r) ? r : e;
|
|
177
177
|
}
|
|
178
|
-
var
|
|
178
|
+
var se = t("tag:yaml.org,2002:int", {
|
|
179
179
|
implicit: !0,
|
|
180
180
|
implicitFirstChars: [
|
|
181
181
|
"-",
|
|
182
182
|
"+",
|
|
183
183
|
..."0123456789"
|
|
184
184
|
],
|
|
185
|
-
resolve:
|
|
185
|
+
resolve: oe,
|
|
186
186
|
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
|
|
187
187
|
represent: (e) => e.toString(10)
|
|
188
|
-
}),
|
|
189
|
-
function
|
|
188
|
+
}), ce = /* @__PURE__ */ RegExp("^-?(?:0|[1-9][0-9]*)$"), le = /* @__PURE__ */ RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
|
|
189
|
+
function ue(e) {
|
|
190
190
|
let t = e, n = 1;
|
|
191
191
|
return (t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b") ? n * parseInt(t.slice(2), 2) : t.startsWith("0o") ? n * parseInt(t.slice(2), 8) : t.startsWith("0x") ? n * parseInt(t.slice(2), 16) : n * parseInt(t, 10);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function de(t, n) {
|
|
194
194
|
if (n) {
|
|
195
|
-
if (!
|
|
196
|
-
} else if (!
|
|
197
|
-
let r =
|
|
195
|
+
if (!le.test(t)) return e;
|
|
196
|
+
} else if (!ce.test(t)) return e;
|
|
197
|
+
let r = ue(t);
|
|
198
198
|
return Number.isFinite(r) ? r : e;
|
|
199
199
|
}
|
|
200
|
-
var
|
|
200
|
+
var fe = t("tag:yaml.org,2002:int", {
|
|
201
201
|
implicit: !0,
|
|
202
202
|
implicitFirstChars: ["-", ..."0123456789"],
|
|
203
|
-
resolve:
|
|
203
|
+
resolve: de,
|
|
204
204
|
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
|
|
205
205
|
represent: (e) => e.toString(10)
|
|
206
|
-
}),
|
|
207
|
-
function
|
|
206
|
+
}), pe = /* @__PURE__ */ RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");
|
|
207
|
+
function me(e) {
|
|
208
208
|
let t = e.replace(/_/g, ""), n = 1;
|
|
209
209
|
if ((t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b")) return n * parseInt(t.slice(2), 2);
|
|
210
210
|
if (t.startsWith("0x")) return n * parseInt(t.slice(2), 16);
|
|
@@ -215,31 +215,31 @@ function he(e) {
|
|
|
215
215
|
}
|
|
216
216
|
return t !== "0" && t[0] === "0" ? n * parseInt(t, 8) : n * parseInt(t, 10);
|
|
217
217
|
}
|
|
218
|
-
function
|
|
219
|
-
if (!
|
|
220
|
-
let n =
|
|
218
|
+
function he(t) {
|
|
219
|
+
if (!pe.test(t)) return e;
|
|
220
|
+
let n = me(t);
|
|
221
221
|
return Number.isFinite(n) ? n : e;
|
|
222
222
|
}
|
|
223
|
-
var
|
|
223
|
+
var g = t("tag:yaml.org,2002:int", {
|
|
224
224
|
implicit: !0,
|
|
225
225
|
implicitFirstChars: [
|
|
226
226
|
"-",
|
|
227
227
|
"+",
|
|
228
228
|
..."0123456789"
|
|
229
229
|
],
|
|
230
|
-
resolve:
|
|
230
|
+
resolve: he,
|
|
231
231
|
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
|
|
232
232
|
represent: (e) => e.toString(10)
|
|
233
|
-
}),
|
|
234
|
-
function
|
|
235
|
-
if (!
|
|
233
|
+
}), ge = /* @__PURE__ */ RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"), _e = /* @__PURE__ */ RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
234
|
+
function ve(t) {
|
|
235
|
+
if (!ge.test(t)) return e;
|
|
236
236
|
let n = t.toLowerCase(), r = n[0] === "-" ? -1 : 1;
|
|
237
237
|
if ("+-".includes(n[0]) && (n = n.slice(1)), n === ".inf") return r === 1 ? Infinity : -Infinity;
|
|
238
238
|
if (n === ".nan") return NaN;
|
|
239
239
|
let i = r * parseFloat(n);
|
|
240
|
-
return Number.isFinite(i) ||
|
|
240
|
+
return Number.isFinite(i) || _e.test(t) ? i : e;
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function ye(e) {
|
|
243
243
|
if (isNaN(e)) return ".nan";
|
|
244
244
|
if (e === Infinity) return ".inf";
|
|
245
245
|
if (e === -Infinity) return "-.inf";
|
|
@@ -247,7 +247,7 @@ function xe(e) {
|
|
|
247
247
|
let t = e.toString(10);
|
|
248
248
|
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
249
249
|
}
|
|
250
|
-
var
|
|
250
|
+
var be = t("tag:yaml.org,2002:float", {
|
|
251
251
|
implicit: !0,
|
|
252
252
|
implicitFirstChars: [
|
|
253
253
|
"-",
|
|
@@ -255,24 +255,24 @@ var Se = n("tag:yaml.org,2002:float", {
|
|
|
255
255
|
".",
|
|
256
256
|
..."0123456789"
|
|
257
257
|
],
|
|
258
|
-
resolve:
|
|
258
|
+
resolve: ve,
|
|
259
259
|
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
260
|
-
represent:
|
|
261
|
-
}),
|
|
262
|
-
function
|
|
260
|
+
represent: ye
|
|
261
|
+
}), xe = /* @__PURE__ */ RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"), Se = /* @__PURE__ */ RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
262
|
+
function Ce(t, n) {
|
|
263
263
|
if (n) {
|
|
264
|
-
if (!
|
|
264
|
+
if (!Se.test(t)) return e;
|
|
265
265
|
let n = t.toLowerCase(), r = n[0] === "-" ? -1 : 1;
|
|
266
266
|
if ("+-".includes(n[0]) && (n = n.slice(1)), n === ".inf") return r === 1 ? Infinity : -Infinity;
|
|
267
267
|
if (n === ".nan") return NaN;
|
|
268
268
|
let i = r * parseFloat(n);
|
|
269
269
|
return Number.isFinite(i) ? i : e;
|
|
270
270
|
}
|
|
271
|
-
if (!
|
|
271
|
+
if (!xe.test(t)) return e;
|
|
272
272
|
let r = Number(t);
|
|
273
273
|
return Number.isFinite(r) ? r : e;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function we(e) {
|
|
276
276
|
if (isNaN(e)) return ".nan";
|
|
277
277
|
if (e === Infinity) return ".inf";
|
|
278
278
|
if (e === -Infinity) return "-.inf";
|
|
@@ -280,15 +280,15 @@ function Ee(e) {
|
|
|
280
280
|
let t = e.toString(10);
|
|
281
281
|
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
282
282
|
}
|
|
283
|
-
var
|
|
283
|
+
var Te = t("tag:yaml.org,2002:float", {
|
|
284
284
|
implicit: !0,
|
|
285
285
|
implicitFirstChars: ["-", ..."0123456789"],
|
|
286
|
-
resolve:
|
|
286
|
+
resolve: Ce,
|
|
287
287
|
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
288
|
-
represent:
|
|
289
|
-
}),
|
|
290
|
-
function
|
|
291
|
-
if (!
|
|
288
|
+
represent: we
|
|
289
|
+
}), Ee = /* @__PURE__ */ RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"), De = /* @__PURE__ */ RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
290
|
+
function Oe(t) {
|
|
291
|
+
if (!Ee.test(t)) return e;
|
|
292
292
|
let n = t.toLowerCase().replace(/_/g, ""), r = n[0] === "-" ? -1 : 1;
|
|
293
293
|
if ("+-".includes(n[0]) && (n = n.slice(1)), n === ".inf") return r === 1 ? Infinity : -Infinity;
|
|
294
294
|
if (n === ".nan") return NaN;
|
|
@@ -297,9 +297,9 @@ function Ae(t) {
|
|
|
297
297
|
for (let e of n.split(":")) i = i * 60 + Number(e);
|
|
298
298
|
i *= r;
|
|
299
299
|
} else i = r * parseFloat(n);
|
|
300
|
-
return Number.isFinite(i) ||
|
|
300
|
+
return Number.isFinite(i) || De.test(t) ? i : e;
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function ke(e) {
|
|
303
303
|
if (isNaN(e)) return ".nan";
|
|
304
304
|
if (e === Infinity) return ".inf";
|
|
305
305
|
if (e === -Infinity) return "-.inf";
|
|
@@ -307,7 +307,7 @@ function je(e) {
|
|
|
307
307
|
let t = e.toString(10);
|
|
308
308
|
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
309
309
|
}
|
|
310
|
-
var
|
|
310
|
+
var _ = t("tag:yaml.org,2002:float", {
|
|
311
311
|
implicit: !0,
|
|
312
312
|
implicitFirstChars: [
|
|
313
313
|
"-",
|
|
@@ -315,41 +315,42 @@ var Me = n("tag:yaml.org,2002:float", {
|
|
|
315
315
|
".",
|
|
316
316
|
..."0123456789"
|
|
317
317
|
],
|
|
318
|
-
resolve:
|
|
318
|
+
resolve: Oe,
|
|
319
319
|
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
320
|
-
represent:
|
|
321
|
-
}),
|
|
320
|
+
represent: ke
|
|
321
|
+
}), Ae = t("tag:yaml.org,2002:merge", {
|
|
322
322
|
implicit: !0,
|
|
323
323
|
implicitFirstChars: ["<"],
|
|
324
|
-
resolve: (
|
|
325
|
-
|
|
326
|
-
|
|
324
|
+
resolve: (t, n) => t === "<<" || n && t === "" ? "<<" : e,
|
|
325
|
+
identify: () => !1
|
|
326
|
+
}), je = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
327
|
+
function Me(t) {
|
|
327
328
|
let n = t.replace(/\s/g, "");
|
|
328
|
-
if (n.length % 4 != 0 || !
|
|
329
|
+
if (n.length % 4 != 0 || !je.test(n)) return e;
|
|
329
330
|
let r = atob(n), i = new Uint8Array(r.length);
|
|
330
331
|
for (let e = 0; e < r.length; e++) i[e] = r.charCodeAt(e);
|
|
331
332
|
return i;
|
|
332
333
|
}
|
|
333
|
-
function
|
|
334
|
+
function Ne(e) {
|
|
334
335
|
let t = "";
|
|
335
336
|
for (let n = 0; n < e.length; n++) t += String.fromCharCode(e[n]);
|
|
336
337
|
return btoa(t);
|
|
337
338
|
}
|
|
338
|
-
var
|
|
339
|
-
resolve:
|
|
339
|
+
var Pe = t("tag:yaml.org,2002:binary", {
|
|
340
|
+
resolve: Me,
|
|
340
341
|
identify: (e) => Object.prototype.toString.call(e) === "[object Uint8Array]",
|
|
341
|
-
represent:
|
|
342
|
-
}),
|
|
343
|
-
function
|
|
342
|
+
represent: Ne
|
|
343
|
+
}), Fe = /* @__PURE__ */ RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"), Ie = /* @__PURE__ */ RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
|
|
344
|
+
function Le(e, t, n, r = 0, i = 0, a = 0, o = 0) {
|
|
344
345
|
let s = new Date(Date.UTC(e, t, n, r, i, a, o));
|
|
345
346
|
return s.setUTCFullYear(e, t, n), s;
|
|
346
347
|
}
|
|
347
|
-
function
|
|
348
|
-
let n =
|
|
349
|
-
if (n === null && (n =
|
|
348
|
+
function Re(t) {
|
|
349
|
+
let n = Fe.exec(t);
|
|
350
|
+
if (n === null && (n = Ie.exec(t)), n === null) return e;
|
|
350
351
|
let r = +n[1], i = n[2] - 1, a = +n[3];
|
|
351
352
|
if (!n[4]) {
|
|
352
|
-
let t =
|
|
353
|
+
let t = Le(r, i, a);
|
|
353
354
|
return t.getUTCFullYear() !== r || t.getUTCMonth() !== i || t.getUTCDate() !== a ? e : t;
|
|
354
355
|
}
|
|
355
356
|
let o = +n[4], s = +n[5], c = +n[6], l = 0;
|
|
@@ -359,7 +360,7 @@ function Ve(t) {
|
|
|
359
360
|
for (; e.length < 3;) e += "0";
|
|
360
361
|
l = +e;
|
|
361
362
|
}
|
|
362
|
-
let u =
|
|
363
|
+
let u = Le(r, i, a, o, s, c, l);
|
|
363
364
|
if (u.getUTCFullYear() !== r || u.getUTCMonth() !== i || u.getUTCDate() !== a) return e;
|
|
364
365
|
if (n[9]) {
|
|
365
366
|
let t = +n[10], r = +(n[11] || 0);
|
|
@@ -369,13 +370,13 @@ function Ve(t) {
|
|
|
369
370
|
}
|
|
370
371
|
return u;
|
|
371
372
|
}
|
|
372
|
-
var
|
|
373
|
+
var ze = t("tag:yaml.org,2002:timestamp", {
|
|
373
374
|
implicit: !0,
|
|
374
375
|
implicitFirstChars: [..."0123456789"],
|
|
375
|
-
resolve:
|
|
376
|
+
resolve: Re,
|
|
376
377
|
identify: (e) => e instanceof Date,
|
|
377
378
|
represent: (e) => e.toISOString()
|
|
378
|
-
}),
|
|
379
|
+
}), Be = n("tag:yaml.org,2002:seq", {
|
|
379
380
|
create: () => [],
|
|
380
381
|
addItem: (e, t) => {
|
|
381
382
|
e.push(t);
|
|
@@ -384,19 +385,19 @@ var He = n("tag:yaml.org,2002:timestamp", {
|
|
|
384
385
|
});
|
|
385
386
|
//#endregion
|
|
386
387
|
//#region src/common/object.ts
|
|
387
|
-
function
|
|
388
|
+
function v(e) {
|
|
388
389
|
if (typeof e != "object" || !e || Array.isArray(e)) return !1;
|
|
389
390
|
let t = Object.getPrototypeOf(e);
|
|
390
391
|
return t === null || t === Object.prototype;
|
|
391
392
|
}
|
|
392
|
-
function
|
|
393
|
+
function Ve(e, t) {
|
|
393
394
|
let n = {};
|
|
394
395
|
for (let r of t) e[r] !== void 0 && (n[r] = e[r]);
|
|
395
396
|
return n;
|
|
396
397
|
}
|
|
397
398
|
//#endregion
|
|
398
399
|
//#region src/tag/sequence/omap.ts
|
|
399
|
-
var
|
|
400
|
+
var He = n("tag:yaml.org,2002:omap", {
|
|
400
401
|
create: () => ({
|
|
401
402
|
list: [],
|
|
402
403
|
seen: /* @__PURE__ */ new Set()
|
|
@@ -406,25 +407,27 @@ var Ke = r("tag:yaml.org,2002:omap", {
|
|
|
406
407
|
if (t instanceof Map) {
|
|
407
408
|
if (t.size !== 1) return "cannot resolve an ordered map item";
|
|
408
409
|
n = t.keys().next().value;
|
|
409
|
-
} else if (
|
|
410
|
+
} else if (v(t)) {
|
|
410
411
|
let e = Object.keys(t);
|
|
411
412
|
if (e.length !== 1) return "cannot resolve an ordered map item";
|
|
412
413
|
n = e[0];
|
|
413
414
|
} else return "cannot resolve an ordered map item";
|
|
414
415
|
return e.seen.has(n) ? "duplicate key in ordered map" : (e.seen.add(n), e.list.push(t), "");
|
|
415
416
|
},
|
|
416
|
-
finalize: (e) => e.list
|
|
417
|
-
|
|
417
|
+
finalize: (e) => e.list,
|
|
418
|
+
identify: () => !1
|
|
419
|
+
}), Ue = n("tag:yaml.org,2002:pairs", {
|
|
418
420
|
create: () => [],
|
|
419
421
|
addItem: (e, t) => {
|
|
420
422
|
if (t instanceof Map) return t.size === 1 ? (e.push(t.entries().next().value), "") : "cannot resolve a pairs item";
|
|
421
423
|
if (Object.prototype.toString.call(t) !== "[object Object]") return "cannot resolve a pairs item";
|
|
422
424
|
let n = t, r = Object.keys(n);
|
|
423
425
|
return r.length === 1 ? (e.push([r[0], n[r[0]]]), "") : "cannot resolve a pairs item";
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
+
},
|
|
427
|
+
identify: () => !1
|
|
428
|
+
}), We = r("tag:yaml.org,2002:map", {
|
|
426
429
|
create: () => ({}),
|
|
427
|
-
identify:
|
|
430
|
+
identify: v,
|
|
428
431
|
represent: (e) => {
|
|
429
432
|
let t = /* @__PURE__ */ new Map();
|
|
430
433
|
for (let n of Object.keys(e)) t.set(n, e[n]);
|
|
@@ -446,7 +449,7 @@ var Ke = r("tag:yaml.org,2002:omap", {
|
|
|
446
449
|
let n = String(t);
|
|
447
450
|
return Object.prototype.hasOwnProperty.call(e, n) ? e[n] : null;
|
|
448
451
|
}
|
|
449
|
-
}),
|
|
452
|
+
}), Ge = r("tag:yaml.org,2002:set", {
|
|
450
453
|
create: () => /* @__PURE__ */ new Set(),
|
|
451
454
|
identify: (e) => e instanceof Set,
|
|
452
455
|
represent: (e) => {
|
|
@@ -461,36 +464,36 @@ var Ke = r("tag:yaml.org,2002:omap", {
|
|
|
461
464
|
});
|
|
462
465
|
//#endregion
|
|
463
466
|
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
|
|
464
|
-
function
|
|
467
|
+
function y(e) {
|
|
465
468
|
"@babel/helpers - typeof";
|
|
466
|
-
return
|
|
469
|
+
return y = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
467
470
|
return typeof e;
|
|
468
471
|
} : function(e) {
|
|
469
472
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
470
|
-
},
|
|
473
|
+
}, y(e);
|
|
471
474
|
}
|
|
472
475
|
//#endregion
|
|
473
476
|
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
|
|
474
|
-
function
|
|
475
|
-
if (
|
|
477
|
+
function Ke(e, t) {
|
|
478
|
+
if (y(e) != "object" || !e) return e;
|
|
476
479
|
var n = e[Symbol.toPrimitive];
|
|
477
480
|
if (n !== void 0) {
|
|
478
481
|
var r = n.call(e, t || "default");
|
|
479
|
-
if (
|
|
482
|
+
if (y(r) != "object") return r;
|
|
480
483
|
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
481
484
|
}
|
|
482
485
|
return (t === "string" ? String : Number)(e);
|
|
483
486
|
}
|
|
484
487
|
//#endregion
|
|
485
488
|
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
|
|
486
|
-
function
|
|
487
|
-
var t =
|
|
488
|
-
return
|
|
489
|
+
function qe(e) {
|
|
490
|
+
var t = Ke(e, "string");
|
|
491
|
+
return y(t) == "symbol" ? t : t + "";
|
|
489
492
|
}
|
|
490
493
|
//#endregion
|
|
491
494
|
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
|
|
492
|
-
function
|
|
493
|
-
return (t =
|
|
495
|
+
function b(e, t, n) {
|
|
496
|
+
return (t = qe(t)) in e ? Object.defineProperty(e, t, {
|
|
494
497
|
value: n,
|
|
495
498
|
enumerable: !0,
|
|
496
499
|
configurable: !0,
|
|
@@ -498,22 +501,45 @@ function _(e, t, n) {
|
|
|
498
501
|
}) : e[t] = n, e;
|
|
499
502
|
}
|
|
500
503
|
//#endregion
|
|
504
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/objectSpread2.js
|
|
505
|
+
function Je(e, t) {
|
|
506
|
+
var n = Object.keys(e);
|
|
507
|
+
if (Object.getOwnPropertySymbols) {
|
|
508
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
509
|
+
t && (r = r.filter(function(t) {
|
|
510
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
511
|
+
})), n.push.apply(n, r);
|
|
512
|
+
}
|
|
513
|
+
return n;
|
|
514
|
+
}
|
|
515
|
+
function x(e) {
|
|
516
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
517
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
518
|
+
t % 2 ? Je(Object(n), !0).forEach(function(t) {
|
|
519
|
+
b(e, t, n[t]);
|
|
520
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Je(Object(n)).forEach(function(t) {
|
|
521
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
return e;
|
|
525
|
+
}
|
|
526
|
+
//#endregion
|
|
501
527
|
//#region src/schema.ts
|
|
502
|
-
function
|
|
528
|
+
function Ye() {
|
|
503
529
|
return {
|
|
504
530
|
scalar: Object.create(null),
|
|
505
531
|
sequence: Object.create(null),
|
|
506
532
|
mapping: Object.create(null)
|
|
507
533
|
};
|
|
508
534
|
}
|
|
509
|
-
function
|
|
535
|
+
function Xe() {
|
|
510
536
|
return {
|
|
511
537
|
scalar: [],
|
|
512
538
|
sequence: [],
|
|
513
539
|
mapping: []
|
|
514
540
|
};
|
|
515
541
|
}
|
|
516
|
-
function
|
|
542
|
+
function Ze(e) {
|
|
517
543
|
let t = [];
|
|
518
544
|
for (let n of e) {
|
|
519
545
|
let e = t.length;
|
|
@@ -528,10 +554,10 @@ function et(e) {
|
|
|
528
554
|
}
|
|
529
555
|
return t;
|
|
530
556
|
}
|
|
531
|
-
var
|
|
557
|
+
var S = class t {
|
|
532
558
|
constructor(e) {
|
|
533
|
-
|
|
534
|
-
let t =
|
|
559
|
+
b(this, "tags", void 0), b(this, "implicitScalarTags", void 0), b(this, "implicitScalarByFirstChar", void 0), b(this, "implicitScalarAnyFirstChar", void 0), b(this, "defaultScalarTag", void 0), b(this, "defaultSequenceTag", void 0), b(this, "defaultMappingTag", void 0), b(this, "exact", void 0), b(this, "prefix", void 0);
|
|
560
|
+
let t = Ze(e), n = [], r = Ye(), i = Xe();
|
|
535
561
|
for (let e of t) {
|
|
536
562
|
if (e.nodeKind === "scalar" && e.implicit) {
|
|
537
563
|
if (e.matchByTagPrefix) throw Error("Implicit scalar tags cannot match by tag prefix");
|
|
@@ -557,46 +583,83 @@ var v = class e {
|
|
|
557
583
|
if (!c) throw Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");
|
|
558
584
|
this.tags = t, this.implicitScalarTags = n, this.implicitScalarByFirstChar = s, this.implicitScalarAnyFirstChar = a, this.defaultScalarTag = c, this.defaultSequenceTag = r.sequence["tag:yaml.org,2002:seq"], this.defaultMappingTag = r.mapping["tag:yaml.org,2002:map"], this.exact = r, this.prefix = i;
|
|
559
585
|
}
|
|
560
|
-
|
|
561
|
-
let
|
|
562
|
-
|
|
563
|
-
|
|
586
|
+
lookupScalarTag(e) {
|
|
587
|
+
let t = this.exact.scalar[e];
|
|
588
|
+
if (t) return t;
|
|
589
|
+
for (let t of this.prefix.scalar) if (e.startsWith(t.tagName)) return t;
|
|
590
|
+
}
|
|
591
|
+
lookupSequenceTag(e) {
|
|
592
|
+
let t = this.exact.sequence[e];
|
|
593
|
+
if (t) return t;
|
|
594
|
+
for (let t of this.prefix.sequence) if (e.startsWith(t.tagName)) return t;
|
|
595
|
+
}
|
|
596
|
+
lookupMappingTag(e) {
|
|
597
|
+
let t = this.exact.mapping[e];
|
|
598
|
+
if (t) return t;
|
|
599
|
+
for (let t of this.prefix.mapping) if (e.startsWith(t.tagName)) return t;
|
|
600
|
+
}
|
|
601
|
+
resolveImplicitScalarTag(t) {
|
|
602
|
+
var n;
|
|
603
|
+
let r = (n = this.implicitScalarByFirstChar.get(t.charAt(0))) == null ? this.implicitScalarAnyFirstChar : n;
|
|
604
|
+
for (let n of r) {
|
|
605
|
+
let r = n.resolve(t, !1, n.tagName);
|
|
606
|
+
if (r !== e) return {
|
|
607
|
+
value: r,
|
|
608
|
+
tag: n
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
let i = this.defaultScalarTag;
|
|
612
|
+
return {
|
|
613
|
+
value: i.resolve(t, !1, i.tagName),
|
|
614
|
+
tag: i
|
|
615
|
+
};
|
|
564
616
|
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
...tt.tags,
|
|
617
|
+
withTags(...e) {
|
|
618
|
+
let n = [];
|
|
619
|
+
for (let t of e) n = n.concat(t);
|
|
620
|
+
return new t([...this.tags, ...n]);
|
|
621
|
+
}
|
|
622
|
+
}, C = new S([
|
|
623
|
+
i,
|
|
624
|
+
Be,
|
|
625
|
+
We
|
|
626
|
+
]), Qe = new S([
|
|
627
|
+
...C.tags,
|
|
577
628
|
s,
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
]),
|
|
582
|
-
...
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
629
|
+
h,
|
|
630
|
+
fe,
|
|
631
|
+
Te
|
|
632
|
+
]), $e = new S([
|
|
633
|
+
...C.tags,
|
|
634
|
+
o,
|
|
635
|
+
f,
|
|
636
|
+
se,
|
|
637
|
+
be
|
|
638
|
+
]), et = new S([
|
|
639
|
+
...C.tags,
|
|
640
|
+
l,
|
|
641
|
+
ne,
|
|
642
|
+
g,
|
|
643
|
+
_,
|
|
644
|
+
ze,
|
|
645
|
+
Ae,
|
|
646
|
+
Pe,
|
|
587
647
|
He,
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
648
|
+
Ue,
|
|
649
|
+
Ge
|
|
650
|
+
]), tt = et.withTags(x(x({}, g), {}, { resolve: (t, n, r) => {
|
|
651
|
+
let i = g.resolve(t, n, r);
|
|
652
|
+
return i === e ? se.resolve(t, n, r) : i;
|
|
653
|
+
} }), x(x({}, _), {}, { resolve: (t, n, r) => {
|
|
654
|
+
let i = _.resolve(t, n, r);
|
|
655
|
+
return i === e ? be.resolve(t, n, r) : i;
|
|
656
|
+
} })), nt = r("tag:yaml.org,2002:map", {
|
|
594
657
|
create: () => /* @__PURE__ */ new Map(),
|
|
595
658
|
addPair: (e, t, n) => (e.set(t, n), ""),
|
|
596
659
|
has: (e, t) => e.has(t),
|
|
597
660
|
keys: (e) => e.keys(),
|
|
598
661
|
get: (e, t) => e.get(t),
|
|
599
|
-
identify: (e) => e instanceof Map ||
|
|
662
|
+
identify: (e) => e instanceof Map || v(e),
|
|
600
663
|
represent: (e) => {
|
|
601
664
|
if (e instanceof Map) return e;
|
|
602
665
|
let t = /* @__PURE__ */ new Map(), n = e;
|
|
@@ -606,7 +669,7 @@ var v = class e {
|
|
|
606
669
|
});
|
|
607
670
|
//#endregion
|
|
608
671
|
//#region src/tag/mapping/legacy_map.ts
|
|
609
|
-
function
|
|
672
|
+
function rt(e) {
|
|
610
673
|
if (Array.isArray(e)) {
|
|
611
674
|
let t = Array.prototype.slice.call(e);
|
|
612
675
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -617,16 +680,16 @@ function ot(e) {
|
|
|
617
680
|
}
|
|
618
681
|
return typeof e == "object" && Object.prototype.toString.call(e) === "[object Object]" ? "[object Object]" : String(e);
|
|
619
682
|
}
|
|
620
|
-
var
|
|
683
|
+
var it = r("tag:yaml.org,2002:map", {
|
|
621
684
|
create: () => ({}),
|
|
622
|
-
identify:
|
|
685
|
+
identify: v,
|
|
623
686
|
represent: (e) => {
|
|
624
687
|
let t = /* @__PURE__ */ new Map();
|
|
625
688
|
for (let n of Object.keys(e)) t.set(n, e[n]);
|
|
626
689
|
return t;
|
|
627
690
|
},
|
|
628
691
|
addPair: (e, t, n) => {
|
|
629
|
-
let r =
|
|
692
|
+
let r = rt(t);
|
|
630
693
|
return r === null ? "nested arrays are not supported inside keys" : (r === "__proto__" ? Object.defineProperty(e, r, {
|
|
631
694
|
value: n,
|
|
632
695
|
enumerable: !0,
|
|
@@ -635,7 +698,7 @@ var st = i("tag:yaml.org,2002:map", {
|
|
|
635
698
|
}) : e[r] = n, "");
|
|
636
699
|
},
|
|
637
700
|
has: (e, t) => {
|
|
638
|
-
let n =
|
|
701
|
+
let n = rt(t);
|
|
639
702
|
return n !== null && Object.prototype.hasOwnProperty.call(e, n);
|
|
640
703
|
},
|
|
641
704
|
keys: (e) => Object.keys(e),
|
|
@@ -643,99 +706,90 @@ var st = i("tag:yaml.org,2002:map", {
|
|
|
643
706
|
let n = String(t);
|
|
644
707
|
return Object.prototype.hasOwnProperty.call(e, n) ? e[n] : null;
|
|
645
708
|
}
|
|
646
|
-
})
|
|
647
|
-
//#endregion
|
|
648
|
-
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/objectSpread2.js
|
|
649
|
-
function ct(e, t) {
|
|
650
|
-
var n = Object.keys(e);
|
|
651
|
-
if (Object.getOwnPropertySymbols) {
|
|
652
|
-
var r = Object.getOwnPropertySymbols(e);
|
|
653
|
-
t && (r = r.filter(function(t) {
|
|
654
|
-
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
655
|
-
})), n.push.apply(n, r);
|
|
656
|
-
}
|
|
657
|
-
return n;
|
|
658
|
-
}
|
|
659
|
-
function y(e) {
|
|
660
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
661
|
-
var n = arguments[t] == null ? {} : arguments[t];
|
|
662
|
-
t % 2 ? ct(Object(n), !0).forEach(function(t) {
|
|
663
|
-
_(e, t, n[t]);
|
|
664
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ct(Object(n)).forEach(function(t) {
|
|
665
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
666
|
-
});
|
|
667
|
-
}
|
|
668
|
-
return e;
|
|
669
|
-
}
|
|
670
|
-
//#endregion
|
|
671
|
-
//#region src/common/snippet.ts
|
|
672
|
-
var lt = {
|
|
709
|
+
}), at = {
|
|
673
710
|
maxLength: 79,
|
|
674
711
|
indent: 1,
|
|
675
712
|
linesBefore: 3,
|
|
676
713
|
linesAfter: 2
|
|
677
714
|
};
|
|
678
|
-
function
|
|
715
|
+
function ot(e, t, n, r, i) {
|
|
679
716
|
let a = "", o = "", s = Math.floor(i / 2) - 1;
|
|
680
717
|
return r - t > s && (a = " ... ", t = r - s + a.length), n - r > s && (o = " ...", n = r + s - o.length), {
|
|
681
718
|
str: a + e.slice(t, n).replace(/\t/g, "→") + o,
|
|
682
719
|
pos: r - t + a.length
|
|
683
720
|
};
|
|
684
721
|
}
|
|
685
|
-
function
|
|
722
|
+
function st(e, t) {
|
|
686
723
|
return " ".repeat(Math.max(t - e.length, 0)) + e;
|
|
687
724
|
}
|
|
688
|
-
function
|
|
725
|
+
function ct(e, t) {
|
|
689
726
|
if (!e.buffer) return null;
|
|
690
|
-
let n =
|
|
727
|
+
let n = x(x({}, at), t), r = /\r?\n|\r|\0/g, i = [0], a = [], o, s = -1;
|
|
691
728
|
for (; o = r.exec(e.buffer);) a.push(o.index), i.push(o.index + o[0].length), e.position <= o.index && s < 0 && (s = i.length - 2);
|
|
692
729
|
s < 0 && (s = i.length - 1);
|
|
693
730
|
let c = "", l = Math.min(e.line + n.linesAfter, a.length).toString().length, u = n.maxLength - (n.indent + l + 3);
|
|
694
731
|
for (let t = 1; t <= n.linesBefore && !(s - t < 0); t++) {
|
|
695
|
-
let r =
|
|
696
|
-
c = `${" ".repeat(n.indent)}${
|
|
732
|
+
let r = ot(e.buffer, i[s - t], a[s - t], e.position - (i[s] - i[s - t]), u);
|
|
733
|
+
c = `${" ".repeat(n.indent)}${st((e.line - t + 1).toString(), l)} | ${r.str}\n${c}`;
|
|
697
734
|
}
|
|
698
|
-
let d =
|
|
699
|
-
c += `${" ".repeat(n.indent)}${
|
|
735
|
+
let d = ot(e.buffer, i[s], a[s], e.position, u);
|
|
736
|
+
c += `${" ".repeat(n.indent)}${st((e.line + 1).toString(), l)} | ${d.str}\n`, c += `${"-".repeat(n.indent + l + 3 + d.pos)}^\n`;
|
|
700
737
|
for (let t = 1; t <= n.linesAfter && !(s + t >= a.length); t++) {
|
|
701
|
-
let r =
|
|
702
|
-
c += `${" ".repeat(n.indent)}${
|
|
738
|
+
let r = ot(e.buffer, i[s + t], a[s + t], e.position - (i[s] - i[s + t]), u);
|
|
739
|
+
c += `${" ".repeat(n.indent)}${st((e.line + t + 1).toString(), l)} | ${r.str}\n`;
|
|
703
740
|
}
|
|
704
741
|
return c.replace(/\n$/, "");
|
|
705
742
|
}
|
|
706
743
|
//#endregion
|
|
707
744
|
//#region src/common/exception.ts
|
|
708
|
-
function
|
|
745
|
+
function lt(e, t) {
|
|
709
746
|
let n = "";
|
|
710
747
|
return e.mark ? (e.mark.name && (n += `in "${e.mark.name}" `), n += `(${e.mark.line + 1}:${e.mark.column + 1})`, !t && e.mark.snippet && (n += `\n\n${e.mark.snippet}`), `${e.reason} ${n}`) : e.reason;
|
|
711
748
|
}
|
|
712
|
-
var
|
|
749
|
+
var w = class e extends Error {
|
|
713
750
|
constructor(e, t) {
|
|
714
|
-
super(),
|
|
751
|
+
super(), b(this, "reason", void 0), b(this, "mark", void 0), this.name = "YAMLException", this.reason = e, this.mark = t, this.message = lt(this, !1), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
|
|
715
752
|
}
|
|
716
753
|
toString(e) {
|
|
717
|
-
return `${this.name}: ${
|
|
754
|
+
return `${this.name}: ${lt(this, e)}`;
|
|
718
755
|
}
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
756
|
+
static throwAt(t, n, r, i = "") {
|
|
757
|
+
let a = 0, o = 0;
|
|
758
|
+
for (let e = 0; e < n; e++) {
|
|
759
|
+
let n = t.charCodeAt(e);
|
|
760
|
+
n === 10 ? (a++, o = e + 1) : n === 13 && (a++, t.charCodeAt(e + 1) === 10 && e++, o = e + 1);
|
|
761
|
+
}
|
|
762
|
+
let s = {
|
|
763
|
+
name: i,
|
|
764
|
+
buffer: t,
|
|
765
|
+
position: n,
|
|
766
|
+
line: a,
|
|
767
|
+
column: n - o
|
|
768
|
+
};
|
|
769
|
+
throw s.snippet = ct(s), new e(r, s);
|
|
770
|
+
}
|
|
771
|
+
}, T = {
|
|
772
|
+
DOCUMENT: 1,
|
|
773
|
+
SEQUENCE: 2,
|
|
774
|
+
MAPPING: 3,
|
|
775
|
+
SCALAR: 4,
|
|
776
|
+
ALIAS: 5,
|
|
777
|
+
POP: 6
|
|
778
|
+
}, E = {
|
|
779
|
+
PLAIN: 1,
|
|
780
|
+
SINGLE_QUOTED: 2,
|
|
781
|
+
DOUBLE_QUOTED: 3,
|
|
782
|
+
LITERAL_BLOCK: 4,
|
|
783
|
+
FOLDED_BLOCK: 5
|
|
784
|
+
}, D = {
|
|
785
|
+
BLOCK: 1,
|
|
786
|
+
FLOW: 2
|
|
787
|
+
}, O = {
|
|
788
|
+
CLIP: 1,
|
|
789
|
+
STRIP: 2,
|
|
790
|
+
KEEP: 3
|
|
791
|
+
}, ut = -1;
|
|
792
|
+
function dt(e) {
|
|
739
793
|
switch (e) {
|
|
740
794
|
case 48: return "\0";
|
|
741
795
|
case 97: return "\x07";
|
|
@@ -758,18 +812,18 @@ function Mt(e) {
|
|
|
758
812
|
default: return "";
|
|
759
813
|
}
|
|
760
814
|
}
|
|
761
|
-
var
|
|
762
|
-
for (let e = 0; e < 256; e++)
|
|
763
|
-
function
|
|
815
|
+
var ft = Array(256), pt = Array(256);
|
|
816
|
+
for (let e = 0; e < 256; e++) ft[e] = +!!dt(e), pt[e] = dt(e);
|
|
817
|
+
function mt(e) {
|
|
764
818
|
return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode((e - 65536 >> 10) + 55296, (e - 65536 & 1023) + 56320);
|
|
765
819
|
}
|
|
766
|
-
function
|
|
820
|
+
function ht(e) {
|
|
767
821
|
return e >= 48 && e <= 57 ? e - 48 : (e | 32) - 97 + 10;
|
|
768
822
|
}
|
|
769
|
-
function
|
|
823
|
+
function gt(e) {
|
|
770
824
|
return e === 120 ? 2 : e === 117 ? 4 : 8;
|
|
771
825
|
}
|
|
772
|
-
function
|
|
826
|
+
function _t(e, t, n) {
|
|
773
827
|
let r = 0;
|
|
774
828
|
for (; t < n;) {
|
|
775
829
|
let n = e.charCodeAt(t);
|
|
@@ -783,62 +837,62 @@ function Rt(e, t, n) {
|
|
|
783
837
|
breaks: r
|
|
784
838
|
};
|
|
785
839
|
}
|
|
786
|
-
function
|
|
840
|
+
function vt(e) {
|
|
787
841
|
return e === 1 ? " " : "\n".repeat(e - 1);
|
|
788
842
|
}
|
|
789
|
-
function
|
|
843
|
+
function yt(e, t, n) {
|
|
790
844
|
let r = "", i = t, a = t, o = t;
|
|
791
845
|
for (; i < n;) {
|
|
792
846
|
let t = e.charCodeAt(i);
|
|
793
847
|
if (t === 10 || t === 13) {
|
|
794
848
|
r += e.slice(a, o);
|
|
795
|
-
let t =
|
|
796
|
-
r +=
|
|
849
|
+
let t = _t(e, i, n);
|
|
850
|
+
r += vt(t.breaks), i = a = o = t.position;
|
|
797
851
|
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
798
852
|
}
|
|
799
853
|
return r + e.slice(a, o);
|
|
800
854
|
}
|
|
801
|
-
function
|
|
855
|
+
function bt(e, t, n) {
|
|
802
856
|
let r = "", i = t, a = t, o = t;
|
|
803
857
|
for (; i < n;) {
|
|
804
858
|
let t = e.charCodeAt(i);
|
|
805
859
|
if (t === 39) r += e.slice(a, i) + "'", i += 2, a = o = i;
|
|
806
860
|
else if (t === 10 || t === 13) {
|
|
807
861
|
r += e.slice(a, o);
|
|
808
|
-
let t =
|
|
809
|
-
r +=
|
|
862
|
+
let t = _t(e, i, n);
|
|
863
|
+
r += vt(t.breaks), i = a = o = t.position;
|
|
810
864
|
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
811
865
|
}
|
|
812
866
|
return r + e.slice(a, n);
|
|
813
867
|
}
|
|
814
|
-
function
|
|
868
|
+
function xt(e, t, n) {
|
|
815
869
|
let r = "", i = t, a = t, o = t;
|
|
816
870
|
for (; i < n;) {
|
|
817
871
|
let t = e.charCodeAt(i);
|
|
818
872
|
if (t === 92) {
|
|
819
873
|
r += e.slice(a, i), i++;
|
|
820
874
|
let t = e.charCodeAt(i);
|
|
821
|
-
if (t === 10 || t === 13) i =
|
|
822
|
-
else if (t < 256 &&
|
|
875
|
+
if (t === 10 || t === 13) i = _t(e, i, n).position;
|
|
876
|
+
else if (t < 256 && ft[t]) r += pt[t], i++;
|
|
823
877
|
else {
|
|
824
|
-
let n =
|
|
878
|
+
let n = gt(t), a = 0;
|
|
825
879
|
for (; n > 0; n--) {
|
|
826
880
|
i++;
|
|
827
|
-
let t =
|
|
881
|
+
let t = ht(e.charCodeAt(i));
|
|
828
882
|
a = (a << 4) + t;
|
|
829
883
|
}
|
|
830
|
-
r +=
|
|
884
|
+
r += mt(a), i++;
|
|
831
885
|
}
|
|
832
886
|
a = o = i;
|
|
833
887
|
} else if (t === 10 || t === 13) {
|
|
834
888
|
r += e.slice(a, o);
|
|
835
|
-
let t =
|
|
836
|
-
r +=
|
|
889
|
+
let t = _t(e, i, n);
|
|
890
|
+
r += vt(t.breaks), i = a = o = t.position;
|
|
837
891
|
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
838
892
|
}
|
|
839
893
|
return r + e.slice(a, n);
|
|
840
894
|
}
|
|
841
|
-
function
|
|
895
|
+
function St(e, t, n, r, i, a) {
|
|
842
896
|
let o = r < 0 ? 0 : r, s = e.slice(t, n).replace(/\r\n?/g, "\n"), c = s === "" ? [] : (s.endsWith("\n") ? s.slice(0, -1) : s).split("\n"), l = "", u = !1, d = 0, f = !1;
|
|
843
897
|
for (let e of c) {
|
|
844
898
|
let t = 0;
|
|
@@ -850,162 +904,146 @@ function Ut(e, t, n, r, i, a) {
|
|
|
850
904
|
let n = e.slice(o), i = n.charCodeAt(0);
|
|
851
905
|
a ? i === 32 || i === 9 ? (f = !0, l += "\n".repeat(u ? 1 + d : d)) : f ? (f = !1, l += "\n".repeat(d + 1)) : d === 0 ? u && (l += " ") : l += "\n".repeat(d) : l += "\n".repeat(u ? 1 + d : d), l += n, u = !0, d = 0;
|
|
852
906
|
}
|
|
853
|
-
return i ===
|
|
907
|
+
return i === O.KEEP ? l += "\n".repeat(u ? 1 + d : d) : i !== O.STRIP && u && (l += "\n"), l;
|
|
854
908
|
}
|
|
855
|
-
function
|
|
856
|
-
if (t.valueStart ===
|
|
909
|
+
function Ct(e, t) {
|
|
910
|
+
if (t.valueStart === ut) return "";
|
|
857
911
|
let { valueStart: n, valueEnd: r } = t;
|
|
858
912
|
if (t.fast) return e.slice(n, r);
|
|
859
913
|
switch (t.style) {
|
|
860
|
-
case
|
|
861
|
-
case
|
|
862
|
-
case
|
|
863
|
-
case
|
|
864
|
-
default: return
|
|
914
|
+
case E.SINGLE_QUOTED: return bt(e, n, r);
|
|
915
|
+
case E.DOUBLE_QUOTED: return xt(e, n, r);
|
|
916
|
+
case E.LITERAL_BLOCK: return St(e, n, r, t.indent, t.chomping, !1);
|
|
917
|
+
case E.FOLDED_BLOCK: return St(e, n, r, t.indent, t.chomping, !0);
|
|
918
|
+
default: return yt(e, n, r);
|
|
865
919
|
}
|
|
866
920
|
}
|
|
867
921
|
//#endregion
|
|
868
922
|
//#region src/common/tagname.ts
|
|
869
|
-
var
|
|
923
|
+
var wt = Object.assign(Object.create(null), {
|
|
870
924
|
"!": "!",
|
|
871
925
|
"!!": "tag:yaml.org,2002:"
|
|
872
926
|
});
|
|
873
|
-
function
|
|
927
|
+
function Tt(e) {
|
|
874
928
|
return encodeURI(e).replace(/!/g, "%21");
|
|
875
929
|
}
|
|
876
|
-
function
|
|
930
|
+
function Et(e, t) {
|
|
877
931
|
var n, r;
|
|
878
932
|
if (e.startsWith("!<") && e.endsWith(">")) return decodeURIComponent(e.slice(2, -1));
|
|
879
|
-
let i = e.indexOf("!", 1), a = i === -1 ? "!" : e.slice(0, i + 1), o = (n = (r = t == null ? void 0 : t[a]) == null ?
|
|
933
|
+
let i = e.indexOf("!", 1), a = i === -1 ? "!" : e.slice(0, i + 1), o = (n = (r = t == null ? void 0 : t[a]) == null ? wt[a] : r) == null ? a : n;
|
|
880
934
|
return decodeURIComponent(o) + decodeURIComponent(e.slice(a.length));
|
|
881
935
|
}
|
|
882
|
-
function
|
|
936
|
+
function Dt(e) {
|
|
883
937
|
let t = e;
|
|
884
|
-
return t.charCodeAt(0) === 33 ? (t = t.slice(1), `!${
|
|
938
|
+
return t.charCodeAt(0) === 33 ? (t = t.slice(1), `!${Tt(t)}`) : t.slice(0, 18) === "tag:yaml.org,2002:" ? `!!${Tt(t.slice(18))}` : `!<${Tt(t)}>`;
|
|
885
939
|
}
|
|
886
940
|
//#endregion
|
|
887
941
|
//#region src/parser/constructor.ts
|
|
888
|
-
var
|
|
942
|
+
var k = -1, Ot = "tag:yaml.org,2002:merge", kt = {
|
|
889
943
|
filename: "",
|
|
890
|
-
schema:
|
|
944
|
+
schema: $e,
|
|
891
945
|
json: !1,
|
|
892
946
|
maxTotalMergeKeys: 1e4,
|
|
893
947
|
maxAliases: -1
|
|
894
948
|
};
|
|
895
|
-
function
|
|
896
|
-
return "tagStart" in e && e.tagStart !==
|
|
949
|
+
function At(e) {
|
|
950
|
+
return "tagStart" in e && e.tagStart !== k ? e.tagStart : "anchorStart" in e && e.anchorStart !== k ? e.anchorStart : "valueStart" in e && e.valueStart !== k ? e.valueStart : "start" in e ? e.start : 0;
|
|
897
951
|
}
|
|
898
|
-
function
|
|
899
|
-
|
|
952
|
+
function A(e, t) {
|
|
953
|
+
w.throwAt(e.source, e.position, t, e.filename);
|
|
900
954
|
}
|
|
901
|
-
function
|
|
955
|
+
function jt(e, t, n, r) {
|
|
902
956
|
try {
|
|
903
957
|
return n.finalize(r);
|
|
904
958
|
} catch (n) {
|
|
905
|
-
if (n instanceof
|
|
906
|
-
|
|
959
|
+
if (n instanceof w) throw n;
|
|
960
|
+
w.throwAt(e.source, t, n instanceof Error ? n.message : String(n), e.filename);
|
|
907
961
|
}
|
|
908
962
|
}
|
|
909
|
-
function
|
|
910
|
-
let r =
|
|
911
|
-
if (r) return r;
|
|
912
|
-
for (let e of t) if (n.startsWith(e.tagName)) return e;
|
|
913
|
-
}
|
|
914
|
-
function $t(e, t, n, r, i) {
|
|
915
|
-
let a = Qt(t, n, r);
|
|
916
|
-
if (a) return a;
|
|
917
|
-
S(e, `unknown ${i} tag !<${r}>`);
|
|
918
|
-
}
|
|
919
|
-
function en(t, n) {
|
|
920
|
-
let r = Wt(t.source, n), i = n.tagStart === x ? "" : t.source.slice(n.tagStart, n.tagEnd), a = t.schema.defaultScalarTag;
|
|
963
|
+
function Mt(t, n) {
|
|
964
|
+
let r = Ct(t.source, n), i = n.tagStart === k ? "" : t.source.slice(n.tagStart, n.tagEnd), a = t.schema.defaultScalarTag;
|
|
921
965
|
if (i !== "") {
|
|
922
966
|
var o;
|
|
923
967
|
if (i === "!") return {
|
|
924
968
|
value: r,
|
|
925
969
|
tag: a
|
|
926
970
|
};
|
|
927
|
-
let n =
|
|
971
|
+
let n = Et(i, t.tagHandlers), s = t.schema.lookupScalarTag(n);
|
|
928
972
|
if (s) {
|
|
929
973
|
let i = s.resolve(r, !0, n);
|
|
930
|
-
return i === e &&
|
|
974
|
+
return i === e && A(t, `cannot resolve a node with !<${n}> explicit tag`), {
|
|
931
975
|
value: i,
|
|
932
976
|
tag: s
|
|
933
977
|
};
|
|
934
978
|
}
|
|
935
|
-
let c = (o =
|
|
979
|
+
let c = (o = t.schema.lookupMappingTag(n)) == null ? t.schema.lookupSequenceTag(n) : o;
|
|
936
980
|
if (c) {
|
|
937
|
-
r !== "" &&
|
|
981
|
+
r !== "" && A(t, `cannot resolve a node with !<${n}> explicit tag`);
|
|
938
982
|
let e = c.create(n);
|
|
939
983
|
return {
|
|
940
|
-
value: c.carrierIsResult ? e :
|
|
984
|
+
value: c.carrierIsResult ? e : jt(t, t.position, c, e),
|
|
941
985
|
tag: c
|
|
942
986
|
};
|
|
943
987
|
}
|
|
944
|
-
|
|
945
|
-
}
|
|
946
|
-
if (n.style === 1) {
|
|
947
|
-
var s;
|
|
948
|
-
let n = (s = t.schema.implicitScalarByFirstChar.get(r.charAt(0))) == null ? t.schema.implicitScalarAnyFirstChar : s;
|
|
949
|
-
for (let t of n) {
|
|
950
|
-
let n = t.resolve(r, !1, t.tagName);
|
|
951
|
-
if (n !== e) return {
|
|
952
|
-
value: n,
|
|
953
|
-
tag: t
|
|
954
|
-
};
|
|
955
|
-
}
|
|
988
|
+
A(t, `unknown scalar tag !<${n}>`);
|
|
956
989
|
}
|
|
957
|
-
return {
|
|
990
|
+
return n.style === E.PLAIN ? t.schema.resolveImplicitScalarTag(r) : {
|
|
958
991
|
value: a.resolve(r, !1, a.tagName),
|
|
959
992
|
tag: a
|
|
960
993
|
};
|
|
961
994
|
}
|
|
962
|
-
function
|
|
963
|
-
let
|
|
964
|
-
return
|
|
965
|
-
tagName: s,
|
|
966
|
-
tag: $t(e, n, r, s, a)
|
|
967
|
-
};
|
|
995
|
+
function Nt(e, t, n) {
|
|
996
|
+
let r = t.tagStart === k ? "" : e.source.slice(t.tagStart, t.tagEnd);
|
|
997
|
+
return r === "" || r === "!" ? n : Et(r, e.tagHandlers);
|
|
968
998
|
}
|
|
969
|
-
function
|
|
999
|
+
function Pt(e) {
|
|
970
1000
|
return e.nodeKind === "mapping";
|
|
971
1001
|
}
|
|
972
|
-
function
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
1002
|
+
function Ft(e) {
|
|
1003
|
+
e.totalMergeKeys++, e.maxTotalMergeKeys !== -1 && e.totalMergeKeys > e.maxTotalMergeKeys && A(e, `merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`);
|
|
1004
|
+
}
|
|
1005
|
+
function It(e, t, n, r) {
|
|
1006
|
+
Ft(e);
|
|
1007
|
+
for (let i of r.keys(n)) {
|
|
1008
|
+
if (Ft(e), t.tag.has(t.value, i)) continue;
|
|
1009
|
+
let a = t.tag.addPair(t.value, i, r.get(n, i));
|
|
1010
|
+
a && A(e, a), t.overridable != null || (t.overridable = /* @__PURE__ */ new Set()), t.overridable.add(i);
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
function Lt(e, t, n, r) {
|
|
1014
|
+
if (e.position = t.keyPosition, Pt(r)) It(e, t, n, r);
|
|
1015
|
+
else if (r.nodeKind === "sequence" && Array.isArray(n)) {
|
|
1016
|
+
n.length > 100 && A(e, "abnormal merge sequence size");
|
|
1017
|
+
for (let r of n) {
|
|
1018
|
+
let n = e.nodeTags.get(r);
|
|
1019
|
+
n || A(e, "cannot merge mappings; the provided source object is unacceptable"), It(e, t, r, n);
|
|
1020
|
+
}
|
|
1021
|
+
} else A(e, "cannot merge mappings; the provided source object is unacceptable");
|
|
984
1022
|
}
|
|
985
|
-
function
|
|
986
|
-
var
|
|
987
|
-
if (e.position =
|
|
988
|
-
|
|
1023
|
+
function Rt(e, t, n, r, i) {
|
|
1024
|
+
var a, o;
|
|
1025
|
+
if (e.position = t.keyPosition, t.keyIsMerge) {
|
|
1026
|
+
Lt(e, t, r, i);
|
|
989
1027
|
return;
|
|
990
1028
|
}
|
|
991
|
-
!e.json &&
|
|
992
|
-
let
|
|
993
|
-
|
|
1029
|
+
!e.json && t.tag.has(t.value, n) && !((a = t.overridable) != null && a.has(n)) && A(e, "duplicated mapping key");
|
|
1030
|
+
let s = t.tag.addPair(t.value, n, r);
|
|
1031
|
+
s && A(e, s), (o = t.overridable) == null || o.delete(n);
|
|
994
1032
|
}
|
|
995
|
-
function
|
|
1033
|
+
function zt(e, t, n) {
|
|
996
1034
|
let r = e.frames[e.frames.length - 1];
|
|
997
1035
|
if (r.kind === "document") r.value = t, r.hasValue = !0;
|
|
998
1036
|
else if (r.kind === "sequence") {
|
|
999
|
-
|
|
1037
|
+
Pt(n) && e.nodeTags.set(t, n);
|
|
1000
1038
|
let i = r.tag.addItem(r.value, t, r.index++);
|
|
1001
|
-
i &&
|
|
1039
|
+
i && A(e, i);
|
|
1002
1040
|
} else if (r.hasKey) {
|
|
1003
1041
|
let i = r.key;
|
|
1004
|
-
r.key = void 0, r.hasKey = !1,
|
|
1005
|
-
} else r.key = t, r.keyPosition = e.position, r.hasKey = !0;
|
|
1042
|
+
r.key = void 0, r.hasKey = !1, Rt(e, r, i, t, n);
|
|
1043
|
+
} else r.key = t, r.keyPosition = e.position, r.hasKey = !0, r.keyIsMerge = n.tagName === Ot;
|
|
1006
1044
|
}
|
|
1007
|
-
function
|
|
1008
|
-
if (t.anchorStart !==
|
|
1045
|
+
function Bt(e, t, n, r, i) {
|
|
1046
|
+
if (t.anchorStart !== k) {
|
|
1009
1047
|
let a = {
|
|
1010
1048
|
value: n,
|
|
1011
1049
|
tag: r,
|
|
@@ -1015,100 +1053,105 @@ function cn(e, t, n, r, i) {
|
|
|
1015
1053
|
}
|
|
1016
1054
|
return null;
|
|
1017
1055
|
}
|
|
1018
|
-
function
|
|
1019
|
-
let
|
|
1056
|
+
function Vt(e, t) {
|
|
1057
|
+
let n = x(x(x({}, kt), t), {}, {
|
|
1020
1058
|
events: e,
|
|
1021
1059
|
documents: [],
|
|
1022
1060
|
eventIndex: 0,
|
|
1023
1061
|
position: 0,
|
|
1024
1062
|
frames: [],
|
|
1025
1063
|
anchors: /* @__PURE__ */ new Map(),
|
|
1064
|
+
nodeTags: /* @__PURE__ */ new Map(),
|
|
1026
1065
|
tagHandlers: Object.create(null),
|
|
1027
1066
|
totalMergeKeys: 0,
|
|
1028
1067
|
aliasCount: 0
|
|
1029
1068
|
});
|
|
1030
|
-
for (;
|
|
1031
|
-
let e =
|
|
1032
|
-
switch (
|
|
1033
|
-
case
|
|
1034
|
-
|
|
1035
|
-
for (let t of e.directives) t.kind === "tag" && (
|
|
1036
|
-
|
|
1069
|
+
for (; n.eventIndex < n.events.length;) {
|
|
1070
|
+
let e = n.events[n.eventIndex++];
|
|
1071
|
+
switch (n.position = At(e), e.type) {
|
|
1072
|
+
case T.DOCUMENT:
|
|
1073
|
+
n.anchors = /* @__PURE__ */ new Map(), n.nodeTags = /* @__PURE__ */ new Map(), n.aliasCount = 0, n.tagHandlers = Object.create(null);
|
|
1074
|
+
for (let t of e.directives) t.kind === "tag" && (n.tagHandlers[t.handle] = t.prefix);
|
|
1075
|
+
n.frames.push({
|
|
1037
1076
|
kind: "document",
|
|
1038
|
-
position:
|
|
1077
|
+
position: n.position,
|
|
1039
1078
|
value: void 0,
|
|
1040
1079
|
hasValue: !1
|
|
1041
1080
|
});
|
|
1042
1081
|
break;
|
|
1043
|
-
case
|
|
1044
|
-
let { value: t, tag:
|
|
1045
|
-
|
|
1082
|
+
case T.SCALAR: {
|
|
1083
|
+
let { value: t, tag: r } = Mt(n, e);
|
|
1084
|
+
Bt(n, e, t, r, !0), zt(n, t, r);
|
|
1046
1085
|
break;
|
|
1047
1086
|
}
|
|
1048
|
-
case
|
|
1049
|
-
let
|
|
1050
|
-
r
|
|
1087
|
+
case T.SEQUENCE: {
|
|
1088
|
+
let t = Nt(n, e, "tag:yaml.org,2002:seq"), r = n.schema.lookupSequenceTag(t);
|
|
1089
|
+
r || A(n, `unknown sequence tag !<${t}>`);
|
|
1090
|
+
let i = r.create(t), a = Bt(n, e, i, r, r.carrierIsResult);
|
|
1091
|
+
n.frames.push({
|
|
1051
1092
|
kind: "sequence",
|
|
1052
|
-
position:
|
|
1093
|
+
position: n.position,
|
|
1053
1094
|
value: i,
|
|
1054
|
-
tag:
|
|
1095
|
+
tag: r,
|
|
1055
1096
|
anchor: a,
|
|
1056
|
-
index: 0
|
|
1057
|
-
merge: s
|
|
1097
|
+
index: 0
|
|
1058
1098
|
});
|
|
1059
1099
|
break;
|
|
1060
1100
|
}
|
|
1061
|
-
case
|
|
1062
|
-
let t =
|
|
1063
|
-
r
|
|
1101
|
+
case T.MAPPING: {
|
|
1102
|
+
let t = Nt(n, e, "tag:yaml.org,2002:map"), r = n.schema.lookupMappingTag(t);
|
|
1103
|
+
r || A(n, `unknown mapping tag !<${t}>`);
|
|
1104
|
+
let i = r.create(t), a = Bt(n, e, i, r, r.carrierIsResult);
|
|
1105
|
+
n.frames.push({
|
|
1064
1106
|
kind: "mapping",
|
|
1065
|
-
position:
|
|
1066
|
-
value:
|
|
1067
|
-
tag:
|
|
1068
|
-
anchor:
|
|
1107
|
+
position: n.position,
|
|
1108
|
+
value: i,
|
|
1109
|
+
tag: r,
|
|
1110
|
+
anchor: a,
|
|
1069
1111
|
key: void 0,
|
|
1070
|
-
keyPosition:
|
|
1112
|
+
keyPosition: n.position,
|
|
1071
1113
|
hasKey: !1,
|
|
1114
|
+
keyIsMerge: !1,
|
|
1072
1115
|
overridable: null
|
|
1073
1116
|
});
|
|
1074
1117
|
break;
|
|
1075
1118
|
}
|
|
1076
|
-
case
|
|
1077
|
-
|
|
1078
|
-
let t =
|
|
1079
|
-
|
|
1119
|
+
case T.ALIAS: {
|
|
1120
|
+
n.maxAliases !== -1 && ++n.aliasCount > n.maxAliases && A(n, `aliases exceeded maxAliases (${n.maxAliases})`);
|
|
1121
|
+
let t = n.source.slice(e.anchorStart, e.anchorEnd), r = n.anchors.get(t);
|
|
1122
|
+
r || A(n, `unidentified alias "${t}"`), r.isValueFinal || A(n, `recursive alias "${t}" is not supported for tag ${r.tag.tagName} because it uses finalize()`), zt(n, r.value, r.tag);
|
|
1080
1123
|
break;
|
|
1081
1124
|
}
|
|
1082
|
-
case
|
|
1083
|
-
let e =
|
|
1084
|
-
if (e.kind === "mapping" && e.hasKey && (
|
|
1125
|
+
case T.POP: {
|
|
1126
|
+
let e = n.frames.pop();
|
|
1127
|
+
if (e.kind === "mapping" && e.hasKey && (n.position = e.keyPosition, A(n, "incomplete mapping pair in event stream")), e.kind === "document") n.documents.push(e.value);
|
|
1085
1128
|
else {
|
|
1086
|
-
let t = e.tag.carrierIsResult ? e.value :
|
|
1087
|
-
e.anchor && (e.anchor.value = t, e.anchor.isValueFinal = !0),
|
|
1129
|
+
let t = e.tag.carrierIsResult ? e.value : jt(n, e.position, e.tag, e.value);
|
|
1130
|
+
e.anchor && (e.anchor.value = t, e.anchor.isValueFinal = !0), zt(n, t, e.tag);
|
|
1088
1131
|
}
|
|
1089
1132
|
break;
|
|
1090
1133
|
}
|
|
1091
1134
|
}
|
|
1092
1135
|
}
|
|
1093
|
-
return
|
|
1136
|
+
return n.documents;
|
|
1094
1137
|
}
|
|
1095
1138
|
//#endregion
|
|
1096
1139
|
//#region src/parser/parser.ts
|
|
1097
|
-
var
|
|
1140
|
+
var j = -1, Ht = Object.prototype.hasOwnProperty, M = 1, Ut = 2, Wt = 3, Gt = 4, Kt = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, qt = /[,\[\]{}]/, Jt = /^(?:!|!!|![0-9A-Za-z-]+!)$/, Yt = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`, Xt = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`, Zt = RegExp(`^(?:${Yt})*$`), Qt = RegExp(`^(?:${Xt})+$`), $t = RegExp(`^(?:!(?:${Yt})*|${Xt}(?:${Yt})*)$`), en = {
|
|
1098
1141
|
filename: "",
|
|
1099
1142
|
maxDepth: 100
|
|
1100
1143
|
};
|
|
1101
|
-
function
|
|
1144
|
+
function tn(e, t, n) {
|
|
1102
1145
|
e.events.push({
|
|
1103
|
-
type:
|
|
1146
|
+
type: T.DOCUMENT,
|
|
1104
1147
|
explicitStart: t,
|
|
1105
1148
|
explicitEnd: n,
|
|
1106
1149
|
directives: e.directives
|
|
1107
1150
|
});
|
|
1108
1151
|
}
|
|
1109
|
-
function
|
|
1152
|
+
function nn(e, t, n, r, i, a, o) {
|
|
1110
1153
|
e.events.push({
|
|
1111
|
-
type:
|
|
1154
|
+
type: T.SEQUENCE,
|
|
1112
1155
|
start: t,
|
|
1113
1156
|
anchorStart: n,
|
|
1114
1157
|
anchorEnd: r,
|
|
@@ -1117,9 +1160,9 @@ function wn(e, t, n, r, i, a, o) {
|
|
|
1117
1160
|
style: o
|
|
1118
1161
|
});
|
|
1119
1162
|
}
|
|
1120
|
-
function
|
|
1163
|
+
function rn(e, t, n, r, i, a, o) {
|
|
1121
1164
|
e.events.push({
|
|
1122
|
-
type:
|
|
1165
|
+
type: T.MAPPING,
|
|
1123
1166
|
start: t,
|
|
1124
1167
|
anchorStart: n,
|
|
1125
1168
|
anchorEnd: r,
|
|
@@ -1128,20 +1171,20 @@ function Tn(e, t, n, r, i, a, o) {
|
|
|
1128
1171
|
style: o
|
|
1129
1172
|
});
|
|
1130
1173
|
}
|
|
1131
|
-
function
|
|
1174
|
+
function an(e, t) {
|
|
1132
1175
|
e.events.splice(t.eventsLength, 0, {
|
|
1133
|
-
type:
|
|
1176
|
+
type: T.MAPPING,
|
|
1134
1177
|
start: t.position,
|
|
1135
|
-
anchorStart:
|
|
1136
|
-
anchorEnd:
|
|
1137
|
-
tagStart:
|
|
1138
|
-
tagEnd:
|
|
1139
|
-
style:
|
|
1178
|
+
anchorStart: j,
|
|
1179
|
+
anchorEnd: j,
|
|
1180
|
+
tagStart: j,
|
|
1181
|
+
tagEnd: j,
|
|
1182
|
+
style: D.FLOW
|
|
1140
1183
|
});
|
|
1141
1184
|
}
|
|
1142
|
-
function
|
|
1185
|
+
function N(e, t, n, r, i, a, o, s, c = O.CLIP, l = -1, u = !1) {
|
|
1143
1186
|
e.events.push({
|
|
1144
|
-
type:
|
|
1187
|
+
type: T.SCALAR,
|
|
1145
1188
|
valueStart: t,
|
|
1146
1189
|
valueEnd: n,
|
|
1147
1190
|
anchorStart: r,
|
|
@@ -1154,28 +1197,28 @@ function T(e, t, n, r, i, a, o, s, c = 1, l = -1, u = !1) {
|
|
|
1154
1197
|
fast: u
|
|
1155
1198
|
});
|
|
1156
1199
|
}
|
|
1157
|
-
function
|
|
1200
|
+
function on(e, t, n) {
|
|
1158
1201
|
e.events.push({
|
|
1159
|
-
type:
|
|
1202
|
+
type: T.ALIAS,
|
|
1160
1203
|
anchorStart: t,
|
|
1161
1204
|
anchorEnd: n
|
|
1162
1205
|
});
|
|
1163
1206
|
}
|
|
1164
|
-
function
|
|
1165
|
-
e.events.push({ type:
|
|
1207
|
+
function P(e) {
|
|
1208
|
+
e.events.push({ type: T.POP });
|
|
1166
1209
|
}
|
|
1167
|
-
function
|
|
1168
|
-
|
|
1210
|
+
function F(e) {
|
|
1211
|
+
N(e, j, j, j, j, j, j, E.PLAIN);
|
|
1169
1212
|
}
|
|
1170
|
-
function
|
|
1213
|
+
function sn() {
|
|
1171
1214
|
return {
|
|
1172
|
-
anchorStart:
|
|
1173
|
-
anchorEnd:
|
|
1174
|
-
tagStart:
|
|
1175
|
-
tagEnd:
|
|
1215
|
+
anchorStart: j,
|
|
1216
|
+
anchorEnd: j,
|
|
1217
|
+
tagStart: j,
|
|
1218
|
+
tagEnd: j
|
|
1176
1219
|
};
|
|
1177
1220
|
}
|
|
1178
|
-
function
|
|
1221
|
+
function I(e) {
|
|
1179
1222
|
return {
|
|
1180
1223
|
position: e.position,
|
|
1181
1224
|
line: e.line,
|
|
@@ -1185,104 +1228,116 @@ function O(e) {
|
|
|
1185
1228
|
eventsLength: e.events.length
|
|
1186
1229
|
};
|
|
1187
1230
|
}
|
|
1188
|
-
function
|
|
1231
|
+
function L(e, t) {
|
|
1189
1232
|
e.position = t.position, e.line = t.line, e.lineStart = t.lineStart, e.lineIndent = t.lineIndent, e.firstTabInLine = t.firstTabInLine, e.events.length = t.eventsLength;
|
|
1190
1233
|
}
|
|
1191
|
-
function
|
|
1192
|
-
|
|
1234
|
+
function R(e, t) {
|
|
1235
|
+
w.throwAt(e.input.slice(0, e.length), e.position, t, e.filename);
|
|
1193
1236
|
}
|
|
1194
|
-
function
|
|
1237
|
+
function z(e) {
|
|
1195
1238
|
return e === 10 || e === 13;
|
|
1196
1239
|
}
|
|
1197
|
-
function
|
|
1240
|
+
function B(e) {
|
|
1198
1241
|
return e === 9 || e === 32;
|
|
1199
1242
|
}
|
|
1200
|
-
function
|
|
1201
|
-
return
|
|
1243
|
+
function V(e) {
|
|
1244
|
+
return B(e) || z(e);
|
|
1202
1245
|
}
|
|
1203
|
-
function
|
|
1204
|
-
return e === 0 ||
|
|
1246
|
+
function H(e) {
|
|
1247
|
+
return e === 0 || V(e);
|
|
1205
1248
|
}
|
|
1206
|
-
function
|
|
1249
|
+
function U(e) {
|
|
1207
1250
|
return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
|
|
1208
1251
|
}
|
|
1209
|
-
function
|
|
1252
|
+
function cn(e) {
|
|
1210
1253
|
return e >= 48 && e <= 57 ? e - 48 : -1;
|
|
1211
1254
|
}
|
|
1212
|
-
function
|
|
1255
|
+
function ln(e) {
|
|
1213
1256
|
if (e >= 48 && e <= 57) return e - 48;
|
|
1214
1257
|
let t = e | 32;
|
|
1215
1258
|
return t >= 97 && t <= 102 ? t - 97 + 10 : -1;
|
|
1216
1259
|
}
|
|
1217
|
-
function
|
|
1260
|
+
function un(e) {
|
|
1218
1261
|
return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
|
|
1219
1262
|
}
|
|
1220
|
-
function
|
|
1263
|
+
function dn(e) {
|
|
1221
1264
|
return e === 48 || e === 97 || e === 98 || e === 116 || e === 9 || e === 110 || e === 118 || e === 102 || e === 114 || e === 101 || e === 32 || e === 34 || e === 47 || e === 92 || e === 78 || e === 95 || e === 76 || e === 80;
|
|
1222
1265
|
}
|
|
1223
|
-
function
|
|
1266
|
+
function fn(e) {
|
|
1224
1267
|
e.input.charCodeAt(e.position) === 10 ? e.position++ : (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++), e.line++, e.lineStart = e.position, e.lineIndent = 0, e.firstTabInLine = -1;
|
|
1225
1268
|
}
|
|
1226
|
-
function
|
|
1227
|
-
let n = 0, r = e.input.charCodeAt(e.position), i = e.position === e.lineStart ||
|
|
1269
|
+
function W(e, t) {
|
|
1270
|
+
let n = 0, r = e.input.charCodeAt(e.position), i = e.position === e.lineStart || V(e.input.charCodeAt(e.position - 1));
|
|
1228
1271
|
for (; r !== 0;) {
|
|
1229
|
-
for (;
|
|
1272
|
+
for (; B(r);) i = !0, r === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), r = e.input.charCodeAt(++e.position);
|
|
1230
1273
|
if (t && i && r === 35) do
|
|
1231
1274
|
r = e.input.charCodeAt(++e.position);
|
|
1232
|
-
while (!
|
|
1233
|
-
if (!
|
|
1234
|
-
for (
|
|
1275
|
+
while (!z(r) && r !== 0);
|
|
1276
|
+
if (!z(r)) break;
|
|
1277
|
+
for (fn(e), n++, i = !0, r = e.input.charCodeAt(e.position); r === 32;) e.lineIndent++, r = e.input.charCodeAt(++e.position);
|
|
1235
1278
|
}
|
|
1236
1279
|
return n;
|
|
1237
1280
|
}
|
|
1238
|
-
function
|
|
1281
|
+
function G(e, t = e.position) {
|
|
1239
1282
|
let n = e.input.charCodeAt(t);
|
|
1240
1283
|
if ((n === 45 || n === 46) && n === e.input.charCodeAt(t + 1) && n === e.input.charCodeAt(t + 2)) {
|
|
1241
1284
|
let n = e.input.charCodeAt(t + 3);
|
|
1242
|
-
return n === 0 ||
|
|
1285
|
+
return n === 0 || V(n);
|
|
1243
1286
|
}
|
|
1244
1287
|
return !1;
|
|
1245
1288
|
}
|
|
1246
|
-
function
|
|
1289
|
+
function pn(e) {
|
|
1290
|
+
e.position === e.lineStart && e.input.charCodeAt(e.position) === 65279 && (e.position++, e.lineStart = e.position);
|
|
1291
|
+
}
|
|
1292
|
+
function mn(e) {
|
|
1293
|
+
if (e.position !== e.lineStart) return !1;
|
|
1294
|
+
if (G(e)) return !0;
|
|
1295
|
+
if (e.input.charCodeAt(e.position) !== 65279) return !1;
|
|
1296
|
+
let t = I(e);
|
|
1297
|
+
pn(e), W(e, !0);
|
|
1298
|
+
let n = e.input.charCodeAt(e.position), r = e.position === e.lineStart && (n === 37 || n === 45 && G(e));
|
|
1299
|
+
return L(e, t), r;
|
|
1300
|
+
}
|
|
1301
|
+
function hn(e) {
|
|
1247
1302
|
let t = e.input.charCodeAt(e.position);
|
|
1248
|
-
for (; t !== 0 && !
|
|
1303
|
+
for (; t !== 0 && !z(t);) t = e.input.charCodeAt(++e.position);
|
|
1249
1304
|
}
|
|
1250
|
-
function
|
|
1251
|
-
|
|
1305
|
+
function gn(e, t, n) {
|
|
1306
|
+
Kt.test(e.input.slice(t, n)) && R(e, "the stream contains non-printable characters");
|
|
1252
1307
|
}
|
|
1253
|
-
function
|
|
1308
|
+
function _n(e, t, n) {
|
|
1254
1309
|
if (e.input.charCodeAt(e.position) !== 33) return !1;
|
|
1255
|
-
t.tagStart !==
|
|
1310
|
+
t.tagStart !== j && R(e, "duplication of a tag property");
|
|
1256
1311
|
let r = e.position, i = !1, a = !1, o = "!", s = e.input.charCodeAt(++e.position);
|
|
1257
1312
|
s === 60 ? (i = !0, s = e.input.charCodeAt(++e.position)) : s === 33 && (a = !0, o = "!!", s = e.input.charCodeAt(++e.position));
|
|
1258
1313
|
let c = e.position, l;
|
|
1259
1314
|
if (i) {
|
|
1260
1315
|
for (; s !== 0 && s !== 62;) s = e.input.charCodeAt(++e.position);
|
|
1261
|
-
s !== 62 &&
|
|
1316
|
+
s !== 62 && R(e, "unexpected end of the stream within a verbatim tag"), l = e.input.slice(c, e.position), e.position++;
|
|
1262
1317
|
} else {
|
|
1263
|
-
for (; s !== 0 && !
|
|
1264
|
-
l = e.input.slice(c, e.position),
|
|
1318
|
+
for (; s !== 0 && !V(s) && !(n && U(s));) s === 33 && (a ? R(e, "tag suffix cannot contain exclamation marks") : (o = e.input.slice(c - 1, e.position + 1), Jt.test(o) || R(e, "named tag handle cannot contain such characters"), a = !0, c = e.position + 1)), s = e.input.charCodeAt(++e.position);
|
|
1319
|
+
l = e.input.slice(c, e.position), qt.test(l) && R(e, "tag suffix cannot contain flow indicator characters");
|
|
1265
1320
|
}
|
|
1266
|
-
return l && !(i ?
|
|
1321
|
+
return l && !(i ? Zt.test(l) : Qt.test(l)) && R(e, `tag name cannot contain such characters: ${l}`), !i && o !== "!" && o !== "!!" && !Ht.call(e.tagHandlers, o) && R(e, `undeclared tag handle "${o}"`), t.tagStart = r, t.tagEnd = e.position, !0;
|
|
1267
1322
|
}
|
|
1268
|
-
function
|
|
1323
|
+
function vn(e, t) {
|
|
1269
1324
|
if (e.input.charCodeAt(e.position) !== 38) return !1;
|
|
1270
|
-
t.anchorStart !==
|
|
1325
|
+
t.anchorStart !== j && R(e, "duplication of an anchor property"), e.position++;
|
|
1271
1326
|
let n = e.position;
|
|
1272
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1273
|
-
return e.position === n &&
|
|
1327
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !V(e.input.charCodeAt(e.position)) && !U(e.input.charCodeAt(e.position));) e.position++;
|
|
1328
|
+
return e.position === n && R(e, "name of an anchor node must contain at least one character"), t.anchorStart = n, t.anchorEnd = e.position, !0;
|
|
1274
1329
|
}
|
|
1275
|
-
function
|
|
1330
|
+
function yn(e, t) {
|
|
1276
1331
|
if (e.input.charCodeAt(e.position) !== 42) return !1;
|
|
1277
|
-
(t.anchorStart !==
|
|
1332
|
+
(t.anchorStart !== j || t.tagStart !== j) && R(e, "alias node should not have any properties"), e.position++;
|
|
1278
1333
|
let n = e.position;
|
|
1279
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1280
|
-
return e.position === n &&
|
|
1334
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !V(e.input.charCodeAt(e.position)) && !U(e.input.charCodeAt(e.position));) e.position++;
|
|
1335
|
+
return e.position === n && R(e, "name of an alias node must contain at least one character"), on(e, n, e.position), !0;
|
|
1281
1336
|
}
|
|
1282
|
-
function
|
|
1283
|
-
|
|
1337
|
+
function bn(e, t) {
|
|
1338
|
+
W(e, !1), e.lineIndent < t && R(e, "deficient indentation");
|
|
1284
1339
|
}
|
|
1285
|
-
function
|
|
1340
|
+
function xn(e, t, n) {
|
|
1286
1341
|
if (e.input.charCodeAt(e.position) !== 39) return !1;
|
|
1287
1342
|
e.position++;
|
|
1288
1343
|
let r = e.position, i = !0;
|
|
@@ -1294,13 +1349,13 @@ function Bn(e, t, n) {
|
|
|
1294
1349
|
continue;
|
|
1295
1350
|
}
|
|
1296
1351
|
let t = e.position;
|
|
1297
|
-
return e.position++,
|
|
1352
|
+
return e.position++, N(e, r, t, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, E.SINGLE_QUOTED, O.CLIP, -1, i), !0;
|
|
1298
1353
|
}
|
|
1299
|
-
|
|
1354
|
+
z(a) ? (i = !1, bn(e, t)) : e.position === e.lineStart && G(e) ? R(e, "unexpected end of the document within a single quoted scalar") : a !== 9 && a < 32 ? R(e, "expected valid JSON character") : e.position++;
|
|
1300
1355
|
}
|
|
1301
|
-
|
|
1356
|
+
R(e, "unexpected end of the stream within a single quoted scalar");
|
|
1302
1357
|
}
|
|
1303
|
-
function
|
|
1358
|
+
function Sn(e, t, n) {
|
|
1304
1359
|
if (e.input.charCodeAt(e.position) !== 34) return !1;
|
|
1305
1360
|
e.position++;
|
|
1306
1361
|
let r = e.position, i = !0;
|
|
@@ -1308,35 +1363,35 @@ function Vn(e, t, n) {
|
|
|
1308
1363
|
let a = e.input.charCodeAt(e.position);
|
|
1309
1364
|
if (a === 34) {
|
|
1310
1365
|
let t = e.position;
|
|
1311
|
-
return e.position++,
|
|
1366
|
+
return e.position++, N(e, r, t, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, E.DOUBLE_QUOTED, O.CLIP, -1, i), !0;
|
|
1312
1367
|
}
|
|
1313
1368
|
if (a === 92) {
|
|
1314
1369
|
i = !1;
|
|
1315
1370
|
let n = e.input.charCodeAt(++e.position);
|
|
1316
|
-
if (
|
|
1317
|
-
else if (
|
|
1371
|
+
if (z(n)) bn(e, t);
|
|
1372
|
+
else if (dn(n)) e.position++;
|
|
1318
1373
|
else {
|
|
1319
|
-
let t =
|
|
1320
|
-
for (t === 0 &&
|
|
1374
|
+
let t = un(n);
|
|
1375
|
+
for (t === 0 && R(e, "unknown escape sequence"); t-- > 0;) e.position++, ln(e.input.charCodeAt(e.position)) < 0 && R(e, "expected hexadecimal character");
|
|
1321
1376
|
e.position++;
|
|
1322
1377
|
}
|
|
1323
|
-
} else
|
|
1378
|
+
} else z(a) ? (i = !1, bn(e, t)) : e.position === e.lineStart && G(e) ? R(e, "unexpected end of the document within a double quoted scalar") : a !== 9 && a < 32 ? R(e, "expected valid JSON character") : e.position++;
|
|
1324
1379
|
}
|
|
1325
|
-
|
|
1380
|
+
R(e, "unexpected end of the stream within a double quoted scalar");
|
|
1326
1381
|
}
|
|
1327
|
-
function
|
|
1328
|
-
let r = e.input.charCodeAt(e.position), i =
|
|
1382
|
+
function Cn(e, t, n) {
|
|
1383
|
+
let r = e.input.charCodeAt(e.position), i = O.CLIP, a = -1, o = !1;
|
|
1329
1384
|
if (r !== 124 && r !== 62) return !1;
|
|
1330
|
-
let s = r === 124 ?
|
|
1385
|
+
let s = r === 124 ? E.LITERAL_BLOCK : E.FOLDED_BLOCK;
|
|
1331
1386
|
for (e.position++; e.input.charCodeAt(e.position) !== 0;) {
|
|
1332
|
-
let n = e.input.charCodeAt(e.position), r =
|
|
1333
|
-
if (n === 43 || n === 45) i !==
|
|
1334
|
-
else if (r >= 0) r === 0 &&
|
|
1387
|
+
let n = e.input.charCodeAt(e.position), r = cn(n);
|
|
1388
|
+
if (n === 43 || n === 45) i !== O.CLIP && R(e, "repeat of a chomping mode identifier"), i = n === 43 ? O.KEEP : O.STRIP, e.position++;
|
|
1389
|
+
else if (r >= 0) r === 0 && R(e, "bad explicit indentation width of a block scalar; it cannot be less than one"), o && R(e, "repeat of an indentation width identifier"), a = t + r - 1, o = !0, e.position++;
|
|
1335
1390
|
else break;
|
|
1336
1391
|
}
|
|
1337
1392
|
let c = !1;
|
|
1338
|
-
for (;
|
|
1339
|
-
c && e.input.charCodeAt(e.position) === 35 &&
|
|
1393
|
+
for (; B(e.input.charCodeAt(e.position));) c = !0, e.position++;
|
|
1394
|
+
c && e.input.charCodeAt(e.position) === 35 && hn(e), z(e.input.charCodeAt(e.position)) ? fn(e) : e.input.charCodeAt(e.position) !== 0 && R(e, "a line break is expected");
|
|
1340
1395
|
let l = o ? a : -1, u = 0, d = e.position, f = e.position;
|
|
1341
1396
|
for (; e.input.charCodeAt(e.position) !== 0;) {
|
|
1342
1397
|
let n = e.position, r = 0;
|
|
@@ -1346,170 +1401,170 @@ function Hn(e, t, n) {
|
|
|
1346
1401
|
l >= 0 ? r > l && (f = n + r) : r > 0 && (f = n + r);
|
|
1347
1402
|
break;
|
|
1348
1403
|
}
|
|
1349
|
-
if (
|
|
1350
|
-
if (!o && l === -1 &&
|
|
1404
|
+
if (mn(e)) break;
|
|
1405
|
+
if (!o && l === -1 && z(i) && (u = Math.max(u, r)), !o && l === -1 && !z(i) && (i === 9 && r < t && (e.position = n + r, R(e, "tab characters must not be used in indentation")), r < u && (e.position = n + r, R(e, "bad indentation of a mapping entry"))), l === -1 && i !== 0 && !z(i) && r < t) {
|
|
1351
1406
|
e.lineIndent = r, e.position = n + r;
|
|
1352
1407
|
break;
|
|
1353
1408
|
}
|
|
1354
|
-
!o && i !== 0 && !
|
|
1409
|
+
!o && i !== 0 && !z(i) && l === -1 && (l = r);
|
|
1355
1410
|
let a = l === -1 ? t + 1 : l;
|
|
1356
|
-
if (i !== 0 && !
|
|
1411
|
+
if (i !== 0 && !z(i) && r < a) {
|
|
1357
1412
|
e.lineIndent = r, e.position = n + r;
|
|
1358
1413
|
break;
|
|
1359
1414
|
}
|
|
1360
|
-
|
|
1415
|
+
hn(e), f = e.position, z(e.input.charCodeAt(e.position)) && (fn(e), f = e.position);
|
|
1361
1416
|
}
|
|
1362
|
-
return
|
|
1417
|
+
return gn(e, d, f), N(e, d, f, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, s, i, l), !0;
|
|
1363
1418
|
}
|
|
1364
|
-
function
|
|
1365
|
-
let n = e.input.charCodeAt(e.position), r = t ===
|
|
1366
|
-
if (n === 0 ||
|
|
1419
|
+
function wn(e, t) {
|
|
1420
|
+
let n = e.input.charCodeAt(e.position), r = t === M;
|
|
1421
|
+
if (n === 0 || V(n) || n === 35 || n === 38 || n === 42 || n === 33 || n === 124 || n === 62 || n === 39 || n === 34 || n === 37 || n === 64 || n === 96 || r && U(n)) return !1;
|
|
1367
1422
|
if (n === 63 || n === 45) {
|
|
1368
1423
|
let t = e.input.charCodeAt(e.position + 1);
|
|
1369
|
-
if (
|
|
1424
|
+
if (H(t) || r && U(t)) return !1;
|
|
1370
1425
|
}
|
|
1371
1426
|
return !0;
|
|
1372
1427
|
}
|
|
1373
|
-
function
|
|
1374
|
-
if (!
|
|
1375
|
-
let i = e.position, a = e.position, o = e.input.charCodeAt(e.position), s = n ===
|
|
1376
|
-
for (; o !== 0 && !(e
|
|
1428
|
+
function Tn(e, t, n, r) {
|
|
1429
|
+
if (!wn(e, n)) return !1;
|
|
1430
|
+
let i = e.position, a = e.position, o = e.input.charCodeAt(e.position), s = n === M, c = !1;
|
|
1431
|
+
for (; o !== 0 && !mn(e);) {
|
|
1377
1432
|
if (o === 58) {
|
|
1378
1433
|
let t = e.input.charCodeAt(e.position + 1);
|
|
1379
|
-
if (
|
|
1434
|
+
if (H(t) || s && U(t)) break;
|
|
1380
1435
|
} else if (o === 35) {
|
|
1381
|
-
if (
|
|
1382
|
-
} else if (s &&
|
|
1383
|
-
else if (
|
|
1436
|
+
if (V(e.input.charCodeAt(e.position - 1))) break;
|
|
1437
|
+
} else if (s && U(o)) break;
|
|
1438
|
+
else if (z(o)) {
|
|
1384
1439
|
let n = e.position, r = e.line, i = e.lineStart, a = e.lineIndent;
|
|
1385
|
-
if (
|
|
1440
|
+
if (W(e, !1), e.lineIndent >= t) {
|
|
1386
1441
|
c = !0, o = e.input.charCodeAt(e.position);
|
|
1387
1442
|
continue;
|
|
1388
1443
|
}
|
|
1389
1444
|
e.position = n, e.line = r, e.lineStart = i, e.lineIndent = a;
|
|
1390
1445
|
break;
|
|
1391
1446
|
}
|
|
1392
|
-
|
|
1447
|
+
B(o) || (a = e.position + 1), o = e.input.charCodeAt(++e.position);
|
|
1393
1448
|
}
|
|
1394
|
-
return a === i ? !1 : (
|
|
1449
|
+
return a === i ? !1 : (gn(e, i, a), N(e, i, a, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, E.PLAIN, O.CLIP, -1, !c), !0);
|
|
1395
1450
|
}
|
|
1396
|
-
function
|
|
1451
|
+
function K(e, t) {
|
|
1397
1452
|
let n = e.line;
|
|
1398
|
-
|
|
1453
|
+
W(e, !0), (e.line > n && e.lineIndent < t || e.firstTabInLine !== -1 && e.lineIndent < t) && R(e, "deficient indentation");
|
|
1399
1454
|
}
|
|
1400
|
-
function
|
|
1455
|
+
function En(e, t, n) {
|
|
1401
1456
|
let r = e.input.charCodeAt(e.position), i = r === 123, a = e.position, o = !0;
|
|
1402
1457
|
if (r !== 91 && r !== 123) return !1;
|
|
1403
1458
|
let s = i ? 125 : 93;
|
|
1404
|
-
for (i ?
|
|
1405
|
-
|
|
1459
|
+
for (i ? rn(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, D.FLOW) : nn(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, D.FLOW), e.position++; e.input.charCodeAt(e.position) !== 0;) {
|
|
1460
|
+
K(e, t);
|
|
1406
1461
|
let n = e.input.charCodeAt(e.position);
|
|
1407
|
-
if (n === s) return e.position++,
|
|
1408
|
-
o ? n === 44 &&
|
|
1462
|
+
if (n === s) return e.position++, P(e), !0;
|
|
1463
|
+
o ? n === 44 && R(e, "expected the node content, but found ','") : R(e, "missed comma between flow collection entries");
|
|
1409
1464
|
let r = !1, a = !1;
|
|
1410
|
-
n === 63 &&
|
|
1411
|
-
let c = e.line, l =
|
|
1412
|
-
|
|
1465
|
+
n === 63 && V(e.input.charCodeAt(e.position + 1)) && (r = a = !0, e.position += 1, K(e, t));
|
|
1466
|
+
let c = e.line, l = I(e), u = q(e, t, M, !1, !0);
|
|
1467
|
+
K(e, t), n = e.input.charCodeAt(e.position), (i || a || e.line === c) && n === 58 ? (r = !0, e.position++, K(e, t), i || an(e, l), u || F(e), q(e, t, M, !1, !0) || F(e), K(e, t), i || P(e)) : i && r ? (u || F(e), F(e)) : i ? F(e) : r && (an(e, l), u || F(e), F(e), P(e)), n = e.input.charCodeAt(e.position), n === 44 ? (o = !0, e.position++) : o = !1;
|
|
1413
1468
|
}
|
|
1414
|
-
|
|
1469
|
+
R(e, "unexpected end of the stream within a flow collection");
|
|
1415
1470
|
}
|
|
1416
|
-
function
|
|
1417
|
-
if (e.firstTabInLine !== -1 || e.input.charCodeAt(e.position) !== 45 || !
|
|
1418
|
-
for (
|
|
1419
|
-
e.firstTabInLine !== -1 && (e.position = e.firstTabInLine,
|
|
1471
|
+
function Dn(e, t, n) {
|
|
1472
|
+
if (e.firstTabInLine !== -1 || e.input.charCodeAt(e.position) !== 45 || !H(e.input.charCodeAt(e.position + 1))) return !1;
|
|
1473
|
+
for (nn(e, e.position, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, D.BLOCK); e.input.charCodeAt(e.position) === 45 && H(e.input.charCodeAt(e.position + 1));) {
|
|
1474
|
+
e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, R(e, "tab characters must not be used in indentation"));
|
|
1420
1475
|
let n = e.line;
|
|
1421
1476
|
e.position++;
|
|
1422
|
-
let r =
|
|
1423
|
-
if (e.firstTabInLine !== -1 && e.input.charCodeAt(e.position) === 45 &&
|
|
1424
|
-
e.lineIndent > t &&
|
|
1477
|
+
let r = W(e, !0) > 0;
|
|
1478
|
+
if (e.firstTabInLine !== -1 && e.input.charCodeAt(e.position) === 45 && H(e.input.charCodeAt(e.position + 1)) && R(e, "bad indentation of a sequence entry"), r && e.lineIndent <= t ? F(e) : q(e, t, Wt, !1, !0), W(e, !0), e.lineIndent < t || e.position >= e.length) break;
|
|
1479
|
+
e.lineIndent > t && R(e, "bad indentation of a sequence entry"), e.line === n && e.input.charCodeAt(e.position) === 45 && H(e.input.charCodeAt(e.position + 1)) && R(e, "bad indentation of a sequence entry");
|
|
1425
1480
|
}
|
|
1426
|
-
return
|
|
1481
|
+
return P(e), !0;
|
|
1427
1482
|
}
|
|
1428
|
-
function
|
|
1483
|
+
function On(e, t, n, r) {
|
|
1429
1484
|
let i = !1, a = !1, o = !1, s = !1;
|
|
1430
1485
|
if (e.firstTabInLine !== -1) return !1;
|
|
1431
1486
|
let c = e.input.charCodeAt(e.position);
|
|
1432
1487
|
for (; c !== 0;) {
|
|
1433
|
-
!i && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine,
|
|
1488
|
+
!i && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, R(e, "tab characters must not be used in indentation"));
|
|
1434
1489
|
let l = e.input.charCodeAt(e.position + 1), u = e.line;
|
|
1435
|
-
if ((c === 63 || c === 58) &&
|
|
1490
|
+
if ((c === 63 || c === 58) && H(l)) o || (rn(e, e.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, D.BLOCK), o = !0), c === 63 ? (i && F(e), a = !0, i = !0) : i ? i = !1 : (F(e), a = !0, i = !1), e.position += 1, s = !0;
|
|
1436
1491
|
else {
|
|
1437
|
-
i && (
|
|
1438
|
-
let t =
|
|
1439
|
-
if (!
|
|
1492
|
+
i && (F(e), i = !1);
|
|
1493
|
+
let t = I(e);
|
|
1494
|
+
if (!q(e, n, Ut, !1, !0)) break;
|
|
1440
1495
|
if (e.line === u) {
|
|
1441
|
-
for (c = e.input.charCodeAt(e.position);
|
|
1496
|
+
for (c = e.input.charCodeAt(e.position); B(c);) c = e.input.charCodeAt(++e.position);
|
|
1442
1497
|
if (c === 58) {
|
|
1443
|
-
if (c = e.input.charCodeAt(++e.position),
|
|
1444
|
-
for (
|
|
1498
|
+
if (c = e.input.charCodeAt(++e.position), H(c) || R(e, "a whitespace character is expected after the key-value separator within a block mapping"), !o) {
|
|
1499
|
+
for (L(e, t), rn(e, t.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, D.BLOCK), o = !0, q(e, n, Ut, !1, !0), c = e.input.charCodeAt(e.position); B(c);) c = e.input.charCodeAt(++e.position);
|
|
1445
1500
|
e.position++;
|
|
1446
1501
|
}
|
|
1447
1502
|
a = !0, i = !1, s = !1;
|
|
1448
|
-
} else if (a)
|
|
1449
|
-
else return r.anchorStart !==
|
|
1450
|
-
} else if (a)
|
|
1451
|
-
else return r.anchorStart !==
|
|
1503
|
+
} else if (a) R(e, "expected ':' after a mapping key");
|
|
1504
|
+
else return r.anchorStart !== j || r.tagStart !== j ? (L(e, t), !1) : !0;
|
|
1505
|
+
} else if (a) R(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
1506
|
+
else return r.anchorStart !== j || r.tagStart !== j ? (L(e, t), !1) : !0;
|
|
1452
1507
|
}
|
|
1453
|
-
if (
|
|
1508
|
+
if (q(e, t, Gt, !0, s) && (s = !1), i || s && (F(e), s = !1), W(e, !0), c = e.input.charCodeAt(e.position), (e.line === u || e.lineIndent > t) && c !== 0) R(e, "bad indentation of a mapping entry");
|
|
1454
1509
|
else if (e.lineIndent < t) break;
|
|
1455
1510
|
}
|
|
1456
|
-
return a ? (i &&
|
|
1511
|
+
return a ? (i && F(e), o && P(e), !0) : !1;
|
|
1457
1512
|
}
|
|
1458
|
-
function
|
|
1459
|
-
e.depth >= e.maxDepth &&
|
|
1460
|
-
let o = 1, s = !1, c = !1, l = null, u =
|
|
1461
|
-
if (r &&
|
|
1462
|
-
let r = e.input.charCodeAt(e.position), i =
|
|
1513
|
+
function q(e, t, n, r, i, a = !0) {
|
|
1514
|
+
e.depth >= e.maxDepth && R(e, `nesting exceeded maxDepth (${e.maxDepth})`), e.depth++;
|
|
1515
|
+
let o = 1, s = !1, c = !1, l = null, u = sn(), d = n === Gt || n === Wt, f = d, p = d;
|
|
1516
|
+
if (r && W(e, !0) && (s = !0, o = e.lineIndent > t ? 1 : e.lineIndent === t ? 0 : -1), o === 1) for (;;) {
|
|
1517
|
+
let r = e.input.charCodeAt(e.position), i = I(e);
|
|
1463
1518
|
if (s && o !== 1 && (r === 33 || r === 38)) break;
|
|
1464
|
-
if (s && p && (u.tagStart !==
|
|
1519
|
+
if (s && p && (u.tagStart !== j || u.anchorStart !== j) && (r === 33 || r === 38)) {
|
|
1465
1520
|
var m;
|
|
1466
|
-
let n =
|
|
1467
|
-
if (
|
|
1468
|
-
|
|
1521
|
+
let n = I(e), r = t + 1;
|
|
1522
|
+
if (On(e, e.position - e.lineStart, r, u) && ((m = e.events[n.eventsLength]) == null ? void 0 : m.type) === T.MAPPING) return e.depth--, !0;
|
|
1523
|
+
L(e, n);
|
|
1469
1524
|
}
|
|
1470
|
-
if (s && (r === 33 && u.tagStart !==
|
|
1471
|
-
l === null && (l = i),
|
|
1525
|
+
if (s && (r === 33 && u.tagStart !== j || r === 38 && u.anchorStart !== j) || !_n(e, u, n === M) && !vn(e, u)) break;
|
|
1526
|
+
l === null && (l = i), W(e, !0) ? (s = !0, f = p, o = e.lineIndent > t ? 1 : e.lineIndent === t ? 0 : -1) : f = !1;
|
|
1472
1527
|
}
|
|
1473
|
-
if (f && (f = s || i), o === 1 || n ===
|
|
1474
|
-
let r = n ===
|
|
1475
|
-
if (o === 1) if (f && (
|
|
1528
|
+
if (f && (f = s || i), o === 1 || n === Gt) {
|
|
1529
|
+
let r = n === M || n === Ut ? t : t + 1, i = e.position - e.lineStart;
|
|
1530
|
+
if (o === 1) if (f && (Dn(e, i, u) || On(e, i, r, u)) || En(e, r, u)) c = !0;
|
|
1476
1531
|
else {
|
|
1477
1532
|
let t = e.input.charCodeAt(e.position);
|
|
1478
1533
|
if (l !== null && a && p && !f && t !== 124 && t !== 62) {
|
|
1479
1534
|
var h;
|
|
1480
|
-
let t =
|
|
1481
|
-
|
|
1535
|
+
let t = I(e), n = l.position - l.lineStart;
|
|
1536
|
+
L(e, l), On(e, n, r, sn()) && ((h = e.events[t.eventsLength]) == null ? void 0 : h.type) === T.MAPPING ? c = !0 : L(e, t);
|
|
1482
1537
|
}
|
|
1483
|
-
!c && (d &&
|
|
1538
|
+
!c && (d && Cn(e, r, u) || xn(e, r, u) || Sn(e, r, u) || yn(e, u) || Tn(e, r, n, u)) && (c = !0);
|
|
1484
1539
|
}
|
|
1485
|
-
else o === 0 && (c = f &&
|
|
1540
|
+
else o === 0 && (c = f && Dn(e, i, u));
|
|
1486
1541
|
}
|
|
1487
|
-
return d = d && !c, !c && (u.anchorStart !==
|
|
1542
|
+
return d = d && !c, !c && (u.anchorStart !== j || u.tagStart !== j || d) && (N(e, j, j, u.anchorStart, u.anchorEnd, u.tagStart, u.tagEnd, E.PLAIN), c = !0), e.depth--, c || u.anchorStart !== j || u.tagStart !== j;
|
|
1488
1543
|
}
|
|
1489
|
-
function
|
|
1544
|
+
function kn(e) {
|
|
1490
1545
|
if (e.lineIndent > 0 || e.input.charCodeAt(e.position) !== 37) return !1;
|
|
1491
1546
|
e.position++;
|
|
1492
1547
|
let t = e.position;
|
|
1493
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1548
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !V(e.input.charCodeAt(e.position));) e.position++;
|
|
1494
1549
|
let n = e.input.slice(t, e.position), r = [];
|
|
1495
|
-
for (n.length === 0 &&
|
|
1496
|
-
for (;
|
|
1497
|
-
if (e.input.charCodeAt(e.position) === 35 ||
|
|
1550
|
+
for (n.length === 0 && R(e, "directive name must not be less than one character in length"); e.input.charCodeAt(e.position) !== 0 && !z(e.input.charCodeAt(e.position));) {
|
|
1551
|
+
for (; B(e.input.charCodeAt(e.position));) e.position++;
|
|
1552
|
+
if (e.input.charCodeAt(e.position) === 35 || z(e.input.charCodeAt(e.position)) || e.input.charCodeAt(e.position) === 0) break;
|
|
1498
1553
|
let t = e.position;
|
|
1499
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1554
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !V(e.input.charCodeAt(e.position));) e.position++;
|
|
1500
1555
|
r.push(e.input.slice(t, e.position));
|
|
1501
1556
|
}
|
|
1502
|
-
if (
|
|
1503
|
-
e.directives.some((e) => e.kind === "yaml") &&
|
|
1557
|
+
if (z(e.input.charCodeAt(e.position)) && fn(e), n === "YAML") {
|
|
1558
|
+
e.directives.some((e) => e.kind === "yaml") && R(e, "duplication of %YAML directive"), r.length !== 1 && R(e, "YAML directive accepts exactly one argument");
|
|
1504
1559
|
let t = /^([0-9]+)\.([0-9]+)$/.exec(r[0]);
|
|
1505
|
-
t === null &&
|
|
1560
|
+
t === null && R(e, "ill-formed argument of the YAML directive"), parseInt(t[1], 10) !== 1 && R(e, "unacceptable YAML version of the document"), e.directives.push({
|
|
1506
1561
|
kind: "yaml",
|
|
1507
1562
|
version: r[0]
|
|
1508
1563
|
});
|
|
1509
1564
|
} else if (n === "TAG") {
|
|
1510
|
-
r.length !== 2 &&
|
|
1565
|
+
r.length !== 2 && R(e, "TAG directive accepts exactly two arguments");
|
|
1511
1566
|
let [t, n] = r;
|
|
1512
|
-
|
|
1567
|
+
Jt.test(t) || R(e, "ill-formed tag handle (first argument) of the TAG directive"), Ht.call(e.tagHandlers, t) && R(e, `there is a previously declared suffix for "${t}" tag handle`), $t.test(n) || R(e, "ill-formed tag prefix (second argument) of the TAG directive"), e.tagHandlers[t] = n, e.directives.push({
|
|
1513
1568
|
kind: "tag",
|
|
1514
1569
|
handle: t,
|
|
1515
1570
|
prefix: n
|
|
@@ -1517,30 +1572,30 @@ function Jn(e) {
|
|
|
1517
1572
|
}
|
|
1518
1573
|
return !0;
|
|
1519
1574
|
}
|
|
1520
|
-
function
|
|
1575
|
+
function An(e) {
|
|
1521
1576
|
e.directives = [], e.tagHandlers = Object.create(null);
|
|
1522
1577
|
let t = !1;
|
|
1523
|
-
for (
|
|
1578
|
+
for (W(e, !0); kn(e);) t = !0, W(e, !0);
|
|
1524
1579
|
let n = !1, r = !1, i = !0;
|
|
1525
|
-
if (e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 &&
|
|
1580
|
+
if (e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 && H(e.input.charCodeAt(e.position + 3))) {
|
|
1526
1581
|
n = !0;
|
|
1527
1582
|
let t = e.line;
|
|
1528
|
-
e.position += 3,
|
|
1529
|
-
} else t &&
|
|
1583
|
+
e.position += 3, W(e, !0), i = e.line > t;
|
|
1584
|
+
} else t && R(e, "directives end mark is expected");
|
|
1530
1585
|
let a = e.events.length;
|
|
1531
|
-
if (!n && e.position === e.lineStart && e.input.charCodeAt(e.position) === 46 &&
|
|
1532
|
-
e.position += 3,
|
|
1586
|
+
if (!n && e.position === e.lineStart && e.input.charCodeAt(e.position) === 46 && G(e)) {
|
|
1587
|
+
e.position += 3, W(e, !0);
|
|
1533
1588
|
return;
|
|
1534
1589
|
}
|
|
1535
|
-
if (
|
|
1590
|
+
if (tn(e, n, !1), q(e, e.lineIndent - 1, Gt, !1, i, i) || F(e), W(e, !0), e.position === e.lineStart && G(e) && (r = e.input.charCodeAt(e.position) === 46, r)) {
|
|
1536
1591
|
let t = e.line;
|
|
1537
|
-
e.position += 3,
|
|
1592
|
+
e.position += 3, W(e, !0), e.line === t && e.position < e.length && R(e, "end of the stream or a document separator is expected");
|
|
1538
1593
|
}
|
|
1539
1594
|
let o = e.events[a];
|
|
1540
|
-
(o == null ? void 0 : o.type) ===
|
|
1595
|
+
(o == null ? void 0 : o.type) === T.DOCUMENT && (o.explicitEnd = r), P(e), !r && e.position < e.length && !mn(e) && R(e, "end of the stream or a document separator is expected");
|
|
1541
1596
|
}
|
|
1542
|
-
function
|
|
1543
|
-
let n = e.length, r =
|
|
1597
|
+
function jn(e, t) {
|
|
1598
|
+
let n = e.length, r = x(x(x({}, en), t), {}, {
|
|
1544
1599
|
input: `${e}\0`,
|
|
1545
1600
|
length: n,
|
|
1546
1601
|
position: 0,
|
|
@@ -1553,40 +1608,36 @@ function Xn(e, t) {
|
|
|
1553
1608
|
tagHandlers: Object.create(null),
|
|
1554
1609
|
events: []
|
|
1555
1610
|
}), i = e.indexOf("\0");
|
|
1556
|
-
for (i !== -1 &&
|
|
1611
|
+
for (i !== -1 && w.throwAt(e, i, "null byte is not allowed in input", r.filename); r.position < r.length && (pn(r), W(r, !0), !(r.position >= r.length));) {
|
|
1557
1612
|
let e = r.position;
|
|
1558
|
-
|
|
1613
|
+
An(r), r.position === e && R(r, "can not read a document");
|
|
1559
1614
|
}
|
|
1560
1615
|
return r.events;
|
|
1561
1616
|
}
|
|
1562
1617
|
//#endregion
|
|
1563
1618
|
//#region src/load.ts
|
|
1564
|
-
var
|
|
1565
|
-
function
|
|
1566
|
-
let n =
|
|
1567
|
-
return
|
|
1619
|
+
var Mn = x(x({}, en), kt);
|
|
1620
|
+
function Nn(e, t = {}) {
|
|
1621
|
+
let n = x(x({}, Mn), t), r = String(e), i = Object.keys(en), a = Object.keys(kt);
|
|
1622
|
+
return Vt(jn(r, Ve(n, i)), x(x({}, Ve(n, a)), {}, { source: r }));
|
|
1568
1623
|
}
|
|
1569
|
-
function
|
|
1624
|
+
function Pn(e, t, n) {
|
|
1570
1625
|
let r = null;
|
|
1571
1626
|
typeof t == "function" ? r = t : typeof t == "object" && t && (n = t);
|
|
1572
|
-
let i =
|
|
1627
|
+
let i = Nn(e, n);
|
|
1573
1628
|
if (r === null) return i;
|
|
1574
1629
|
for (let e of i) r(e);
|
|
1575
1630
|
}
|
|
1576
|
-
function
|
|
1577
|
-
let n =
|
|
1578
|
-
if (n.length === 0) throw new
|
|
1631
|
+
function Fn(e, t) {
|
|
1632
|
+
let n = Nn(e, t);
|
|
1633
|
+
if (n.length === 0) throw new w("expected a document, but the input is empty");
|
|
1579
1634
|
if (n.length === 1) return n[0];
|
|
1580
|
-
throw new
|
|
1635
|
+
throw new w("expected a single document in the stream, but found more");
|
|
1581
1636
|
}
|
|
1582
1637
|
//#endregion
|
|
1583
|
-
//#region src/ast/
|
|
1584
|
-
var
|
|
1585
|
-
|
|
1586
|
-
_(this, "tagged", !1), _(this, "flow", !1), _(this, "singleQuoted", !1), _(this, "doubleQuoted", !1), _(this, "literal", !1), _(this, "folded", !1);
|
|
1587
|
-
}
|
|
1588
|
-
}, V = Symbol("INVALID");
|
|
1589
|
-
function tr(e) {
|
|
1638
|
+
//#region src/ast/from_js.ts
|
|
1639
|
+
var J = Symbol("INVALID");
|
|
1640
|
+
function In(e) {
|
|
1590
1641
|
let t = new Set([
|
|
1591
1642
|
e.defaultScalarTag,
|
|
1592
1643
|
e.defaultSequenceTag,
|
|
@@ -1607,12 +1658,12 @@ function tr(e) {
|
|
|
1607
1658
|
}))
|
|
1608
1659
|
];
|
|
1609
1660
|
}
|
|
1610
|
-
function
|
|
1661
|
+
function Ln(e, t) {
|
|
1611
1662
|
for (let n = 0, r = e.representTypes.length; n < r; n += 1) {
|
|
1612
1663
|
let { tag: r, implicitTag: i } = e.representTypes[n];
|
|
1613
|
-
if (r.identify
|
|
1664
|
+
if (r.identify(t)) {
|
|
1614
1665
|
let e;
|
|
1615
|
-
return e = r.matchByTagPrefix
|
|
1666
|
+
return e = r.matchByTagPrefix ? r.representTagName(t) : r.tagName, {
|
|
1616
1667
|
tag: r,
|
|
1617
1668
|
tagName: e,
|
|
1618
1669
|
implicitTag: i
|
|
@@ -1621,103 +1672,97 @@ function nr(e, t) {
|
|
|
1621
1672
|
}
|
|
1622
1673
|
return null;
|
|
1623
1674
|
}
|
|
1624
|
-
function
|
|
1675
|
+
function Y(e, t) {
|
|
1625
1676
|
if (!e.noRefs && typeof t == "object" && t) {
|
|
1626
1677
|
let n = e.refs.get(t);
|
|
1627
1678
|
if (n) return n.anchor === void 0 && (n.anchor = `ref_${e.refCounter++}`), {
|
|
1628
1679
|
kind: "alias",
|
|
1629
|
-
tag: "",
|
|
1630
|
-
style: new B(),
|
|
1631
1680
|
anchor: n.anchor
|
|
1632
1681
|
};
|
|
1633
1682
|
}
|
|
1634
|
-
let n =
|
|
1683
|
+
let n = Ln(e, t);
|
|
1635
1684
|
if (!n) {
|
|
1636
|
-
if (t === void 0 || e.skipInvalid) return
|
|
1637
|
-
throw new
|
|
1638
|
-
}
|
|
1639
|
-
let { tag: r, tagName: i, implicitTag: a } = n, o = a ? i : Jt(i);
|
|
1640
|
-
if (r.nodeKind === "scalar") {
|
|
1641
|
-
let e = new B();
|
|
1642
|
-
return e.tagged = !a, {
|
|
1643
|
-
kind: "scalar",
|
|
1644
|
-
tag: o,
|
|
1645
|
-
style: e,
|
|
1646
|
-
value: r.represent(t)
|
|
1647
|
-
};
|
|
1685
|
+
if (t === void 0 || e.skipInvalid) return J;
|
|
1686
|
+
throw new w(`unacceptable kind of an object to dump ${Object.prototype.toString.call(t)}`);
|
|
1648
1687
|
}
|
|
1688
|
+
let { tag: r, tagName: i, implicitTag: a } = n, o = a ? i : Dt(i);
|
|
1689
|
+
if (r.nodeKind === "scalar") return {
|
|
1690
|
+
kind: "scalar",
|
|
1691
|
+
tag: o,
|
|
1692
|
+
tagged: !a,
|
|
1693
|
+
style: E.PLAIN,
|
|
1694
|
+
value: r.represent(t)
|
|
1695
|
+
};
|
|
1649
1696
|
if (r.nodeKind === "sequence") {
|
|
1650
|
-
let n = r.represent(t), i =
|
|
1651
|
-
i.tagged = !a;
|
|
1652
|
-
let s = {
|
|
1697
|
+
let n = r.represent(t), i = {
|
|
1653
1698
|
kind: "sequence",
|
|
1654
1699
|
tag: o,
|
|
1655
|
-
|
|
1700
|
+
tagged: !a,
|
|
1701
|
+
style: D.BLOCK,
|
|
1656
1702
|
items: []
|
|
1657
1703
|
};
|
|
1658
|
-
e.noRefs || e.refs.set(t,
|
|
1704
|
+
e.noRefs || e.refs.set(t, i);
|
|
1659
1705
|
for (let t = 0, r = n.length; t < r; t += 1) {
|
|
1660
|
-
let r =
|
|
1661
|
-
r ===
|
|
1706
|
+
let r = Y(e, n[t]);
|
|
1707
|
+
r === J && n[t] === void 0 && (r = Y(e, null)), r !== J && i.items.push(r);
|
|
1662
1708
|
}
|
|
1663
|
-
return
|
|
1709
|
+
return i;
|
|
1664
1710
|
}
|
|
1665
|
-
let s = r.represent(t), c =
|
|
1666
|
-
c.tagged = !a;
|
|
1667
|
-
let l = {
|
|
1711
|
+
let s = r.represent(t), c = {
|
|
1668
1712
|
kind: "mapping",
|
|
1669
1713
|
tag: o,
|
|
1670
|
-
|
|
1714
|
+
tagged: !a,
|
|
1715
|
+
style: D.BLOCK,
|
|
1671
1716
|
items: []
|
|
1672
1717
|
};
|
|
1673
|
-
e.noRefs || e.refs.set(t,
|
|
1718
|
+
e.noRefs || e.refs.set(t, c);
|
|
1674
1719
|
for (let [t, n] of s) {
|
|
1675
|
-
let r =
|
|
1676
|
-
if (r ===
|
|
1677
|
-
let i =
|
|
1678
|
-
i !==
|
|
1720
|
+
let r = Y(e, t);
|
|
1721
|
+
if (r === J) continue;
|
|
1722
|
+
let i = Y(e, n);
|
|
1723
|
+
i !== J && c.items.push({
|
|
1679
1724
|
key: r,
|
|
1680
1725
|
value: i
|
|
1681
1726
|
});
|
|
1682
1727
|
}
|
|
1683
|
-
return
|
|
1728
|
+
return c;
|
|
1684
1729
|
}
|
|
1685
|
-
function
|
|
1730
|
+
function Rn(e, t, n = {}) {
|
|
1686
1731
|
var r, i;
|
|
1687
|
-
let a =
|
|
1688
|
-
representTypes:
|
|
1732
|
+
let a = Y({
|
|
1733
|
+
representTypes: In(t),
|
|
1689
1734
|
noRefs: (r = n.noRefs) == null ? !1 : r,
|
|
1690
1735
|
skipInvalid: (i = n.skipInvalid) == null ? !1 : i,
|
|
1691
1736
|
refs: /* @__PURE__ */ new Map(),
|
|
1692
1737
|
refCounter: 0
|
|
1693
1738
|
}, e);
|
|
1694
1739
|
return [{
|
|
1695
|
-
contents: a ===
|
|
1740
|
+
contents: a === J ? null : a,
|
|
1696
1741
|
directives: []
|
|
1697
1742
|
}];
|
|
1698
1743
|
}
|
|
1699
1744
|
//#endregion
|
|
1700
1745
|
//#region src/ast/visit.ts
|
|
1701
|
-
var
|
|
1702
|
-
function
|
|
1746
|
+
var zn = Symbol("visit:break"), Bn = Symbol("visit:skip");
|
|
1747
|
+
function Vn(e, t, n) {
|
|
1703
1748
|
let r = t(e, n);
|
|
1704
|
-
if (r ===
|
|
1705
|
-
if (r ===
|
|
1749
|
+
if (r === zn) return !0;
|
|
1750
|
+
if (r === Bn) return !1;
|
|
1706
1751
|
let i = n.depth + 1;
|
|
1707
1752
|
switch (e.kind) {
|
|
1708
1753
|
case "sequence":
|
|
1709
|
-
for (let n of e.items) if (
|
|
1754
|
+
for (let n of e.items) if (Vn(n, t, {
|
|
1710
1755
|
depth: i,
|
|
1711
1756
|
parent: e,
|
|
1712
1757
|
isKey: !1
|
|
1713
1758
|
})) return !0;
|
|
1714
1759
|
break;
|
|
1715
1760
|
case "mapping":
|
|
1716
|
-
for (let { key: n, value: r } of e.items) if (
|
|
1761
|
+
for (let { key: n, value: r } of e.items) if (Vn(n, t, {
|
|
1717
1762
|
depth: i,
|
|
1718
1763
|
parent: e,
|
|
1719
1764
|
isKey: !0
|
|
1720
|
-
}) ||
|
|
1765
|
+
}) || Vn(r, t, {
|
|
1721
1766
|
depth: i,
|
|
1722
1767
|
parent: e,
|
|
1723
1768
|
isKey: !1
|
|
@@ -1726,158 +1771,136 @@ function or(e, t, n) {
|
|
|
1726
1771
|
}
|
|
1727
1772
|
return !1;
|
|
1728
1773
|
}
|
|
1729
|
-
function
|
|
1730
|
-
for (let n of e) if (n.contents &&
|
|
1774
|
+
function Hn(e, t) {
|
|
1775
|
+
for (let n of e) if (n.contents && Vn(n.contents, t, {
|
|
1731
1776
|
depth: 0,
|
|
1732
1777
|
parent: null,
|
|
1733
1778
|
isKey: !1
|
|
1734
1779
|
})) return;
|
|
1735
1780
|
}
|
|
1736
1781
|
//#endregion
|
|
1737
|
-
//#region src/ast/
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
quoteFlowKeys: !1,
|
|
1750
|
-
quoteStyle: "single",
|
|
1751
|
-
forceQuotes: !1,
|
|
1752
|
-
tagBeforeAnchor: !1
|
|
1782
|
+
//#region src/ast/styler_defaults.ts
|
|
1783
|
+
function Un(e, t) {
|
|
1784
|
+
return (e & 1 << t) != 0;
|
|
1785
|
+
}
|
|
1786
|
+
var Wn = {
|
|
1787
|
+
applyQuoteFlowKeysOption: Kn,
|
|
1788
|
+
doubleQuoteForInvisibles: qn,
|
|
1789
|
+
doubleQuoteWhitespaceOnly: Jn,
|
|
1790
|
+
applyForceQuotesOption: Yn,
|
|
1791
|
+
tryLongOrMultilineAsBlock: Xn,
|
|
1792
|
+
quoteInvalidPlain: Zn,
|
|
1793
|
+
fallbackToDoubleQuoted: Qn
|
|
1753
1794
|
};
|
|
1754
|
-
function
|
|
1755
|
-
return e.
|
|
1795
|
+
function Gn(e) {
|
|
1796
|
+
return e.presenterOptions.quoteStyle === "single" && Un(e.allowedStylesMask, E.SINGLE_QUOTED) ? E.SINGLE_QUOTED : E.DOUBLE_QUOTED;
|
|
1797
|
+
}
|
|
1798
|
+
function Kn(e) {
|
|
1799
|
+
e.presenterOptions.quoteFlowKeys && (!e.isKey || !e.flowOnly || e.style !== E.PLAIN || (e.style = E.DOUBLE_QUOTED));
|
|
1756
1800
|
}
|
|
1801
|
+
function qn(e) {
|
|
1802
|
+
e.style === E.PLAIN && /[\t\x7F-\xA0\u2028\u2029\uFEFF\uFFFE\uFFFF]/.test(e.node.value) && (e.style = E.DOUBLE_QUOTED);
|
|
1803
|
+
}
|
|
1804
|
+
function Jn(e) {
|
|
1805
|
+
e.style === E.PLAIN && /^\s+$/.test(e.node.value) && (e.style = E.DOUBLE_QUOTED);
|
|
1806
|
+
}
|
|
1807
|
+
function Yn(e) {
|
|
1808
|
+
e.presenterOptions.forceQuotes && (e.isKey || e.style !== E.PLAIN || (e.style = e.node.value.includes("\n") ? E.DOUBLE_QUOTED : Gn(e)));
|
|
1809
|
+
}
|
|
1810
|
+
function Xn(e) {
|
|
1811
|
+
if (e.style !== E.PLAIN || e.isKey) return;
|
|
1812
|
+
let t = e.node.value, n = t.indexOf("\n") !== -1;
|
|
1813
|
+
if (!Un(e.allowedStylesMask, E.LITERAL_BLOCK)) {
|
|
1814
|
+
n && (e.style = E.DOUBLE_QUOTED);
|
|
1815
|
+
return;
|
|
1816
|
+
}
|
|
1817
|
+
let r = e.presenterOptions.lineWidth;
|
|
1818
|
+
if (r === -1) {
|
|
1819
|
+
n && (e.style = E.LITERAL_BLOCK);
|
|
1820
|
+
return;
|
|
1821
|
+
}
|
|
1822
|
+
let i = Math.max(Math.min(r, 40), r - e.shiftOfContent), a = 0, o = !1;
|
|
1823
|
+
for (; a <= t.length;) {
|
|
1824
|
+
let e = t.length, n = t.indexOf("\n", a);
|
|
1825
|
+
n !== -1 && (e = n);
|
|
1826
|
+
let r = t.slice(a, e);
|
|
1827
|
+
if (r.length > i && r[0] !== " " && / [^ \t]/.test(r) && (o = !0), n === -1) break;
|
|
1828
|
+
a = n + 1;
|
|
1829
|
+
}
|
|
1830
|
+
o ? e.style = E.FOLDED_BLOCK : n && (e.style = E.LITERAL_BLOCK);
|
|
1831
|
+
}
|
|
1832
|
+
function Zn(e) {
|
|
1833
|
+
e.style === E.PLAIN && !Un(e.allowedStylesMask, E.PLAIN) && (e.style = Gn(e));
|
|
1834
|
+
}
|
|
1835
|
+
function Qn(e) {
|
|
1836
|
+
Un(e.allowedStylesMask, e.style) || (e.style = E.DOUBLE_QUOTED);
|
|
1837
|
+
}
|
|
1838
|
+
//#endregion
|
|
1839
|
+
//#region src/ast/scalar_styler.ts
|
|
1840
|
+
function X(e, t) {
|
|
1841
|
+
return e | 1 << t;
|
|
1842
|
+
}
|
|
1843
|
+
var $n = "[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]", er = "[\\n\\r]", tr = "\\uFEFF", nr = "[ \\t]", rr = `(?:(?!(?:${er}|${tr}))${$n})`, ir = `(?:(?!${nr})${rr})`, ar = "[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]", or = "[-?:,\\[\\]{}#&*!|>'\"%@`]", sr = "[,\\[\\]{}]", cr = ir, lr = `(?:(?!${sr})${ir})`, ur = `(?:(?:(?!${or})${ir})|[?:-](?=${cr}))`, dr = `(?:(?:(?!${or})${ir})|[?:-](?=${lr}))`, fr = `(?:(?:(?![:#])${cr})|:(?=${cr}))#*`, pr = `(?:(?:(?![:#])${lr})|:(?=${lr}))#*`, mr = `(?:${nr}*${fr})*`, hr = `(?:${nr}*${pr})*`, gr = `${ur}#*${mr}`, _r = `${dr}#*${hr}`, vr = gr, yr = _r, br = `\\n+${fr}${mr}`, xr = `\\n+${pr}${hr}`, Sr = `${gr}(?:${br})*`, Cr = `${_r}(?:${xr})*`, wr = RegExp(`^(?:${Sr})$`, "u"), Tr = RegExp(`^(?:${Cr})$`, "u"), Er = RegExp(`^(?:${vr})$`, "u"), Dr = RegExp(`^(?:${yr})$`, "u"), Or = RegExp(`^(?:${ar})*$`, "u"), kr = RegExp(`^(?:${ar}|\\n)*$`, "u"), Ar = RegExp(`^(?:${rr}|\\n)*$`, "u"), jr = /^(?:---|\.\.\.)(?=$|[ \t\n\r])/, Mr = /^(?:---|\.\.\.)(?=$|[ \t\n\r])/m;
|
|
1757
1844
|
function Nr(e) {
|
|
1758
|
-
let t =
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1845
|
+
let t = e.node.value;
|
|
1846
|
+
if (t !== "") {
|
|
1847
|
+
if (!(e.isKey ? e.flowOnly ? Dr : Er : e.flowOnly ? Tr : wr).test(t) || e.shiftOfFirstLine === 0 && jr.test(t)) return !1;
|
|
1848
|
+
if (e.shiftOfContent === 0) {
|
|
1849
|
+
let e = t.indexOf("\n");
|
|
1850
|
+
if (e !== -1) {
|
|
1851
|
+
let n = t.slice(e + 1);
|
|
1852
|
+
if (Mr.test(n)) return !1;
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
let n = e.presenterOptions.schema.resolveImplicitScalarTag(t).tag.tagName;
|
|
1857
|
+
return !(!e.node.tagged && n !== e.node.tag || !e.node.tagged && t === "=" && n === e.presenterOptions.schema.defaultScalarTag.tagName);
|
|
1763
1858
|
}
|
|
1764
1859
|
function Pr(e) {
|
|
1765
|
-
let t = e.
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
for (; r < a;) {
|
|
1771
|
-
let t, o = e.indexOf("\n", r);
|
|
1772
|
-
o === -1 ? (t = e.slice(r), r = a) : (t = e.slice(r, o + 1), r = o + 1), t.length && t !== "\n" && (i += n), i += t;
|
|
1860
|
+
let t = e.node.value;
|
|
1861
|
+
if (!(e.isKey ? Or : kr).test(t) || /[ \t]\n|\n[ \t]/.test(t)) return !1;
|
|
1862
|
+
if (!e.isKey && e.shiftOfContent === 0) {
|
|
1863
|
+
let e = t.indexOf("\n");
|
|
1864
|
+
if (e !== -1 && Mr.test(t.slice(e + 1))) return !1;
|
|
1773
1865
|
}
|
|
1774
|
-
return
|
|
1866
|
+
return !0;
|
|
1775
1867
|
}
|
|
1776
|
-
function
|
|
1777
|
-
|
|
1868
|
+
function Fr(e) {
|
|
1869
|
+
if (e.flowOnly || !Ar.test(e.node.value)) return !1;
|
|
1870
|
+
let t = e.shiftOfContent - e.shiftOfParent;
|
|
1871
|
+
return !(t < 1 || t > 9 && /^\n* /.test(e.node.value) || e.shiftOfContent === 0 && Mr.test(e.node.value));
|
|
1778
1872
|
}
|
|
1779
|
-
function
|
|
1780
|
-
let
|
|
1781
|
-
|
|
1782
|
-
indent: n,
|
|
1783
|
-
blockIndent: t === 0 ? e.indent + 1 : e.indent,
|
|
1784
|
-
lineWidth: e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - n)
|
|
1785
|
-
};
|
|
1873
|
+
function Ir(e) {
|
|
1874
|
+
let t = X(0, E.DOUBLE_QUOTED);
|
|
1875
|
+
Nr(e) && (t = X(t, E.PLAIN)), Pr(e) && (t = X(t, E.SINGLE_QUOTED)), Fr(e) && (t = X(X(t, E.LITERAL_BLOCK), E.FOLDED_BLOCK)), e.allowedStylesMask = t;
|
|
1786
1876
|
}
|
|
1787
|
-
function
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1877
|
+
function Lr(e) {
|
|
1878
|
+
switch (e.style) {
|
|
1879
|
+
case E.PLAIN: return Rr(e);
|
|
1880
|
+
case E.SINGLE_QUOTED: return zr(e);
|
|
1881
|
+
case E.LITERAL_BLOCK: return Br(e);
|
|
1882
|
+
case E.FOLDED_BLOCK: return Vr(e);
|
|
1883
|
+
case E.DOUBLE_QUOTED: return Hr(e);
|
|
1791
1884
|
}
|
|
1792
|
-
return t.defaultScalarTagName;
|
|
1793
1885
|
}
|
|
1794
|
-
function
|
|
1795
|
-
return e
|
|
1886
|
+
function Rr(e) {
|
|
1887
|
+
return Ur(e.node.value, e.shiftOfContent);
|
|
1796
1888
|
}
|
|
1797
1889
|
function zr(e) {
|
|
1798
|
-
|
|
1799
|
-
if (t !== br && t !== 46 || e.charCodeAt(1) !== t || e.charCodeAt(2) !== t) return !1;
|
|
1800
|
-
if (e.length === 3) return !0;
|
|
1801
|
-
let n = e.charCodeAt(3);
|
|
1802
|
-
return K(n) || n === ur || n === U;
|
|
1803
|
-
}
|
|
1804
|
-
function q(e) {
|
|
1805
|
-
return e >= 32 && e <= 126 || e >= 161 && e <= 55295 && e !== 8232 && e !== 8233 || e >= 57344 && e <= 65533 && e !== cr || e >= 65536 && e <= 1114111;
|
|
1890
|
+
return `'${Ur(e.node.value, e.shiftOfContent).replace(/'/g, "''")}'`;
|
|
1806
1891
|
}
|
|
1807
1892
|
function Br(e) {
|
|
1808
|
-
|
|
1893
|
+
let t = e.node.value;
|
|
1894
|
+
return "|" + Kr(t, e.shiftOfParent, e.shiftOfContent) + qr(Wr(t, e.shiftOfContent));
|
|
1809
1895
|
}
|
|
1810
|
-
function Vr(e
|
|
1811
|
-
let
|
|
1812
|
-
return
|
|
1896
|
+
function Vr(e) {
|
|
1897
|
+
let t = e.node.value, n = e.presenterOptions.lineWidth, r = Infinity;
|
|
1898
|
+
return n !== -1 && (r = Math.max(Math.min(n, 40), n - e.shiftOfContent)), ">" + Kr(t, e.shiftOfParent, e.shiftOfContent) + qr(Wr(Xr(t, r), e.shiftOfContent));
|
|
1813
1899
|
}
|
|
1814
1900
|
function Hr(e) {
|
|
1815
|
-
return
|
|
1901
|
+
return `"${$r(e.node.value)}"`;
|
|
1816
1902
|
}
|
|
1817
1903
|
function Ur(e, t) {
|
|
1818
|
-
let n = J(e, 0);
|
|
1819
|
-
if (Hr(n)) return !0;
|
|
1820
|
-
if (e.length > 1 && (n === br || n === Cr || n === W)) {
|
|
1821
|
-
let r = J(e, 1);
|
|
1822
|
-
return !K(r) && Vr(r, n, t);
|
|
1823
|
-
}
|
|
1824
|
-
return !1;
|
|
1825
|
-
}
|
|
1826
|
-
function Wr(e) {
|
|
1827
|
-
return !K(e) && e !== W;
|
|
1828
|
-
}
|
|
1829
|
-
function J(e, t) {
|
|
1830
|
-
let n = e.charCodeAt(t), r;
|
|
1831
|
-
return n >= 55296 && n <= 56319 && t + 1 < e.length && (r = e.charCodeAt(t + 1), r >= 56320 && r <= 57343) ? (n - 55296) * 1024 + r - 56320 + 65536 : n;
|
|
1832
|
-
}
|
|
1833
|
-
function Gr(e) {
|
|
1834
|
-
return /^\n* /.test(e);
|
|
1835
|
-
}
|
|
1836
|
-
var Y = 1, X = 2, Kr = 3, qr = 4, Z = 5;
|
|
1837
|
-
function Jr(e, t, n, r, i, a) {
|
|
1838
|
-
let { blockIndent: o, lineWidth: s } = n, c, l = 0, u = -1, d = !1, f = !1, p = s !== -1, m = -1, h = !zr(t) && Ur(t, a) && Wr(J(t, t.length - 1));
|
|
1839
|
-
if (r || i) for (c = 0; c < t.length; l >= 65536 ? c += 2 : c++) {
|
|
1840
|
-
if (l = J(t, c), !q(l)) return Z;
|
|
1841
|
-
h = h && Vr(l, u, a), u = l;
|
|
1842
|
-
}
|
|
1843
|
-
else {
|
|
1844
|
-
for (c = 0; c < t.length; l >= 65536 ? c += 2 : c++) {
|
|
1845
|
-
if (l = J(t, c), l === U) d = !0, p && (f = f || c - m - 1 > s && !ei(t[m + 1]), m = c);
|
|
1846
|
-
else if (!q(l)) return Z;
|
|
1847
|
-
h = h && Vr(l, u, a), u = l;
|
|
1848
|
-
}
|
|
1849
|
-
f = f || p && c - m - 1 > s && !ei(t[m + 1]);
|
|
1850
|
-
}
|
|
1851
|
-
return !d && !f ? h && !i ? Y : e.quoteStyle === "double" ? Z : X : o > 9 && Gr(t) ? Z : f ? qr : Kr;
|
|
1852
|
-
}
|
|
1853
|
-
function Yr(e, t, n) {
|
|
1854
|
-
let { indent: r, blockIndent: i, lineWidth: a } = n;
|
|
1855
|
-
switch (t) {
|
|
1856
|
-
case Y: return Qr(e, r);
|
|
1857
|
-
case X: return `'${Qr(e, r).replace(/'/g, "''")}'`;
|
|
1858
|
-
case Kr: return "|" + Zr(e, i) + $r(Fr(e, r));
|
|
1859
|
-
case qr: return ">" + Zr(e, i) + $r(Fr(ti(e, a), r));
|
|
1860
|
-
case Z: return `"${ri(e)}"`;
|
|
1861
|
-
}
|
|
1862
|
-
}
|
|
1863
|
-
function Xr(e, t, n, r, i) {
|
|
1864
|
-
let a = r || !i;
|
|
1865
|
-
if (t.style.singleQuoted) return X;
|
|
1866
|
-
if (t.style.doubleQuoted) return Z;
|
|
1867
|
-
if (!a) {
|
|
1868
|
-
if (t.style.literal) return Kr;
|
|
1869
|
-
if (t.style.folded) return qr;
|
|
1870
|
-
}
|
|
1871
|
-
let o = t.value;
|
|
1872
|
-
if (o.length === 0) return t.style.tagged || Rr(e, o) === t.tag ? Y : e.quoteStyle === "double" ? Z : X;
|
|
1873
|
-
let s = Jr(e, o, n, a, e.forceQuotes && !r, i);
|
|
1874
|
-
return s === Y && !t.style.tagged && Rr(e, o) !== t.tag ? e.quoteStyle === "double" ? Z : X : s;
|
|
1875
|
-
}
|
|
1876
|
-
function Zr(e, t) {
|
|
1877
|
-
let n = Gr(e) ? String(t) : "", r = e[e.length - 1] === "\n";
|
|
1878
|
-
return `${n}${r && (e[e.length - 2] === "\n" || e === "\n") ? "+" : r ? "" : "-"}\n`;
|
|
1879
|
-
}
|
|
1880
|
-
function Qr(e, t) {
|
|
1881
1904
|
let n = e.indexOf("\n");
|
|
1882
1905
|
if (n === -1) return e;
|
|
1883
1906
|
let r = " ".repeat(t), i = e.slice(0, n), a = /(\n+)([^\n]*)/g;
|
|
@@ -1889,153 +1912,205 @@ function Qr(e, t) {
|
|
|
1889
1912
|
}
|
|
1890
1913
|
return i;
|
|
1891
1914
|
}
|
|
1892
|
-
function
|
|
1915
|
+
function Wr(e, t) {
|
|
1916
|
+
let n = " ".repeat(t), r = 0, i = "", a = e.length;
|
|
1917
|
+
for (; r < a;) {
|
|
1918
|
+
let t, o = e.indexOf("\n", r);
|
|
1919
|
+
o === -1 ? (t = e.slice(r), r = a) : (t = e.slice(r, o + 1), r = o + 1), t.length && t !== "\n" && (i += n), i += t;
|
|
1920
|
+
}
|
|
1921
|
+
return i;
|
|
1922
|
+
}
|
|
1923
|
+
function Gr(e) {
|
|
1924
|
+
return /^\n* /.test(e);
|
|
1925
|
+
}
|
|
1926
|
+
function Kr(e, t, n) {
|
|
1927
|
+
let r = Gr(e) ? String(n - t) : "", i = e[e.length - 1] === "\n";
|
|
1928
|
+
return `${r}${i && (e[e.length - 2] === "\n" || e === "\n") ? "+" : i ? "" : "-"}\n`;
|
|
1929
|
+
}
|
|
1930
|
+
function qr(e) {
|
|
1893
1931
|
return e[e.length - 1] === "\n" ? e.slice(0, -1) : e;
|
|
1894
1932
|
}
|
|
1895
|
-
function
|
|
1933
|
+
function Jr(e) {
|
|
1896
1934
|
return e === " " || e === " ";
|
|
1897
1935
|
}
|
|
1898
|
-
function
|
|
1936
|
+
function Yr(e, t) {
|
|
1937
|
+
if (e === "" || Jr(e[0])) return e;
|
|
1938
|
+
let n = / [^ \t]/g, r, i = 0, a, o = 0, s = 0, c = "";
|
|
1939
|
+
for (; r = n.exec(e);) s = r.index, s - i > t && (a = o > i ? o : s, c += `\n${e.slice(i, a)}`, i = a + 1), o = s;
|
|
1940
|
+
return c += "\n", e.length - i > t && o > i ? c += `${e.slice(i, o)}\n${e.slice(o + 1)}` : c += e.slice(i), c.slice(1);
|
|
1941
|
+
}
|
|
1942
|
+
function Xr(e, t) {
|
|
1899
1943
|
let n = /(\n+)([^\n]*)/g, r = e.indexOf("\n");
|
|
1900
1944
|
r === -1 && (r = e.length), n.lastIndex = r;
|
|
1901
|
-
let i =
|
|
1945
|
+
let i = Yr(e.slice(0, r), t), a = e[0] === "\n" || Jr(e[0]), o, s;
|
|
1902
1946
|
for (; s = n.exec(e);) {
|
|
1903
1947
|
let e = s[1], n = s[2];
|
|
1904
|
-
o = n !== "" &&
|
|
1948
|
+
o = n !== "" && Jr(n[0]), i += e + (!a && !o && n !== "" ? "\n" : "") + Yr(n, t), a = o;
|
|
1905
1949
|
}
|
|
1906
1950
|
return i;
|
|
1907
1951
|
}
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1952
|
+
var Zr = /["\\\x00-\x1F\x7F-\xA0\u2028\u2029\uD800-\uDFFF\uFEFF\uFFFE\uFFFF]/gu;
|
|
1953
|
+
function Qr(e) {
|
|
1954
|
+
switch (e) {
|
|
1955
|
+
case "\0": return "\\0";
|
|
1956
|
+
case "\x07": return "\\a";
|
|
1957
|
+
case "\b": return "\\b";
|
|
1958
|
+
case " ": return "\\t";
|
|
1959
|
+
case "\n": return "\\n";
|
|
1960
|
+
case "\v": return "\\v";
|
|
1961
|
+
case "\f": return "\\f";
|
|
1962
|
+
case "\r": return "\\r";
|
|
1963
|
+
case "\x1B": return "\\e";
|
|
1964
|
+
case "\"": return "\\\"";
|
|
1965
|
+
case "\\": return "\\\\";
|
|
1966
|
+
case "
": return "\\N";
|
|
1967
|
+
case "\xA0": return "\\_";
|
|
1968
|
+
case "\u2028": return "\\L";
|
|
1969
|
+
case "\u2029": return "\\P";
|
|
1970
|
+
}
|
|
1971
|
+
let t = e.charCodeAt(0), n = t.toString(16).toUpperCase();
|
|
1972
|
+
return t <= 255 ? `\\x${"0".repeat(2 - n.length)}${n}` : `\\u${"0".repeat(4 - n.length)}${n}`;
|
|
1913
1973
|
}
|
|
1914
|
-
function
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1974
|
+
function $r(e) {
|
|
1975
|
+
return e.replace(Zr, Qr);
|
|
1976
|
+
}
|
|
1977
|
+
//#endregion
|
|
1978
|
+
//#region src/ast/presenter.ts
|
|
1979
|
+
var Z = 10, ei = {
|
|
1980
|
+
indent: 2,
|
|
1981
|
+
seqNoIndent: !1,
|
|
1982
|
+
seqInlineFirst: !0,
|
|
1983
|
+
lineWidth: 80,
|
|
1984
|
+
flowBracketPadding: !1,
|
|
1985
|
+
flowSkipCommaSpace: !1,
|
|
1986
|
+
flowSkipColonSpace: !1,
|
|
1987
|
+
quoteFlowKeys: !1,
|
|
1988
|
+
quoteStyle: "single",
|
|
1989
|
+
forceQuotes: !1,
|
|
1990
|
+
scalarStyleRules: Object.keys(Wn).map((e) => Reflect.get(Wn, e)),
|
|
1991
|
+
tagBeforeAnchor: !1
|
|
1992
|
+
};
|
|
1993
|
+
function ti(e) {
|
|
1994
|
+
return e.tagged ? e.tag : Dt(e.tag);
|
|
1930
1995
|
}
|
|
1931
|
-
function
|
|
1996
|
+
function ni(e) {
|
|
1997
|
+
let t = x(x({}, ei), e);
|
|
1998
|
+
return t.flowSkipColonSpace && (t.quoteFlowKeys = !0), x(x({}, t), {}, {
|
|
1999
|
+
defaultScalarTagName: t.schema.defaultScalarTag.tagName,
|
|
2000
|
+
openEnded: !1
|
|
2001
|
+
});
|
|
2002
|
+
}
|
|
2003
|
+
function ri(e, t) {
|
|
2004
|
+
return `\n${" ".repeat(e.indent * t)}`;
|
|
2005
|
+
}
|
|
2006
|
+
function ii(e, t, n, r, i, a) {
|
|
2007
|
+
return {
|
|
2008
|
+
node: t,
|
|
2009
|
+
parent: n,
|
|
2010
|
+
level: r,
|
|
2011
|
+
isKey: i,
|
|
2012
|
+
flowOnly: a,
|
|
2013
|
+
shiftOfParent: r === 0 ? -1 : e.indent * (r - 1),
|
|
2014
|
+
shiftOfContent: e.indent * Math.max(1, r),
|
|
2015
|
+
shiftOfFirstLine: r === 0 ? 0 : e.indent * r,
|
|
2016
|
+
presenterOptions: e,
|
|
2017
|
+
allowedStylesMask: 0,
|
|
2018
|
+
style: t.style
|
|
2019
|
+
};
|
|
2020
|
+
}
|
|
2021
|
+
function ai(e, t, n) {
|
|
1932
2022
|
let r = "";
|
|
1933
2023
|
for (let i = 0, a = n.items.length; i < a; i += 1) {
|
|
1934
|
-
let a = Q(e, t, n.items[i], {});
|
|
1935
|
-
|
|
2024
|
+
let a = Q(e, t, n.items[i], n, {}).text;
|
|
2025
|
+
i > 0 && (r += `,${e.flowSkipCommaSpace ? "" : " "}`), r += a;
|
|
1936
2026
|
}
|
|
1937
|
-
let i = e.flowBracketPadding &&
|
|
2027
|
+
let i = e.flowBracketPadding && n.items.length > 0 ? " " : "";
|
|
1938
2028
|
return `[${i}${r}${i}]`;
|
|
1939
2029
|
}
|
|
1940
|
-
function
|
|
2030
|
+
function oi(e, t, n, r) {
|
|
1941
2031
|
let i = "";
|
|
1942
2032
|
for (let a = 0, o = n.items.length; a < o; a += 1) {
|
|
1943
|
-
let o = Q(e, t + 1, n.items[a], {
|
|
2033
|
+
let o = Q(e, t + 1, n.items[a], n, {
|
|
1944
2034
|
block: !0,
|
|
1945
2035
|
compact: e.seqInlineFirst,
|
|
1946
2036
|
isblockseq: !0
|
|
1947
|
-
});
|
|
1948
|
-
(!r || i !== "") && (i +=
|
|
2037
|
+
}).text;
|
|
2038
|
+
(!r || i !== "") && (i += ri(e, t)), o === "" || Z === o.charCodeAt(0) ? i += "-" : i += "- ", i += o;
|
|
1949
2039
|
}
|
|
1950
2040
|
return i;
|
|
1951
2041
|
}
|
|
1952
|
-
function
|
|
1953
|
-
let r = ""
|
|
1954
|
-
for (let { key:
|
|
1955
|
-
let
|
|
1956
|
-
r !== "" && (
|
|
1957
|
-
let
|
|
1958
|
-
|
|
1959
|
-
let c = Q(e, t, a, {}), l = e.flowSkipColonSpace || c === "" ? "" : " ";
|
|
1960
|
-
i += `${o}${e.quoteFlowKeys && !s ? "\"" : ""}:${l}${c}`, r += i;
|
|
1961
|
-
}
|
|
1962
|
-
let a = e.flowBracketPadding && r !== "" ? " " : "";
|
|
1963
|
-
return `{${a}${r}${a}}`;
|
|
1964
|
-
}
|
|
1965
|
-
function si(e) {
|
|
1966
|
-
return e.kind === "scalar" ? e.value : e;
|
|
1967
|
-
}
|
|
1968
|
-
function ci(e, t) {
|
|
1969
|
-
if (!e.sortKeys) return t;
|
|
1970
|
-
let n = t.slice();
|
|
1971
|
-
if (e.sortKeys === !0) n.sort((e, t) => {
|
|
1972
|
-
let n = si(e.key), r = si(t.key);
|
|
1973
|
-
return n < r ? -1 : +(n > r);
|
|
1974
|
-
});
|
|
1975
|
-
else {
|
|
1976
|
-
let t = e.sortKeys;
|
|
1977
|
-
n.sort((e, n) => t(si(e.key), si(n.key)));
|
|
2042
|
+
function si(e, t, n) {
|
|
2043
|
+
let r = "";
|
|
2044
|
+
for (let { key: i, value: a } of n.items) {
|
|
2045
|
+
let o = "";
|
|
2046
|
+
r !== "" && (o += `,${e.flowSkipCommaSpace ? "" : " "}`);
|
|
2047
|
+
let s = Q(e, t, i, n, { iskey: !0 }), c = s.text, l = Q(e, t, a, n, {}).text, u = e.flowSkipColonSpace || l === "" ? "" : " ", d = i.kind === "scalar" && s.noBody && (i.tagged || i.anchor !== void 0), f = i.kind === "alias" || d ? " " : "";
|
|
2048
|
+
o += `${c}${f}:${u}${l}`, r += o;
|
|
1978
2049
|
}
|
|
1979
|
-
|
|
2050
|
+
let i = e.flowBracketPadding && r !== "" ? " " : "";
|
|
2051
|
+
return `{${i}${r}${i}}`;
|
|
1980
2052
|
}
|
|
1981
|
-
function
|
|
1982
|
-
let i = ""
|
|
1983
|
-
for (let
|
|
2053
|
+
function ci(e, t, n, r) {
|
|
2054
|
+
let i = "";
|
|
2055
|
+
for (let a = 0, o = n.items.length; a < o; a += 1) {
|
|
1984
2056
|
let o = "";
|
|
1985
|
-
(!r || i !== "") && (o +=
|
|
1986
|
-
let { key: s, value: c } = a
|
|
2057
|
+
(!r || i !== "") && (o += ri(e, t));
|
|
2058
|
+
let { key: s, value: c } = n.items[a], l = (s.kind === "mapping" || s.kind === "sequence") && s.style === D.BLOCK && s.items.length !== 0 || s.kind === "scalar" && (s.style === E.LITERAL_BLOCK || s.style === E.FOLDED_BLOCK), u = l ? Q(e, t + 1, s, n, {
|
|
1987
2059
|
block: !0,
|
|
1988
2060
|
compact: !0,
|
|
1989
|
-
isblockseq: !
|
|
1990
|
-
}) : Q(e, t + 1, s, {
|
|
2061
|
+
isblockseq: !li(e, s, t + 1)
|
|
2062
|
+
}) : Q(e, t + 1, s, n, {
|
|
1991
2063
|
block: !0,
|
|
1992
2064
|
compact: !0,
|
|
1993
2065
|
iskey: !0
|
|
1994
|
-
}), d = s.kind === "scalar" && s.value.indexOf("\n") !== -1,
|
|
1995
|
-
|
|
1996
|
-
let
|
|
2066
|
+
}), d = u.text, f = s.kind === "scalar" && s.value.indexOf("\n") !== -1, p = d.length > 1024 && /^[\s\S]{1025}/u.test(d), m = l || f || p;
|
|
2067
|
+
m && (d && Z === d.charCodeAt(0) ? o += "?" : o += "? "), o += d, m && (o += ri(e, t));
|
|
2068
|
+
let h = Q(e, t + 1, c, n, {
|
|
1997
2069
|
block: !0,
|
|
1998
|
-
compact:
|
|
1999
|
-
isblockseq:
|
|
2000
|
-
}),
|
|
2001
|
-
|
|
2070
|
+
compact: m,
|
|
2071
|
+
isblockseq: m && !li(e, c, t + 1)
|
|
2072
|
+
}).text, ee = s.kind === "scalar" && u.noBody && (s.tagged || s.anchor !== void 0), te = !m && (s.kind === "alias" || ee) ? " " : "";
|
|
2073
|
+
h === "" || Z === h.charCodeAt(0) ? o += `${te}:` : o += `${te}: `, o += h, i += o;
|
|
2002
2074
|
}
|
|
2003
2075
|
return i;
|
|
2004
2076
|
}
|
|
2005
|
-
function
|
|
2006
|
-
return t.
|
|
2007
|
-
}
|
|
2008
|
-
function Q(e, t, n, r) {
|
|
2009
|
-
var
|
|
2010
|
-
if (n.kind === "alias") return
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2077
|
+
function li(e, t, n) {
|
|
2078
|
+
return t.kind === "alias" ? !0 : t.tagged || t.anchor !== void 0 || e.indent < 2 && n > 0;
|
|
2079
|
+
}
|
|
2080
|
+
function Q(e, t, n, r, i) {
|
|
2081
|
+
var a;
|
|
2082
|
+
if (n.kind === "alias") return e.openEnded = !1, {
|
|
2083
|
+
text: `*${n.anchor}`,
|
|
2084
|
+
noBody: !1
|
|
2085
|
+
};
|
|
2086
|
+
let { block: o = !1, iskey: s = !1, isblockseq: c = !1 } = i, l = (a = i.compact) == null ? !1 : a, u = n.anchor !== void 0;
|
|
2087
|
+
li(e, n, t) && (l = !1);
|
|
2088
|
+
let d, f = n.tagged, p = o && (n.kind === "mapping" || n.kind === "sequence") && n.style === D.BLOCK && n.items.length !== 0;
|
|
2089
|
+
if (n.kind === "mapping") d = p ? ci(e, t, n, l) : si(e, t, n);
|
|
2090
|
+
else if (n.kind === "sequence") d = p ? e.seqNoIndent && !c && t > 0 ? oi(e, t - 1, n, l) : oi(e, t, n, l) : ai(e, t, n);
|
|
2016
2091
|
else {
|
|
2017
|
-
let
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2092
|
+
let i = ii(e, n, r, t, s, !o);
|
|
2093
|
+
Ir(i);
|
|
2094
|
+
for (let t of e.scalarStyleRules) t(i);
|
|
2095
|
+
d = Lr(i), e.openEnded = (i.style === E.LITERAL_BLOCK || i.style === E.FOLDED_BLOCK) && (n.value === "\n" || n.value.endsWith("\n\n")), f = n.tagged || d === "" && i.flowOnly && (r == null ? void 0 : r.kind) === "sequence" && !u || i.style !== E.PLAIN && n.tag !== e.defaultScalarTagName;
|
|
2096
|
+
}
|
|
2097
|
+
(n.kind === "mapping" || n.kind === "sequence") && !p && (e.openEnded = !1), p && l && t > 0 && e.indent > 2 && (d = `${" ".repeat(e.indent - 2)}${d}`);
|
|
2098
|
+
let m = d === "", h = d;
|
|
2099
|
+
if (f || u) {
|
|
2100
|
+
let t = [], r = f ? ti(n) : null, i = u ? `&${n.anchor}` : null;
|
|
2022
2101
|
e.tagBeforeAnchor ? (r !== null && t.push(r), i !== null && t.push(i)) : (i !== null && t.push(i), r !== null && t.push(r));
|
|
2023
|
-
let a =
|
|
2024
|
-
|
|
2102
|
+
let a = d === "" || d.charCodeAt(0) === Z ? "" : " ";
|
|
2103
|
+
h = `${t.join(" ")}${a}${d}`;
|
|
2025
2104
|
}
|
|
2026
|
-
return
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2105
|
+
return {
|
|
2106
|
+
text: h,
|
|
2107
|
+
noBody: m
|
|
2108
|
+
};
|
|
2030
2109
|
}
|
|
2031
|
-
function
|
|
2032
|
-
|
|
2033
|
-
for (; (t.kind === "sequence" || t.kind === "mapping") && !t.style.flow && t.items.length !== 0;) t = t.kind === "sequence" ? t.items[t.items.length - 1] : t.items[t.items.length - 1].value;
|
|
2034
|
-
if (t.kind !== "scalar" || !(t.style.literal || t.style.folded)) return !1;
|
|
2035
|
-
let { value: n } = t;
|
|
2036
|
-
return n.endsWith("\n\n") || n === "\n";
|
|
2110
|
+
function ui(e) {
|
|
2111
|
+
return (e.kind === "sequence" || e.kind === "mapping") && e.style === D.BLOCK && e.items.length !== 0 && !e.tagged && e.anchor === void 0;
|
|
2037
2112
|
}
|
|
2038
|
-
function
|
|
2113
|
+
function di(e) {
|
|
2039
2114
|
let t = "";
|
|
2040
2115
|
for (let n of e.directives) {
|
|
2041
2116
|
if (n.kind === "yaml") {
|
|
@@ -2047,110 +2122,96 @@ function pi(e) {
|
|
|
2047
2122
|
}
|
|
2048
2123
|
return t;
|
|
2049
2124
|
}
|
|
2050
|
-
function
|
|
2051
|
-
let n =
|
|
2125
|
+
function fi(e, t) {
|
|
2126
|
+
let n = ni(t), r = "", i = !1;
|
|
2052
2127
|
for (let t = 0; t < e.length; t += 1) {
|
|
2053
|
-
let a = e[t]
|
|
2128
|
+
let a = e[t];
|
|
2129
|
+
n.openEnded = !1;
|
|
2130
|
+
let o = di(a), s = o !== "", c = a.explicitStart || s || t > 0 && !i;
|
|
2054
2131
|
if (r += o, a.contents === null) c && (r += "---\n");
|
|
2055
2132
|
else if (c) {
|
|
2056
|
-
let e = Q(n, 0, a.contents, {
|
|
2133
|
+
let e = Q(n, 0, a.contents, null, {
|
|
2057
2134
|
block: !0,
|
|
2058
2135
|
compact: !0
|
|
2059
|
-
}), t = e === "" ? "" : s ||
|
|
2136
|
+
}).text, t = e === "" ? "" : s || ui(a.contents) ? "\n" : " ";
|
|
2060
2137
|
r += `---${t}${e}\n`;
|
|
2061
|
-
} else r += Q(n, 0, a.contents, {
|
|
2138
|
+
} else r += Q(n, 0, a.contents, null, {
|
|
2062
2139
|
block: !0,
|
|
2063
2140
|
compact: !0
|
|
2064
|
-
}) + "\n";
|
|
2065
|
-
i = a.explicitEnd ||
|
|
2141
|
+
}).text + "\n";
|
|
2142
|
+
i = a.explicitEnd || n.openEnded, i && (r += "...\n");
|
|
2066
2143
|
}
|
|
2067
2144
|
return r;
|
|
2068
2145
|
}
|
|
2069
2146
|
//#endregion
|
|
2070
2147
|
//#region src/dump.ts
|
|
2071
|
-
var
|
|
2072
|
-
|
|
2073
|
-
return i === e ? ce.resolve(t, n, r) : i;
|
|
2074
|
-
} }), y(y({}, Me), {}, { resolve: (t, n, r) => {
|
|
2075
|
-
let i = Me.resolve(t, n, r);
|
|
2076
|
-
return i === e ? Se.resolve(t, n, r) : i;
|
|
2077
|
-
} })), gi = y(y({}, jr), {}, {
|
|
2078
|
-
schema: hi,
|
|
2148
|
+
var pi = x(x({}, ei), {}, {
|
|
2149
|
+
schema: tt,
|
|
2079
2150
|
skipInvalid: !1,
|
|
2080
2151
|
noRefs: !1,
|
|
2081
2152
|
flowLevel: -1,
|
|
2153
|
+
sortKeys: !1,
|
|
2082
2154
|
transform: () => {}
|
|
2083
2155
|
});
|
|
2084
|
-
function
|
|
2085
|
-
let n =
|
|
2156
|
+
function mi(e, t) {
|
|
2157
|
+
let n = String(e), r = String(t);
|
|
2158
|
+
return n < r ? -1 : +(n > r);
|
|
2159
|
+
}
|
|
2160
|
+
function hi(e, t = {}) {
|
|
2161
|
+
let n = x(x({}, pi), t), r = Rn(e, n.schema, {
|
|
2086
2162
|
noRefs: n.noRefs,
|
|
2087
2163
|
skipInvalid: n.skipInvalid
|
|
2088
2164
|
});
|
|
2089
|
-
|
|
2090
|
-
if (!(t.depth < n.flowLevel)) return e.
|
|
2091
|
-
}), n.
|
|
2165
|
+
if (n.flowLevel >= 0 && Hn(r, (e, t) => {
|
|
2166
|
+
if (!(t.depth < n.flowLevel)) return (e.kind === "sequence" || e.kind === "mapping") && (e.style = D.FLOW), Bn;
|
|
2167
|
+
}), n.sortKeys) {
|
|
2168
|
+
let e = n.sortKeys === !0 ? mi : n.sortKeys;
|
|
2169
|
+
Hn(r, (t) => {
|
|
2170
|
+
t.kind === "mapping" && t.items.sort((t, n) => e(t.key.kind === "scalar" ? t.key.value : "", n.key.kind === "scalar" ? n.key.value : ""));
|
|
2171
|
+
});
|
|
2172
|
+
}
|
|
2173
|
+
return n.transform(r), fi(r, x(x({}, Ve(n, Object.keys(ei))), {}, { schema: n.schema }));
|
|
2092
2174
|
}
|
|
2093
2175
|
//#endregion
|
|
2094
2176
|
//#region src/ast/from_events.ts
|
|
2095
2177
|
var $ = -1;
|
|
2096
|
-
function
|
|
2178
|
+
function gi(e) {
|
|
2097
2179
|
return "tagStart" in e && e.tagStart !== $ ? e.tagStart : "anchorStart" in e && e.anchorStart !== $ ? e.anchorStart : "valueStart" in e && e.valueStart !== $ ? e.valueStart : "start" in e ? e.start : 0;
|
|
2098
2180
|
}
|
|
2099
|
-
function
|
|
2181
|
+
function _i(e, t) {
|
|
2100
2182
|
return t.tagStart === $ ? "" : e.source.slice(t.tagStart, t.tagEnd);
|
|
2101
2183
|
}
|
|
2102
|
-
function
|
|
2184
|
+
function vi(e, t) {
|
|
2103
2185
|
return t.anchorStart === $ ? void 0 : e.source.slice(t.anchorStart, t.anchorEnd);
|
|
2104
2186
|
}
|
|
2105
|
-
function
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
for (let t of a) if (t.resolve(n, !1, t.tagName) !== e) return t.tagName;
|
|
2109
|
-
return i.defaultScalarTag.tagName;
|
|
2110
|
-
}
|
|
2111
|
-
function Si(e, t) {
|
|
2112
|
-
let n = Wt(e.source, t), r = yi(e, t), i = new B();
|
|
2113
|
-
switch (t.style) {
|
|
2114
|
-
case 2:
|
|
2115
|
-
i.singleQuoted = !0;
|
|
2116
|
-
break;
|
|
2117
|
-
case 3:
|
|
2118
|
-
i.doubleQuoted = !0;
|
|
2119
|
-
break;
|
|
2120
|
-
case 4:
|
|
2121
|
-
i.literal = !0;
|
|
2122
|
-
break;
|
|
2123
|
-
case 5:
|
|
2124
|
-
i.folded = !0;
|
|
2125
|
-
break;
|
|
2126
|
-
}
|
|
2127
|
-
let a;
|
|
2128
|
-
return r === "" ? a = t.style === 1 ? xi(e, n) : e.schema.defaultScalarTag.tagName : (i.tagged = !0, a = r), {
|
|
2187
|
+
function yi(e, t) {
|
|
2188
|
+
let n = Ct(e.source, t), r = _i(e, t), i, a = !1;
|
|
2189
|
+
return r === "" ? i = t.style === E.PLAIN ? e.schema.resolveImplicitScalarTag(n).tag.tagName : e.schema.defaultScalarTag.tagName : (a = !0, i = r), {
|
|
2129
2190
|
kind: "scalar",
|
|
2130
|
-
tag:
|
|
2131
|
-
|
|
2132
|
-
|
|
2191
|
+
tag: i,
|
|
2192
|
+
tagged: a,
|
|
2193
|
+
style: t.style,
|
|
2194
|
+
anchor: vi(e, t),
|
|
2133
2195
|
value: n
|
|
2134
2196
|
};
|
|
2135
2197
|
}
|
|
2136
|
-
function
|
|
2137
|
-
let r =
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
anchor: bi(e, t)
|
|
2198
|
+
function bi(e, t, n) {
|
|
2199
|
+
let r = _i(e, t), i, a = !1;
|
|
2200
|
+
return r === "" ? i = n : (i = r, a = !0), {
|
|
2201
|
+
tag: i,
|
|
2202
|
+
tagged: a,
|
|
2203
|
+
style: t.style,
|
|
2204
|
+
anchor: vi(e, t)
|
|
2144
2205
|
};
|
|
2145
2206
|
}
|
|
2146
|
-
function
|
|
2207
|
+
function xi(e, t) {
|
|
2147
2208
|
let n = e.frames[e.frames.length - 1];
|
|
2148
2209
|
n.kind === "document" ? n.doc.contents = t : n.kind === "sequence" ? n.node.items.push(t) : n.key ? (n.node.items.push({
|
|
2149
2210
|
key: n.key,
|
|
2150
2211
|
value: t
|
|
2151
2212
|
}), n.key = null) : n.key = t;
|
|
2152
2213
|
}
|
|
2153
|
-
function
|
|
2214
|
+
function Si(e, t) {
|
|
2154
2215
|
let n = {
|
|
2155
2216
|
source: t.source,
|
|
2156
2217
|
schema: t.schema,
|
|
@@ -2161,8 +2222,8 @@ function Ti(e, t) {
|
|
|
2161
2222
|
};
|
|
2162
2223
|
for (; n.eventIndex < e.length;) {
|
|
2163
2224
|
let t = e[n.eventIndex++];
|
|
2164
|
-
switch (n.position =
|
|
2165
|
-
case
|
|
2225
|
+
switch (n.position = gi(t), t.type) {
|
|
2226
|
+
case T.DOCUMENT: {
|
|
2166
2227
|
let e = {
|
|
2167
2228
|
contents: null,
|
|
2168
2229
|
explicitStart: t.explicitStart,
|
|
@@ -2175,52 +2236,50 @@ function Ti(e, t) {
|
|
|
2175
2236
|
});
|
|
2176
2237
|
break;
|
|
2177
2238
|
}
|
|
2178
|
-
case
|
|
2179
|
-
|
|
2239
|
+
case T.SCALAR:
|
|
2240
|
+
xi(n, yi(n, t));
|
|
2180
2241
|
break;
|
|
2181
|
-
case
|
|
2182
|
-
let { tag: e,
|
|
2242
|
+
case T.SEQUENCE: {
|
|
2243
|
+
let { tag: e, tagged: r, style: i, anchor: a } = bi(n, t, "tag:yaml.org,2002:seq"), o = {
|
|
2183
2244
|
kind: "sequence",
|
|
2184
2245
|
tag: e,
|
|
2185
|
-
|
|
2186
|
-
|
|
2246
|
+
tagged: r,
|
|
2247
|
+
style: i,
|
|
2248
|
+
anchor: a,
|
|
2187
2249
|
items: []
|
|
2188
2250
|
};
|
|
2189
2251
|
n.frames.push({
|
|
2190
2252
|
kind: "sequence",
|
|
2191
|
-
node:
|
|
2253
|
+
node: o
|
|
2192
2254
|
});
|
|
2193
2255
|
break;
|
|
2194
2256
|
}
|
|
2195
|
-
case
|
|
2196
|
-
let { tag: e,
|
|
2257
|
+
case T.MAPPING: {
|
|
2258
|
+
let { tag: e, tagged: r, style: i, anchor: a } = bi(n, t, "tag:yaml.org,2002:map"), o = {
|
|
2197
2259
|
kind: "mapping",
|
|
2198
2260
|
tag: e,
|
|
2199
|
-
|
|
2200
|
-
|
|
2261
|
+
tagged: r,
|
|
2262
|
+
style: i,
|
|
2263
|
+
anchor: a,
|
|
2201
2264
|
items: []
|
|
2202
2265
|
};
|
|
2203
2266
|
n.frames.push({
|
|
2204
2267
|
kind: "mapping",
|
|
2205
|
-
node:
|
|
2268
|
+
node: o,
|
|
2206
2269
|
key: null
|
|
2207
2270
|
});
|
|
2208
2271
|
break;
|
|
2209
2272
|
}
|
|
2210
|
-
case
|
|
2211
|
-
|
|
2212
|
-
wi(n, {
|
|
2273
|
+
case T.ALIAS:
|
|
2274
|
+
xi(n, {
|
|
2213
2275
|
kind: "alias",
|
|
2214
|
-
|
|
2215
|
-
style: new B(),
|
|
2216
|
-
anchor: e
|
|
2276
|
+
anchor: n.source.slice(t.anchorStart, t.anchorEnd)
|
|
2217
2277
|
});
|
|
2218
2278
|
break;
|
|
2219
|
-
|
|
2220
|
-
case 6: {
|
|
2279
|
+
case T.POP: {
|
|
2221
2280
|
let e = n.frames.pop();
|
|
2222
2281
|
if (e.kind === "mapping" && e.key) throw Error("incomplete mapping pair in event stream");
|
|
2223
|
-
e.kind === "document" ? n.documents.push(e.doc) :
|
|
2282
|
+
e.kind === "document" ? n.documents.push(e.doc) : xi(n, e.node);
|
|
2224
2283
|
break;
|
|
2225
2284
|
}
|
|
2226
2285
|
}
|
|
@@ -2228,6 +2287,9 @@ function Ti(e, t) {
|
|
|
2228
2287
|
return n.documents;
|
|
2229
2288
|
}
|
|
2230
2289
|
//#endregion
|
|
2231
|
-
|
|
2290
|
+
//#region src/index.ts
|
|
2291
|
+
var Ci = T.DOCUMENT, wi = T.SEQUENCE, Ti = T.MAPPING, Ei = T.SCALAR, Di = T.ALIAS, Oi = T.POP, ki = E.PLAIN, Ai = E.SINGLE_QUOTED, ji = E.DOUBLE_QUOTED, Mi = E.LITERAL_BLOCK, Ni = E.FOLDED_BLOCK, Pi = D.BLOCK, Fi = D.FLOW, Ii = O.CLIP, Li = O.STRIP, Ri = O.KEEP;
|
|
2292
|
+
//#endregion
|
|
2293
|
+
export { Ii as CHOMPING_CLIP, Ri as CHOMPING_KEEP, O as CHOMPING_MODE, Li as CHOMPING_STRIP, D as COLLECTION_STYLE, Pi as COLLECTION_STYLE_BLOCK, Fi as COLLECTION_STYLE_FLOW, $e as CORE_SCHEMA, Wn as DEFAULT_SCALAR_STYLE_RULES, tt as DUMP_SCHEMA, Di as EVENT_ALIAS, Ci as EVENT_DOCUMENT, T as EVENT_ID, Ti as EVENT_MAPPING, Oi as EVENT_POP, Ei as EVENT_SCALAR, wi as EVENT_SEQUENCE, C as FAILSAFE_SCHEMA, Qe as JSON_SCHEMA, e as NOT_RESOLVED, E as SCALAR_STYLE, ji as SCALAR_STYLE_DOUBLE_QUOTED, Ni as SCALAR_STYLE_FOLDED_BLOCK, Mi as SCALAR_STYLE_LITERAL_BLOCK, ki as SCALAR_STYLE_PLAIN, Ai as SCALAR_STYLE_SINGLE_QUOTED, S as Schema, zn as VISIT_BREAK, Bn as VISIT_SKIP, et as YAML11_SCHEMA, w as YAMLException, Pe as binaryTag, f as boolCoreTag, h as boolJsonTag, ne as boolYaml11Tag, Vt as constructFromEvents, r as defineMappingTag, t as defineScalarTag, n as defineSequenceTag, hi as dump, Si as eventsToAst, be as floatCoreTag, Te as floatJsonTag, _ as floatYaml11Tag, Ct as getScalarValue, se as intCoreTag, fe as intJsonTag, g as intYaml11Tag, Rn as jsToAst, it as legacyMapTag, Fn as load, Pn as loadAll, We as mapTag, Ae as mergeTag, o as nullCoreTag, s as nullJsonTag, l as nullYaml11Tag, He as omapTag, Ue as pairsTag, jn as parseEvents, fi as present, nt as realMapTag, Be as seqTag, Ge as setTag, i as strTag, ze as timestampTag, Hn as visit };
|
|
2232
2294
|
|
|
2233
2295
|
//# sourceMappingURL=js-yaml.esm.min.mjs.map
|