Skip to content

Home > @opengovsg/validators > EmailValidatorOptions

EmailValidatorOptions interface ​

The options to use for email validation.

Signature:

typescript
export interface EmailValidatorOptions

Properties ​

PropertyModifiersTypeDescription
domains?{ domain: string; includeSubdomains?: boolean; }[]

(Optional) The list of allowed domains for the domain part of the email address. If not provided, all domains are allowed.

Each whitelisted domain must be specified as an object with the domain and includeSubdomains properties. By default, includeSubdomains is false, meaning only the exact domain is allowed. If includeSubdomains is true, all subdomains of the domain are also allowed.