 sanitize = (email, options = {}) ->
-
-  email = email.trim().toLowerCase()
-
-  return switch
-    when checkGmail email then sanitizeGmail email, options
-    else email
-
-
-sanitizeGmail = (email, options = {}) ->
 
   options.excludeDots or= no
   options.excludePlus or= no

checkGmail = (email) -> /^(.)+@(gmail|googlemail).com/.test email


excludeDots = (username) -> username.replace /\./g, ''



  parts[0]  if (parts = username.split '+').length


module.exports = (email, options = {}) ->

  email = email.trim().toLowerCase()

  if checkKoding email
  then email
  else sanitize email, options
