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
17 lines
389 B
TypeScript
17 lines
389 B
TypeScript
import * as v from "valibot"; // 1.37 kB
|
||
|
||
const Valibot = v.object({
|
||
email: v.pipe(
|
||
v.string(),
|
||
v.nonEmpty("Please enter your email."),
|
||
v.email("The email address is badly formatted.")
|
||
),
|
||
password: v.pipe(
|
||
v.string(),
|
||
v.nonEmpty("Please enter your password."),
|
||
v.minLength(8, "Your password must have 8 characters or more.")
|
||
),
|
||
});
|
||
|
||
v.parse(Valibot, {});
|