Files
zod/packages/treeshake/valibot-simple-object.ts
T
Colin McDonnellandGitHub 4fda7a42c9 v4.0.6 (#4941)
* 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
2025-07-23 15:31:04 -07:00

17 lines
389 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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, {});