Capítulo 54 de 61
ZodMiniType (extending zod/v4/core's $ZodType) implements a smaller surface than full Zod's ZodType, but keeps the essentials: parsing methods, .check() for attaching checks, .register(), .brand(), and .clone() — plus, notably, no auto-loaded locale.
.parse(), .parseAsync(), .safeParse(), .safeParseAsync() all work the same way..check(...): the single mechanism for attaching checks in Mini, replacing all of Zod's individual chained methods (.min(), .refine(), .trim(), etc.). Every check function is type-safe — TypeScript rejects checks that don't apply to the schema's type.z.lt, z.lte/z.maximum, z.gt, z.gte/z.minimum, z.positive, z.negative, z.nonpositive, z.nonnegative, z.multipleOf), length/size checks (z.maxSize, z.minSize, z.size, z.maxLength, z.minLength, z.length), string checks (z.regex, z.lowercase, z.uppercase, z.includes, z.startsWith, z.endsWith), structural (z.property, z.mime), custom (z.refine, z.check — the Mini replacement for .superRefine()), mutations that don't change the inferred type (z.overwrite, z.normalize, z.trim, z.toLowerCase, z.toUpperCase), and metadata (z.meta, z.describe)..register(registry, meta): same registry-registration mechanism as full Zod..brand(tag): same branded-type mechanism as full Zod, just as a function-style call..clone(def): returns a new schema built from a given def object — useful for low-level schema manipulation.en), Zod Mini loads no locale by default, so every issue's message is the generic "Invalid input" unless you explicitly configure a locale via z.config().import * as z from "zod/mini";
const mySchema = z.string();
mySchema.parse("asdf");
await mySchema.safeParseAsync("asdf");
z.string().check(
z.minLength(5),
z.maxLength(10),
z.refine(val => val.includes("@")),
z.trim(),
);
const myReg = z.registry<{ title: string }>();
z.string().register(myReg, { title: "My cool string schema" });
const USD = z.string().brand("USD");
const mySchema2 = z.string();
mySchema2.clone(mySchema2._zod.def);
.check()-centric API alongside its other retained instance methods.z.config(en()) (or another locale), every message is the generic "Invalid input" — don't skip locale setup and then be surprised by uninformative errors..check() is Mini's universal attachment point — think of it as replacing the entire family of Zod's chained validation methods.