Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
♻️ Lowercase, remove plus from email
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Oct 27, 2020
1 parent f7697eb commit 75fc733
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/helpers/safe-email.ts
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
export const safeEmail = (email: string) => email;
/**
* Converts an email address to a unqiue, safe email
* @param email - Valid email address
*/
export const safeEmail = (input: string) => {
const [user, domain] = input.split('@');
return `${user.split('+')[0]}@${domain}`.toLowerCase();
};

0 comments on commit 75fc733

Please sign in to comment.