From 502af91eb92f49da6e740d67d370207a11c9b5b3 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Wed, 26 Oct 2016 13:44:09 -0700 Subject: [PATCH] =?UTF-8?q?fix(utils):=20Don=E2=80=99t=20overwrite=20=5F?= =?UTF-8?q?=20in=20global=20scope?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/flux/models/utils.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/flux/models/utils.coffee b/src/flux/models/utils.coffee index 515d1d78b..62954b02d 100644 --- a/src/flux/models/utils.coffee +++ b/src/flux/models/utils.coffee @@ -225,9 +225,10 @@ Utils = # to match an email address. We'd rather let false positives through. toEquivalentEmailForm: (email) -> # https://regex101.com/r/iS7kD5/3 - [_, user, domain] = /^([^+]+).*@(.+)$/gi.exec(email) + [ignored, user, domain] = /^([^+]+).*@(.+)$/gi.exec(email) || [null, "", ""] "#{user}@#{domain}".trim().toLowerCase() + emailIsEquivalent: (email1="", email2="") -> return true if email1 is email2 email1 = Utils.toEquivalentEmailForm(email1)