validator icon indicating copy to clipboard operation
validator copied to clipboard

Options for Email is set but not used

Open Barbapapazes opened this issue 3 years ago • 0 comments

Hello,

We are speaking about the email rules.

You say that we can use any options available in validator.js but in the code, options returned are filtered.

return {
    compiledOptions: {
        domain_specific_validation: options.domainSpecificValidation,
        allow_ip_domain: options.allowIpDomain,
        ignore_max_length: options.ignoreMaxLength,
        sanitize: sanitizationOptions,
    },
 };

So it's impossible to use an option list host_blacklist !

And here is the type

/**
 * Options to validate email
 */
export type EmailValidationOptions = {
    allowDisplayName?: boolean;
    requireDisplayName?: boolean;
    allowUtf8LocalPart?: boolean;
    requireTld?: boolean;
    ignoreMaxLength?: boolean;
    allowIpDomain?: boolean;
    domainSpecificValidation?: boolean;
    hostBlacklist?: string[];
};

Barbapapazes avatar Sep 02 '22 16:09 Barbapapazes