Files
typemap/example/index.ts
sinclairzx81 b6d6ac7e8b Revision 0.8.8 (#18)
* Reverse Syntax Mapping

* Minor Optimizations

* Documentation
2025-02-01 03:16:00 +09:00

28 lines
1.2 KiB
TypeScript

import { TypeBox, Valibot, Zod } from '@sinclair/typemap'
// Syntax Type
const S = `{
x: number,
y: number,
z: number
}`
const T = TypeBox(S) // const T: TObject<{
// x: TNumber,
// y: TNumber,
// z: TNumber
// }>
const V = Valibot(S) // const V: ObjectSchema<{
// x: NumberSchema<...>,
// y: NumberSchema<...>,
// z: NumberSchema<...>
// }, ...>
const Z = Zod(S) // const Z: ZodObject<{
// x: ZodNumber,
// y: ZodNumber,
// z: ZodNumber
// }, ...>