mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-13 03:29:46 +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.
|
# to match an email address. We'd rather let false positives through.
|
||||||
toEquivalentEmailForm: (email) ->
|
toEquivalentEmailForm: (email) ->
|
||||||
# https://regex101.com/r/iS7kD5/3
|
# https://regex101.com/r/iS7kD5/3
|
||||||
[_, user, domain] = /^([^+]+).*@(.+)$/gi.exec(email)
|
[ignored, user, domain] = /^([^+]+).*@(.+)$/gi.exec(email) || [null, "", ""]
|
||||||
"#{user}@#{domain}".trim().toLowerCase()
|
"#{user}@#{domain}".trim().toLowerCase()
|
||||||
|
|
||||||
|
|
||||||
emailIsEquivalent: (email1="", email2="") ->
|
emailIsEquivalent: (email1="", email2="") ->
|
||||||
return true if email1 is email2
|
return true if email1 is email2
|
||||||
email1 = Utils.toEquivalentEmailForm(email1)
|
email1 = Utils.toEquivalentEmailForm(email1)
|
||||||
|
|
Loading…
Reference in a new issue