fumadocs-openapi 10.10.1 → 10.10.3

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.
Files changed (127) hide show
  1. package/css/generated/shared.css +16 -8
  2. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/bundle.js +239 -0
  3. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/dereference.js +187 -0
  4. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/index.js +136 -0
  5. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/normalize-args.js +41 -0
  6. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/options.js +124 -0
  7. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parse.js +109 -0
  8. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/binary.js +30 -0
  9. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/json.js +46 -0
  10. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/text.js +36 -0
  11. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/yaml.js +49 -0
  12. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/pointer.js +242 -0
  13. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/ref.js +247 -0
  14. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/refs.js +210 -0
  15. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolve-external.js +100 -0
  16. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolvers/file.js +41 -0
  17. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolvers/http.js +112 -0
  18. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/convert-path-to-posix.js +8 -0
  19. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/errors.js +146 -0
  20. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/is-windows.js +5 -0
  21. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/maybe.js +18 -0
  22. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/next.js +11 -0
  23. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/plugins.js +99 -0
  24. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/schema-resources.js +30 -0
  25. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/url.js +315 -0
  26. package/dist/ui/schema/client.js +70 -69
  27. package/dist/utils/document/process.js +7 -12
  28. package/package.json +4 -7
  29. package/dist/node_modules/.pnpm/@scalar_helpers@0.8.0/node_modules/@scalar/helpers/dist/general/create-limiter.js +0 -43
  30. package/dist/node_modules/.pnpm/@scalar_helpers@0.8.0/node_modules/@scalar/helpers/dist/object/is-object.js +0 -27
  31. package/dist/node_modules/.pnpm/@scalar_helpers@0.8.0/node_modules/@scalar/helpers/dist/object/prevent-pollution.js +0 -33
  32. package/dist/node_modules/.pnpm/@scalar_helpers@0.8.0/node_modules/@scalar/helpers/dist/queue/queue.js +0 -106
  33. package/dist/node_modules/.pnpm/@scalar_helpers@0.8.0/node_modules/@scalar/helpers/dist/string/generate-hash.js +0 -120
  34. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/bundle/bundle.js +0 -357
  35. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/bundle/plugins/fetch-urls/index.js +0 -73
  36. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/bundle/plugins/node.js +0 -3
  37. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/bundle/plugins/parse-yaml/index.js +0 -1
  38. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/bundle/plugins/read-files/index.js +0 -51
  39. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/bundle/value-generator.js +0 -102
  40. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/convert-to-local-ref.js +0 -24
  41. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/escape-json-pointer.js +0 -11
  42. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/get-schemas.js +0 -44
  43. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/get-segments-from-path.js +0 -10
  44. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/get-value-by-path.js +0 -42
  45. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/is-file-path.js +0 -23
  46. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/is-http-url.js +0 -23
  47. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/is-json-object.js +0 -28
  48. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/is-yaml.js +0 -21
  49. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/normalize.js +0 -33
  50. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/resolve-reference-path.js +0 -30
  51. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/set-value-at-path.js +0 -70
  52. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/to-relative-path.js +0 -33
  53. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/unescape-json-pointer.js +0 -12
  54. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.js +0 -19
  55. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js +0 -430
  56. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/compose-collection.js +0 -50
  57. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/compose-doc.js +0 -39
  58. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/compose-node.js +0 -85
  59. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/compose-scalar.js +0 -57
  60. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/composer.js +0 -193
  61. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/resolve-block-map.js +0 -82
  62. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +0 -174
  63. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +0 -40
  64. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/resolve-end.js +0 -36
  65. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +0 -153
  66. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +0 -203
  67. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/resolve-props.js +0 -105
  68. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/util-contains-newline.js +0 -27
  69. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +0 -25
  70. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +0 -10
  71. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/util-map-includes.js +0 -10
  72. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/doc/Document.js +0 -277
  73. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/doc/anchors.js +0 -62
  74. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/doc/applyReviver.js +0 -38
  75. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/doc/createNode.js +0 -61
  76. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/doc/directives.js +0 -163
  77. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/errors.js +0 -48
  78. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/index.js +0 -16
  79. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/log.js +0 -6
  80. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/Alias.js +0 -92
  81. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/Collection.js +0 -117
  82. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/Node.js +0 -32
  83. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/Pair.js +0 -29
  84. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/Scalar.js +0 -24
  85. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/YAMLMap.js +0 -106
  86. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +0 -104
  87. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +0 -49
  88. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/identity.js +0 -33
  89. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/nodes/toJS.js +0 -35
  90. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/parse/cst-scalar.js +0 -3
  91. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/parse/cst-visit.js +0 -89
  92. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/parse/cst.js +0 -40
  93. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/parse/lexer.js +0 -529
  94. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/parse/line-counter.js +0 -45
  95. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/parse/parser.js +0 -859
  96. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/public-api.js +0 -44
  97. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/Schema.js +0 -27
  98. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/common/map.js +0 -16
  99. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/common/null.js +0 -13
  100. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/common/seq.js +0 -16
  101. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/common/string.js +0 -14
  102. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/core/bool.js +0 -17
  103. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/core/float.js +0 -38
  104. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/core/int.js +0 -37
  105. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/core/schema.js +0 -23
  106. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/json/schema.js +0 -61
  107. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/tags.js +0 -81
  108. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +0 -52
  109. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +0 -24
  110. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +0 -41
  111. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +0 -70
  112. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +0 -39
  113. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +0 -60
  114. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +0 -56
  115. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +0 -39
  116. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +0 -65
  117. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +0 -79
  118. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +0 -111
  119. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/stringify/stringify.js +0 -105
  120. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +0 -116
  121. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/stringify/stringifyComment.js +0 -16
  122. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +0 -59
  123. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +0 -19
  124. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/stringify/stringifyPair.js +0 -95
  125. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/stringify/stringifyString.js +0 -222
  126. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/visit.js +0 -187
  127. package/dist/node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/index.js +0 -16
