File tree 4 files changed +5
-26
lines changed
4 files changed +5
-26
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @devmehq/email-validator-js" ,
3
- "version" : " 1.0.18 " ,
3
+ "version" : " 1.0.19 " ,
4
4
"private" : false ,
5
5
"description" : " Advanced Email Validation with DNS MX lookup and Mailbox Verification" ,
6
6
"keywords" : [
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ function isInvalidMailboxError(smtpReply: string): boolean {
23
23
* @param {String } smtpReply A message from the SMTP server.
24
24
* @return {Boolean } True if this is a multiline greet.
25
25
*/
26
- function isMultilineGreet ( smtpReply : string ) {
26
+ function isMultilineGreet ( smtpReply : string ) : boolean {
27
27
return smtpReply && / ^ ( 2 5 0 | 2 2 0 ) - / . test ( smtpReply ) ;
28
28
}
29
29
@@ -51,9 +51,9 @@ export async function verifyMailboxSMTP(params: verifyMailBoxSMTP): Promise<bool
51
51
const ret = ( result : boolean ) => {
52
52
if ( resolved ) return ;
53
53
54
- if ( ! socket . destroyed ) {
55
- socket . write ( 'QUIT\r\n' ) ;
56
- socket . end ( ) ;
54
+ if ( ! socket ? .destroyed ) {
55
+ socket ? .write ( 'QUIT\r\n' ) ;
56
+ socket ? .end ( ) ;
57
57
}
58
58
59
59
clearTimeout ( resTimeout ) ;
@@ -64,8 +64,6 @@ export async function verifyMailboxSMTP(params: verifyMailBoxSMTP): Promise<bool
64
64
const messages = [ `HELO ${ domain } ` , `MAIL FROM: <${ local } @${ domain } >` , `RCPT TO: <${ local } @${ domain } >` ] ;
65
65
66
66
socket . on ( 'data' , ( data : string ) => {
67
- data = data . toString ( ) ;
68
-
69
67
log ( 'Mailbox: got data' , data ) ;
70
68
71
69
if ( isInvalidMailboxError ( data ) ) return ret ( false ) ;
You can’t perform that action at this time.
0 commit comments