Open mdss-single opened 5 months ago
For your expected behaviour you need to add option "ignore_max_length" with value "true"
// After add {gnore_max_length: true} :
const email = test@1234567890123456789012345678901234567890123456789012345678901234.com;
console.log(validator.isEmail(email, {require_tld: false, ignore_max_length: true})); // => true
For your expected behaviour you need to add option "ignore_max_length" with value "true"
// After add {gnore_max_length: true} : const email = test@1234567890123456789012345678901234567890123456789012345678901234.com; console.log(validator.isEmail(email, {require_tld: false, ignore_max_length: true})); // => true
In this case, that part of the code would be unreachable. My main idea is to validate the email according to the RFC standard, but with any configuration, it is impossible
if (options.ignore_max_length === false && (
!isByteLength(user, { max: 64 }) ||
!isByteLength(domain, { max: 254 }))
) {
return false;
}
Describe the bug The email is invalid if domain part is bigger than 63 symbols
Examples
Additional context Validator.js version: 13.12.0 Node.js version: 18.18.0 OS platform: macOS