newStaffLDB-API #48
@ -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 = {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user