Skip to content

Commit 712cd28

Browse files
committed
Remove periods from gmail.com local parts
1 parent dba4f5a commit 712cd28

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ CHANGELOG
77
* Added `PxpFinancial` and `Trustpay` to the `Processor` enum.
88
* Equivalent domain names are now normalized when `hashAddress` is used.
99
For example, `googlemail.com` will become `gmail.com`.
10+
* Periods are now removed from `gmail.com` email address local parts when
11+
`hashAddress` is used. For example, `[email protected]` will become
12+
1013

1114
6.0.0 (2023-12-05)
1215
------------------

src/request/email.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ describe('Email()', () => {
153153
md5: md5('[email protected]'),
154154
domain: 'googlemail.com',
155155
},
156+
{
157+
158+
md5: md5('[email protected]'),
159+
domain: 'gmail.com',
160+
},
156161
];
157162

158163
test.each(normalizeTests)('%p', (arg) => {

src/request/email.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ export default class Email implements EmailProps {
102102
localPart = localPart.substring(0, separatorIndex);
103103
}
104104

105+
if (domain === 'gmail.com') {
106+
localPart = localPart.replace(/\./g, '');
107+
}
108+
105109
return localPart + '@' + domain;
106110
}
107111

0 commit comments

Comments
 (0)