function parseEmail
parseEmail(email: string): ValidEmail | null

Parse and normalize a candidate email, returning the branded ValidEmail when it is valid or null otherwise. Use this in preference to isValidEmail when the validated address needs to be carried onward in a type-safe way.

Parameters

email: string

Return Type

ValidEmail | null

Usage

import { parseEmail } from "docs/email.ts";