feat: Add plus address check to /v1/verify
This commit is contained in:
@@ -7,6 +7,7 @@ export interface EmailVerificationResult {
|
|||||||
valid: boolean;
|
valid: boolean;
|
||||||
isDisposable: boolean;
|
isDisposable: boolean;
|
||||||
isTypo: boolean;
|
isTypo: boolean;
|
||||||
|
isPlusAddressed: boolean;
|
||||||
domainExists: boolean;
|
domainExists: boolean;
|
||||||
hasMxRecords: boolean;
|
hasMxRecords: boolean;
|
||||||
suggestedEmail?: string;
|
suggestedEmail?: string;
|
||||||
@@ -27,6 +28,7 @@ export class EmailVerificationService {
|
|||||||
valid: true,
|
valid: true,
|
||||||
isDisposable: false,
|
isDisposable: false,
|
||||||
isTypo: false,
|
isTypo: false,
|
||||||
|
isPlusAddressed: false,
|
||||||
domainExists: false,
|
domainExists: false,
|
||||||
hasMxRecords: false,
|
hasMxRecords: false,
|
||||||
reasons: [],
|
reasons: [],
|
||||||
@@ -46,6 +48,9 @@ export class EmailVerificationService {
|
|||||||
// MailChecker.isValid returns false for disposable emails
|
// MailChecker.isValid returns false for disposable emails
|
||||||
result.isDisposable = disposable.validate(domain);
|
result.isDisposable = disposable.validate(domain);
|
||||||
|
|
||||||
|
// Check for plus addressing
|
||||||
|
result.isPlusAddressed = emailParts[0]!.includes('+');
|
||||||
|
|
||||||
// Check for common typos and suggest corrections
|
// Check for common typos and suggest corrections
|
||||||
const typoCheck = run({email});
|
const typoCheck = run({email});
|
||||||
if (typoCheck && typoCheck.address && typoCheck.address !== email) {
|
if (typoCheck && typoCheck.address && typoCheck.address !== email) {
|
||||||
|
|||||||
Reference in New Issue
Block a user