overleaf/services/web/app/coffee/Features/Helpers/EmailHelper.coffee

12 lines
231 B
CoffeeScript
Raw Normal View History

mimelib = require("mimelib")
module.exports = EmailHelper =
parseEmail: (email) ->
email = mimelib.parseAddresses(email or "")[0]?.address?.toLowerCase()
if !email? or email == ""
return null
else
return email