Fix for issue: #44

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-09-24 20:42:26 +01:00
parent 1c593bb6c2
commit 05c9e061dc
2 changed files with 2 additions and 1 deletions

View File

@ -24,7 +24,7 @@ function cleanNrcc(input: string) {
function getDomainFromEmail(mail: string) {
// Needs testing
let split = mail.split("@");
return split[1];
return split[1].toLowerCase();
}
module.exports = {

View File

@ -9,6 +9,7 @@ describe("Sanitize Email", () => {
"I%Have{Special}%Characters@example.com",
"Basic.address@example.com",
`"very.(),:;<>[]\".VERY.\"very\ \"very\".unusual"@example.com`,
"THIS_EMAIL_CONTAINS_CAPITALISED_DOMAIN@EXAMPLE.COM"
];
const expectedOutput = "example.com";
for (const addr of inputs) {