Skip to content

Commit

Permalink
Additional stuff for #607
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso committed Nov 28, 2016
1 parent 19bd81b commit 69f63bd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#### HEAD
- Added an option to require an email display name
([#607](https://github.com/chriso/validator.js/pull/607))
- Added support for `lt` and `gt` to `isInt()`
([#588](https://github.com/chriso/validator.js/pull/588))
- New locales
Expand Down
2 changes: 1 addition & 1 deletion lib/isEmail.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ function isEmail(str, options) {

return true;
}
module.exports = exports['default'];
module.exports = exports['default'];
6 changes: 1 addition & 5 deletions src/lib/isEmail.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ export default function isEmail(str, options) {
assertString(str);
options = merge(options, default_email_options);

if (options.require_display_name) {
options.allow_display_name = true;
}

if (options.allow_display_name) {
if (options.require_display_name || options.allow_display_name) {
const display_email = str.match(displayName);
if (display_email) {
str = display_email[1];
Expand Down
6 changes: 1 addition & 5 deletions validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,7 @@
assertString(str);
options = merge(options, default_email_options);

if (options.require_display_name) {
options.allow_display_name = true;
}

if (options.allow_display_name) {
if (options.require_display_name || options.allow_display_name) {
var display_email = str.match(displayName);
if (display_email) {
str = display_email[1];
Expand Down
Loading

0 comments on commit 69f63bd

Please sign in to comment.