@@ -1,19 +0,0 @@
1
- import { _path } from "./shared/pathe.M-eThtNZ.js";
2
- //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs
3
- const delimiter = /* @__PURE__ */ (() => globalThis.process?.platform === "win32" ? ";" : ":")();
4
- const _platforms = {
5
- posix: void 0,
6
- win32: void 0
7
- };
8
- const mix = (del = delimiter) => {
9
- return new Proxy(_path, { get(_, prop) {
10
- if (prop === "delimiter") return del;
11
- if (prop === "posix") return posix;
12
- if (prop === "win32") return win32;
13
- return _platforms[prop] || _path[prop];
14
- } });
15
- };
16
- const posix = /* @__PURE__ */ mix(":");
17
- const win32 = /* @__PURE__ */ mix(";");
18
- //#endregion
19
- export { posix };
@@ -1,430 +0,0 @@
1
- //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
2
- let _lazyMatch = () => {
3
- var __lib__ = (() => {
4
- var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
5
- for (var n in e) m(r, n, {
6
- get: e[n],
7
- enumerable: true
8
- });
9
- }, H = (r, e, n, a) => {
10
- if (e && typeof e == "object" || typeof e == "function") for (let t of G(e)) !T.call(r, t) && t !== n && m(r, t, {
11
- get: () => e[t],
12
- enumerable: !(a = V(e, t)) || a.enumerable
13
- });
14
- return r;
15
- }, J = (r) => H(m({}, "__esModule", { value: true }), r), w = {};
16
- q(w, { default: () => re });
17
- var A = (r) => Array.isArray(r), d = (r) => typeof r == "function", Q = (r) => r.length === 0, W = (r) => typeof r == "number", K = (r) => typeof r == "object" && r !== null, X = (r) => r instanceof RegExp, b = (r) => typeof r == "string", h = (r) => r === void 0, Y = (r) => {
18
- const e = /* @__PURE__ */ new Map();
19
- return (n) => {
20
- const a = e.get(n);
21
- if (a) return a;
22
- const t = r(n);
23
- return e.set(n, t), t;
24
- };
25
- }, rr = (r, e, n = {}) => {
26
- const a = {
27
- cache: {},
28
- input: r,
29
- index: 0,
30
- indexMax: 0,
31
- options: n,
32
- output: []
33
- };
34
- if (v(e)(a) && a.index === r.length) return a.output;
35
- throw new Error(`Failed to parse at index ${a.indexMax}`);
36
- }, i = (r, e) => A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e) => {
37
- const n = {};
38
- for (const a of r) {
39
- if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
40
- const t = a.charCodeAt(0);
41
- n[t] = true;
42
- }
43
- return (a) => {
44
- const t = a.index, o = a.input;
45
- for (; a.index < o.length && o.charCodeAt(a.index) in n;) a.index += 1;
46
- const u = a.index;
47
- if (u > t) {
48
- if (!h(e) && !a.options.silent) {
49
- const s = a.input.slice(t, u), c = d(e) ? e(s, o, String(t)) : e;
50
- h(c) || a.output.push(c);
51
- }
52
- a.indexMax = Math.max(a.indexMax, a.index);
53
- }
54
- return true;
55
- };
56
- }, nr = (r, e) => {
57
- const n = r.source, a = r.flags.replace(/y|$/, "y"), t = new RegExp(n, a);
58
- return g((o) => {
59
- t.lastIndex = o.index;
60
- const u = t.exec(o.input);
61
- if (u) {
62
- if (!h(e) && !o.options.silent) {
63
- const s = d(e) ? e(...u, o.input, String(o.index)) : e;
64
- h(s) || o.output.push(s);
65
- }
66
- return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), true;
67
- } else return false;
68
- });
69
- }, ar = (r, e) => (n) => {
70
- if (n.input.startsWith(r, n.index)) {
71
- if (!h(e) && !n.options.silent) {
72
- const t = d(e) ? e(r, n.input, String(n.index)) : e;
73
- h(t) || n.output.push(t);
74
- }
75
- return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), true;
76
- } else return false;
77
- }, C = (r, e, n, a) => {
78
- const t = v(r);
79
- return g(_(M((o) => {
80
- let u = 0;
81
- for (; u < n;) {
82
- const s = o.index;
83
- if (!t(o) || (u += 1, o.index === s)) break;
84
- }
85
- return u >= e;
86
- })));
87
- }, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, Infinity), x = (r, e) => {
88
- const n = r.map(v);
89
- return g(_(M((a) => {
90
- for (let t = 0, o = n.length; t < o; t++) if (!n[t](a)) return false;
91
- return true;
92
- })));
93
- }, l = (r, e) => {
94
- const n = r.map(v);
95
- return g(_((a) => {
96
- for (let t = 0, o = n.length; t < o; t++) if (n[t](a)) return true;
97
- return false;
98
- }));
99
- }, M = (r, e = false) => {
100
- const n = v(r);
101
- return (a) => {
102
- const t = a.index, o = a.output.length, u = n(a);
103
- return (!u || e) && (a.index = t, a.output.length !== o && (a.output.length = o)), u;
104
- };
105
- }, _ = (r, e) => {
106
- return v(r);
107
- }, g = (() => {
108
- let r = 0;
109
- return (e) => {
110
- const n = v(e), a = r += 1;
111
- return (t) => {
112
- var o;
113
- if (t.options.memoization === false) return n(t);
114
- const u = t.index, s = (o = t.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
115
- if (c === false) return false;
116
- if (W(c)) return t.index = c, true;
117
- if (c) return t.index = c.index, c.output?.length && t.output.push(...c.output), true;
118
- {
119
- const Z = t.output.length;
120
- if (n(t)) {
121
- const D = t.index, U = t.output.length;
122
- if (U > Z) {
123
- const ee = t.output.slice(Z, U);
124
- s.set(u, {
125
- index: D,
126
- output: ee
127
- });
128
- } else s.set(u, D);
129
- return true;
130
- } else return s.set(u, false), false;
131
- }
132
- };
133
- };
134
- })(), E = (r) => {
135
- let e;
136
- return (n) => (e || (e = v(r())), e(n));
137
- }, v = Y((r) => {
138
- if (d(r)) return Q(r) ? E(r) : r;
139
- if (b(r) || X(r)) return i(r);
140
- if (A(r)) return x(r);
141
- if (K(r)) return l(Object.values(r));
142
- throw new Error("Invalid rule");
143
- }), P = "abcdefghijklmnopqrstuvwxyz", ir = (r) => {
144
- let e = "";
145
- for (; r > 0;) e = P[(r - 1) % 26] + e, r = Math.floor((r - 1) / 26);
146
- return e;
147
- }, O = (r) => {
148
- let e = 0;
149
- for (let n = 0, a = r.length; n < a; n++) e = e * 26 + P.indexOf(r[n]) + 1;
150
- return e;
151
- }, S = (r, e) => {
152
- if (e < r) return S(e, r);
153
- const n = [];
154
- for (; r <= e;) n.push(r++);
155
- return n;
156
- }, or = (r, e, n) => S(r, e).map((a) => String(a).padStart(n, "0")), R = (r, e) => S(O(r), O(e)).map(ir), p = (r) => r, z = (r) => ur((e) => rr(e, r, { memoization: false }).join("")), ur = (r) => {
157
- const e = {};
158
- return (n) => e[n] ?? (e[n] = r(n));
159
- }, sr = i(/^\*\*\/\*$/, ".*"), cr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, a) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${a.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i(/\\./, p), pr = i(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i(/./, p), fr = l([i(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${L(e)}$).*?`), i(/^(!!)+/, "")]), j = l([
160
- i(/\/(\*\*\/)+/, "(?:/.+/|/)"),
161
- i(/^(\*\*\/)+/, "(?:^|.*/)"),
162
- i(/\/(\*\*)$/, "(?:/.*|$)"),
163
- i(/\*\*/, ".*")
164
- ]), N = l([i(/\*\/(?!\*\*\/)/, "[^/]*/"), i(/\*/, "[^/]*")]), k = i("?", "[^/]"), $r = i("[", p), wr = i("]", p), Ar = i(/[!^]/, "^/"), br = i(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Er = l([
165
- y,
166
- i(/[$.*+?^(){}[\|]/, (r) => `\\${r}`),
167
- br,
168
- i(/[^\]]/, p)
169
- ]), B = x([
170
- $r,
171
- tr(Ar),
172
- f(Er),
173
- wr
174
- ]), Pr = i("{", "(?:"), Or = i("}", ")"), I = x([
175
- Pr,
176
- l([
177
- i(/(\d+)\.\.(\d+)/, (r, e, n) => or(+e, +n, Math.min(e.length, n.length)).join("|")),
178
- i(/([a-z]+)\.\.([a-z]+)/, (r, e, n) => R(e, n).join("|")),
179
- i(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n) => R(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase())
180
- ]),
181
- Or
182
- ]), kr = i("{", "(?:"), Br = i("}", ")"), Ir = i(",", "|"), Fr = i(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i(/[^}]/, p), F = x([
183
- kr,
184
- f(l([
185
- j,
186
- N,
187
- k,
188
- B,
189
- I,
190
- E(() => F),
191
- y,
192
- Fr,
193
- Ir,
194
- Lr
195
- ])),
196
- Br
197
- ]), L = z(f(l([
198
- sr,
199
- cr,
200
- lr,
201
- fr,
202
- j,
203
- N,
204
- k,
205
- B,
206
- I,
207
- F,
208
- y,
209
- pr,
210
- vr
211
- ]))), Tr = i(/\\./, p), qr = i(/./, p), Yr = z(f(l([
212
- Tr,
213
- i(/\*\*\*+/, "*"),
214
- i(/([^/{[(!])\*\*/, (r, e) => `${e}*`),
215
- i(/(^|.)\*\*(?=[^*/)\]}])/, (r, e) => `${e}*`),
216
- qr
217
- ]))), $ = (r, e) => {
218
- const n = Array.isArray(r) ? r : [r];
219
- if (!n.length) return false;
220
- const a = n.map($.compile), t = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t ? "/" : "");
221
- return a.some((s) => s.test(o));
222
- };
223
- $.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
224
- var re = $;
225
- return J(w);
226
- })();
227
- return __lib__.default || __lib__;
228
- };
229
- let _match;
230
- const zeptomatch = (path, pattern) => {
231
- if (!_match) {
232
- _match = _lazyMatch();
233
- _lazyMatch = null;
234
- }
235
- return _match(path, pattern);
236
- };
237
- const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
238
- function normalizeWindowsPath(input = "") {
239
- if (!input) return input;
240
- return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
241
- }
242
- const _UNC_REGEX = /^[/\\]{2}/;
243
- const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
244
- const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
245
- const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
246
- const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
247
- const _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
248
- const normalize = function(path) {
249
- if (path.length === 0) return ".";
250
- path = normalizeWindowsPath(path);
251
- const isUNCPath = path.match(_UNC_REGEX);
252
- const isPathAbsolute = isAbsolute(path);
253
- const trailingSeparator = path[path.length - 1] === "/";
254
- path = normalizeString(path, !isPathAbsolute);
255
- if (path.length === 0) {
256
- if (isPathAbsolute) return "/";
257
- return trailingSeparator ? "./" : ".";
258
- }
259
- if (trailingSeparator) path += "/";
260
- if (_DRIVE_LETTER_RE.test(path)) path += "/";
261
- if (isUNCPath) {
262
- if (!isPathAbsolute) return `//./${path}`;
263
- return `//${path}`;
264
- }
265
- return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
266
- };
267
- const join = function(...segments) {
268
- let path = "";
269
- for (const seg of segments) {
270
- if (!seg) continue;
271
- if (path.length > 0) {
272
- const pathTrailing = path[path.length - 1] === "/";
273
- const segLeading = seg[0] === "/";
274
- if (pathTrailing && segLeading) path += seg.slice(1);
275
- else path += pathTrailing || segLeading ? seg : `/${seg}`;
276
- } else path += seg;
277
- }
278
- return normalize(path);
279
- };
280
- function cwd() {
281
- if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
282
- return "/";
283
- }
284
- const resolve = function(...arguments_) {
285
- arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
286
- let resolvedPath = "";
287
- let resolvedAbsolute = false;
288
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
289
- const path = index >= 0 ? arguments_[index] : cwd();
290
- if (!path || path.length === 0) continue;
291
- resolvedPath = `${path}/${resolvedPath}`;
292
- resolvedAbsolute = isAbsolute(path);
293
- }
294
- resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
295
- if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
296
- return resolvedPath.length > 0 ? resolvedPath : ".";
297
- };
298
- function normalizeString(path, allowAboveRoot) {
299
- let res = "";
300
- let lastSegmentLength = 0;
301
- let lastSlash = -1;
302
- let dots = 0;
303
- let char = null;
304
- for (let index = 0; index <= path.length; ++index) {
305
- if (index < path.length) char = path[index];
306
- else if (char === "/") break;
307
- else char = "/";
308
- if (char === "/") {
309
- if (lastSlash === index - 1 || dots === 1);
310
- else if (dots === 2) {
311
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
312
- if (res.length > 2) {
313
- const lastSlashIndex = res.lastIndexOf("/");
314
- if (lastSlashIndex === -1) {
315
- res = "";
316
- lastSegmentLength = 0;
317
- } else {
318
- res = res.slice(0, lastSlashIndex);
319
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
320
- }
321
- lastSlash = index;
322
- dots = 0;
323
- continue;
324
- } else if (res.length > 0) {
325
- res = "";
326
- lastSegmentLength = 0;
327
- lastSlash = index;
328
- dots = 0;
329
- continue;
330
- }
331
- }
332
- if (allowAboveRoot) {
333
- res += res.length > 0 ? "/.." : "..";
334
- lastSegmentLength = 2;
335
- }
336
- } else {
337
- if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
338
- else res = path.slice(lastSlash + 1, index);
339
- lastSegmentLength = index - lastSlash - 1;
340
- }
341
- lastSlash = index;
342
- dots = 0;
343
- } else if (char === "." && dots !== -1) ++dots;
344
- else dots = -1;
345
- }
346
- return res;
347
- }
348
- const isAbsolute = function(p) {
349
- return _IS_ABSOLUTE_RE.test(p);
350
- };
351
- const toNamespacedPath = function(p) {
352
- return normalizeWindowsPath(p);
353
- };
354
- const extname = function(p) {
355
- if (p === "..") return "";
356
- const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
357
- return match && match[1] || "";
358
- };
359
- const relative = function(from, to) {
360
- const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
361
- const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
362
- if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) return _to.join("/");
363
- const _fromCopy = [..._from];
364
- for (const segment of _fromCopy) {
365
- if (_to[0] !== segment) break;
366
- _from.shift();
367
- _to.shift();
368
- }
369
- return [..._from.map(() => ".."), ..._to].join("/");
370
- };
371
- const dirname = function(p) {
372
- const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
373
- if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) segments[0] += "/";
374
- return segments.join("/") || (isAbsolute(p) ? "/" : ".");
375
- };
376
- const format = function(p) {
377
- const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
378
- const segments = [
379
- p.root,
380
- p.dir,
381
- p.base ?? (p.name ?? "") + ext
382
- ].filter(Boolean);
383
- return normalizeWindowsPath(p.root ? resolve(...segments) : segments.join("/"));
384
- };
385
- const basename = function(p, extension) {
386
- const segments = normalizeWindowsPath(p).split("/");
387
- let lastSegment = "";
388
- for (let i = segments.length - 1; i >= 0; i--) {
389
- const val = segments[i];
390
- if (val) {
391
- lastSegment = val;
392
- break;
393
- }
394
- }
395
- return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
396
- };
397
- const parse = function(p) {
398
- const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
399
- const base = basename(p);
400
- const extension = extname(base);
401
- return {
402
- root,
403
- dir: dirname(p),
404
- base,
405
- ext: extension,
406
- name: base.slice(0, base.length - extension.length)
407
- };
408
- };
409
- const matchesGlob = (path, pattern) => {
410
- return zeptomatch(pattern, normalize(path));
411
- };
412
- const _path = {
413
- __proto__: null,
414
- basename,
415
- dirname,
416
- extname,
417
- format,
418
- isAbsolute,
419
- join,
420
- matchesGlob,
421
- normalize,
422
- normalizeString,
423
- parse,
424
- relative,
425
- resolve,
426
- sep: "/",
427
- toNamespacedPath
428
- };
429
- //#endregion
430
- export { _path, basename, dirname, extname, format, isAbsolute, join, matchesGlob, normalize, normalizeString, parse, relative, resolve, toNamespacedPath };
@@ -1,50 +0,0 @@
1
- import { isNode } from "../nodes/identity.js";
2
- import { Scalar } from "../nodes/Scalar.js";
3
- import { YAMLMap } from "../nodes/YAMLMap.js";
4
- import { YAMLSeq } from "../nodes/YAMLSeq.js";
5
- import { resolveBlockMap } from "./resolve-block-map.js";
6
- import { resolveBlockSeq } from "./resolve-block-seq.js";
7
- import { resolveFlowCollection } from "./resolve-flow-collection.js";
8
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/compose-collection.js
9
- function resolveCollection(CN, ctx, token, onError, tagName, tag) {
10
- const coll = token.type === "block-map" ? resolveBlockMap(CN, ctx, token, onError, tag) : token.type === "block-seq" ? resolveBlockSeq(CN, ctx, token, onError, tag) : resolveFlowCollection(CN, ctx, token, onError, tag);
11
- const Coll = coll.constructor;
12
- if (tagName === "!" || tagName === Coll.tagName) {
13
- coll.tag = Coll.tagName;
14
- return coll;
15
- }
16
- if (tagName) coll.tag = tagName;
17
- return coll;
18
- }
19
- function composeCollection(CN, ctx, token, props, onError) {
20
- const tagToken = props.tag;
21
- const tagName = !tagToken ? null : ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg));
22
- if (token.type === "block-seq") {
23
- const { anchor, newlineAfterProp: nl } = props;
24
- const lastProp = anchor && tagToken ? anchor.offset > tagToken.offset ? anchor : tagToken : anchor ?? tagToken;
25
- if (lastProp && (!nl || nl.offset < lastProp.offset)) onError(lastProp, "MISSING_CHAR", "Missing newline after block sequence props");
26
- }
27
- const expType = token.type === "block-map" ? "map" : token.type === "block-seq" ? "seq" : token.start.source === "{" ? "map" : "seq";
28
- if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap.tagName && expType === "map" || tagName === YAMLSeq.tagName && expType === "seq") return resolveCollection(CN, ctx, token, onError, tagName);
29
- let tag = ctx.schema.tags.find((t) => t.tag === tagName && t.collection === expType);
30
- if (!tag) {
31
- const kt = ctx.schema.knownTags[tagName];
32
- if (kt?.collection === expType) {
33
- ctx.schema.tags.push(Object.assign({}, kt, { default: false }));
34
- tag = kt;
35
- } else {
36
- if (kt) onError(tagToken, "BAD_COLLECTION_TYPE", `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? "scalar"}`, true);
37
- else onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, true);
38
- return resolveCollection(CN, ctx, token, onError, tagName);
39
- }
40
- }
41
- const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);
42
- const res = tag.resolve?.(coll, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg), ctx.options) ?? coll;
43
- const node = isNode(res) ? res : new Scalar(res);
44
- node.range = coll.range;
45
- node.tag = tagName;
46
- if (tag?.format) node.format = tag.format;
47
- return node;
48
- }
49
- //#endregion
50
- export { composeCollection };
@@ -1,39 +0,0 @@
1
- import { Document } from "../doc/Document.js";
2
- import { resolveProps } from "./resolve-props.js";
3
- import { resolveEnd } from "./resolve-end.js";
4
- import { composeEmptyNode, composeNode } from "./compose-node.js";
5
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/compose-doc.js
6
- function composeDoc(options, directives, { offset, start, value, end }, onError) {
7
- const doc = new Document(void 0, Object.assign({ _directives: directives }, options));
8
- const ctx = {
9
- atKey: false,
10
- atRoot: true,
11
- directives: doc.directives,
12
- options: doc.options,
13
- schema: doc.schema
14
- };
15
- const props = resolveProps(start, {
16
- indicator: "doc-start",
17
- next: value ?? end?.[0],
18
- offset,
19
- onError,
20
- parentIndent: 0,
21
- startOnNewline: true
22
- });
23
- if (props.found) {
24
- doc.directives.docStart = true;
25
- if (value && (value.type === "block-map" || value.type === "block-seq") && !props.hasNewline) onError(props.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker");
26
- }
27
- doc.contents = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError);
28
- const contentEnd = doc.contents.range[2];
29
- const re = resolveEnd(end, contentEnd, false, onError);
30
- if (re.comment) doc.comment = re.comment;
31
- doc.range = [
32
- offset,
33
- contentEnd,
34
- re.offset
35
- ];
36
- return doc;
37
- }
38
- //#endregion
39
- export { composeDoc };
@@ -1,85 +0,0 @@
1
- import { isScalar } from "../nodes/identity.js";
2
- import { Alias } from "../nodes/Alias.js";
3
- import { resolveEnd } from "./resolve-end.js";
4
- import { composeCollection } from "./compose-collection.js";
5
- import { composeScalar } from "./compose-scalar.js";
6
- import { emptyScalarPosition } from "./util-empty-scalar-position.js";
7
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/compose-node.js
8
- const CN = {
9
- composeNode,
10
- composeEmptyNode
11
- };
12
- function composeNode(ctx, token, props, onError) {
13
- const atKey = ctx.atKey;
14
- const { spaceBefore, comment, anchor, tag } = props;
15
- let node;
16
- let isSrcToken = true;
17
- switch (token.type) {
18
- case "alias":
19
- node = composeAlias(ctx, token, onError);
20
- if (anchor || tag) onError(token, "ALIAS_PROPS", "An alias node must not specify any properties");
21
- break;
22
- case "scalar":
23
- case "single-quoted-scalar":
24
- case "double-quoted-scalar":
25
- case "block-scalar":
26
- node = composeScalar(ctx, token, tag, onError);
27
- if (anchor) node.anchor = anchor.source.substring(1);
28
- break;
29
- case "block-map":
30
- case "block-seq":
31
- case "flow-collection":
32
- try {
33
- node = composeCollection(CN, ctx, token, props, onError);
34
- if (anchor) node.anchor = anchor.source.substring(1);
35
- } catch (error) {
36
- onError(token, "RESOURCE_EXHAUSTION", error instanceof Error ? error.message : String(error));
37
- }
38
- break;
39
- default:
40
- onError(token, "UNEXPECTED_TOKEN", token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`);
41
- isSrcToken = false;
42
- }
43
- node ?? (node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError));
44
- if (anchor && node.anchor === "") onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
45
- if (atKey && ctx.options.stringKeys && (!isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) onError(tag ?? token, "NON_STRING_KEY", "With stringKeys, all keys must be strings");
46
- if (spaceBefore) node.spaceBefore = true;
47
- if (comment) if (token.type === "scalar" && token.source === "") node.comment = comment;
48
- else node.commentBefore = comment;
49
- if (ctx.options.keepSourceTokens && isSrcToken) node.srcToken = token;
50
- return node;
51
- }
52
- function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {
53
- const node = composeScalar(ctx, {
54
- type: "scalar",
55
- offset: emptyScalarPosition(offset, before, pos),
56
- indent: -1,
57
- source: ""
58
- }, tag, onError);
59
- if (anchor) {
60
- node.anchor = anchor.source.substring(1);
61
- if (node.anchor === "") onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
62
- }
63
- if (spaceBefore) node.spaceBefore = true;
64
- if (comment) {
65
- node.comment = comment;
66
- node.range[2] = end;
67
- }
68
- return node;
69
- }
70
- function composeAlias({ options }, { offset, source, end }, onError) {
71
- const alias = new Alias(source.substring(1));
72
- if (alias.source === "") onError(offset, "BAD_ALIAS", "Alias cannot be an empty string");
73
- if (alias.source.endsWith(":")) onError(offset + source.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", true);
74
- const valueEnd = offset + source.length;
75
- const re = resolveEnd(end, valueEnd, options.strict, onError);
76
- alias.range = [
77
- offset,
78
- valueEnd,
79
- re.offset
80
- ];
81
- if (re.comment) alias.comment = re.comment;
82
- return alias;
83
- }
84
- //#endregion
85
- export { composeEmptyNode, composeNode };
@@ -1,57 +0,0 @@
1
- import { SCALAR, isScalar } from "../nodes/identity.js";
2
- import { Scalar } from "../nodes/Scalar.js";
3
- import { resolveBlockScalar } from "./resolve-block-scalar.js";
4
- import { resolveFlowScalar } from "./resolve-flow-scalar.js";
5
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/compose/compose-scalar.js
6
- function composeScalar(ctx, token, tagToken, onError) {
7
- const { value, type, comment, range } = token.type === "block-scalar" ? resolveBlockScalar(ctx, token, onError) : resolveFlowScalar(token, ctx.options.strict, onError);
8
- const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null;
9
- let tag;
10
- if (ctx.options.stringKeys && ctx.atKey) tag = ctx.schema[SCALAR];
11
- else if (tagName) tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
12
- else if (token.type === "scalar") tag = findScalarTagByTest(ctx, value, token, onError);
13
- else tag = ctx.schema[SCALAR];
14
- let scalar;
15
- try {
16
- const res = tag.resolve(value, (msg) => onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg), ctx.options);
17
- scalar = isScalar(res) ? res : new Scalar(res);
18
- } catch (error) {
19
- const msg = error instanceof Error ? error.message : String(error);
20
- onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg);
21
- scalar = new Scalar(value);
22
- }
23
- scalar.range = range;
24
- scalar.source = value;
25
- if (type) scalar.type = type;
26
- if (tagName) scalar.tag = tagName;
27
- if (tag.format) scalar.format = tag.format;
28
- if (comment) scalar.comment = comment;
29
- return scalar;
30
- }
31
- function findScalarTagByName(schema, value, tagName, tagToken, onError) {
32
- if (tagName === "!") return schema[SCALAR];
33
- const matchWithTest = [];
34
- for (const tag of schema.tags) if (!tag.collection && tag.tag === tagName) if (tag.default && tag.test) matchWithTest.push(tag);
35
- else return tag;
36
- for (const tag of matchWithTest) if (tag.test?.test(value)) return tag;
37
- const kt = schema.knownTags[tagName];
38
- if (kt && !kt.collection) {
39
- schema.tags.push(Object.assign({}, kt, {
40
- default: false,
41
- test: void 0
42
- }));
43
- return kt;
44
- }
45
- onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
46
- return schema[SCALAR];
47
- }
48
- function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
49
- const tag = schema.tags.find((tag) => (tag.default === true || atKey && tag.default === "key") && tag.test?.test(value)) || schema[SCALAR];
50
- if (schema.compat) {
51
- const compat = schema.compat.find((tag) => tag.default && tag.test?.test(value)) ?? schema[SCALAR];
52
- if (tag.tag !== compat.tag) onError(token, "TAG_RESOLVE_FAILED", `Value may be parsed as either ${directives.tagString(tag.tag)} or ${directives.tagString(compat.tag)}`, true);
53
- }
54
- return tag;
55
- }
56
- //#endregion
57
- export { composeScalar };