feat(isEmail): add `host_blacklist` option by fedeci · Pull Request #1641 · validatorjs/validator.js

@fedeci

We add an option to allow the user to exclude some specific domains from isEmail validation.
Fixes #1639

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)

@codecov

tux-tn

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little suggestion, we have a similar option in isURL called host_whitelist and host_blacklist that accepts hosts and regexes. What do you think about matching that behaviour to have consistency between validators options?

@fedeci

It makes sense but I would keep the denylist instead of blacklist to use an inclusive language at least in new options.

I have nothing against blacklist and whitelist, but someone may be offended by such terms.

@tux-tn

It makes sense but I would keep the denylist instead of blacklist to use an inclusive language at least in new options.

I have nothing against blacklist and whitelist, but someone may be offended by such terms.

Project maintainer views on this matter have already been shared here #1522

@fedeci fedeci changed the title feat(isEmail): add domain_denylist option feat(isEmail): add host_blacklist option

Apr 17, 2021

@fedeci

It's always a good time to change your mind 🤷‍♂️

@fedeci

tux-tn

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉
Sorry for the long review delay, i missed the notification about new commits in this PR !

profnandaa

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@fedeci fedeci deleted the email-domain-denylist branch

October 2, 2021 23:02