Skip to content

Commit 51eb0a7

Browse files
add ip address field to email
1 parent 44bdb02 commit 51eb0a7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Email.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ export default class Email {
77
public readonly subject: string,
88
public readonly body: string,
99
public readonly html: string | null,
10-
public readonly date: number
10+
public readonly date: number,
11+
public readonly ip: string,
1112
) {}
1213

1314
}

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function checkInbox(inbox: Inbox | string, cb: (emails: Email[], err: Error | nu
5252
if(json.email === null) {
5353
return cb([], null);
5454
}
55-
const emails = json.email.map((email: Email) => new Email(email.from, email.to, email.subject, email.body, email.html, email.date));
55+
const emails = json.email.map((email: Email) => new Email(email.from, email.to, email.subject, email.body, email.html, email.date, email.ip));
5656
cb(emails, null);
5757
});
5858
}
@@ -79,7 +79,7 @@ async function checkInboxAsync(inbox: Inbox | string): Promise<Email[]> {
7979
if(json.email === null) {
8080
return [];
8181
}
82-
return json.email.map((email: Email) => new Email(email.from, email.to, email.subject, email.body, email.html, email.date));
82+
return json.email.map((email: Email) => new Email(email.from, email.to, email.subject, email.body, email.html, email.date, email.ip));
8383
}
8484

8585
export {

0 commit comments

Comments
 (0)