mirror of
https://github.com/hanzoai/zod.git
synced 2026-09-24 17:04:49 +00:00
* Fix File reference issues. Fixes #4880. Fixes #4933. * Relax metadata constraint to object. Fixes #4929 * Clean up partialRecord implementation. Closes #4882. * Fixes catch handling in object schemas. Fixes #4883. * Add treeshake case * Document optionality changes * Fix docs build * Do not return empty metadata objects. Fixed #4885 * Escape non-string literal patterns. Closes #4894 * Surface continuable errors preferentially in unions. Fixes #4896 * Drop private modifier. Fixes #4903 * Simplify object parsing. Closes #4900 * Clean up .caught * Make message a non-getter. Closes #4901. * Standardize behavior of transform and preprocess. Closes #4910 * Clean up docs * Fix extend for recursive objects. Fixes #4931 * Make object methods work with recursive types. Closes #4931 again * Improve laziness of object methods * Make standardschema FailureResult work with prettifyError. Closes #4914. * Do not use normalized URLs by default. Add normalize flag to ZodURL. Closes #4906 * Tweak URL docs. Closes #4959 * 4.0.6
19 lines
403 B
TypeScript
19 lines
403 B
TypeScript
import * as z from "zod/mini"; // 6.57 kB
|
||
|
||
const Zod = z.object({
|
||
email: z
|
||
.string()
|
||
.check(
|
||
z.minLength(1, "Please enter your email."),
|
||
z.email("The email address is badly formatted.")
|
||
),
|
||
password: z.string()
|
||
.check(
|
||
z.minLength(1, "Please enter your password."),
|
||
z.minLength(8, "Your password must have 8 characters or more.")
|
||
),
|
||
});
|
||
|
||
|
||
Zod.parse({});
|