fix(utils): Don’t overwrite _ in global scope

This commit is contained in:
Ben Gotow 2016-10-26 13:44:09 -07:00
parent 316933fa58
commit 502af91eb9

View file

@ -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)