From b6ec14f85f334240abbb53781e8e2f353d5b06a3 Mon Sep 17 00:00:00 2001 From: Robert DeSimone Date: Mon, 28 Nov 2016 07:58:16 -0500 Subject: [PATCH] PR-607 - Tweak to options setting for isEmail --- lib/isEmail.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/isEmail.js b/lib/isEmail.js index 19345cf1a..061d2f645 100644 --- a/lib/isEmail.js +++ b/lib/isEmail.js @@ -44,11 +44,7 @@ function isEmail(str, options) { (0, _assertString2.default)(str); options = (0, _merge2.default)(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]; @@ -90,4 +86,4 @@ function isEmail(str, options) { return true; } -module.exports = exports['default']; \ No newline at end of file +module.exports = exports['default'];