Files
typemap/example/index.ts
2024-12-25 07:40:46 +09:00

24 lines
351 B
TypeScript

import { Box } from '@sinclair/typebox-adapter'
import * as v from 'valibot'
import * as z from 'zod'
// Valibot to TypeBox (Runtime)
const V = Box(
v.object({
x: v.number(),
y: v.number(),
z: v.number(),
}),
)
// Zod to TypeBox (Static)
const Z = Box(
z.object({
a: z.string(),
b: z.string(),
c: z.string(),
}),
)