-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: email validator #8
Conversation
Downgrade because current version breaks Markdown formatting with HTML tables
@qin-guan OK now it's just a simple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spaceraccoon plz have a look too!
domain === whitelisted.domain || | ||
(whitelisted.includeSubdomains && | ||
domain.endsWith(`.${whitelisted.domain}`)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nitty: would
whitelisted.includeSubdomains ? domain.endsWith(`.${whitelisted.domain}`) : domain === whitelisted.domain
be somewhat more readable? @qin-guan thots?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spaceraccoon subtle difference in logic here: in the original, if includeSubdomains
is true, an exact match of the domain is still allowed (instead of only .${whitelisted.domain}
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think either is okay, just need to document down clearly what the expected / not expected behaviors are and maybe a comment in the code to clarify
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK will clarify the documentation + add comment!
Co-authored-by: Eugene Lim <[email protected]>
Co-authored-by: Qin Guan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor stylistic changes
Co-authored-by: Qin Guan <[email protected]>
Email validator that addresses the subdomain validation problem.