Skip to content

Commit d583b8d

Browse files
committed
Normalize more gmail leading digit domains
1 parent 0b36e17 commit d583b8d

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ CHANGELOG
2525
become `example.com`.
2626
* Certain `.com` typos are now normalized to `.com` when `hashAddress` is
2727
used. For example, `example.cam` will become `example.com`.
28+
* Additional `gmail.com` domain names with leading digits are now
29+
normalized when `hashAddress` is used. For example, `100gmail.com` will
30+
become `gmail.com`.
2831

2932
6.0.0 (2023-12-05)
3033
------------------

src/request/email.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ describe('Email()', () => {
188188
md5: md5('[email protected]'),
189189
domain: 'example.cam',
190190
},
191+
{
192+
193+
md5: md5('[email protected]'),
194+
domain: '10000gmail.com',
195+
},
191196
];
192197

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

src/request/email.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ export default class Email implements EmailProps {
320320
/(?:\.(?:com|c[a-z]{1,2}m|co[ln]|[dsvx]o[mn]|))$/,
321321
'.com'
322322
);
323+
domain = domain.replace(/^\d+(?:gmail?\.com)$/, 'gmail.com');
323324

324325
if (Object.prototype.hasOwnProperty.call(Email.typoDomains, domain)) {
325326
domain = Email.typoDomains[domain];

0 commit comments

Comments
 (0)