Given the following Typescript blurb:
import { z, ZodType, infer as ZodInfer } from "zod";
type TransformEntry<T extends ZodType = ZodType> = {
schema: T;
transform: (value: ZodInfer<T>) => void;
};
const myEntry:TransformEntry = {
schema: z.object({
firstName: z.string()
}),
transform: (value) => {
// value resolves as any
}
}
I would like the value
property in the transform
function to resolve as an object that matches the zod schema, like {firstName:string}
, but for some reason it resolves as any
. What am I doing wrong here?