Migration

Coming from Zod

Map jobs, not methods. Do not reproduce z.object in another spelling.

Zod
import { z } from 'zod'

const User = z.object({
  name: z.string().min(1),
  email: z.string().email().optional(),
})
litetype
import { string } from 'litetype'

const User = {
  name: string.min(1),
  'email?': string.email(),
}
JobZodlitetype
Objectz.object({…}){…}
Optional key.optional()'key?'
Undefined value.optional().undefinable()
Extend / pick / omitLibrary methodsSpread / property / rest
Inferz.inferInfer
ValidateSchema methodsparse, safeParse, check
Reject extras.strict()strict(shape)
Drop extrasDefaultstrip(shape)
Coercez.coerce.number()coerce.number()
Cross-field check.refine()refine(shape, pred, message)

Wrap only at the boundary

TypeScript
import { standard, string } from 'litetype'

export const User = { name: string.min(1), 'email?': string.email() }
export const UserInput = standard(User)

t.procedure.input(UserInput)

Do not port every feature. Use transforms for trim and brand, inspect issue.code instead of installing an error-map language, and skip Map, Set and Promise schemas unless your boundary genuinely receives them.