elysia 2.0.0-beta.2 → 2.0.0-beta.21
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/dist/adapter/bun/index.d.ts +18 -2
- package/dist/adapter/bun/index.js +467 -110
- package/dist/adapter/bun/index.mjs +467 -112
- package/dist/adapter/types.d.ts +2 -21
- package/dist/adapter/utils.d.ts +14 -3
- package/dist/adapter/utils.js +146 -87
- package/dist/adapter/utils.mjs +148 -90
- package/dist/adapter/web-standard/handler.d.ts +1 -1
- package/dist/adapter/web-standard/handler.js +47 -36
- package/dist/adapter/web-standard/handler.mjs +48 -37
- package/dist/adapter/web-standard/index.js +2 -30
- package/dist/adapter/web-standard/index.mjs +2 -30
- package/dist/adapter/web-standard/utils.js +5 -18
- package/dist/adapter/web-standard/utils.mjs +5 -18
- package/dist/base.d.ts +99 -67
- package/dist/base.js +678 -510
- package/dist/base.mjs +682 -514
- package/dist/compile/aot-capture.d.ts +2 -13
- package/dist/compile/aot-capture.js +26 -69
- package/dist/compile/aot-capture.mjs +28 -67
- package/dist/compile/aot-emit.d.ts +9 -7
- package/dist/compile/aot-emit.js +42 -19
- package/dist/compile/aot-emit.mjs +42 -20
- package/dist/compile/aot.d.ts +17 -19
- package/dist/compile/aot.js +41 -51
- package/dist/compile/aot.mjs +39 -49
- package/dist/compile/handler/descriptor.d.ts +9 -12
- package/dist/compile/handler/descriptor.js +19 -44
- package/dist/compile/handler/descriptor.mjs +20 -42
- package/dist/compile/handler/frozen-validator.d.ts +5 -10
- package/dist/compile/handler/frozen-validator.js +55 -105
- package/dist/compile/handler/frozen-validator.mjs +53 -105
- package/dist/compile/handler/index.d.ts +7 -5
- package/dist/compile/handler/index.js +270 -111
- package/dist/compile/handler/index.mjs +270 -113
- package/dist/compile/handler/jit.d.ts +19 -17
- package/dist/compile/handler/jit.js +222 -149
- package/dist/compile/handler/jit.mjs +224 -152
- package/dist/compile/handler/params.d.ts +1 -4
- package/dist/compile/handler/params.js +10 -5
- package/dist/compile/handler/params.mjs +14 -8
- package/dist/compile/handler/reconstruct.d.ts +2 -2
- package/dist/compile/handler/reconstruct.js +6 -4
- package/dist/compile/handler/reconstruct.mjs +6 -4
- package/dist/compile/handler/static-clone-resolver.d.ts +6 -0
- package/dist/compile/handler/static-clone-resolver.js +8 -0
- package/dist/compile/handler/static-clone-resolver.mjs +7 -0
- package/dist/compile/handler/utils.d.ts +22 -11
- package/dist/compile/handler/utils.js +159 -253
- package/dist/compile/handler/utils.mjs +155 -252
- package/dist/compile/jit-probe.d.ts +2 -2
- package/dist/compile/jit-probe.js +2 -3
- package/dist/compile/jit-probe.mjs +2 -3
- package/dist/compile/lexer.d.ts +7 -4
- package/dist/compile/lexer.js +268 -6
- package/dist/compile/lexer.mjs +268 -4
- package/dist/compile/utils.js +7 -4
- package/dist/compile/utils.mjs +7 -4
- package/dist/compiled.d.ts +0 -1
- package/dist/compiled.js +0 -1
- package/dist/compiled.mjs +0 -1
- package/dist/context.d.ts +14 -4
- package/dist/context.js +17 -32
- package/dist/context.mjs +19 -34
- package/dist/cookie/config.d.ts +7 -2
- package/dist/cookie/config.js +76 -16
- package/dist/cookie/config.mjs +77 -18
- package/dist/cookie/cookie.d.ts +1 -1
- package/dist/cookie/cookie.js +8 -10
- package/dist/cookie/cookie.mjs +8 -10
- package/dist/cookie/crypto.d.ts +8 -7
- package/dist/cookie/crypto.js +51 -40
- package/dist/cookie/crypto.mjs +51 -41
- package/dist/cookie/error.d.ts +1 -2
- package/dist/cookie/error.js +6 -4
- package/dist/cookie/error.mjs +6 -4
- package/dist/cookie/lib.js +7 -2
- package/dist/cookie/lib.mjs +7 -2
- package/dist/cookie/serialize.js +1 -1
- package/dist/cookie/serialize.mjs +1 -1
- package/dist/cookie/types.d.ts +10 -0
- package/dist/cookie/utils.d.ts +4 -8
- package/dist/cookie/utils.js +86 -52
- package/dist/cookie/utils.mjs +89 -54
- package/dist/error.d.ts +113 -103
- package/dist/error.js +181 -117
- package/dist/error.mjs +179 -118
- package/dist/generation.d.ts +2 -2
- package/dist/handler/error.d.ts +26 -15
- package/dist/handler/error.js +77 -96
- package/dist/handler/error.mjs +74 -97
- package/dist/handler/fetch.js +87 -108
- package/dist/handler/fetch.mjs +89 -110
- package/dist/handler/utils.d.ts +12 -6
- package/dist/handler/utils.js +84 -28
- package/dist/handler/utils.mjs +80 -28
- package/dist/index.d.ts +12 -12
- package/dist/index.js +2 -9
- package/dist/index.mjs +1 -1
- package/dist/memory.js +1 -1
- package/dist/memory.mjs +1 -1
- package/dist/package.js +1 -1
- package/dist/package.mjs +1 -1
- package/dist/plugin/aot/bun.d.ts +8 -1
- package/dist/plugin/aot/bun.js +16 -9
- package/dist/plugin/aot/bun.mjs +17 -10
- package/dist/plugin/aot/core.d.ts +52 -60
- package/dist/plugin/aot/core.js +208 -109
- package/dist/plugin/aot/core.mjs +205 -111
- package/dist/plugin/aot/esbuild.js +8 -5
- package/dist/plugin/aot/esbuild.mjs +9 -6
- package/dist/plugin/aot/hooks.d.ts +6 -17
- package/dist/plugin/aot/hooks.js +36 -14
- package/dist/plugin/aot/hooks.mjs +37 -16
- package/dist/plugin/aot/rspack-loader.d.ts +1 -5
- package/dist/plugin/aot/rspack-loader.js +1 -10
- package/dist/plugin/aot/rspack-loader.mjs +1 -10
- package/dist/plugin/aot/rspack.js +2 -5
- package/dist/plugin/aot/rspack.mjs +3 -6
- package/dist/plugin/aot/source.d.ts +6 -42
- package/dist/plugin/aot/source.js +71 -71
- package/dist/plugin/aot/source.mjs +72 -72
- package/dist/plugin/aot/treeshake.js +2 -6
- package/dist/plugin/aot/treeshake.mjs +2 -6
- package/dist/plugin/aot/unplugin.d.ts +1 -4
- package/dist/plugin/aot/unplugin.js +4 -13
- package/dist/plugin/aot/unplugin.mjs +4 -13
- package/dist/plugin/aot/vite.d.ts +2 -6
- package/dist/plugin/aot/worker.js +2 -2
- package/dist/plugin/aot/worker.mjs +2 -2
- package/dist/plugin/auto-head.js +1 -10
- package/dist/plugin/auto-head.mjs +1 -10
- package/dist/plugin/trace.d.ts +2 -1
- package/dist/route-table.d.ts +3 -0
- package/dist/route-table.js +16 -11
- package/dist/route-table.mjs +16 -11
- package/dist/schema-snapshot.d.ts +0 -4
- package/dist/schema-snapshot.js +32 -49
- package/dist/schema-snapshot.mjs +32 -49
- package/dist/sucrose.d.ts +6 -55
- package/dist/sucrose.js +103 -731
- package/dist/sucrose.mjs +102 -724
- package/dist/trace.d.ts +5 -8
- package/dist/trace.js +23 -134
- package/dist/trace.mjs +24 -135
- package/dist/type/bridge-live.d.ts +4 -2
- package/dist/type/bridge-live.js +6 -3
- package/dist/type/bridge-live.mjs +4 -2
- package/dist/type/bridge.d.ts +6 -4
- package/dist/type/bridge.js +17 -9
- package/dist/type/bridge.mjs +5 -3
- package/dist/type/coerce-plan.d.ts +5 -5
- package/dist/type/coerce-plan.js +41 -39
- package/dist/type/coerce-plan.mjs +43 -39
- package/dist/type/coerce.d.ts +3 -7
- package/dist/type/coerce.js +18 -75
- package/dist/type/coerce.mjs +19 -76
- package/dist/type/compat.d.ts +3 -0
- package/dist/type/compat.js +23 -14
- package/dist/type/compat.mjs +20 -10
- package/dist/type/elysia/array-buffer.d.ts +4 -1
- package/dist/type/elysia/array-buffer.js +17 -17
- package/dist/type/elysia/array-buffer.mjs +17 -17
- package/dist/type/elysia/array-string.js +2 -40
- package/dist/type/elysia/array-string.mjs +2 -39
- package/dist/type/elysia/array.js +5 -9
- package/dist/type/elysia/array.mjs +5 -9
- package/dist/type/elysia/boolean-string.js +2 -3
- package/dist/type/elysia/boolean-string.mjs +1 -1
- package/dist/type/elysia/boolean.js +3 -12
- package/dist/type/elysia/boolean.mjs +3 -11
- package/dist/type/elysia/cookie.d.ts +3 -4
- package/dist/type/elysia/cookie.js +5 -15
- package/dist/type/elysia/cookie.mjs +5 -15
- package/dist/type/elysia/date.js +13 -20
- package/dist/type/elysia/date.mjs +10 -16
- package/dist/type/elysia/file-type.d.ts +11 -4
- package/dist/type/elysia/file-type.js +17 -2
- package/dist/type/elysia/file-type.mjs +17 -3
- package/dist/type/elysia/file.d.ts +1 -3
- package/dist/type/elysia/file.js +11 -27
- package/dist/type/elysia/file.mjs +11 -12
- package/dist/type/elysia/files.js +7 -11
- package/dist/type/elysia/files.mjs +7 -10
- package/dist/type/elysia/form.js +2 -3
- package/dist/type/elysia/form.mjs +3 -3
- package/dist/type/elysia/integer-string.d.ts +1 -1
- package/dist/type/elysia/integer-string.js +4 -30
- package/dist/type/elysia/integer-string.mjs +5 -30
- package/dist/type/elysia/integer.js +3 -12
- package/dist/type/elysia/integer.mjs +3 -11
- package/dist/type/elysia/intersect.js +0 -5
- package/dist/type/elysia/intersect.mjs +0 -5
- package/dist/type/elysia/json-string.d.ts +7 -0
- package/dist/type/elysia/json-string.js +47 -0
- package/dist/type/elysia/json-string.mjs +46 -0
- package/dist/type/elysia/keep-config.d.ts +14 -0
- package/dist/type/elysia/keep-config.js +62 -0
- package/dist/type/elysia/keep-config.mjs +53 -0
- package/dist/type/elysia/maybe-empty.js +3 -4
- package/dist/type/elysia/maybe-empty.mjs +1 -1
- package/dist/type/elysia/nullable.js +2 -3
- package/dist/type/elysia/nullable.mjs +1 -1
- package/dist/type/elysia/number.d.ts +2 -1
- package/dist/type/elysia/number.js +19 -11
- package/dist/type/elysia/number.mjs +18 -10
- package/dist/type/elysia/numeric-enum.d.ts +1 -1
- package/dist/type/elysia/numeric-enum.js +4 -5
- package/dist/type/elysia/numeric-enum.mjs +3 -3
- package/dist/type/elysia/numeric.d.ts +4 -2
- package/dist/type/elysia/numeric.js +20 -17
- package/dist/type/elysia/numeric.mjs +19 -16
- package/dist/type/elysia/object-string.js +2 -37
- package/dist/type/elysia/object-string.mjs +2 -36
- package/dist/type/elysia/object.js +5 -9
- package/dist/type/elysia/object.mjs +5 -9
- package/dist/type/elysia/optional.js +8 -8
- package/dist/type/elysia/optional.mjs +7 -7
- package/dist/type/elysia/problem.d.ts +20 -0
- package/dist/type/elysia/problem.js +25 -0
- package/dist/type/elysia/problem.mjs +24 -0
- package/dist/type/elysia/string.js +4 -3
- package/dist/type/elysia/string.mjs +4 -2
- package/dist/type/elysia/uint8-array.d.ts +1 -1
- package/dist/type/elysia/uint8-array.js +5 -20
- package/dist/type/elysia/uint8-array.mjs +5 -19
- package/dist/type/elysia/union-enum.js +7 -8
- package/dist/type/elysia/union-enum.mjs +6 -6
- package/dist/type/elysia/union.js +0 -5
- package/dist/type/elysia/union.mjs +0 -5
- package/dist/type/elysia/utils.d.ts +2 -4
- package/dist/type/elysia/utils.js +10 -21
- package/dist/type/elysia/utils.mjs +7 -15
- package/dist/type/exports.d.ts +4 -2
- package/dist/type/exports.js +23 -2
- package/dist/type/exports.mjs +11 -2
- package/dist/type/index.d.ts +10 -2
- package/dist/type/index.js +62 -15
- package/dist/type/index.mjs +65 -11
- package/dist/type/shared.d.ts +3 -9
- package/dist/type/shared.js +44 -97
- package/dist/type/shared.mjs +43 -97
- package/dist/type/sync-require.d.ts +11 -0
- package/dist/type/sync-require.js +14 -0
- package/dist/type/sync-require.mjs +12 -0
- package/dist/type/typebox-system-lite.d.ts +2 -0
- package/dist/type/typebox-system-lite.js +34 -0
- package/dist/type/typebox-system-lite.mjs +3 -0
- package/dist/type/typebox-system-require.d.ts +7 -0
- package/dist/type/typebox-system-require.js +24 -0
- package/dist/type/typebox-system-require.mjs +23 -0
- package/dist/type/typebox-type-live.d.ts +11 -0
- package/dist/type/typebox-type-live.js +45 -0
- package/dist/type/typebox-type-live.mjs +20 -0
- package/dist/type/typebox-type.d.ts +34 -0
- package/dist/type/typebox-type.js +199 -0
- package/dist/type/typebox-type.mjs +86 -0
- package/dist/type/typebox-value-live.d.ts +11 -0
- package/dist/type/typebox-value-live.js +31 -0
- package/dist/type/typebox-value-live.mjs +13 -0
- package/dist/type/typebox-value-ops.d.ts +4 -0
- package/dist/type/typebox-value-ops.js +90 -0
- package/dist/type/typebox-value-ops.mjs +5 -0
- package/dist/type/typebox-value-require.d.ts +8 -0
- package/dist/type/typebox-value-require.js +28 -0
- package/dist/type/typebox-value-require.mjs +25 -0
- package/dist/type/typebox-value.d.ts +35 -0
- package/dist/type/typebox-value.js +161 -0
- package/dist/type/typebox-value.mjs +74 -0
- package/dist/type/utils.js +1 -10
- package/dist/type/utils.mjs +1 -10
- package/dist/type/validator/clean-safe.d.ts +2 -4
- package/dist/type/validator/clean-safe.js +15 -11
- package/dist/type/validator/clean-safe.mjs +16 -10
- package/dist/type/validator/custom-error.js +12 -16
- package/dist/type/validator/custom-error.mjs +11 -14
- package/dist/type/validator/default-precompute.d.ts +9 -1
- package/dist/type/validator/default-precompute.js +40 -77
- package/dist/type/validator/default-precompute.mjs +37 -74
- package/dist/type/validator/exact-mirror-live.d.ts +8 -0
- package/dist/type/validator/exact-mirror-live.js +22 -0
- package/dist/type/validator/exact-mirror-live.mjs +17 -0
- package/dist/type/validator/exact-mirror-require.d.ts +4 -0
- package/dist/type/validator/exact-mirror-require.js +11 -0
- package/dist/type/validator/exact-mirror-require.mjs +9 -0
- package/dist/type/validator/exact-mirror.js +8 -8
- package/dist/type/validator/exact-mirror.mjs +9 -8
- package/dist/type/validator/frozen-check.js +5 -6
- package/dist/type/validator/frozen-check.mjs +6 -7
- package/dist/type/validator/index.d.ts +1 -0
- package/dist/type/validator/index.js +169 -166
- package/dist/type/validator/index.mjs +162 -158
- package/dist/type/validator/string-codec-aot.d.ts +2 -1
- package/dist/type/validator/string-codec-aot.js +8 -2
- package/dist/type/validator/string-codec-aot.mjs +7 -2
- package/dist/type/validator/validator-cache.d.ts +5 -4
- package/dist/type/validator/validator-cache.js +41 -24
- package/dist/type/validator/validator-cache.mjs +40 -22
- package/dist/types.d.ts +263 -95
- package/dist/universal/constants.d.ts +2 -1
- package/dist/universal/constants.js +3 -1
- package/dist/universal/constants.mjs +2 -1
- package/dist/universal/env.js +2 -3
- package/dist/universal/env.mjs +2 -3
- package/dist/universal/file.d.ts +6 -4
- package/dist/universal/file.js +11 -16
- package/dist/universal/file.mjs +12 -16
- package/dist/universal/index.d.ts +2 -2
- package/dist/universal/is-production.d.ts +1 -2
- package/dist/universal/is-production.js +1 -3
- package/dist/universal/is-production.mjs +2 -3
- package/dist/universal/server.d.ts +0 -272
- package/dist/utils.d.ts +43 -7
- package/dist/utils.js +181 -126
- package/dist/utils.mjs +168 -126
- package/dist/validator/index.d.ts +1 -1
- package/dist/validator/index.js +17 -30
- package/dist/validator/index.mjs +18 -31
- package/dist/validator/route.js +2 -1
- package/dist/validator/route.mjs +2 -1
- package/dist/ws/context.d.ts +8 -1
- package/dist/ws/context.js +68 -44
- package/dist/ws/context.mjs +67 -44
- package/dist/ws/parser.js +10 -20
- package/dist/ws/parser.mjs +10 -20
- package/dist/ws/route.d.ts +2 -2
- package/dist/ws/route.js +249 -141
- package/dist/ws/route.mjs +254 -146
- package/dist/ws/types.d.ts +2 -2
- package/package.json +23 -49
- package/dist/compile/analysis-cache.d.ts +0 -6
- package/dist/compile/analysis-cache.js +0 -12
- package/dist/compile/analysis-cache.mjs +0 -11
- package/dist/cookie/index.d.ts +0 -7
- package/dist/cookie/index.js +0 -13
- package/dist/cookie/index.mjs +0 -7
- package/dist/handler/index.d.ts +0 -2
- package/dist/handler/index.js +0 -5
- package/dist/handler/index.mjs +0 -3
package/dist/type/shared.mjs
CHANGED
|
@@ -13,12 +13,6 @@ function clearSharedReferenceCaches() {
|
|
|
13
13
|
for (const cache of sharedReferenceCaches) cache.clear();
|
|
14
14
|
}
|
|
15
15
|
const pureRefinements = /* @__PURE__ */ new WeakSet();
|
|
16
|
-
/**
|
|
17
|
-
* @internal Tag every `~refine` entry of a framework-built node as pure.
|
|
18
|
-
* Only ever call this on nodes whose predicates are self-contained: a predicate
|
|
19
|
-
* that can transitively reach a USER refinement (e.g. ObjectString, which runs
|
|
20
|
-
* `Check` over the inner schema) is NOT pure and must keep the pool.
|
|
21
|
-
*/
|
|
22
16
|
function pureRefine(node) {
|
|
23
17
|
const refinements = node?.["~refine"];
|
|
24
18
|
if (Array.isArray(refinements)) {
|
|
@@ -31,20 +25,13 @@ const isPureRefinement = (refinement) => pureRefinements.has(refinement);
|
|
|
31
25
|
/** @internal */
|
|
32
26
|
const coerceLeafCache = /* @__PURE__ */ new Map();
|
|
33
27
|
/** @internal test isolation */
|
|
34
|
-
const coerceLeafCacheSize = () => coerceLeafCache.size;
|
|
35
|
-
/** @internal test isolation */
|
|
36
28
|
function clearCoerceLeafCache() {
|
|
37
29
|
coerceLeafCache.clear();
|
|
38
30
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"~kind": node["~kind"]
|
|
44
|
-
};
|
|
45
|
-
for (const key of Object.getOwnPropertyNames(node)) {
|
|
46
|
-
const desc = Object.getOwnPropertyDescriptor(node, key);
|
|
47
|
-
if (!desc || desc.enumerable || key === "~kind") continue;
|
|
31
|
+
function copyNonEnumerable(src, target, skipKey) {
|
|
32
|
+
for (const key of Object.getOwnPropertyNames(src)) {
|
|
33
|
+
const desc = Object.getOwnPropertyDescriptor(src, key);
|
|
34
|
+
if (!desc || desc.enumerable || key === skipKey) continue;
|
|
48
35
|
Object.defineProperty(target, key, {
|
|
49
36
|
value: desc.value,
|
|
50
37
|
enumerable: false,
|
|
@@ -52,104 +39,63 @@ function cloneNode(node, out) {
|
|
|
52
39
|
configurable: true
|
|
53
40
|
});
|
|
54
41
|
}
|
|
42
|
+
}
|
|
43
|
+
function cloneNode(node, out) {
|
|
44
|
+
if (out !== node) return out;
|
|
45
|
+
const target = {
|
|
46
|
+
...node,
|
|
47
|
+
"~kind": node["~kind"]
|
|
48
|
+
};
|
|
49
|
+
copyNonEnumerable(node, target, "~kind");
|
|
55
50
|
return Object.defineProperty(target, "~kind", noEnumerable);
|
|
56
51
|
}
|
|
52
|
+
function dropCompiledSource(tb) {
|
|
53
|
+
if (tb.evaluateResult) tb.evaluateResult.code = void 0;
|
|
54
|
+
if (tb.buildResult) tb.buildResult.functions = void 0;
|
|
55
|
+
}
|
|
57
56
|
function nonAdditionalProperties(node, seen = /* @__PURE__ */ new WeakSet()) {
|
|
58
57
|
if (!node || typeof node !== "object" || seen.has(node)) return node;
|
|
59
58
|
seen.add(node);
|
|
60
59
|
let out = node;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
const set = (key, value) => {
|
|
61
|
+
out = cloneNode(node, out);
|
|
62
|
+
out[key] = value;
|
|
63
|
+
};
|
|
64
|
+
const single = (key) => {
|
|
65
|
+
const v = node[key];
|
|
66
|
+
const r = nonAdditionalProperties(v, seen);
|
|
67
|
+
if (r !== v) set(key, r);
|
|
68
|
+
};
|
|
69
|
+
const record = (key) => {
|
|
70
|
+
const children = node[key];
|
|
71
|
+
let copy;
|
|
72
|
+
for (const k in children) {
|
|
73
|
+
const v = children[k];
|
|
65
74
|
const r = nonAdditionalProperties(v, seen);
|
|
66
|
-
if (r !== v) {
|
|
67
|
-
newProps ??= { ...node.properties };
|
|
68
|
-
newProps[k] = r;
|
|
69
|
-
}
|
|
75
|
+
if (r !== v) (copy ??= { ...children })[k] = r;
|
|
70
76
|
}
|
|
71
|
-
if (
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
if (node.items) if (Array.isArray(node.items)) {
|
|
77
|
-
let newItems;
|
|
78
|
-
for (let i = 0; i < node.items.length; i++) {
|
|
79
|
-
const r = nonAdditionalProperties(node.items[i], seen);
|
|
80
|
-
if (r !== node.items[i]) {
|
|
81
|
-
newItems ??= [...node.items];
|
|
82
|
-
newItems[i] = r;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (newItems) {
|
|
86
|
-
out = cloneNode(node, out);
|
|
87
|
-
out.items = newItems;
|
|
88
|
-
}
|
|
89
|
-
} else {
|
|
90
|
-
const r = nonAdditionalProperties(node.items, seen);
|
|
91
|
-
if (r !== node.items) {
|
|
92
|
-
out = cloneNode(node, out);
|
|
93
|
-
out.items = r;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
77
|
+
if (copy) set(key, copy);
|
|
78
|
+
};
|
|
79
|
+
if (node.properties) record("properties");
|
|
80
|
+
if (node.items && !Array.isArray(node.items)) single("items");
|
|
96
81
|
for (const key of [
|
|
82
|
+
"items",
|
|
97
83
|
"anyOf",
|
|
98
84
|
"allOf",
|
|
99
85
|
"oneOf"
|
|
100
86
|
]) {
|
|
101
87
|
const arr = node[key];
|
|
102
88
|
if (!Array.isArray(arr)) continue;
|
|
103
|
-
let
|
|
89
|
+
let copy;
|
|
104
90
|
for (let i = 0; i < arr.length; i++) {
|
|
105
91
|
const r = nonAdditionalProperties(arr[i], seen);
|
|
106
|
-
if (r !== arr[i])
|
|
107
|
-
newArr ??= [...arr];
|
|
108
|
-
newArr[i] = r;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (newArr) {
|
|
112
|
-
out = cloneNode(node, out);
|
|
113
|
-
out[key] = newArr;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
if (node.additionalProperties && typeof node.additionalProperties === "object") {
|
|
117
|
-
const r = nonAdditionalProperties(node.additionalProperties, seen);
|
|
118
|
-
if (r !== node.additionalProperties) {
|
|
119
|
-
out = cloneNode(node, out);
|
|
120
|
-
out.additionalProperties = r;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (node.patternProperties) {
|
|
124
|
-
let newPP;
|
|
125
|
-
for (const k in node.patternProperties) {
|
|
126
|
-
const v = node.patternProperties[k];
|
|
127
|
-
const r = nonAdditionalProperties(v, seen);
|
|
128
|
-
if (r !== v) {
|
|
129
|
-
newPP ??= { ...node.patternProperties };
|
|
130
|
-
newPP[k] = r;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
if (newPP) {
|
|
134
|
-
out = cloneNode(node, out);
|
|
135
|
-
out.patternProperties = newPP;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
if (node.$defs) {
|
|
139
|
-
let newDefs;
|
|
140
|
-
for (const k in node.$defs) {
|
|
141
|
-
const v = node.$defs[k];
|
|
142
|
-
const r = nonAdditionalProperties(v, seen);
|
|
143
|
-
if (r !== v) {
|
|
144
|
-
newDefs ??= { ...node.$defs };
|
|
145
|
-
newDefs[k] = r;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
if (newDefs) {
|
|
149
|
-
out = cloneNode(node, out);
|
|
150
|
-
out.$defs = newDefs;
|
|
92
|
+
if (r !== arr[i]) (copy ??= [...arr])[i] = r;
|
|
151
93
|
}
|
|
94
|
+
if (copy) set(key, copy);
|
|
152
95
|
}
|
|
96
|
+
if (node.additionalProperties && typeof node.additionalProperties === "object") single("additionalProperties");
|
|
97
|
+
if (node.patternProperties) record("patternProperties");
|
|
98
|
+
if (node.$defs) record("$defs");
|
|
153
99
|
if ((node.type === "object" || node["~kind"] === "Object") && !("additionalProperties" in node)) {
|
|
154
100
|
out = cloneNode(node, out);
|
|
155
101
|
out.additionalProperties = false;
|
|
@@ -158,4 +104,4 @@ function nonAdditionalProperties(node, seen = /* @__PURE__ */ new WeakSet()) {
|
|
|
158
104
|
}
|
|
159
105
|
|
|
160
106
|
//#endregion
|
|
161
|
-
export { SHARED_REFERENCE_CACHE_LIMIT, clearCoerceLeafCache, clearSharedReferenceCaches, cloneNode, coerceLeafCache,
|
|
107
|
+
export { SHARED_REFERENCE_CACHE_LIMIT, clearCoerceLeafCache, clearSharedReferenceCaches, cloneNode, coerceLeafCache, copyNonEnumerable, dropCompiledSource, isPureRefinement, nonAdditionalProperties, pureRefine, referenceCache };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/type/sync-require.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Synchronous `require` resolving from the CALLER's module: pass its own
|
|
4
|
+
* `import.meta` and `import.meta.url` (a CJS build empties `import.meta` but
|
|
5
|
+
* still rewrites `import.meta.url`)
|
|
6
|
+
*
|
|
7
|
+
* Never swapped by the AOT build plugin
|
|
8
|
+
*/
|
|
9
|
+
declare const syncRequire: (meta: ImportMeta, url: string) => ((specifier: string) => any) | undefined;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { syncRequire };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
//#region src/type/sync-require.ts
|
|
4
|
+
/**
|
|
5
|
+
* Synchronous `require` resolving from the CALLER's module: pass its own
|
|
6
|
+
* `import.meta` and `import.meta.url` (a CJS build empties `import.meta` but
|
|
7
|
+
* still rewrites `import.meta.url`)
|
|
8
|
+
*
|
|
9
|
+
* Never swapped by the AOT build plugin
|
|
10
|
+
*/
|
|
11
|
+
const syncRequire = (meta, url) => meta.require ?? globalThis.process?.getBuiltinModule?.("module")?.createRequire(url);
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
exports.syncRequire = syncRequire;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/type/sync-require.ts
|
|
2
|
+
/**
|
|
3
|
+
* Synchronous `require` resolving from the CALLER's module: pass its own
|
|
4
|
+
* `import.meta` and `import.meta.url` (a CJS build empties `import.meta` but
|
|
5
|
+
* still rewrites `import.meta.url`)
|
|
6
|
+
*
|
|
7
|
+
* Never swapped by the AOT build plugin
|
|
8
|
+
*/
|
|
9
|
+
const syncRequire = (meta, url) => meta.require ?? globalThis.process?.getBuiltinModule?.("module")?.createRequire(url);
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { syncRequire };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
3
|
+
let typebox_system = require("typebox/system");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, 'Arguments', {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function () {
|
|
8
|
+
return typebox_system.Arguments;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, 'Environment', {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () {
|
|
14
|
+
return typebox_system.Environment;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, 'Hashing', {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return typebox_system.Hashing;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, 'Memory', {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () {
|
|
26
|
+
return typebox_system.Memory;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(exports, 'Settings', {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () {
|
|
32
|
+
return typebox_system.Settings;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TypeboxTypeNamespaces } from "./typebox-type.js";
|
|
2
|
+
import { System } from "typebox/system";
|
|
3
|
+
|
|
4
|
+
//#region src/type/typebox-system-require.d.ts
|
|
5
|
+
declare const typeSystem: (system: TypeboxTypeNamespaces["system"]) => typeof System;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { typeSystem };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_type_sync_require = require('./sync-require.js');
|
|
3
|
+
|
|
4
|
+
//#region src/type/typebox-system-require.ts
|
|
5
|
+
const requireLocale = () => {
|
|
6
|
+
try {
|
|
7
|
+
const req = require_type_sync_require.syncRequire({}, require("url").pathToFileURL(__filename).href);
|
|
8
|
+
if (req) return req("typebox/system").System.Locale;
|
|
9
|
+
} catch {}
|
|
10
|
+
throw new Error("TypeSystem.Locale isn't bundled: it carries every locale table. Register it with setupTypebox({ typebox: { type, system } }) using `import * as system from 'typebox/system'`, or build with `aot(entry)`.");
|
|
11
|
+
};
|
|
12
|
+
const typeSystem = (system) => system.System ?? Object.defineProperty({
|
|
13
|
+
Arguments: system.Arguments,
|
|
14
|
+
Environment: system.Environment,
|
|
15
|
+
Hashing: system.Hashing,
|
|
16
|
+
Memory: system.Memory,
|
|
17
|
+
Settings: system.Settings
|
|
18
|
+
}, "Locale", {
|
|
19
|
+
get: requireLocale,
|
|
20
|
+
enumerable: true
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.typeSystem = typeSystem;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { syncRequire } from "./sync-require.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/type/typebox-system-require.ts
|
|
4
|
+
const requireLocale = () => {
|
|
5
|
+
try {
|
|
6
|
+
const req = syncRequire(import.meta, import.meta.url);
|
|
7
|
+
if (req) return req("typebox/system").System.Locale;
|
|
8
|
+
} catch {}
|
|
9
|
+
throw new Error("TypeSystem.Locale isn't bundled: it carries every locale table. Register it with setupTypebox({ typebox: { type, system } }) using `import * as system from 'typebox/system'`, or build with `aot(entry)`.");
|
|
10
|
+
};
|
|
11
|
+
const typeSystem = (system) => system.System ?? Object.defineProperty({
|
|
12
|
+
Arguments: system.Arguments,
|
|
13
|
+
Environment: system.Environment,
|
|
14
|
+
Hashing: system.Hashing,
|
|
15
|
+
Memory: system.Memory,
|
|
16
|
+
Settings: system.Settings
|
|
17
|
+
}, "Locale", {
|
|
18
|
+
get: requireLocale,
|
|
19
|
+
enumerable: true
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { typeSystem };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TypeboxTypeNamespaces } from "./typebox-type.js";
|
|
2
|
+
import { Codec, Composite, Decode, Evaluate, Interface, Intersect, Mapped, Module, Null, Omit, Partial, Pick, ReadonlyObject, Ref, Refine, Required, Undefined, Unsafe } from "typebox/type";
|
|
3
|
+
|
|
4
|
+
//#region src/type/typebox-type-live.d.ts
|
|
5
|
+
declare function injectTypeboxType(typebox?: TypeboxTypeNamespaces): void;
|
|
6
|
+
declare const loadTypeNamespace: () => TypeboxTypeNamespaces;
|
|
7
|
+
declare function markTypeUsed(): void;
|
|
8
|
+
declare const isTypeUsed: () => boolean;
|
|
9
|
+
declare const isTypeNamespaceLoaded: () => boolean;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Codec, Composite, Decode, Evaluate, Interface, Intersect, Mapped, Module, Null, Omit, Partial, Pick, ReadonlyObject, Ref, Refine, Required, type TypeboxTypeNamespaces, Undefined, Unsafe, injectTypeboxType, isTypeNamespaceLoaded, isTypeUsed, loadTypeNamespace, markTypeUsed };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
3
|
+
let typebox_type = require("typebox/type");
|
|
4
|
+
typebox_type = require_runtime.__toESM(typebox_type);
|
|
5
|
+
let src_type_typebox_system_lite = require("./typebox-system-lite.mjs");
|
|
6
|
+
src_type_typebox_system_lite = require_runtime.__toESM(src_type_typebox_system_lite);
|
|
7
|
+
|
|
8
|
+
//#region src/type/typebox-type-live.ts
|
|
9
|
+
src_type_typebox_system_lite.Settings.Set({ unionPrioritySort: false });
|
|
10
|
+
let namespaces = {
|
|
11
|
+
type: typebox_type,
|
|
12
|
+
system: src_type_typebox_system_lite
|
|
13
|
+
};
|
|
14
|
+
function injectTypeboxType(typebox) {
|
|
15
|
+
if (typebox) namespaces = typebox;
|
|
16
|
+
}
|
|
17
|
+
const loadTypeNamespace = () => namespaces;
|
|
18
|
+
function markTypeUsed() {}
|
|
19
|
+
const isTypeUsed = () => true;
|
|
20
|
+
const isTypeNamespaceLoaded = () => true;
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.Codec = typebox_type.Codec;
|
|
24
|
+
exports.Composite = typebox_type.Composite;
|
|
25
|
+
exports.Decode = typebox_type.Decode;
|
|
26
|
+
exports.Evaluate = typebox_type.Evaluate;
|
|
27
|
+
exports.Interface = typebox_type.Interface;
|
|
28
|
+
exports.Intersect = typebox_type.Intersect;
|
|
29
|
+
exports.Mapped = typebox_type.Mapped;
|
|
30
|
+
exports.Module = typebox_type.Module;
|
|
31
|
+
exports.Null = typebox_type.Null;
|
|
32
|
+
exports.Omit = typebox_type.Omit;
|
|
33
|
+
exports.Partial = typebox_type.Partial;
|
|
34
|
+
exports.Pick = typebox_type.Pick;
|
|
35
|
+
exports.ReadonlyObject = typebox_type.ReadonlyObject;
|
|
36
|
+
exports.Ref = typebox_type.Ref;
|
|
37
|
+
exports.Refine = typebox_type.Refine;
|
|
38
|
+
exports.Required = typebox_type.Required;
|
|
39
|
+
exports.Undefined = typebox_type.Undefined;
|
|
40
|
+
exports.Unsafe = typebox_type.Unsafe;
|
|
41
|
+
exports.injectTypeboxType = injectTypeboxType;
|
|
42
|
+
exports.isTypeNamespaceLoaded = isTypeNamespaceLoaded;
|
|
43
|
+
exports.isTypeUsed = isTypeUsed;
|
|
44
|
+
exports.loadTypeNamespace = loadTypeNamespace;
|
|
45
|
+
exports.markTypeUsed = markTypeUsed;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as type from "typebox/type";
|
|
2
|
+
import { Codec, Composite, Decode, Evaluate, Interface, Intersect, Mapped, Module, Null, Omit, Partial, Pick, ReadonlyObject, Ref, Refine, Required, Undefined, Unsafe } from "typebox/type";
|
|
3
|
+
import * as system from "./typebox-system-lite.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/type/typebox-type-live.ts
|
|
6
|
+
system.Settings.Set({ unionPrioritySort: false });
|
|
7
|
+
let namespaces = {
|
|
8
|
+
type,
|
|
9
|
+
system
|
|
10
|
+
};
|
|
11
|
+
function injectTypeboxType(typebox) {
|
|
12
|
+
if (typebox) namespaces = typebox;
|
|
13
|
+
}
|
|
14
|
+
const loadTypeNamespace = () => namespaces;
|
|
15
|
+
function markTypeUsed() {}
|
|
16
|
+
const isTypeUsed = () => true;
|
|
17
|
+
const isTypeNamespaceLoaded = () => true;
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Codec, Composite, Decode, Evaluate, Interface, Intersect, Mapped, Module, Null, Omit, Partial, Pick, ReadonlyObject, Ref, Refine, Required, Undefined, Unsafe, injectTypeboxType, isTypeNamespaceLoaded, isTypeUsed, loadTypeNamespace, markTypeUsed };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as _$typebox_type0 from "typebox/type";
|
|
2
|
+
import { Codec as Codec$1, Composite as Composite$1, Decode as Decode$1, Evaluate as Evaluate$1, Interface as Interface$1, Intersect as Intersect$1, Mapped as Mapped$1, Module as Module$1, Null as Null$1, Omit as Omit$1, Partial as Partial$1, Pick as Pick$1, ReadonlyObject as ReadonlyObject$1, Ref as Ref$1, Refine as Refine$1, Required as Required$1, Undefined as Undefined$1, Unsafe as Unsafe$1 } from "typebox/type";
|
|
3
|
+
import * as _$typebox_system0 from "typebox/system";
|
|
4
|
+
|
|
5
|
+
//#region src/type/typebox-type.d.ts
|
|
6
|
+
interface TypeboxTypeNamespaces {
|
|
7
|
+
type: typeof _$typebox_type0;
|
|
8
|
+
system: Pick<typeof _$typebox_system0, 'Arguments' | 'Environment' | 'Hashing' | 'Memory' | 'Settings'> & Partial<Pick<typeof _$typebox_system0, 'System'>>;
|
|
9
|
+
}
|
|
10
|
+
declare const loadTypeNamespace: () => TypeboxTypeNamespaces;
|
|
11
|
+
declare const markTypeUsed: () => void;
|
|
12
|
+
declare const isTypeUsed: () => boolean;
|
|
13
|
+
declare const isTypeNamespaceLoaded: () => boolean;
|
|
14
|
+
declare let Codec: typeof Codec$1;
|
|
15
|
+
declare let Composite: typeof Composite$1;
|
|
16
|
+
declare let Decode: typeof Decode$1;
|
|
17
|
+
declare let Evaluate: typeof Evaluate$1;
|
|
18
|
+
declare let Interface: typeof Interface$1;
|
|
19
|
+
declare let Intersect: typeof Intersect$1;
|
|
20
|
+
declare let Mapped: typeof Mapped$1;
|
|
21
|
+
declare let Module: typeof Module$1;
|
|
22
|
+
declare let Null: typeof Null$1;
|
|
23
|
+
declare let Omit: typeof Omit$1;
|
|
24
|
+
declare let Partial: typeof Partial$1;
|
|
25
|
+
declare let Pick: typeof Pick$1;
|
|
26
|
+
declare let ReadonlyObject: typeof ReadonlyObject$1;
|
|
27
|
+
declare let Ref: typeof Ref$1;
|
|
28
|
+
declare let Refine: typeof Refine$1;
|
|
29
|
+
declare let Required: typeof Required$1;
|
|
30
|
+
declare let Undefined: typeof Undefined$1;
|
|
31
|
+
declare let Unsafe: typeof Unsafe$1;
|
|
32
|
+
declare function injectTypeboxType(typebox: TypeboxTypeNamespaces): void;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { Codec, Composite, Decode, Evaluate, Interface, Intersect, Mapped, Module, Null, Omit, Partial, Pick, ReadonlyObject, Ref, Refine, Required, TypeboxTypeNamespaces, Undefined, Unsafe, injectTypeboxType, isTypeNamespaceLoaded, isTypeUsed, loadTypeNamespace, markTypeUsed };
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_type_sync_require = require('./sync-require.js');
|
|
3
|
+
|
|
4
|
+
//#region src/type/typebox-type.ts
|
|
5
|
+
let namespaces;
|
|
6
|
+
/**
|
|
7
|
+
* Loads `typebox/type` + `typebox/system` on first use
|
|
8
|
+
*
|
|
9
|
+
* separate from `typebox-value` (type ⊂ value)
|
|
10
|
+
* sharing one would make a single `t.Date()` drag the whole value graph in
|
|
11
|
+
*/
|
|
12
|
+
function load() {
|
|
13
|
+
if (namespaces) return namespaces;
|
|
14
|
+
injectTypeboxType(resolveNamespaces());
|
|
15
|
+
return namespaces;
|
|
16
|
+
}
|
|
17
|
+
function resolveNamespaces() {
|
|
18
|
+
if (typeof require === "function") try {
|
|
19
|
+
return {
|
|
20
|
+
type: require("typebox/type"),
|
|
21
|
+
system: require("./typebox-system-lite.mjs")
|
|
22
|
+
};
|
|
23
|
+
} catch {}
|
|
24
|
+
const req = require_type_sync_require.syncRequire({}, require("url").pathToFileURL(__filename).href);
|
|
25
|
+
if (!req) throw new Error("TypeBox couldn't be loaded: this runtime has no synchronous module loader. Build with the AOT plugin ('elysia/plugin/aot') so TypeBox is wired statically, or register it manually with setupTypebox({ typebox: { type, system } }).");
|
|
26
|
+
return {
|
|
27
|
+
type: req("typebox/type"),
|
|
28
|
+
system: req("typebox/system")
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const loadTypeNamespace = () => namespaces ?? load();
|
|
32
|
+
let typeUsed = false;
|
|
33
|
+
const markTypeUsed = () => {
|
|
34
|
+
typeUsed = true;
|
|
35
|
+
};
|
|
36
|
+
const isTypeUsed = () => typeUsed || namespaces !== void 0;
|
|
37
|
+
const isTypeNamespaceLoaded = () => namespaces !== void 0;
|
|
38
|
+
function stub(get) {
|
|
39
|
+
return function(...args) {
|
|
40
|
+
load();
|
|
41
|
+
return get()(...args);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
let Codec = stub(() => Codec);
|
|
45
|
+
let Composite = stub(() => Composite);
|
|
46
|
+
let Decode = stub(() => Decode);
|
|
47
|
+
let Evaluate = stub(() => Evaluate);
|
|
48
|
+
let Interface = stub(() => Interface);
|
|
49
|
+
let Intersect = stub(() => Intersect);
|
|
50
|
+
let Mapped = stub(() => Mapped);
|
|
51
|
+
let Module = stub(() => Module);
|
|
52
|
+
let Null = stub(() => Null);
|
|
53
|
+
let Omit = stub(() => Omit);
|
|
54
|
+
let Partial = stub(() => Partial);
|
|
55
|
+
let Pick = stub(() => Pick);
|
|
56
|
+
let ReadonlyObject = stub(() => ReadonlyObject);
|
|
57
|
+
let Ref = stub(() => Ref);
|
|
58
|
+
let Refine = stub(() => Refine);
|
|
59
|
+
let Required = stub(() => Required);
|
|
60
|
+
let Undefined = stub(() => Undefined);
|
|
61
|
+
let Unsafe = stub(() => Unsafe);
|
|
62
|
+
function injectTypeboxType(typebox) {
|
|
63
|
+
const first = namespaces === void 0;
|
|
64
|
+
namespaces = typebox;
|
|
65
|
+
Codec = typebox.type.Codec;
|
|
66
|
+
Composite = typebox.type.Composite;
|
|
67
|
+
Decode = typebox.type.Decode;
|
|
68
|
+
Evaluate = typebox.type.Evaluate;
|
|
69
|
+
Interface = typebox.type.Interface;
|
|
70
|
+
Intersect = typebox.type.Intersect;
|
|
71
|
+
Mapped = typebox.type.Mapped;
|
|
72
|
+
Module = typebox.type.Module;
|
|
73
|
+
Null = typebox.type.Null;
|
|
74
|
+
Omit = typebox.type.Omit;
|
|
75
|
+
Partial = typebox.type.Partial;
|
|
76
|
+
Pick = typebox.type.Pick;
|
|
77
|
+
ReadonlyObject = typebox.type.ReadonlyObject;
|
|
78
|
+
Ref = typebox.type.Ref;
|
|
79
|
+
Refine = typebox.type.Refine;
|
|
80
|
+
Required = typebox.type.Required;
|
|
81
|
+
Undefined = typebox.type.Undefined;
|
|
82
|
+
Unsafe = typebox.type.Unsafe;
|
|
83
|
+
if (first) typebox.system.Settings.Set({ unionPrioritySort: false });
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
87
|
+
Object.defineProperty(exports, 'Codec', {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function () {
|
|
90
|
+
return Codec;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
Object.defineProperty(exports, 'Composite', {
|
|
94
|
+
enumerable: true,
|
|
95
|
+
get: function () {
|
|
96
|
+
return Composite;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
Object.defineProperty(exports, 'Decode', {
|
|
100
|
+
enumerable: true,
|
|
101
|
+
get: function () {
|
|
102
|
+
return Decode;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
Object.defineProperty(exports, 'Evaluate', {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
get: function () {
|
|
108
|
+
return Evaluate;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
Object.defineProperty(exports, 'Interface', {
|
|
112
|
+
enumerable: true,
|
|
113
|
+
get: function () {
|
|
114
|
+
return Interface;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
Object.defineProperty(exports, 'Intersect', {
|
|
118
|
+
enumerable: true,
|
|
119
|
+
get: function () {
|
|
120
|
+
return Intersect;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
Object.defineProperty(exports, 'Mapped', {
|
|
124
|
+
enumerable: true,
|
|
125
|
+
get: function () {
|
|
126
|
+
return Mapped;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
Object.defineProperty(exports, 'Module', {
|
|
130
|
+
enumerable: true,
|
|
131
|
+
get: function () {
|
|
132
|
+
return Module;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
Object.defineProperty(exports, 'Null', {
|
|
136
|
+
enumerable: true,
|
|
137
|
+
get: function () {
|
|
138
|
+
return Null;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
Object.defineProperty(exports, 'Omit', {
|
|
142
|
+
enumerable: true,
|
|
143
|
+
get: function () {
|
|
144
|
+
return Omit;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
Object.defineProperty(exports, 'Partial', {
|
|
148
|
+
enumerable: true,
|
|
149
|
+
get: function () {
|
|
150
|
+
return Partial;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
Object.defineProperty(exports, 'Pick', {
|
|
154
|
+
enumerable: true,
|
|
155
|
+
get: function () {
|
|
156
|
+
return Pick;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
Object.defineProperty(exports, 'ReadonlyObject', {
|
|
160
|
+
enumerable: true,
|
|
161
|
+
get: function () {
|
|
162
|
+
return ReadonlyObject;
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
Object.defineProperty(exports, 'Ref', {
|
|
166
|
+
enumerable: true,
|
|
167
|
+
get: function () {
|
|
168
|
+
return Ref;
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
Object.defineProperty(exports, 'Refine', {
|
|
172
|
+
enumerable: true,
|
|
173
|
+
get: function () {
|
|
174
|
+
return Refine;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
Object.defineProperty(exports, 'Required', {
|
|
178
|
+
enumerable: true,
|
|
179
|
+
get: function () {
|
|
180
|
+
return Required;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
Object.defineProperty(exports, 'Undefined', {
|
|
184
|
+
enumerable: true,
|
|
185
|
+
get: function () {
|
|
186
|
+
return Undefined;
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
Object.defineProperty(exports, 'Unsafe', {
|
|
190
|
+
enumerable: true,
|
|
191
|
+
get: function () {
|
|
192
|
+
return Unsafe;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
exports.injectTypeboxType = injectTypeboxType;
|
|
196
|
+
exports.isTypeNamespaceLoaded = isTypeNamespaceLoaded;
|
|
197
|
+
exports.isTypeUsed = isTypeUsed;
|
|
198
|
+
exports.loadTypeNamespace = loadTypeNamespace;
|
|
199
|
+
exports.markTypeUsed = markTypeUsed;
|