Thanks for the package. While migrating to it, I encountered to an issue. When preprocess is used, the lib produces an invalid output. Here's demonstration:
import { serialize } from "@zod-codepen/zod-v4";
import { z } from "zod";
import { stringToArray } from "./utils.ts";
const Schema = z.object({
items: z.preprocess((val) => stringToArray(val), z.array(z.string())),
});
const code = serialize(Schema);
// Output:
const generatedCode = z.object({
items: /* transform */.pipe(z.array(z.string())),
})
Thanks for the package. While migrating to it, I encountered to an issue. When preprocess is used, the lib produces an invalid output. Here's demonstration: