fumadocs-openapi 10.6.8 → 10.7.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/css/generated/shared.css +0 -1
- package/dist/node_modules/.pnpm/@scalar_helpers@0.4.3/node_modules/@scalar/helpers/dist/general/create-limiter.js +43 -0
- package/dist/node_modules/.pnpm/@scalar_helpers@0.4.3/node_modules/@scalar/helpers/dist/object/is-object.js +26 -0
- package/dist/node_modules/.pnpm/@scalar_helpers@0.4.3/node_modules/@scalar/helpers/dist/object/prevent-pollution.js +33 -0
- package/dist/node_modules/.pnpm/@scalar_helpers@0.4.3/node_modules/@scalar/helpers/dist/queue/queue.js +106 -0
- package/dist/node_modules/.pnpm/@scalar_helpers@0.4.3/node_modules/@scalar/helpers/dist/string/generate-hash.js +120 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/bundle/bundle.js +346 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/bundle/plugins/fetch-urls/index.js +73 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/bundle/plugins/node.js +3 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/bundle/plugins/parse-yaml/index.js +1 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/bundle/plugins/read-files/index.js +51 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/bundle/value-generator.js +88 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/helpers/convert-to-local-ref.js +24 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/helpers/escape-json-pointer.js +11 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/helpers/get-schemas.js +44 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/helpers/get-segments-from-path.js +10 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/helpers/get-value-by-path.js +42 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/helpers/is-file-path.js +23 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/helpers/is-http-url.js +23 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/helpers/is-json-object.js +28 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/helpers/is-yaml.js +21 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/helpers/normalize.js +26 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/helpers/resolve-reference-path.js +30 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/helpers/set-value-at-path.js +70 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/helpers/to-relative-path.js +33 -0
- package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.5/node_modules/@scalar/json-magic/dist/helpers/unescape-json-pointer.js +12 -0
- package/dist/node_modules/.pnpm/@scalar_openapi-upgrader@0.2.4/node_modules/@scalar/openapi-upgrader/dist/2.0-to-3.0/upgrade-from-two-to-three.js +487 -0
- package/dist/node_modules/.pnpm/@scalar_openapi-upgrader@0.2.4/node_modules/@scalar/openapi-upgrader/dist/3.0-to-3.1/upgrade-from-three-to-three-one.js +95 -0
- package/dist/node_modules/.pnpm/@scalar_openapi-upgrader@0.2.4/node_modules/@scalar/openapi-upgrader/dist/3.1-to-3.2/upgrade-from-three-one-to-three-two.js +59 -0
- package/dist/node_modules/.pnpm/@scalar_openapi-upgrader@0.2.4/node_modules/@scalar/openapi-upgrader/dist/helpers/traverse.js +25 -0
- package/dist/node_modules/.pnpm/@scalar_openapi-upgrader@0.2.4/node_modules/@scalar/openapi-upgrader/dist/upgrade.js +15 -0
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.js +19 -0
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js +430 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/compose-collection.js +50 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/compose-doc.js +39 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/compose-node.js +85 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/compose-scalar.js +57 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/composer.js +193 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/resolve-block-map.js +82 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +174 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +40 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/resolve-end.js +36 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +153 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +206 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/resolve-props.js +105 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/util-contains-newline.js +27 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +25 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +10 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/util-map-includes.js +10 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/doc/Document.js +277 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/doc/anchors.js +57 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/doc/applyReviver.js +38 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/doc/createNode.js +61 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/doc/directives.js +163 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/errors.js +48 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/index.js +16 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/log.js +6 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/nodes/Alias.js +91 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/nodes/Collection.js +117 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/nodes/Node.js +32 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/nodes/Pair.js +29 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/nodes/YAMLMap.js +106 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +104 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +49 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/nodes/identity.js +33 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/nodes/toJS.js +35 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/parse/cst-scalar.js +3 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/parse/cst-visit.js +89 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/parse/cst.js +40 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/parse/lexer.js +517 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/parse/line-counter.js +45 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/parse/parser.js +855 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/public-api.js +44 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/Schema.js +27 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/common/map.js +16 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/common/null.js +13 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/common/seq.js +16 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/core/bool.js +17 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/core/float.js +38 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/core/int.js +37 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/json/schema.js +61 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/tags.js +81 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +44 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +24 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +41 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +70 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +36 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +60 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +56 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +65 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +79 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +111 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/stringify/stringify.js +105 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +116 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/stringify/stringifyComment.js +16 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +59 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +19 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/stringify/stringifyPair.js +95 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/stringify/stringifyString.js +222 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/visit.js +187 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/index.js +16 -0
- package/dist/scalar/client.js +1 -1
- package/dist/server/index.d.ts +2 -2
- package/dist/server/source-api.d.ts +8 -8
- package/dist/server/source-api.js +1 -1
- package/dist/utils/document/process.js +5 -3
- package/package.json +17 -17
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { upgradeFromThreeOneToThreeTwo } from "./3.1-to-3.2/upgrade-from-three-one-to-three-two.js";
|
|
2
|
+
import { upgradeFromTwoToThree } from "./2.0-to-3.0/upgrade-from-two-to-three.js";
|
|
3
|
+
import { upgradeFromThreeToThreeOne } from "./3.0-to-3.1/upgrade-from-three-to-three-one.js";
|
|
4
|
+
//#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.4/node_modules/@scalar/openapi-upgrader/dist/upgrade.js
|
|
5
|
+
function upgrade(value, targetVersion) {
|
|
6
|
+
const openapi30 = upgradeFromTwoToThree(value);
|
|
7
|
+
if (targetVersion === "3.0") return openapi30;
|
|
8
|
+
const openapi31 = upgradeFromThreeToThreeOne(openapi30);
|
|
9
|
+
if (targetVersion === "3.1") return openapi31;
|
|
10
|
+
const openapi32 = upgradeFromThreeOneToThreeTwo(openapi31);
|
|
11
|
+
if (targetVersion === "3.2") return openapi32;
|
|
12
|
+
return openapi32;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { upgrade };
|
|
@@ -0,0 +1,19 @@
|
|
|
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 = 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 };
|
|
@@ -0,0 +1,430 @@
|
|
|
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 };
|
|
@@ -0,0 +1,50 @@
|
|
|
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.8.3/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 };
|
package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/compose-doc.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
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.8.3/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 };
|
package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/compose-node.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
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.8.3/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 };
|