mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-12 19:23:13 +08:00
fix(utils): Don’t overwrite _ in global scope
This commit is contained in:
parent
316933fa58
commit
502af91eb9
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue