Skip to content

email

const email: TypedPrimitive<string>

Email address primitive. Validates against a simplified RFC 5322 pattern and returns the input lowercased for consistent storage and comparison.

Example:

email("user@example.com") // "user@example.com"
email("User@Example.COM") // "user@example.com"
email("not-an-email") // throws

Throws:

When the raw value fails this primitive’s validation.

Learn: Primitives and builders

Last updated: