typesea 0.1.0 → 0.3.0
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/CHANGELOG.md +85 -6
- package/README.md +143 -28
- package/dist/adapters/index.d.ts +50 -8
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +169 -48
- package/dist/aot/index.d.ts +19 -3
- package/dist/aot/index.d.ts.map +1 -1
- package/dist/aot/index.js +115 -17
- package/dist/async/index.d.ts +28 -56
- package/dist/async/index.d.ts.map +1 -1
- package/dist/async/index.js +94 -37
- package/dist/builders/composite.d.ts +43 -9
- package/dist/builders/composite.d.ts.map +1 -1
- package/dist/builders/composite.js +100 -17
- package/dist/builders/index.d.ts +8 -5
- package/dist/builders/index.d.ts.map +1 -1
- package/dist/builders/index.js +7 -4
- package/dist/builders/modifier.d.ts +36 -5
- package/dist/builders/modifier.d.ts.map +1 -1
- package/dist/builders/modifier.js +52 -5
- package/dist/builders/object/guard.d.ts +72 -24
- package/dist/builders/object/guard.d.ts.map +1 -1
- package/dist/builders/object/guard.js +139 -29
- package/dist/builders/object/index.d.ts +4 -2
- package/dist/builders/object/index.d.ts.map +1 -1
- package/dist/builders/object/index.js +3 -1
- package/dist/builders/object/schema.d.ts +88 -11
- package/dist/builders/object/schema.d.ts.map +1 -1
- package/dist/builders/object/schema.js +290 -23
- package/dist/builders/object/types.d.ts +20 -31
- package/dist/builders/object/types.d.ts.map +1 -1
- package/dist/builders/object/types.js +2 -0
- package/dist/builders/runtime.d.ts +40 -0
- package/dist/builders/runtime.d.ts.map +1 -0
- package/dist/builders/runtime.js +150 -0
- package/dist/builders/scalar.d.ts +49 -9
- package/dist/builders/scalar.d.ts.map +1 -1
- package/dist/builders/scalar.js +87 -9
- package/dist/builders/table.d.ts +35 -5
- package/dist/builders/table.d.ts.map +1 -1
- package/dist/builders/table.js +35 -5
- package/dist/builders/types.d.ts +20 -4
- package/dist/builders/types.d.ts.map +1 -1
- package/dist/builders/types.js +2 -0
- package/dist/compile/check-composite.d.ts +25 -2
- package/dist/compile/check-composite.d.ts.map +1 -1
- package/dist/compile/check-composite.js +699 -27
- package/dist/compile/check-scalar.d.ts +88 -0
- package/dist/compile/check-scalar.d.ts.map +1 -1
- package/dist/compile/check-scalar.js +570 -3
- package/dist/compile/check.d.ts +12 -0
- package/dist/compile/check.d.ts.map +1 -1
- package/dist/compile/check.js +62 -3
- package/dist/compile/context.d.ts +47 -9
- package/dist/compile/context.d.ts.map +1 -1
- package/dist/compile/context.js +53 -8
- package/dist/compile/first.d.ts +26 -0
- package/dist/compile/first.d.ts.map +1 -0
- package/dist/compile/first.js +850 -0
- package/dist/compile/graph-predicate.d.ts +4 -2
- package/dist/compile/graph-predicate.d.ts.map +1 -1
- package/dist/compile/graph-predicate.js +2272 -165
- package/dist/compile/guard.d.ts +16 -24
- package/dist/compile/guard.d.ts.map +1 -1
- package/dist/compile/guard.js +202 -72
- package/dist/compile/index.d.ts +3 -1
- package/dist/compile/index.d.ts.map +1 -1
- package/dist/compile/index.js +2 -0
- package/dist/compile/issue.d.ts +110 -0
- package/dist/compile/issue.d.ts.map +1 -1
- package/dist/compile/issue.js +184 -1
- package/dist/compile/names.d.ts +12 -2
- package/dist/compile/names.d.ts.map +1 -1
- package/dist/compile/names.js +19 -3
- package/dist/compile/predicate.d.ts +24 -0
- package/dist/compile/predicate.d.ts.map +1 -1
- package/dist/compile/predicate.js +287 -10
- package/dist/compile/runtime.d.ts +100 -13
- package/dist/compile/runtime.d.ts.map +1 -1
- package/dist/compile/runtime.js +56 -6
- package/dist/compile/source.d.ts +10 -2
- package/dist/compile/source.d.ts.map +1 -1
- package/dist/compile/source.js +385 -26
- package/dist/compile/types.d.ts +22 -0
- package/dist/compile/types.d.ts.map +1 -1
- package/dist/compile/types.js +2 -0
- package/dist/decoder/index.d.ts +92 -46
- package/dist/decoder/index.d.ts.map +1 -1
- package/dist/decoder/index.js +266 -39
- package/dist/evaluate/check-composite.d.ts +111 -2
- package/dist/evaluate/check-composite.d.ts.map +1 -1
- package/dist/evaluate/check-composite.js +343 -8
- package/dist/evaluate/check-scalar.d.ts +25 -0
- package/dist/evaluate/check-scalar.d.ts.map +1 -1
- package/dist/evaluate/check-scalar.js +124 -3
- package/dist/evaluate/check.d.ts +7 -0
- package/dist/evaluate/check.d.ts.map +1 -1
- package/dist/evaluate/check.js +62 -4
- package/dist/evaluate/index.d.ts +2 -0
- package/dist/evaluate/index.d.ts.map +1 -1
- package/dist/evaluate/index.js +2 -0
- package/dist/evaluate/issue.d.ts +11 -1
- package/dist/evaluate/issue.d.ts.map +1 -1
- package/dist/evaluate/issue.js +15 -1
- package/dist/evaluate/predicate.d.ts +16 -5
- package/dist/evaluate/predicate.d.ts.map +1 -1
- package/dist/evaluate/predicate.js +20 -5
- package/dist/evaluate/shared.d.ts +78 -13
- package/dist/evaluate/shared.d.ts.map +1 -1
- package/dist/evaluate/shared.js +101 -8
- package/dist/evaluate/state.d.ts +35 -13
- package/dist/evaluate/state.d.ts.map +1 -1
- package/dist/evaluate/state.js +35 -2
- package/dist/guard/array.d.ts +48 -0
- package/dist/guard/array.d.ts.map +1 -0
- package/dist/guard/array.js +84 -0
- package/dist/guard/base.d.ts +111 -31
- package/dist/guard/base.d.ts.map +1 -1
- package/dist/guard/base.js +165 -32
- package/dist/guard/date.d.ts +34 -0
- package/dist/guard/date.d.ts.map +1 -0
- package/dist/guard/date.js +60 -0
- package/dist/guard/error.d.ts +10 -5
- package/dist/guard/error.d.ts.map +1 -1
- package/dist/guard/error.js +10 -5
- package/dist/guard/index.d.ts +4 -0
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +4 -0
- package/dist/guard/number.d.ts +86 -11
- package/dist/guard/number.d.ts.map +1 -1
- package/dist/guard/number.js +159 -11
- package/dist/guard/props.d.ts +27 -3
- package/dist/guard/props.d.ts.map +1 -1
- package/dist/guard/props.js +27 -3
- package/dist/guard/read.d.ts +115 -10
- package/dist/guard/read.d.ts.map +1 -1
- package/dist/guard/read.js +185 -10
- package/dist/guard/registry.d.ts +12 -2
- package/dist/guard/registry.d.ts.map +1 -1
- package/dist/guard/registry.js +15 -3
- package/dist/guard/string.d.ts +115 -13
- package/dist/guard/string.d.ts.map +1 -1
- package/dist/guard/string.js +250 -13
- package/dist/guard/types.d.ts +110 -40
- package/dist/guard/types.d.ts.map +1 -1
- package/dist/guard/types.js +2 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/internal/index.d.ts +42 -6
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +51 -8
- package/dist/ir/builder.d.ts +17 -127
- package/dist/ir/builder.d.ts.map +1 -1
- package/dist/ir/builder.js +80 -137
- package/dist/ir/freeze.d.ts +4 -0
- package/dist/ir/freeze.d.ts.map +1 -1
- package/dist/ir/freeze.js +66 -0
- package/dist/ir/index.d.ts +3 -1
- package/dist/ir/index.d.ts.map +1 -1
- package/dist/ir/index.js +2 -0
- package/dist/ir/regexp.d.ts +2 -0
- package/dist/ir/regexp.d.ts.map +1 -1
- package/dist/ir/regexp.js +2 -0
- package/dist/ir/types.d.ts +94 -56
- package/dist/ir/types.d.ts.map +1 -1
- package/dist/ir/types.js +2 -0
- package/dist/ir/validate.d.ts +8 -1
- package/dist/ir/validate.d.ts.map +1 -1
- package/dist/ir/validate.js +511 -61
- package/dist/issue/index.d.ts +42 -10
- package/dist/issue/index.d.ts.map +1 -1
- package/dist/issue/index.js +65 -11
- package/dist/json-schema/emit-combinator.d.ts +44 -4
- package/dist/json-schema/emit-combinator.d.ts.map +1 -1
- package/dist/json-schema/emit-combinator.js +44 -4
- package/dist/json-schema/emit-composite.d.ts +16 -2
- package/dist/json-schema/emit-composite.d.ts.map +1 -1
- package/dist/json-schema/emit-composite.js +81 -13
- package/dist/json-schema/emit-scalar.d.ts +26 -3
- package/dist/json-schema/emit-scalar.d.ts.map +1 -1
- package/dist/json-schema/emit-scalar.js +124 -10
- package/dist/json-schema/emit-types.d.ts +11 -1
- package/dist/json-schema/emit-types.d.ts.map +1 -1
- package/dist/json-schema/emit-types.js +2 -0
- package/dist/json-schema/emit.d.ts +12 -1
- package/dist/json-schema/emit.d.ts.map +1 -1
- package/dist/json-schema/emit.js +23 -3
- package/dist/json-schema/freeze.d.ts +13 -2
- package/dist/json-schema/freeze.d.ts.map +1 -1
- package/dist/json-schema/freeze.js +41 -8
- package/dist/json-schema/index.d.ts +16 -2
- package/dist/json-schema/index.d.ts.map +1 -1
- package/dist/json-schema/index.js +23 -3
- package/dist/json-schema/issue.d.ts +4 -1
- package/dist/json-schema/issue.d.ts.map +1 -1
- package/dist/json-schema/issue.js +4 -1
- package/dist/json-schema/read.d.ts +24 -3
- package/dist/json-schema/read.d.ts.map +1 -1
- package/dist/json-schema/read.js +59 -12
- package/dist/json-schema/types.d.ts +45 -16
- package/dist/json-schema/types.d.ts.map +1 -1
- package/dist/json-schema/types.js +2 -0
- package/dist/kind/index.d.ts +40 -28
- package/dist/kind/index.d.ts.map +1 -1
- package/dist/kind/index.js +41 -13
- package/dist/lower/index.d.ts +6 -1
- package/dist/lower/index.d.ts.map +1 -1
- package/dist/lower/index.js +462 -46
- package/dist/message/index.d.ts +64 -10
- package/dist/message/index.d.ts.map +1 -1
- package/dist/message/index.js +155 -17
- package/dist/optimize/algebraic.d.ts +54 -0
- package/dist/optimize/algebraic.d.ts.map +1 -0
- package/dist/optimize/algebraic.js +314 -0
- package/dist/optimize/compact.d.ts +8 -1
- package/dist/optimize/compact.d.ts.map +1 -1
- package/dist/optimize/compact.js +13 -2
- package/dist/optimize/domain.d.ts +16 -0
- package/dist/optimize/domain.d.ts.map +1 -0
- package/dist/optimize/domain.js +619 -0
- package/dist/optimize/fold-boolean.d.ts +17 -2
- package/dist/optimize/fold-boolean.d.ts.map +1 -1
- package/dist/optimize/fold-boolean.js +59 -14
- package/dist/optimize/fold-common.d.ts +43 -8
- package/dist/optimize/fold-common.d.ts.map +1 -1
- package/dist/optimize/fold-common.js +37 -6
- package/dist/optimize/fold-constraints.d.ts +33 -0
- package/dist/optimize/fold-constraints.d.ts.map +1 -0
- package/dist/optimize/fold-constraints.js +484 -0
- package/dist/optimize/fold-scalar.d.ts +98 -13
- package/dist/optimize/fold-scalar.d.ts.map +1 -1
- package/dist/optimize/fold-scalar.js +98 -13
- package/dist/optimize/fold.d.ts +8 -1
- package/dist/optimize/fold.d.ts.map +1 -1
- package/dist/optimize/fold.js +22 -2
- package/dist/optimize/index.d.ts +9 -1
- package/dist/optimize/index.d.ts.map +1 -1
- package/dist/optimize/index.js +18 -3
- package/dist/optimize/map-node.d.ts +3 -1
- package/dist/optimize/map-node.d.ts.map +1 -1
- package/dist/optimize/map-node.js +48 -3
- package/dist/optimize/peephole.d.ts +16 -0
- package/dist/optimize/peephole.d.ts.map +1 -0
- package/dist/optimize/peephole.js +254 -0
- package/dist/optimize/remap.d.ts +2 -0
- package/dist/optimize/remap.d.ts.map +1 -1
- package/dist/optimize/remap.js +2 -0
- package/dist/optimize/rewrite.d.ts +13 -8
- package/dist/optimize/rewrite.d.ts.map +1 -1
- package/dist/optimize/rewrite.js +13 -8
- package/dist/plan/cache.d.ts +9 -3
- package/dist/plan/cache.d.ts.map +1 -1
- package/dist/plan/cache.js +34 -6
- package/dist/plan/index.d.ts +2 -0
- package/dist/plan/index.d.ts.map +1 -1
- package/dist/plan/index.js +2 -0
- package/dist/plan/predicate.d.ts +2 -0
- package/dist/plan/predicate.d.ts.map +1 -1
- package/dist/plan/predicate.js +298 -29
- package/dist/plan/schema-predicate.d.ts +6 -0
- package/dist/plan/schema-predicate.d.ts.map +1 -1
- package/dist/plan/schema-predicate.js +382 -19
- package/dist/plan/types.d.ts +2 -0
- package/dist/plan/types.d.ts.map +1 -1
- package/dist/plan/types.js +2 -0
- package/dist/result/index.d.ts +19 -5
- package/dist/result/index.d.ts.map +1 -1
- package/dist/result/index.js +10 -2
- package/dist/schema/common.d.ts +69 -6
- package/dist/schema/common.d.ts.map +1 -1
- package/dist/schema/common.js +104 -10
- package/dist/schema/freeze.d.ts +4 -0
- package/dist/schema/freeze.d.ts.map +1 -1
- package/dist/schema/freeze.js +40 -0
- package/dist/schema/index.d.ts +5 -2
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +4 -1
- package/dist/schema/lazy.d.ts +4 -0
- package/dist/schema/lazy.d.ts.map +1 -1
- package/dist/schema/lazy.js +4 -0
- package/dist/schema/literal.d.ts +7 -1
- package/dist/schema/literal.d.ts.map +1 -1
- package/dist/schema/literal.js +7 -1
- package/dist/schema/types.d.ts +109 -100
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/schema/types.js +13 -2
- package/dist/schema/undefined.d.ts +17 -0
- package/dist/schema/undefined.d.ts.map +1 -0
- package/dist/schema/undefined.js +77 -0
- package/dist/schema/validate.d.ts +8 -1
- package/dist/schema/validate.d.ts.map +1 -1
- package/dist/schema/validate.js +255 -57
- package/docs/api.md +128 -8
- package/docs/assets/benchmark-headline.svg +163 -0
- package/docs/engine-notes.md +62 -15
- package/docs/index.html +1340 -702
- package/docs/ko/api.md +375 -0
- package/docs/ko/engine-notes.md +156 -0
- package/docs/ko/readme.md +378 -0
- package/package.json +66 -65
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,88 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
All notable changes to TypeSea are recorded here.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- Added
|
|
5
|
+
## 0.3.0 - 2026-07-05
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added Date bounds with `t.date.min()` and `t.date.max()`.
|
|
10
|
+
- Added tuple rest support with `t.tuple([head], rest)`.
|
|
11
|
+
- Added `t.map`, `t.set`, `t.instanceOf`, `t.property`, `guard.property`, and
|
|
12
|
+
`t.json`.
|
|
13
|
+
- Added scalar aliases `t.null`, `t.undefined`, `t.void`, and presence helper
|
|
14
|
+
`t.nullish`.
|
|
15
|
+
- Added string decoder helpers `t.string.trim()`, `t.string.toLowerCase()`,
|
|
16
|
+
and `t.string.toUpperCase()`.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Hardened Date validation to use intrinsic Date reads instead of
|
|
21
|
+
user-overridable Date instance methods.
|
|
22
|
+
|
|
23
|
+
## 0.2.0 - 2026-07-04
|
|
24
|
+
|
|
25
|
+
Initial public release of TypeSea: a zero-runtime-dependency TypeScript runtime
|
|
26
|
+
narrowing library built around immutable guards, optimized Sea-of-Nodes
|
|
27
|
+
validation plans, runtime compilation, and AOT source generation.
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
|
|
31
|
+
- Added the `t` builder surface for scalar, object, strict object, array,
|
|
32
|
+
tuple, record, union, discriminated union, intersection, optional,
|
|
33
|
+
undefinedable, nullable, literal, brand, refine, lazy, unknown, and never
|
|
34
|
+
guards.
|
|
35
|
+
- Added `is()`, `check()`, and `assert()` guard APIs with explicit Result-style
|
|
36
|
+
diagnostics and frozen public outputs.
|
|
37
|
+
- Added `compile()` for runtime-generated validators and `emitAotModule()` for
|
|
38
|
+
standalone validator source.
|
|
39
|
+
- Added safe, unsafe, and unchecked compile modes. Safe mode keeps hostile-input
|
|
40
|
+
descriptor semantics by default; unsafe and unchecked modes opt into
|
|
41
|
+
trusted-data FastMode codegen.
|
|
42
|
+
- Added optimized Sea-of-Nodes validation plans, graph introspection, constant
|
|
43
|
+
folding, algebraic simplification, peephole optimization, and
|
|
44
|
+
validation-domain specialization for composite loops.
|
|
45
|
+
- Added lossless JSON Schema export with typed issues for unsupported runtime
|
|
46
|
+
semantics.
|
|
47
|
+
- Added adapters for tRPC, async tRPC-style parsers, Fastify route schemas,
|
|
48
|
+
Fastify validator compilers, and React Hook Form resolvers.
|
|
49
|
+
- Added seeded parity fuzzing across runtime plan, compiled validators, AOT
|
|
50
|
+
output, sparse arrays, accessors, symbol keys, non-enumerable extras, and
|
|
51
|
+
FastMode trusted-data invariants.
|
|
52
|
+
- Added release gates for source policy, docs validation, typechecking, linting,
|
|
53
|
+
tests, dist policy, public API drift, package contents, consumer smoke tests,
|
|
54
|
+
and benchmark smoke coverage.
|
|
55
|
+
|
|
56
|
+
### Performance
|
|
57
|
+
|
|
58
|
+
- Measured TypeSea compiled safe `is()` at `4,297,306 hz` on valid benchmark
|
|
59
|
+
objects, essentially Ajv-class throughput while keeping TypeSea's hostile
|
|
60
|
+
boundary contract.
|
|
61
|
+
- Measured TypeSea compiled unsafe `is()` at `36,297,653 hz` and unchecked
|
|
62
|
+
`is()` at `42,581,174 hz` on valid benchmark objects.
|
|
63
|
+
- Measured TypeSea compiled safe invalid `is()` at `42,080,241 hz`, ahead of
|
|
64
|
+
Ajv on the local strict-object benchmark run.
|
|
65
|
+
- Measured TypeSea compiled safe invalid `check()` at `2,086,129 hz`, with
|
|
66
|
+
unsafe and unchecked diagnostic modes at `3,077,367 hz` and `3,673,508 hz`.
|
|
67
|
+
|
|
68
|
+
### Security And Correctness
|
|
69
|
+
|
|
70
|
+
- Enforced zero runtime dependencies, strict TypeScript settings, no `any`, and
|
|
71
|
+
no expected-failure exceptions through policy gates.
|
|
72
|
+
- Kept safe validation getter-free by using property descriptors for hostile
|
|
73
|
+
boundary data.
|
|
74
|
+
- Rejected strict-object symbol and non-enumerable extras in safe mode.
|
|
75
|
+
- Fixed strict object compiled/AOT parity around own-key counting and required
|
|
76
|
+
non-enumerable properties.
|
|
77
|
+
- Fixed interpreter step-budget divergence on large valid arrays by making the
|
|
78
|
+
limit configurable and parity-covered.
|
|
79
|
+
- Fixed React Hook Form nested error output and Fastify validator compiler
|
|
80
|
+
route-part handling.
|
|
81
|
+
- Fixed unsafe optional own-`undefined` field codegen so child guard refinements
|
|
82
|
+
cannot leak between generated branches.
|
|
83
|
+
|
|
84
|
+
### Packaging
|
|
85
|
+
|
|
86
|
+
- Published as ESM-only with Node.js `>=20.19`.
|
|
87
|
+
- Added repository metadata, package export defaults, docs site checks, CI
|
|
88
|
+
matrices, Pages deployment workflow, and npm publish workflow support.
|
package/README.md
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
# TypeSea
|
|
2
2
|
|
|
3
3
|
[](https://github.com/Feralthedogg/TypeSea/actions/workflows/ci.yml)
|
|
4
|
+
[](https://badge.socket.dev/npm/package/typesea/0.3.0)
|
|
4
5
|
[](./LICENSE)
|
|
5
6
|

|
|
6
7
|

|
|
8
|
+

|
|
9
|
+

|
|
10
|
+

|
|
7
11
|

|
|
8
12
|

|
|
9
13
|
|
|
@@ -11,6 +15,19 @@
|
|
|
11
15
|
built around **immutable guards**, optimized **Sea-of-Nodes validation plans**,
|
|
12
16
|
runtime compilation, and AOT source generation.
|
|
13
17
|
|
|
18
|
+
## Benchmark Headline
|
|
19
|
+
|
|
20
|
+
Last local benchmark on 2026-07-04 KST:
|
|
21
|
+
`npm run bench -- bench/ecosystem.bench.ts --run`, strict-object contract,
|
|
22
|
+
operations per second on one machine.
|
|
23
|
+
|
|
24
|
+

|
|
25
|
+
|
|
26
|
+
TypeSea safe compiled validators are already in Ajv's boolean hot-path class
|
|
27
|
+
while keeping descriptor-based hostile-input semantics. Unsafe and unchecked
|
|
28
|
+
FastMode are the bragging-rights path for trusted normalized data: direct field
|
|
29
|
+
loads, allocation-light strict-key loops, and V8-friendly monomorphic codegen.
|
|
30
|
+
|
|
14
31
|
> Goal: not "probably valid", but **provably parity-tested validation** that
|
|
15
32
|
> never executes user code, never throws on expected failures, and never leaks
|
|
16
33
|
> mutable state across a public boundary.
|
|
@@ -76,8 +93,10 @@ import { compile, t, toJsonSchema, type Infer } from "typesea";
|
|
|
76
93
|
|
|
77
94
|
const User = t.strictObject({
|
|
78
95
|
id: t.string.uuid(),
|
|
79
|
-
|
|
80
|
-
|
|
96
|
+
email: t.string.email(),
|
|
97
|
+
age: t.number.int().nonnegative(),
|
|
98
|
+
role: t.enum(["admin", "user"]),
|
|
99
|
+
tags: t.array(t.string.min(1)).max(8)
|
|
81
100
|
});
|
|
82
101
|
|
|
83
102
|
type User = Infer<typeof User>;
|
|
@@ -101,8 +120,11 @@ const schema = toJsonSchema(User);
|
|
|
101
120
|
```
|
|
102
121
|
|
|
103
122
|
Use `is()` for the allocation-light boolean path. Use `check()` when callers
|
|
104
|
-
need immutable
|
|
105
|
-
|
|
123
|
+
need the full immutable diagnostic list, or `checkFirst()` when a hot rejection
|
|
124
|
+
path only needs one machine-readable issue. Use `compile()` or `emitAotModule()`
|
|
125
|
+
when a stable schema is hot enough to deserve generated validator code.
|
|
126
|
+
Compiled and AOT `checkFirst()` use a dedicated first-fault collector instead
|
|
127
|
+
of building the full issue list and slicing it afterward.
|
|
106
128
|
|
|
107
129
|
> [!CAUTION]
|
|
108
130
|
> `compile()` builds the validator with `new Function`, which throws under a
|
|
@@ -110,6 +132,47 @@ schema is hot enough to deserve generated validator code.
|
|
|
110
132
|
> environments, generate validator source ahead of time with
|
|
111
133
|
> `emitAotModule()` instead.
|
|
112
134
|
|
|
135
|
+
### Unsafe FastMode
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
const FastButLooseUser = compile(User, {
|
|
139
|
+
name: "isUserFast",
|
|
140
|
+
mode: "unsafe"
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
const FastTrustedShapeUser = compile(User, {
|
|
144
|
+
name: "isUserTrustedShape",
|
|
145
|
+
mode: "unchecked"
|
|
146
|
+
});
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
`compile(..., { mode: "unsafe" })` and
|
|
150
|
+
`emitAotModule(..., { mode: "unsafe" })` emit the V8-friendliest predicate
|
|
151
|
+
TypeSea can generate: required object fields are read with direct bracket
|
|
152
|
+
access, arrays and tuples use direct indexed loads, discriminants avoid
|
|
153
|
+
descriptor reads, and strict-object extras are checked with an allocation-free
|
|
154
|
+
`for...in` loop. This mode is for trusted, already-normalized data on extremely
|
|
155
|
+
hot paths.
|
|
156
|
+
|
|
157
|
+
The default is still `mode: "safe"`. Unsafe mode may execute getters, may accept
|
|
158
|
+
prototype-backed values, and strict objects do not reject symbol or
|
|
159
|
+
non-enumerable extras. Use it only when the caller owns the object graph or has
|
|
160
|
+
already normalized input into plain data records. Unsafe generated predicates
|
|
161
|
+
may also embed escaped static property keys directly in source so V8 can use
|
|
162
|
+
ordinary property-load inline caches.
|
|
163
|
+
|
|
164
|
+
`mode: "unchecked"` goes one step further: it trusts the object shape and skips
|
|
165
|
+
strict extra-key loops entirely. That is the fastest path for already-owned DTOs,
|
|
166
|
+
but strict objects no longer reject any extra keys.
|
|
167
|
+
|
|
168
|
+
In unsafe and unchecked modes, successful compiled `check()` calls return a raw
|
|
169
|
+
`{ ok: true, value }` object instead of freezing the success result. Failed
|
|
170
|
+
diagnostics are still frozen. Safe mode keeps the fully frozen Result contract.
|
|
171
|
+
FastMode diagnostic collectors also use the same trusted direct-read object
|
|
172
|
+
shape where possible, so their issue codes can be less hostile-input-specific
|
|
173
|
+
than safe mode for missing/accessor-backed fields and sparse/accessor-backed
|
|
174
|
+
array or record slots. Discriminant diagnostics also read tags directly.
|
|
175
|
+
|
|
113
176
|
---
|
|
114
177
|
|
|
115
178
|
## Presence Semantics
|
|
@@ -159,29 +222,56 @@ failed check() -> schema-aware diagnostic collector
|
|
|
159
222
|
|
|
160
223
|
## Performance Snapshot
|
|
161
224
|
|
|
162
|
-
Last local
|
|
163
|
-
`npm run
|
|
164
|
-
operations per second on one machine, not release
|
|
225
|
+
Last local benchmark on 2026-07-04 KST, using
|
|
226
|
+
`npm run bench -- bench/ecosystem.bench.ts --run` on the benchmark strict-object
|
|
227
|
+
contract. These are operations per second on one machine, not release
|
|
228
|
+
guarantees.
|
|
165
229
|
|
|
166
230
|
| Valid object path | hz |
|
|
167
231
|
| --- | ---: |
|
|
168
|
-
| TypeSea interpreted `is()` |
|
|
169
|
-
| TypeSea compiled `is()` | 4,
|
|
170
|
-
|
|
|
171
|
-
|
|
|
172
|
-
|
|
|
232
|
+
| TypeSea interpreted `is()` | 513,701 |
|
|
233
|
+
| TypeSea compiled safe `is()` | 4,297,306 |
|
|
234
|
+
| TypeSea compiled unsafe `is()` | 36,297,653 |
|
|
235
|
+
| TypeSea compiled unchecked `is()` | 42,581,174 |
|
|
236
|
+
| Zod `safeParse` | 1,343,756 |
|
|
237
|
+
| Valibot `safeParse` | 1,406,528 |
|
|
238
|
+
| Ajv compiled | 4,275,389 |
|
|
239
|
+
|
|
240
|
+
| Valid diagnostic path | hz |
|
|
241
|
+
| --- | ---: |
|
|
242
|
+
| TypeSea interpreted `check()` | 503,232 |
|
|
243
|
+
| TypeSea compiled safe `check()` | 3,903,929 |
|
|
244
|
+
| TypeSea compiled unsafe `check()` | 35,568,425 |
|
|
245
|
+
| TypeSea compiled unchecked `check()` | 40,084,605 |
|
|
246
|
+
| Zod `safeParse` | 1,355,014 |
|
|
247
|
+
| Valibot `safeParse` | 1,378,266 |
|
|
248
|
+
| Ajv compiled | 4,278,587 |
|
|
173
249
|
|
|
174
250
|
| Invalid object path | hz |
|
|
175
251
|
| --- | ---: |
|
|
176
|
-
| TypeSea interpreted `is()` | 3,
|
|
177
|
-
| TypeSea compiled `is()` |
|
|
178
|
-
|
|
|
179
|
-
|
|
|
180
|
-
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
252
|
+
| TypeSea interpreted `is()` | 3,636,369 |
|
|
253
|
+
| TypeSea compiled safe `is()` | 42,080,241 |
|
|
254
|
+
| TypeSea compiled unsafe `is()` | 49,654,076 |
|
|
255
|
+
| TypeSea compiled unchecked `is()` | 50,482,732 |
|
|
256
|
+
| Zod `safeParse` | 84,272 |
|
|
257
|
+
| Valibot `safeParse` | 878,521 |
|
|
258
|
+
| Ajv compiled | 27,820,643 |
|
|
259
|
+
|
|
260
|
+
| Invalid diagnostic path | hz |
|
|
261
|
+
| --- | ---: |
|
|
262
|
+
| TypeSea interpreted `check()` | 420,446 |
|
|
263
|
+
| TypeSea compiled safe `check()` | 2,086,129 |
|
|
264
|
+
| TypeSea compiled unsafe `check()` | 3,077,367 |
|
|
265
|
+
| TypeSea compiled unchecked `check()` | 3,673,508 |
|
|
266
|
+
| Zod `safeParse` | 79,613 |
|
|
267
|
+
| Valibot `safeParse` | 887,991 |
|
|
268
|
+
| Ajv compiled | 28,713,035 |
|
|
269
|
+
|
|
270
|
+
The safe compiled path stays close to Ajv while retaining TypeSea hostile-input
|
|
271
|
+
semantics: descriptor-based property reads, symbol/non-enumerable strict-key
|
|
272
|
+
rejection, presence semantics, immutable diagnostics, and TypeScript guard
|
|
273
|
+
inference. Unsafe and unchecked compiled modes are faster because they
|
|
274
|
+
deliberately give up parts of that hostile-input contract.
|
|
185
275
|
|
|
186
276
|
---
|
|
187
277
|
|
|
@@ -194,37 +284,57 @@ grouped under the `t` table.
|
|
|
194
284
|
|
|
195
285
|
| Area | Entry points |
|
|
196
286
|
| --- | --- |
|
|
197
|
-
| Scalar guards | `t.unknown`, `t.never`, `t.string`, `t.number`, `t.bigint`, `t.symbol`, `t.boolean` |
|
|
198
|
-
|
|
|
199
|
-
|
|
|
287
|
+
| Scalar guards | `t.unknown`, `t.never`, `t.string`, `t.number`, `t.date`, `t.bigint`, `t.symbol`, `t.boolean`, `t.null`, `t.undefined`, `t.void` |
|
|
288
|
+
| String checks | `.min`, `.max`, `.length`, `.nonempty`, `.regex`, `.startsWith`, `.endsWith`, `.includes`, `.uuid`, `.email`, `.url`, `.isoDate`, `.isoDateTime`, `.ulid`, `.ipv4`, `.ipv6` |
|
|
289
|
+
| Number checks | `.int`, `.finite`, `.safe`, `.gte`, `.lte`, `.min`, `.max`, `.gt`, `.lt`, `.multipleOf`, `.positive`, `.nonnegative`, `.negative`, `.nonpositive` |
|
|
290
|
+
| Date checks | `.min`, `.max` |
|
|
291
|
+
| Literal and containers | `t.literal`, `t.enum`, `t.array`, `t.tuple`, tuple rest, `t.record`, `t.map`, `t.set`, `t.json` |
|
|
292
|
+
| Array checks | `.min`, `.max`, `.length`, `.nonempty` |
|
|
293
|
+
| Objects | `t.object`, `t.strictObject`, `extend`, `safeExtend`, `merge`, `pick`, `omit`, `partial`, `deepPartial`, `required`, `strict`, `passthrough`, `strip`, `catchall` |
|
|
294
|
+
| Runtime object contracts | `t.instanceOf`, `t.property`, `guard.property` |
|
|
200
295
|
| Composition | `t.union`, `t.discriminatedUnion`, `t.intersect`, `guard.intersect` |
|
|
201
|
-
| Presence wrappers | `t.optional`, `t.undefinedable`, `t.nullable` |
|
|
296
|
+
| Presence wrappers | `t.optional`, `t.undefinedable`, `t.nullable`, `t.nullish` |
|
|
202
297
|
| Dynamic contracts | `t.lazy`, `t.refine` |
|
|
203
298
|
|
|
204
299
|
### Decoders
|
|
205
300
|
|
|
206
301
|
| Area | Entry points |
|
|
207
302
|
| --- | --- |
|
|
208
|
-
| Sync decoders | `t.decoder`, `t.transform`, `t.pipe`, `t.coerce` |
|
|
303
|
+
| Sync decoders | `t.decoder`, `t.transform`, `t.pipe`, `t.default`, `t.defaultValue`, `t.prefault`, `t.catch`, `t.codec`, `t.coerce`, `t.string.trim()`, `t.string.toLowerCase()`, `t.string.toUpperCase()` |
|
|
209
304
|
| Async decoders | `t.asyncDecoder`, `t.asyncRefine`, `t.asyncTransform`, `t.asyncPipe` |
|
|
210
305
|
|
|
211
306
|
### Execution & Export
|
|
212
307
|
|
|
213
308
|
| Area | Entry points |
|
|
214
309
|
| --- | --- |
|
|
215
|
-
| Guard methods | `guard.is()`, `guard.check()`, `guard.graph()` |
|
|
310
|
+
| Guard methods | `guard.is()`, `guard.check()`, `guard.checkFirst()`, `guard.graph()` |
|
|
216
311
|
| Generated validators | `compile`, `emitAotModule` |
|
|
217
312
|
| JSON Schema | `toJsonSchema` |
|
|
313
|
+
| Messages | `formatIssue`, `formatIssues`, `flattenIssues`, `withMessages` |
|
|
218
314
|
|
|
219
315
|
### Messages & Adapters
|
|
220
316
|
|
|
221
317
|
| Area | Entry points |
|
|
222
318
|
| --- | --- |
|
|
223
|
-
| Messages / i18n | `formatIssue`, `formatIssues`, `withMessages`, `defineMessages` |
|
|
319
|
+
| Messages / i18n | `formatIssue`, `formatIssues`, `flattenIssues`, `withMessages`, `defineMessages` |
|
|
224
320
|
| tRPC | `toTrpcParser`, `toAsyncTrpcParser` |
|
|
225
321
|
| Fastify | `toFastifyRouteSchema`, `toFastifyValidatorCompiler` |
|
|
226
322
|
| React Hook Form | `toReactHookFormResolver` |
|
|
227
323
|
|
|
324
|
+
Adapters accept compiled guards too. Compile once at startup, then pass the
|
|
325
|
+
compiled guard into parser or validator-compiler adapters so framework hot paths
|
|
326
|
+
reuse the generated predicate.
|
|
327
|
+
|
|
328
|
+
```ts
|
|
329
|
+
const FastUser = compile(User);
|
|
330
|
+
const trpcParser = toTrpcParser(FastUser);
|
|
331
|
+
const fastifyCompiler = toFastifyValidatorCompiler(FastUser);
|
|
332
|
+
|
|
333
|
+
// Trusted normalized data only: trades hostile-input hardening for direct reads.
|
|
334
|
+
const UnsafeUser = compile(User, { mode: "unsafe" });
|
|
335
|
+
const internalParser = toTrpcParser(UnsafeUser);
|
|
336
|
+
```
|
|
337
|
+
|
|
228
338
|
> [!TIP]
|
|
229
339
|
> Match the inference alias to the source kind: `Infer<>` for guards,
|
|
230
340
|
> `InferDecoder<>` for decoders, `InferAsyncDecoder<>` for async decoders.
|
|
@@ -245,6 +355,11 @@ Deliberate, documented, and pinned by tests:
|
|
|
245
355
|
| `__proto__`, `constructor` keys | validated as plain own keys, no pollution |
|
|
246
356
|
| Sparse array holes | read as `undefined` without executing accessors |
|
|
247
357
|
| Strict object extras | rejected via `Reflect.ownKeys` — including symbol keys and non-enumerable properties |
|
|
358
|
+
| `catchall` extras | unknown own keys are descriptor-read and validated by the catchall schema |
|
|
359
|
+
| `strip()` | validation-only alias for accepting extras; TypeSea does not clone stripped output |
|
|
360
|
+
| `t.date` | accepts valid JavaScript `Date` objects; `.min` and `.max` compare epoch milliseconds without reading user-overridable Date methods |
|
|
361
|
+
| `t.map`, `t.set`, `t.instanceOf` | runtime-only contracts; JSON Schema and AOT export reject them instead of weakening semantics |
|
|
362
|
+
| `property` | validates own data properties only; getter-backed properties are rejected |
|
|
248
363
|
| Global-flag regexes | cloned at construction; `lastIndex` reset before every test |
|
|
249
364
|
| UUID | accepts RFC 9562 versions 1–8 plus the nil UUID |
|
|
250
365
|
| Cyclic input values | validate finitely via (value × schema) active-pair tracking |
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -6,30 +6,42 @@ import type { Result } from "../result/index.js";
|
|
|
6
6
|
import { type JsonSchema, type JsonSchemaDialect, type JsonSchemaExportIssue } from "../json-schema/index.js";
|
|
7
7
|
/**
|
|
8
8
|
* @brief sync adapter source.
|
|
9
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
10
|
+
* adding framework dependencies.
|
|
9
11
|
*/
|
|
10
12
|
export type SyncAdapterSource = DecodeSource;
|
|
11
13
|
/**
|
|
12
14
|
* @brief infer sync adapter.
|
|
15
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
16
|
+
* adding framework dependencies.
|
|
13
17
|
*/
|
|
14
18
|
export type InferSyncAdapter<TSource> = InferDecoder<TSource>;
|
|
15
19
|
/**
|
|
16
20
|
* @brief infer adapter.
|
|
21
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
22
|
+
* adding framework dependencies.
|
|
17
23
|
*/
|
|
18
24
|
export type InferAdapter<TSource> = InferAsyncDecoder<TSource>;
|
|
19
25
|
/**
|
|
20
26
|
* @brief trpc parser.
|
|
27
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
28
|
+
* adding framework dependencies.
|
|
21
29
|
*/
|
|
22
30
|
export interface TrpcParser<TValue> {
|
|
23
31
|
readonly parse: (value: unknown) => TValue;
|
|
24
32
|
}
|
|
25
33
|
/**
|
|
26
34
|
* @brief async trpc parser.
|
|
35
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
36
|
+
* adding framework dependencies.
|
|
27
37
|
*/
|
|
28
38
|
export interface AsyncTrpcParser<TValue> {
|
|
29
39
|
readonly parseAsync: (value: unknown) => Promise<TValue>;
|
|
30
40
|
}
|
|
31
41
|
/**
|
|
32
42
|
* @brief fastify route schema.
|
|
43
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
44
|
+
* adding framework dependencies.
|
|
33
45
|
*/
|
|
34
46
|
export interface FastifyRouteSchema {
|
|
35
47
|
readonly body?: JsonSchema;
|
|
@@ -40,28 +52,34 @@ export interface FastifyRouteSchema {
|
|
|
40
52
|
}
|
|
41
53
|
/**
|
|
42
54
|
* @brief fastify http part.
|
|
55
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
56
|
+
* adding framework dependencies.
|
|
43
57
|
*/
|
|
44
58
|
export type FastifyHttpPart = "body" | "querystring" | "params" | "headers";
|
|
45
59
|
/**
|
|
46
60
|
* @brief fastify route schema options.
|
|
61
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
62
|
+
* adding framework dependencies.
|
|
47
63
|
*/
|
|
48
64
|
export interface FastifyRouteSchemaOptions {
|
|
49
65
|
readonly part: FastifyHttpPart;
|
|
50
66
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
67
|
+
* @brief schema id.
|
|
68
|
+
* @details Forwards a concrete `$schema` marker to the JSON Schema exporter.
|
|
69
|
+
* @invariant When omitted, TypeSea emits its conservative default dialect marker.
|
|
70
|
+
*/
|
|
55
71
|
readonly schemaId?: string;
|
|
56
72
|
/**
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
73
|
+
* @brief dialect.
|
|
74
|
+
* @details Selects the JSON Schema keyword set used by generated route schemas.
|
|
75
|
+
* @invariant Tuple schemas remain validator-visible for the selected dialect.
|
|
76
|
+
*/
|
|
61
77
|
readonly dialect?: JsonSchemaDialect;
|
|
62
78
|
}
|
|
63
79
|
/**
|
|
64
80
|
* @brief fastify validator route.
|
|
81
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
82
|
+
* adding framework dependencies.
|
|
65
83
|
*/
|
|
66
84
|
export interface FastifyValidatorRoute {
|
|
67
85
|
readonly schema: unknown;
|
|
@@ -71,6 +89,8 @@ export interface FastifyValidatorRoute {
|
|
|
71
89
|
}
|
|
72
90
|
/**
|
|
73
91
|
* @brief fastify validation result.
|
|
92
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
93
|
+
* adding framework dependencies.
|
|
74
94
|
*/
|
|
75
95
|
export type FastifyValidationResult = {
|
|
76
96
|
readonly value: unknown;
|
|
@@ -79,10 +99,14 @@ export type FastifyValidationResult = {
|
|
|
79
99
|
};
|
|
80
100
|
/**
|
|
81
101
|
* @brief fastify validator.
|
|
102
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
103
|
+
* adding framework dependencies.
|
|
82
104
|
*/
|
|
83
105
|
export type FastifyValidator = (value: unknown) => FastifyValidationResult;
|
|
84
106
|
/**
|
|
85
107
|
* @brief fastify validator compiler.
|
|
108
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
109
|
+
* adding framework dependencies.
|
|
86
110
|
*/
|
|
87
111
|
export type FastifyValidatorCompiler = (route: FastifyValidatorRoute) => FastifyValidator;
|
|
88
112
|
/**
|
|
@@ -99,6 +123,8 @@ export type FastifyValidatorCompilerSourceMap = Readonly<Partial<Record<FastifyH
|
|
|
99
123
|
export type FastifyValidatorCompilerSource = SyncAdapterSource | FastifyValidatorCompilerSourceMap;
|
|
100
124
|
/**
|
|
101
125
|
* @brief react hook form field error.
|
|
126
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
127
|
+
* adding framework dependencies.
|
|
102
128
|
*/
|
|
103
129
|
export interface ReactHookFormFieldError {
|
|
104
130
|
readonly type: string;
|
|
@@ -114,6 +140,8 @@ export interface ReactHookFormErrors {
|
|
|
114
140
|
}
|
|
115
141
|
/**
|
|
116
142
|
* @brief react hook form resolver result.
|
|
143
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
144
|
+
* adding framework dependencies.
|
|
117
145
|
*/
|
|
118
146
|
export interface ReactHookFormResolverResult<TValue> {
|
|
119
147
|
readonly values: TValue | Readonly<Record<string, never>>;
|
|
@@ -121,32 +149,46 @@ export interface ReactHookFormResolverResult<TValue> {
|
|
|
121
149
|
}
|
|
122
150
|
/**
|
|
123
151
|
* @brief react hook form resolver.
|
|
152
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
153
|
+
* adding framework dependencies.
|
|
124
154
|
*/
|
|
125
155
|
export type ReactHookFormResolver<TValue> = (values: unknown, context: unknown, options: unknown) => Promise<ReactHookFormResolverResult<TValue>>;
|
|
126
156
|
/**
|
|
127
157
|
* @brief react hook form resolver options.
|
|
158
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
159
|
+
* adding framework dependencies.
|
|
128
160
|
*/
|
|
129
161
|
export interface ReactHookFormResolverOptions {
|
|
130
162
|
readonly messages: Partial<IssueMessageOptions> | undefined;
|
|
131
163
|
}
|
|
132
164
|
/**
|
|
133
165
|
* @brief to trpc parser.
|
|
166
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
167
|
+
* adding framework dependencies.
|
|
134
168
|
*/
|
|
135
169
|
export declare function toTrpcParser<TSource extends SyncAdapterSource>(source: TSource): TrpcParser<InferSyncAdapter<TSource>>;
|
|
136
170
|
/**
|
|
137
171
|
* @brief to async trpc parser.
|
|
172
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
173
|
+
* adding framework dependencies.
|
|
138
174
|
*/
|
|
139
175
|
export declare function toAsyncTrpcParser<TSource extends AsyncDecodeSource>(source: TSource): AsyncTrpcParser<InferAdapter<TSource>>;
|
|
140
176
|
/**
|
|
141
177
|
* @brief to fastify route schema.
|
|
178
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
179
|
+
* adding framework dependencies.
|
|
142
180
|
*/
|
|
143
181
|
export declare function toFastifyRouteSchema(guard: Guard<unknown, Presence>, options?: Partial<FastifyRouteSchemaOptions>): Result<FastifyRouteSchema, readonly JsonSchemaExportIssue[]>;
|
|
144
182
|
/**
|
|
145
183
|
* @brief to fastify validator compiler.
|
|
184
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
185
|
+
* adding framework dependencies.
|
|
146
186
|
*/
|
|
147
187
|
export declare function toFastifyValidatorCompiler(source: FastifyValidatorCompilerSource): FastifyValidatorCompiler;
|
|
148
188
|
/**
|
|
149
189
|
* @brief to react hook form resolver.
|
|
190
|
+
* @details Adapter shapes stay local so TypeSea diagnostics can be translated without
|
|
191
|
+
* adding framework dependencies.
|
|
150
192
|
*/
|
|
151
193
|
export declare function toReactHookFormResolver<TSource extends AsyncDecodeSource>(source: TSource, options?: Partial<ReactHookFormResolverOptions>): ReactHookFormResolver<InferAdapter<TSource>>;
|
|
152
194
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,iBAAiB,EAEtB,KAAK,iBAAiB,EAEzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,KAAK,YAAY,EACjB,KAAK,YAAY,EAEpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,qBAAqB,EACrB,KAAK,KAAK,EACV,KAAK,QAAQ,EAChB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAEH,KAAK,mBAAmB,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,MAA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