@sinclair/typebox 0.31.27 → 0.32.0-dev-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/compiler/compiler.d.ts +25 -18
- package/compiler/compiler.js +118 -107
- package/errors/errors.d.ts +7 -7
- package/errors/errors.js +48 -44
- package/index.d.ts +71 -0
- package/index.js +205 -0
- package/package.json +8 -19
- package/readme.md +188 -160
- package/system/errors.d.ts +14 -0
- package/system/errors.js +192 -0
- package/system/index.d.ts +3 -1
- package/system/index.js +10 -16
- package/system/policy.d.ts +21 -0
- package/system/policy.js +74 -0
- package/system/system.d.ts +3 -38
- package/system/system.js +15 -218
- package/type/any/any.d.ts +8 -0
- package/type/any/any.js +36 -0
- package/type/any/index.d.ts +1 -0
- package/type/any/index.js +44 -0
- package/type/array/array.d.ts +25 -0
- package/type/array/array.js +42 -0
- package/type/array/index.d.ts +1 -0
- package/type/array/index.js +44 -0
- package/type/async-iterator/async-iterator.d.ts +11 -0
- package/type/async-iterator/async-iterator.js +42 -0
- package/type/async-iterator/index.d.ts +1 -0
- package/type/async-iterator/index.js +44 -0
- package/type/awaited/awaited.d.ts +12 -0
- package/type/awaited/awaited.js +66 -0
- package/type/awaited/index.d.ts +1 -0
- package/type/awaited/index.js +44 -0
- package/type/bigint/bigint.d.ts +16 -0
- package/type/bigint/bigint.js +40 -0
- package/type/bigint/index.d.ts +1 -0
- package/type/bigint/index.js +44 -0
- package/type/boolean/boolean.d.ts +9 -0
- package/type/boolean/boolean.js +40 -0
- package/type/boolean/index.d.ts +1 -0
- package/type/boolean/index.js +44 -0
- package/type/clone/index.d.ts +2 -0
- package/type/clone/index.js +32 -0
- package/type/clone/type.d.ts +5 -0
- package/type/clone/type.js +41 -0
- package/type/clone/value.d.ts +2 -0
- package/type/clone/value.js +58 -0
- package/type/composite/composite.d.ts +15 -0
- package/type/composite/composite.js +47 -0
- package/type/composite/index.d.ts +1 -0
- package/type/composite/index.js +44 -0
- package/type/const/const.d.ts +30 -0
- package/type/const/const.js +84 -0
- package/type/const/index.d.ts +1 -0
- package/type/const/index.js +44 -0
- package/type/constructor/constructor.d.ts +17 -0
- package/type/constructor/constructor.js +43 -0
- package/type/constructor/index.d.ts +1 -0
- package/type/constructor/index.js +44 -0
- package/type/constructor-parameters/constructor-parameters.d.ts +7 -0
- package/type/constructor-parameters/constructor-parameters.js +37 -0
- package/type/constructor-parameters/index.d.ts +1 -0
- package/type/constructor-parameters/index.js +44 -0
- package/type/date/date.d.ts +21 -0
- package/type/date/date.js +40 -0
- package/type/date/index.d.ts +1 -0
- package/type/date/index.js +44 -0
- package/type/deref/deref.d.ts +24 -0
- package/type/deref/deref.js +136 -0
- package/type/deref/index.d.ts +1 -0
- package/type/deref/index.js +44 -0
- package/type/discard/discard.d.ts +1 -0
- package/type/discard/discard.js +38 -0
- package/type/discard/index.d.ts +1 -0
- package/type/discard/index.js +44 -0
- package/type/enum/enum.d.ts +14 -0
- package/type/enum/enum.js +46 -0
- package/type/enum/index.d.ts +1 -0
- package/type/enum/index.js +44 -0
- package/type/exclude/exclude.d.ts +21 -0
- package/type/exclude/exclude.js +54 -0
- package/type/exclude/index.d.ts +1 -0
- package/type/exclude/index.js +44 -0
- package/type/extends/extends-check.d.ts +9 -0
- package/type/extends/extends-check.js +654 -0
- package/type/extends/extends-undefined.d.ts +3 -0
- package/type/extends/extends-undefined.js +51 -0
- package/type/extends/extends.d.ts +9 -0
- package/type/extends/extends.js +47 -0
- package/type/extends/index.d.ts +3 -0
- package/type/extends/index.js +46 -0
- package/type/extract/extract.d.ts +20 -0
- package/type/extract/extract.js +54 -0
- package/type/extract/index.d.ts +1 -0
- package/type/extract/index.js +44 -0
- package/type/function/function.d.ts +17 -0
- package/type/function/function.js +43 -0
- package/type/function/index.d.ts +1 -0
- package/type/function/index.js +44 -0
- package/type/guard/index.d.ts +2 -0
- package/type/guard/index.js +32 -0
- package/type/guard/type.d.ts +130 -0
- package/type/guard/type.js +515 -0
- package/type/guard/value.d.ts +28 -0
- package/type/guard/value.js +100 -0
- package/type/helpers/helpers.d.ts +42 -0
- package/type/helpers/helpers.js +35 -0
- package/type/helpers/index.d.ts +1 -0
- package/type/helpers/index.js +44 -0
- package/type/index.d.ts +70 -0
- package/type/index.js +113 -0
- package/type/indexed/index.d.ts +3 -0
- package/type/indexed/index.js +46 -0
- package/type/indexed/indexed-key.d.ts +17 -0
- package/type/indexed/indexed-key.js +65 -0
- package/type/indexed/indexed-type.d.ts +33 -0
- package/type/indexed/indexed-type.js +106 -0
- package/type/indexed/indexed.d.ts +8 -0
- package/type/indexed/indexed.js +41 -0
- package/type/instance-type/index.d.ts +1 -0
- package/type/instance-type/index.js +44 -0
- package/type/instance-type/instance-type.d.ts +5 -0
- package/type/instance-type/instance-type.js +36 -0
- package/type/integer/index.d.ts +1 -0
- package/type/integer/index.js +44 -0
- package/type/integer/integer.d.ts +16 -0
- package/type/integer/integer.js +40 -0
- package/type/intersect/index.d.ts +1 -0
- package/type/intersect/index.js +44 -0
- package/type/intersect/intersect.d.ts +22 -0
- package/type/intersect/intersect.js +59 -0
- package/type/intrinsic/index.d.ts +1 -0
- package/type/intrinsic/index.js +44 -0
- package/type/intrinsic/intrinsic.d.ts +27 -0
- package/type/intrinsic/intrinsic.js +106 -0
- package/type/iterator/index.d.ts +1 -0
- package/type/iterator/index.js +44 -0
- package/type/iterator/iterator.d.ts +11 -0
- package/type/iterator/iterator.js +42 -0
- package/type/keyof/index.d.ts +3 -0
- package/type/keyof/index.js +46 -0
- package/type/keyof/keyof-string.d.ts +30 -0
- package/type/keyof/keyof-string.js +103 -0
- package/type/keyof/keyof-type.d.ts +11 -0
- package/type/keyof/keyof-type.js +48 -0
- package/type/keyof/keyof.d.ts +5 -0
- package/type/keyof/keyof.js +38 -0
- package/type/literal/index.d.ts +1 -0
- package/type/literal/index.js +44 -0
- package/type/literal/literal.d.ts +10 -0
- package/type/literal/literal.js +41 -0
- package/type/mapped/index.d.ts +1 -0
- package/type/mapped/index.js +44 -0
- package/type/mapped/mapped.d.ts +26 -0
- package/type/mapped/mapped.js +47 -0
- package/type/modifiers/index.d.ts +1 -0
- package/type/modifiers/index.js +44 -0
- package/type/modifiers/modifiers.d.ts +18 -0
- package/type/modifiers/modifiers.js +78 -0
- package/type/never/index.d.ts +1 -0
- package/type/never/index.js +44 -0
- package/type/never/never.d.ts +9 -0
- package/type/never/never.js +40 -0
- package/type/not/index.d.ts +1 -0
- package/type/not/index.js +44 -0
- package/type/not/not.d.ts +10 -0
- package/type/not/not.js +41 -0
- package/type/null/index.d.ts +1 -0
- package/type/null/index.js +44 -0
- package/type/null/null.d.ts +9 -0
- package/type/null/null.js +40 -0
- package/type/number/index.d.ts +1 -0
- package/type/number/index.js +44 -0
- package/type/number/number.d.ts +16 -0
- package/type/number/number.js +40 -0
- package/type/object/index.d.ts +1 -0
- package/type/object/index.js +44 -0
- package/type/object/object.d.ts +44 -0
- package/type/object/object.js +47 -0
- package/type/omit/index.d.ts +1 -0
- package/type/omit/index.js +44 -0
- package/type/omit/omit.d.ts +21 -0
- package/type/omit/omit.js +75 -0
- package/type/operators/index.d.ts +1 -0
- package/type/operators/index.js +44 -0
- package/type/operators/operators.d.ts +24 -0
- package/type/operators/operators.js +119 -0
- package/type/optional/index.d.ts +1 -0
- package/type/optional/index.js +44 -0
- package/type/optional/optional.d.ts +7 -0
- package/type/optional/optional.js +37 -0
- package/type/parameters/index.d.ts +1 -0
- package/type/parameters/index.js +44 -0
- package/type/parameters/parameters.d.ts +7 -0
- package/type/parameters/parameters.js +37 -0
- package/type/partial/index.d.ts +1 -0
- package/type/partial/index.js +44 -0
- package/type/partial/partial.d.ts +23 -0
- package/type/partial/partial.js +73 -0
- package/type/patterns/index.d.ts +1 -0
- package/type/patterns/index.js +44 -0
- package/type/patterns/patterns.d.ts +6 -0
- package/type/patterns/patterns.js +36 -0
- package/type/pick/index.d.ts +1 -0
- package/type/pick/index.js +44 -0
- package/type/pick/pick.d.ts +21 -0
- package/type/pick/pick.js +66 -0
- package/type/promise/index.d.ts +1 -0
- package/type/promise/index.js +44 -0
- package/type/promise/promise.d.ts +11 -0
- package/type/promise/promise.js +42 -0
- package/type/readonly/index.d.ts +1 -0
- package/type/readonly/index.js +44 -0
- package/type/readonly/readonly.d.ts +7 -0
- package/type/readonly/readonly.js +37 -0
- package/type/readonly-optional/index.d.ts +1 -0
- package/type/readonly-optional/index.js +44 -0
- package/type/readonly-optional/readonly-optional.d.ts +6 -0
- package/type/readonly-optional/readonly-optional.js +37 -0
- package/type/record/index.d.ts +1 -0
- package/type/record/index.js +44 -0
- package/type/record/record.d.ts +55 -0
- package/type/record/record.js +97 -0
- package/type/recursive/index.d.ts +1 -0
- package/type/recursive/index.js +44 -0
- package/type/recursive/recursive.d.ts +15 -0
- package/type/recursive/recursive.js +48 -0
- package/type/ref/index.d.ts +1 -0
- package/type/ref/index.js +44 -0
- package/type/ref/ref.d.ts +12 -0
- package/type/ref/ref.js +45 -0
- package/type/regexp/index.d.ts +1 -0
- package/type/regexp/index.js +44 -0
- package/type/regexp/regexp.d.ts +7 -0
- package/type/regexp/regexp.js +38 -0
- package/type/registry/format.d.ts +13 -0
- package/type/registry/format.js +62 -0
- package/type/registry/index.d.ts +2 -0
- package/type/registry/index.js +32 -0
- package/type/registry/type.d.ts +13 -0
- package/type/registry/type.js +62 -0
- package/type/required/index.d.ts +1 -0
- package/type/required/index.js +44 -0
- package/type/required/required.d.ts +23 -0
- package/type/required/required.js +72 -0
- package/type/rest/index.d.ts +1 -0
- package/type/rest/index.js +44 -0
- package/type/rest/rest.d.ts +10 -0
- package/type/rest/rest.js +41 -0
- package/type/return-type/index.d.ts +1 -0
- package/type/return-type/index.js +44 -0
- package/type/return-type/return-type.d.ts +5 -0
- package/type/return-type/return-type.js +36 -0
- package/type/schema/anyschema.d.ts +32 -0
- package/type/schema/anyschema.js +29 -0
- package/type/schema/index.d.ts +2 -0
- package/type/schema/index.js +45 -0
- package/type/schema/schema.d.ts +29 -0
- package/type/schema/schema.js +30 -0
- package/type/static/index.d.ts +1 -0
- package/type/static/index.js +44 -0
- package/type/static/static.d.ts +34 -0
- package/type/static/static.js +29 -0
- package/type/strict/index.d.ts +1 -0
- package/type/strict/index.js +44 -0
- package/type/strict/strict.d.ts +3 -0
- package/type/strict/strict.js +35 -0
- package/type/string/index.d.ts +1 -0
- package/type/string/index.js +44 -0
- package/type/string/string.d.ts +25 -0
- package/type/string/string.js +36 -0
- package/type/symbol/index.d.ts +1 -0
- package/type/symbol/index.js +44 -0
- package/type/symbol/symbol.d.ts +10 -0
- package/type/symbol/symbol.js +36 -0
- package/type/symbols/index.d.ts +1 -0
- package/type/symbols/index.js +44 -0
- package/type/symbols/symbols.d.ts +10 -0
- package/type/symbols/symbols.js +40 -0
- package/type/template-literal/finite.d.ts +16 -0
- package/type/template-literal/finite.js +71 -0
- package/type/template-literal/generate.d.ts +15 -0
- package/type/template-literal/generate.js +74 -0
- package/type/template-literal/index.d.ts +7 -0
- package/type/template-literal/index.js +50 -0
- package/type/template-literal/parser.d.ts +19 -0
- package/type/template-literal/parser.js +175 -0
- package/type/template-literal/pattern.d.ts +4 -0
- package/type/template-literal/pattern.js +61 -0
- package/type/template-literal/syntax.d.ts +20 -0
- package/type/template-literal/syntax.js +87 -0
- package/type/template-literal/template-literal.d.ts +30 -0
- package/type/template-literal/template-literal.js +43 -0
- package/type/template-literal/union.d.ts +7 -0
- package/type/template-literal/union.js +48 -0
- package/type/transform/index.d.ts +1 -0
- package/type/transform/index.js +44 -0
- package/type/transform/transform.d.ts +29 -0
- package/type/transform/transform.js +72 -0
- package/type/tuple/index.d.ts +1 -0
- package/type/tuple/index.js +44 -0
- package/type/tuple/tuple.d.ts +15 -0
- package/type/tuple/tuple.js +42 -0
- package/type/type/index.d.ts +6 -0
- package/type/type/index.js +44 -0
- package/type/type/javascript.d.ts +58 -0
- package/type/type/javascript.js +120 -0
- package/type/type/json.d.ts +139 -0
- package/type/type/json.js +255 -0
- package/type/type/type.d.ts +58 -0
- package/type/type/type.js +153 -0
- package/type/uint8array/index.d.ts +1 -0
- package/type/uint8array/index.js +44 -0
- package/type/uint8array/uint8array.d.ts +13 -0
- package/type/uint8array/uint8array.js +36 -0
- package/type/undefined/index.d.ts +1 -0
- package/type/undefined/index.js +44 -0
- package/type/undefined/undefined.d.ts +9 -0
- package/type/undefined/undefined.js +36 -0
- package/type/union/index.d.ts +1 -0
- package/type/union/index.js +44 -0
- package/type/union/union.d.ts +16 -0
- package/type/union/union.js +50 -0
- package/type/unknown/index.d.ts +1 -0
- package/type/unknown/index.js +44 -0
- package/type/unknown/unknown.d.ts +8 -0
- package/type/unknown/unknown.js +39 -0
- package/type/unsafe/index.d.ts +1 -0
- package/type/unsafe/index.js +44 -0
- package/type/unsafe/unsafe.d.ts +11 -0
- package/type/unsafe/unsafe.js +39 -0
- package/type/void/index.d.ts +1 -0
- package/type/void/index.js +44 -0
- package/type/void/void.d.ts +9 -0
- package/type/void/void.js +40 -0
- package/value/cast/cast.d.ts +23 -0
- package/value/{cast.js → cast/cast.js} +62 -83
- package/value/cast/index.d.ts +1 -0
- package/value/cast/index.js +44 -0
- package/value/check/check.d.ts +10 -0
- package/value/{check.js → check/check.js} +50 -45
- package/value/check/index.d.ts +1 -0
- package/value/check/index.js +44 -0
- package/value/clean/clean.d.ts +5 -0
- package/value/clean/clean.js +167 -0
- package/value/clean/index.d.ts +1 -0
- package/value/clean/index.js +44 -0
- package/value/{clone.js → clone/clone.js} +6 -6
- package/value/clone/index.d.ts +1 -0
- package/value/clone/index.js +44 -0
- package/value/convert/convert.d.ts +9 -0
- package/value/{convert.js → convert/convert.js} +93 -116
- package/value/convert/index.d.ts +1 -0
- package/value/convert/index.js +44 -0
- package/value/create/create.d.ts +31 -0
- package/value/{create.js → create/create.js} +69 -62
- package/value/create/index.d.ts +1 -0
- package/value/create/index.js +44 -0
- package/value/default/default.d.ts +5 -0
- package/value/default/default.js +175 -0
- package/value/default/index.d.ts +1 -0
- package/value/default/index.js +44 -0
- package/value/delta/delta.d.ts +41 -0
- package/value/{delta.js → delta/delta.js} +57 -53
- package/value/delta/index.d.ts +1 -0
- package/value/delta/index.js +44 -0
- package/value/{deref.d.ts → deref/deref.d.ts} +4 -2
- package/value/{deref.js → deref/deref.js} +1 -2
- package/value/deref/index.d.ts +1 -0
- package/value/deref/index.js +44 -0
- package/value/{equal.js → equal/equal.js} +14 -14
- package/value/equal/index.d.ts +1 -0
- package/value/equal/index.js +44 -0
- package/value/guard/index.d.ts +1 -0
- package/value/guard/index.js +44 -0
- package/value/{hash.d.ts → hash/hash.d.ts} +0 -13
- package/value/{hash.js → hash/hash.js} +26 -26
- package/value/hash/index.d.ts +1 -0
- package/value/hash/index.js +44 -0
- package/value/index.d.ts +17 -4
- package/value/index.js +91 -10
- package/value/mutate/index.d.ts +1 -0
- package/value/mutate/index.js +44 -0
- package/value/{mutate.d.ts → mutate/mutate.d.ts} +1 -1
- package/value/{mutate.js → mutate/mutate.js} +25 -25
- package/value/pointer/index.d.ts +1 -0
- package/value/pointer/index.js +31 -0
- package/value/pointer/pointer.d.ts +21 -0
- package/value/pointer/pointer.js +151 -0
- package/value/transform/decode.d.ts +19 -0
- package/value/transform/decode.js +211 -0
- package/value/transform/encode.d.ts +20 -0
- package/value/transform/encode.js +219 -0
- package/value/transform/has.d.ts +3 -0
- package/value/transform/has.js +146 -0
- package/value/transform/index.d.ts +3 -0
- package/value/transform/index.js +46 -0
- package/value/value/index.d.ts +1 -0
- package/value/value/index.js +31 -0
- package/value/value/value.d.ts +53 -0
- package/value/value/value.js +125 -0
- package/typebox.d.ts +0 -962
- package/typebox.js +0 -2364
- package/value/cast.d.ts +0 -24
- package/value/check.d.ts +0 -9
- package/value/convert.d.ts +0 -10
- package/value/create.d.ts +0 -30
- package/value/delta.d.ts +0 -41
- package/value/pointer.d.ts +0 -24
- package/value/pointer.js +0 -148
- package/value/transform.d.ts +0 -42
- package/value/transform.js +0 -517
- package/value/value.d.ts +0 -47
- package/value/value.js +0 -117
- /package/value/{clone.d.ts → clone/clone.d.ts} +0 -0
- /package/value/{equal.d.ts → equal/equal.d.ts} +0 -0
- /package/value/{guard.d.ts → guard/guard.d.ts} +0 -0
- /package/value/{guard.js → guard/guard.js} +0 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*--------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
@sinclair/typebox/type
|
|
5
|
+
|
|
6
|
+
The MIT License (MIT)
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2017-2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in
|
|
18
|
+
all copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
|
+
THE SOFTWARE.
|
|
27
|
+
|
|
28
|
+
---------------------------------------------------------------------------*/
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.JsonTypeBuilder = void 0;
|
|
31
|
+
const index_1 = require("../any/index");
|
|
32
|
+
const index_2 = require("../array/index");
|
|
33
|
+
const index_3 = require("../boolean/index");
|
|
34
|
+
const index_4 = require("../composite/index");
|
|
35
|
+
const index_5 = require("../const/index");
|
|
36
|
+
const index_6 = require("../deref/index");
|
|
37
|
+
const index_7 = require("../enum/index");
|
|
38
|
+
const index_8 = require("../exclude/index");
|
|
39
|
+
const index_9 = require("../extends/index");
|
|
40
|
+
const index_10 = require("../extract/index");
|
|
41
|
+
const index_11 = require("../indexed/index");
|
|
42
|
+
const index_12 = require("../integer/index");
|
|
43
|
+
const index_13 = require("../intersect/index");
|
|
44
|
+
const index_14 = require("../intrinsic/index");
|
|
45
|
+
const index_15 = require("../keyof/index");
|
|
46
|
+
const index_16 = require("../literal/index");
|
|
47
|
+
const index_17 = require("../never/index");
|
|
48
|
+
const index_18 = require("../not/index");
|
|
49
|
+
const index_19 = require("../null/index");
|
|
50
|
+
const index_20 = require("../number/index");
|
|
51
|
+
const index_21 = require("../object/index");
|
|
52
|
+
const index_22 = require("../omit/index");
|
|
53
|
+
const index_23 = require("../optional/index");
|
|
54
|
+
const index_24 = require("../partial/index");
|
|
55
|
+
const index_25 = require("../pick/index");
|
|
56
|
+
const index_26 = require("../readonly/index");
|
|
57
|
+
const index_27 = require("../readonly-optional/index");
|
|
58
|
+
const index_28 = require("../record/index");
|
|
59
|
+
const index_29 = require("../recursive/index");
|
|
60
|
+
const index_30 = require("../ref/index");
|
|
61
|
+
const index_31 = require("../required/index");
|
|
62
|
+
const index_32 = require("../rest/index");
|
|
63
|
+
const index_33 = require("../strict/index");
|
|
64
|
+
const index_34 = require("../string/index");
|
|
65
|
+
const index_35 = require("../template-literal/index");
|
|
66
|
+
const index_36 = require("../transform/index");
|
|
67
|
+
const index_37 = require("../tuple/index");
|
|
68
|
+
const index_38 = require("../union/index");
|
|
69
|
+
const index_39 = require("../unknown/index");
|
|
70
|
+
const index_40 = require("../unsafe/index");
|
|
71
|
+
/** Json Type Builder with Static Resolution for TypeScript */
|
|
72
|
+
class JsonTypeBuilder {
|
|
73
|
+
// ------------------------------------------------------------------------
|
|
74
|
+
// Strict
|
|
75
|
+
// ------------------------------------------------------------------------
|
|
76
|
+
/** `[Json]` Omits compositing symbols from this schema */
|
|
77
|
+
Strict(schema) {
|
|
78
|
+
return (0, index_33.Strict)(schema);
|
|
79
|
+
}
|
|
80
|
+
// ------------------------------------------------------------------------
|
|
81
|
+
// Modifiers
|
|
82
|
+
// ------------------------------------------------------------------------
|
|
83
|
+
/** `[Json]` Creates a Readonly and Optional property */
|
|
84
|
+
ReadonlyOptional(schema) {
|
|
85
|
+
return (0, index_27.ReadonlyOptional)(schema);
|
|
86
|
+
}
|
|
87
|
+
/** `[Json]` Creates a Readonly property */
|
|
88
|
+
Readonly(schema) {
|
|
89
|
+
return (0, index_26.Readonly)(schema);
|
|
90
|
+
}
|
|
91
|
+
/** `[Json]` Creates an Optional property */
|
|
92
|
+
Optional(schema) {
|
|
93
|
+
return (0, index_23.Optional)(schema);
|
|
94
|
+
}
|
|
95
|
+
// ------------------------------------------------------------------------
|
|
96
|
+
// Types
|
|
97
|
+
// ------------------------------------------------------------------------
|
|
98
|
+
/** `[Json]` Creates an Any type */
|
|
99
|
+
Any(options = {}) {
|
|
100
|
+
return (0, index_1.Any)(options);
|
|
101
|
+
}
|
|
102
|
+
/** `[Json]` Creates an Array type */
|
|
103
|
+
Array(schema, options = {}) {
|
|
104
|
+
return (0, index_2.Array)(schema, options);
|
|
105
|
+
}
|
|
106
|
+
/** `[Json]` Creates a Boolean type */
|
|
107
|
+
Boolean(options = {}) {
|
|
108
|
+
return (0, index_3.Boolean)(options);
|
|
109
|
+
}
|
|
110
|
+
/** `[Json]` Intrinsic function to Capitalize LiteralString types */
|
|
111
|
+
Capitalize(schema, options = {}) {
|
|
112
|
+
return (0, index_14.Capitalize)(schema, options);
|
|
113
|
+
}
|
|
114
|
+
/** `[Json]` Creates a Composite object type */
|
|
115
|
+
Composite(objects, options) {
|
|
116
|
+
return (0, index_4.Composite)(objects, options); // (error) TS 5.4.0-dev - review TComposite implementation
|
|
117
|
+
}
|
|
118
|
+
/** `[JavaScript]` Creates a readonly const type from the given value. */
|
|
119
|
+
Const(value, options = {}) {
|
|
120
|
+
return (0, index_5.Const)(value, options);
|
|
121
|
+
}
|
|
122
|
+
/** `[Json]` Creates a dereferenced type */
|
|
123
|
+
Deref(schema, references) {
|
|
124
|
+
return (0, index_6.Deref)(schema, references);
|
|
125
|
+
}
|
|
126
|
+
/** `[Json]` Creates a Enum type */
|
|
127
|
+
Enum(item, options = {}) {
|
|
128
|
+
return (0, index_7.Enum)(item, options);
|
|
129
|
+
}
|
|
130
|
+
/** `[Json]` Creates a Conditional type */
|
|
131
|
+
Extends(left, right, trueType, falseType, options = {}) {
|
|
132
|
+
return (0, index_9.Extends)(left, right, trueType, falseType, options);
|
|
133
|
+
}
|
|
134
|
+
/** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */
|
|
135
|
+
Exclude(unionType, excludedMembers, options = {}) {
|
|
136
|
+
return (0, index_8.Exclude)(unionType, excludedMembers, options);
|
|
137
|
+
}
|
|
138
|
+
/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */
|
|
139
|
+
Extract(type, union, options = {}) {
|
|
140
|
+
return (0, index_10.Extract)(type, union, options);
|
|
141
|
+
}
|
|
142
|
+
/** `[Json]` Returns an Indexed property type for the given keys */
|
|
143
|
+
Index(schema, unresolved, options = {}) {
|
|
144
|
+
return (0, index_11.Index)(schema, unresolved, options);
|
|
145
|
+
}
|
|
146
|
+
/** `[Json]` Creates an Integer type */
|
|
147
|
+
Integer(options = {}) {
|
|
148
|
+
return (0, index_12.Integer)(options);
|
|
149
|
+
}
|
|
150
|
+
/** `[Json]` Creates an Intersect type */
|
|
151
|
+
Intersect(T, options = {}) {
|
|
152
|
+
return (0, index_13.Intersect)(T, options);
|
|
153
|
+
}
|
|
154
|
+
/** `[Json]` Creates a KeyOf type */
|
|
155
|
+
KeyOf(schema, options = {}) {
|
|
156
|
+
return (0, index_15.KeyOf)(schema, options);
|
|
157
|
+
}
|
|
158
|
+
/** `[Json]` Creates a Literal type */
|
|
159
|
+
Literal(value, options = {}) {
|
|
160
|
+
return (0, index_16.Literal)(value, options);
|
|
161
|
+
}
|
|
162
|
+
/** `[Json]` Intrinsic function to Lowercase LiteralString types */
|
|
163
|
+
Lowercase(schema, options = {}) {
|
|
164
|
+
return (0, index_14.Lowercase)(schema, options);
|
|
165
|
+
}
|
|
166
|
+
/** `[Json]` Creates a Never type */
|
|
167
|
+
Never(options = {}) {
|
|
168
|
+
return (0, index_17.Never)(options);
|
|
169
|
+
}
|
|
170
|
+
/** `[Json]` Creates a Not type */
|
|
171
|
+
Not(schema, options) {
|
|
172
|
+
return (0, index_18.Not)(schema, options);
|
|
173
|
+
}
|
|
174
|
+
/** `[Json]` Creates a Null type */
|
|
175
|
+
Null(options = {}) {
|
|
176
|
+
return (0, index_19.Null)(options);
|
|
177
|
+
}
|
|
178
|
+
/** `[Json]` Creates a Number type */
|
|
179
|
+
Number(options = {}) {
|
|
180
|
+
return (0, index_20.Number)(options);
|
|
181
|
+
}
|
|
182
|
+
/** `[Json]` Creates an Object type */
|
|
183
|
+
Object(properties, options = {}) {
|
|
184
|
+
return (0, index_21.Object)(properties, options);
|
|
185
|
+
}
|
|
186
|
+
/** `[Json]` Constructs a type whose keys are omitted from the given type */
|
|
187
|
+
Omit(schema, unresolved, options = {}) {
|
|
188
|
+
return (0, index_22.Omit)(schema, unresolved, options);
|
|
189
|
+
}
|
|
190
|
+
/** `[Json]` Constructs a type where all properties are optional */
|
|
191
|
+
Partial(schema, options = {}) {
|
|
192
|
+
return (0, index_24.Partial)(schema, options);
|
|
193
|
+
}
|
|
194
|
+
/** `[Json]` Constructs a type whose keys are picked from the given type */
|
|
195
|
+
Pick(schema, unresolved, options = {}) {
|
|
196
|
+
return (0, index_25.Pick)(schema, unresolved, options);
|
|
197
|
+
}
|
|
198
|
+
/** `[Json]` Creates a Record type */
|
|
199
|
+
Record(key, schema, options = {}) {
|
|
200
|
+
return (0, index_28.Record)(key, schema);
|
|
201
|
+
}
|
|
202
|
+
/** `[Json]` Creates a Recursive type */
|
|
203
|
+
Recursive(callback, options = {}) {
|
|
204
|
+
return (0, index_29.Recursive)(callback, options);
|
|
205
|
+
}
|
|
206
|
+
/** `[Json]` Creates a Ref type. */
|
|
207
|
+
Ref(unresolved, options = {}) {
|
|
208
|
+
return (0, index_30.Ref)(unresolved, options);
|
|
209
|
+
}
|
|
210
|
+
/** `[Json]` Constructs a type where all properties are required */
|
|
211
|
+
Required(schema, options = {}) {
|
|
212
|
+
return (0, index_31.Required)(schema, options);
|
|
213
|
+
}
|
|
214
|
+
/** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */
|
|
215
|
+
Rest(schema) {
|
|
216
|
+
return (0, index_32.Rest)(schema);
|
|
217
|
+
}
|
|
218
|
+
/** `[Json]` Creates a String type */
|
|
219
|
+
String(options = {}) {
|
|
220
|
+
return (0, index_34.String)(options);
|
|
221
|
+
}
|
|
222
|
+
/** `[Json]` Creates a TemplateLiteral type */
|
|
223
|
+
TemplateLiteral(unresolved, options = {}) {
|
|
224
|
+
return (0, index_35.TemplateLiteral)(unresolved, options);
|
|
225
|
+
}
|
|
226
|
+
/** `[Json]` Creates a Transform type */
|
|
227
|
+
Transform(schema) {
|
|
228
|
+
return (0, index_36.Transform)(schema);
|
|
229
|
+
}
|
|
230
|
+
/** `[Json]` Creates a Tuple type */
|
|
231
|
+
Tuple(items, options = {}) {
|
|
232
|
+
return (0, index_37.Tuple)(items, options);
|
|
233
|
+
}
|
|
234
|
+
/** `[Json]` Intrinsic function to Uncapitalize LiteralString types */
|
|
235
|
+
Uncapitalize(schema, options = {}) {
|
|
236
|
+
return (0, index_14.Uncapitalize)(schema, options);
|
|
237
|
+
}
|
|
238
|
+
/** `[Json]` Creates a Union type */
|
|
239
|
+
Union(schemas, options = {}) {
|
|
240
|
+
return (0, index_38.Union)(schemas, options);
|
|
241
|
+
}
|
|
242
|
+
/** `[Json]` Creates an Unknown type */
|
|
243
|
+
Unknown(options = {}) {
|
|
244
|
+
return (0, index_39.Unknown)(options);
|
|
245
|
+
}
|
|
246
|
+
/** `[Json]` Creates a Unsafe type that will infers as the generic argument T */
|
|
247
|
+
Unsafe(options = {}) {
|
|
248
|
+
return (0, index_40.Unsafe)(options);
|
|
249
|
+
}
|
|
250
|
+
/** `[Json]` Intrinsic function to Uppercase LiteralString types */
|
|
251
|
+
Uppercase(schema, options = {}) {
|
|
252
|
+
return (0, index_14.Uppercase)(schema, options);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
exports.JsonTypeBuilder = JsonTypeBuilder;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export { Any } from '../any/index';
|
|
2
|
+
export { Array } from '../array/index';
|
|
3
|
+
export { AsyncIterator } from '../async-iterator/index';
|
|
4
|
+
export { Awaited } from '../awaited/index';
|
|
5
|
+
export { BigInt } from '../bigint/index';
|
|
6
|
+
export { Boolean } from '../boolean/index';
|
|
7
|
+
export { Composite } from '../composite/index';
|
|
8
|
+
export { Const } from '../const/index';
|
|
9
|
+
export { Constructor } from '../constructor/index';
|
|
10
|
+
export { ConstructorParameters } from '../constructor-parameters/index';
|
|
11
|
+
export { Date } from '../date/index';
|
|
12
|
+
export { Deref } from '../deref/index';
|
|
13
|
+
export { Enum } from '../enum/index';
|
|
14
|
+
export { Exclude } from '../exclude/index';
|
|
15
|
+
export { Extends } from '../extends/index';
|
|
16
|
+
export { Extract } from '../extract/index';
|
|
17
|
+
export { Function } from '../function/index';
|
|
18
|
+
export { Index } from '../indexed/index';
|
|
19
|
+
export { InstanceType } from '../instance-type/index';
|
|
20
|
+
export { Integer } from '../integer/index';
|
|
21
|
+
export { Intersect } from '../intersect/index';
|
|
22
|
+
export { Capitalize, Uncapitalize, Lowercase, Uppercase } from '../intrinsic/index';
|
|
23
|
+
export { Iterator } from '../iterator/index';
|
|
24
|
+
export { KeyOf } from '../keyof/index';
|
|
25
|
+
export { Literal } from '../literal/index';
|
|
26
|
+
export { Mapped } from '../mapped/index';
|
|
27
|
+
export { Never } from '../never/index';
|
|
28
|
+
export { Not } from '../not/index';
|
|
29
|
+
export { Null } from '../null/index';
|
|
30
|
+
export { Number } from '../number/index';
|
|
31
|
+
export { Object } from '../object/index';
|
|
32
|
+
export { Omit } from '../omit/index';
|
|
33
|
+
export { Optional } from '../optional/index';
|
|
34
|
+
export { Parameters } from '../parameters/index';
|
|
35
|
+
export { Partial } from '../partial/index';
|
|
36
|
+
export { Pick } from '../pick/index';
|
|
37
|
+
export { Promise } from '../promise/index';
|
|
38
|
+
export { Readonly } from '../readonly/index';
|
|
39
|
+
export { ReadonlyOptional } from '../readonly-optional/index';
|
|
40
|
+
export { Record } from '../record/index';
|
|
41
|
+
export { Recursive } from '../recursive/index';
|
|
42
|
+
export { Ref } from '../ref/index';
|
|
43
|
+
export { RegExp } from '../regexp/index';
|
|
44
|
+
export { Required } from '../required/index';
|
|
45
|
+
export { Rest } from '../rest/index';
|
|
46
|
+
export { ReturnType } from '../return-type/index';
|
|
47
|
+
export { Strict } from '../strict/index';
|
|
48
|
+
export { String } from '../string/index';
|
|
49
|
+
export { Symbol } from '../symbol/index';
|
|
50
|
+
export { TemplateLiteral } from '../template-literal/index';
|
|
51
|
+
export { Transform } from '../transform/index';
|
|
52
|
+
export { Tuple } from '../tuple/index';
|
|
53
|
+
export { Uint8Array } from '../uint8array/index';
|
|
54
|
+
export { Undefined } from '../undefined/index';
|
|
55
|
+
export { Union } from '../union/index';
|
|
56
|
+
export { Unknown } from '../unknown/index';
|
|
57
|
+
export { Unsafe } from '../unsafe/index';
|
|
58
|
+
export { Void } from '../void/index';
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*--------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
@sinclair/typebox/type
|
|
5
|
+
|
|
6
|
+
The MIT License (MIT)
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2017-2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in
|
|
18
|
+
all copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
|
+
THE SOFTWARE.
|
|
27
|
+
|
|
28
|
+
---------------------------------------------------------------------------*/
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.Strict = exports.ReturnType = exports.Rest = exports.Required = exports.RegExp = exports.Ref = exports.Recursive = exports.Record = exports.ReadonlyOptional = exports.Readonly = exports.Promise = exports.Pick = exports.Partial = exports.Parameters = exports.Optional = exports.Omit = exports.Object = exports.Number = exports.Null = exports.Not = exports.Never = exports.Mapped = exports.Literal = exports.KeyOf = exports.Iterator = exports.Uppercase = exports.Lowercase = exports.Uncapitalize = exports.Capitalize = exports.Intersect = exports.Integer = exports.InstanceType = exports.Index = exports.Function = exports.Extract = exports.Extends = exports.Exclude = exports.Enum = exports.Deref = exports.Date = exports.ConstructorParameters = exports.Constructor = exports.Const = exports.Composite = exports.Boolean = exports.BigInt = exports.Awaited = exports.AsyncIterator = exports.Array = exports.Any = void 0;
|
|
31
|
+
exports.Void = exports.Unsafe = exports.Unknown = exports.Union = exports.Undefined = exports.Uint8Array = exports.Tuple = exports.Transform = exports.TemplateLiteral = exports.Symbol = exports.String = void 0;
|
|
32
|
+
// ------------------------------------------------------------------
|
|
33
|
+
// Type: Module
|
|
34
|
+
// ------------------------------------------------------------------
|
|
35
|
+
var index_1 = require("../any/index");
|
|
36
|
+
Object.defineProperty(exports, "Any", { enumerable: true, get: function () { return index_1.Any; } });
|
|
37
|
+
var index_2 = require("../array/index");
|
|
38
|
+
Object.defineProperty(exports, "Array", { enumerable: true, get: function () { return index_2.Array; } });
|
|
39
|
+
var index_3 = require("../async-iterator/index");
|
|
40
|
+
Object.defineProperty(exports, "AsyncIterator", { enumerable: true, get: function () { return index_3.AsyncIterator; } });
|
|
41
|
+
var index_4 = require("../awaited/index");
|
|
42
|
+
Object.defineProperty(exports, "Awaited", { enumerable: true, get: function () { return index_4.Awaited; } });
|
|
43
|
+
var index_5 = require("../bigint/index");
|
|
44
|
+
Object.defineProperty(exports, "BigInt", { enumerable: true, get: function () { return index_5.BigInt; } });
|
|
45
|
+
var index_6 = require("../boolean/index");
|
|
46
|
+
Object.defineProperty(exports, "Boolean", { enumerable: true, get: function () { return index_6.Boolean; } });
|
|
47
|
+
var index_7 = require("../composite/index");
|
|
48
|
+
Object.defineProperty(exports, "Composite", { enumerable: true, get: function () { return index_7.Composite; } });
|
|
49
|
+
var index_8 = require("../const/index");
|
|
50
|
+
Object.defineProperty(exports, "Const", { enumerable: true, get: function () { return index_8.Const; } });
|
|
51
|
+
var index_9 = require("../constructor/index");
|
|
52
|
+
Object.defineProperty(exports, "Constructor", { enumerable: true, get: function () { return index_9.Constructor; } });
|
|
53
|
+
var index_10 = require("../constructor-parameters/index");
|
|
54
|
+
Object.defineProperty(exports, "ConstructorParameters", { enumerable: true, get: function () { return index_10.ConstructorParameters; } });
|
|
55
|
+
var index_11 = require("../date/index");
|
|
56
|
+
Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return index_11.Date; } });
|
|
57
|
+
var index_12 = require("../deref/index");
|
|
58
|
+
Object.defineProperty(exports, "Deref", { enumerable: true, get: function () { return index_12.Deref; } });
|
|
59
|
+
var index_13 = require("../enum/index");
|
|
60
|
+
Object.defineProperty(exports, "Enum", { enumerable: true, get: function () { return index_13.Enum; } });
|
|
61
|
+
var index_14 = require("../exclude/index");
|
|
62
|
+
Object.defineProperty(exports, "Exclude", { enumerable: true, get: function () { return index_14.Exclude; } });
|
|
63
|
+
var index_15 = require("../extends/index");
|
|
64
|
+
Object.defineProperty(exports, "Extends", { enumerable: true, get: function () { return index_15.Extends; } });
|
|
65
|
+
var index_16 = require("../extract/index");
|
|
66
|
+
Object.defineProperty(exports, "Extract", { enumerable: true, get: function () { return index_16.Extract; } });
|
|
67
|
+
var index_17 = require("../function/index");
|
|
68
|
+
Object.defineProperty(exports, "Function", { enumerable: true, get: function () { return index_17.Function; } });
|
|
69
|
+
var index_18 = require("../indexed/index");
|
|
70
|
+
Object.defineProperty(exports, "Index", { enumerable: true, get: function () { return index_18.Index; } });
|
|
71
|
+
var index_19 = require("../instance-type/index");
|
|
72
|
+
Object.defineProperty(exports, "InstanceType", { enumerable: true, get: function () { return index_19.InstanceType; } });
|
|
73
|
+
var index_20 = require("../integer/index");
|
|
74
|
+
Object.defineProperty(exports, "Integer", { enumerable: true, get: function () { return index_20.Integer; } });
|
|
75
|
+
var index_21 = require("../intersect/index");
|
|
76
|
+
Object.defineProperty(exports, "Intersect", { enumerable: true, get: function () { return index_21.Intersect; } });
|
|
77
|
+
var index_22 = require("../intrinsic/index");
|
|
78
|
+
Object.defineProperty(exports, "Capitalize", { enumerable: true, get: function () { return index_22.Capitalize; } });
|
|
79
|
+
Object.defineProperty(exports, "Uncapitalize", { enumerable: true, get: function () { return index_22.Uncapitalize; } });
|
|
80
|
+
Object.defineProperty(exports, "Lowercase", { enumerable: true, get: function () { return index_22.Lowercase; } });
|
|
81
|
+
Object.defineProperty(exports, "Uppercase", { enumerable: true, get: function () { return index_22.Uppercase; } });
|
|
82
|
+
var index_23 = require("../iterator/index");
|
|
83
|
+
Object.defineProperty(exports, "Iterator", { enumerable: true, get: function () { return index_23.Iterator; } });
|
|
84
|
+
var index_24 = require("../keyof/index");
|
|
85
|
+
Object.defineProperty(exports, "KeyOf", { enumerable: true, get: function () { return index_24.KeyOf; } });
|
|
86
|
+
var index_25 = require("../literal/index");
|
|
87
|
+
Object.defineProperty(exports, "Literal", { enumerable: true, get: function () { return index_25.Literal; } });
|
|
88
|
+
var index_26 = require("../mapped/index");
|
|
89
|
+
Object.defineProperty(exports, "Mapped", { enumerable: true, get: function () { return index_26.Mapped; } });
|
|
90
|
+
var index_27 = require("../never/index");
|
|
91
|
+
Object.defineProperty(exports, "Never", { enumerable: true, get: function () { return index_27.Never; } });
|
|
92
|
+
var index_28 = require("../not/index");
|
|
93
|
+
Object.defineProperty(exports, "Not", { enumerable: true, get: function () { return index_28.Not; } });
|
|
94
|
+
var index_29 = require("../null/index");
|
|
95
|
+
Object.defineProperty(exports, "Null", { enumerable: true, get: function () { return index_29.Null; } });
|
|
96
|
+
var index_30 = require("../number/index");
|
|
97
|
+
Object.defineProperty(exports, "Number", { enumerable: true, get: function () { return index_30.Number; } });
|
|
98
|
+
var index_31 = require("../object/index");
|
|
99
|
+
Object.defineProperty(exports, "Object", { enumerable: true, get: function () { return index_31.Object; } });
|
|
100
|
+
var index_32 = require("../omit/index");
|
|
101
|
+
Object.defineProperty(exports, "Omit", { enumerable: true, get: function () { return index_32.Omit; } });
|
|
102
|
+
var index_33 = require("../optional/index");
|
|
103
|
+
Object.defineProperty(exports, "Optional", { enumerable: true, get: function () { return index_33.Optional; } });
|
|
104
|
+
var index_34 = require("../parameters/index");
|
|
105
|
+
Object.defineProperty(exports, "Parameters", { enumerable: true, get: function () { return index_34.Parameters; } });
|
|
106
|
+
var index_35 = require("../partial/index");
|
|
107
|
+
Object.defineProperty(exports, "Partial", { enumerable: true, get: function () { return index_35.Partial; } });
|
|
108
|
+
var index_36 = require("../pick/index");
|
|
109
|
+
Object.defineProperty(exports, "Pick", { enumerable: true, get: function () { return index_36.Pick; } });
|
|
110
|
+
var index_37 = require("../promise/index");
|
|
111
|
+
Object.defineProperty(exports, "Promise", { enumerable: true, get: function () { return index_37.Promise; } });
|
|
112
|
+
var index_38 = require("../readonly/index");
|
|
113
|
+
Object.defineProperty(exports, "Readonly", { enumerable: true, get: function () { return index_38.Readonly; } });
|
|
114
|
+
var index_39 = require("../readonly-optional/index");
|
|
115
|
+
Object.defineProperty(exports, "ReadonlyOptional", { enumerable: true, get: function () { return index_39.ReadonlyOptional; } });
|
|
116
|
+
var index_40 = require("../record/index");
|
|
117
|
+
Object.defineProperty(exports, "Record", { enumerable: true, get: function () { return index_40.Record; } });
|
|
118
|
+
var index_41 = require("../recursive/index");
|
|
119
|
+
Object.defineProperty(exports, "Recursive", { enumerable: true, get: function () { return index_41.Recursive; } });
|
|
120
|
+
var index_42 = require("../ref/index");
|
|
121
|
+
Object.defineProperty(exports, "Ref", { enumerable: true, get: function () { return index_42.Ref; } });
|
|
122
|
+
var index_43 = require("../regexp/index");
|
|
123
|
+
Object.defineProperty(exports, "RegExp", { enumerable: true, get: function () { return index_43.RegExp; } });
|
|
124
|
+
var index_44 = require("../required/index");
|
|
125
|
+
Object.defineProperty(exports, "Required", { enumerable: true, get: function () { return index_44.Required; } });
|
|
126
|
+
var index_45 = require("../rest/index");
|
|
127
|
+
Object.defineProperty(exports, "Rest", { enumerable: true, get: function () { return index_45.Rest; } });
|
|
128
|
+
var index_46 = require("../return-type/index");
|
|
129
|
+
Object.defineProperty(exports, "ReturnType", { enumerable: true, get: function () { return index_46.ReturnType; } });
|
|
130
|
+
var index_47 = require("../strict/index");
|
|
131
|
+
Object.defineProperty(exports, "Strict", { enumerable: true, get: function () { return index_47.Strict; } });
|
|
132
|
+
var index_48 = require("../string/index");
|
|
133
|
+
Object.defineProperty(exports, "String", { enumerable: true, get: function () { return index_48.String; } });
|
|
134
|
+
var index_49 = require("../symbol/index");
|
|
135
|
+
Object.defineProperty(exports, "Symbol", { enumerable: true, get: function () { return index_49.Symbol; } });
|
|
136
|
+
var index_50 = require("../template-literal/index");
|
|
137
|
+
Object.defineProperty(exports, "TemplateLiteral", { enumerable: true, get: function () { return index_50.TemplateLiteral; } });
|
|
138
|
+
var index_51 = require("../transform/index");
|
|
139
|
+
Object.defineProperty(exports, "Transform", { enumerable: true, get: function () { return index_51.Transform; } });
|
|
140
|
+
var index_52 = require("../tuple/index");
|
|
141
|
+
Object.defineProperty(exports, "Tuple", { enumerable: true, get: function () { return index_52.Tuple; } });
|
|
142
|
+
var index_53 = require("../uint8array/index");
|
|
143
|
+
Object.defineProperty(exports, "Uint8Array", { enumerable: true, get: function () { return index_53.Uint8Array; } });
|
|
144
|
+
var index_54 = require("../undefined/index");
|
|
145
|
+
Object.defineProperty(exports, "Undefined", { enumerable: true, get: function () { return index_54.Undefined; } });
|
|
146
|
+
var index_55 = require("../union/index");
|
|
147
|
+
Object.defineProperty(exports, "Union", { enumerable: true, get: function () { return index_55.Union; } });
|
|
148
|
+
var index_56 = require("../unknown/index");
|
|
149
|
+
Object.defineProperty(exports, "Unknown", { enumerable: true, get: function () { return index_56.Unknown; } });
|
|
150
|
+
var index_57 = require("../unsafe/index");
|
|
151
|
+
Object.defineProperty(exports, "Unsafe", { enumerable: true, get: function () { return index_57.Unsafe; } });
|
|
152
|
+
var index_58 = require("../void/index");
|
|
153
|
+
Object.defineProperty(exports, "Void", { enumerable: true, get: function () { return index_58.Void; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './uint8array';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*--------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
@sinclair/typebox/type
|
|
5
|
+
|
|
6
|
+
The MIT License (MIT)
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2017-2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in
|
|
18
|
+
all copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
|
+
THE SOFTWARE.
|
|
27
|
+
|
|
28
|
+
---------------------------------------------------------------------------*/
|
|
29
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
30
|
+
if (k2 === undefined) k2 = k;
|
|
31
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
32
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
33
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
34
|
+
}
|
|
35
|
+
Object.defineProperty(o, k2, desc);
|
|
36
|
+
}) : (function(o, m, k, k2) {
|
|
37
|
+
if (k2 === undefined) k2 = k;
|
|
38
|
+
o[k2] = m[k];
|
|
39
|
+
}));
|
|
40
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
41
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
__exportStar(require("./uint8array"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TSchema, SchemaOptions } from '../schema/index';
|
|
2
|
+
import { Kind } from '../symbols/index';
|
|
3
|
+
export interface Uint8ArrayOptions extends SchemaOptions {
|
|
4
|
+
maxByteLength?: number;
|
|
5
|
+
minByteLength?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface TUint8Array extends TSchema, Uint8ArrayOptions {
|
|
8
|
+
[Kind]: 'Uint8Array';
|
|
9
|
+
static: Uint8Array;
|
|
10
|
+
type: 'uint8array';
|
|
11
|
+
}
|
|
12
|
+
/** `[JavaScript]` Creates a Uint8Array type */
|
|
13
|
+
export declare function Uint8Array(options?: Uint8ArrayOptions): TUint8Array;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*--------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
@sinclair/typebox/type
|
|
5
|
+
|
|
6
|
+
The MIT License (MIT)
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2017-2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in
|
|
18
|
+
all copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
|
+
THE SOFTWARE.
|
|
27
|
+
|
|
28
|
+
---------------------------------------------------------------------------*/
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.Uint8Array = void 0;
|
|
31
|
+
const index_1 = require("../symbols/index");
|
|
32
|
+
/** `[JavaScript]` Creates a Uint8Array type */
|
|
33
|
+
function Uint8Array(options = {}) {
|
|
34
|
+
return { ...options, [index_1.Kind]: 'Uint8Array', type: 'Uint8Array' };
|
|
35
|
+
}
|
|
36
|
+
exports.Uint8Array = Uint8Array;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './undefined';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*--------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
@sinclair/typebox/type
|
|
5
|
+
|
|
6
|
+
The MIT License (MIT)
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2017-2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in
|
|
18
|
+
all copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
|
+
THE SOFTWARE.
|
|
27
|
+
|
|
28
|
+
---------------------------------------------------------------------------*/
|
|
29
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
30
|
+
if (k2 === undefined) k2 = k;
|
|
31
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
32
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
33
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
34
|
+
}
|
|
35
|
+
Object.defineProperty(o, k2, desc);
|
|
36
|
+
}) : (function(o, m, k, k2) {
|
|
37
|
+
if (k2 === undefined) k2 = k;
|
|
38
|
+
o[k2] = m[k];
|
|
39
|
+
}));
|
|
40
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
41
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
__exportStar(require("./undefined"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TSchema, SchemaOptions } from '../schema/index';
|
|
2
|
+
import { Kind } from '../symbols/index';
|
|
3
|
+
export interface TUndefined extends TSchema {
|
|
4
|
+
[Kind]: 'Undefined';
|
|
5
|
+
static: undefined;
|
|
6
|
+
type: 'undefined';
|
|
7
|
+
}
|
|
8
|
+
/** `[JavaScript]` Creates a Undefined type */
|
|
9
|
+
export declare function Undefined(options?: SchemaOptions): TUndefined;
|