mirror of https://github.com/eleith/emailjs.git
chore: fix nits
This commit is contained in:
parent
8503c7f63a
commit
8706678fbc
|
@ -163,7 +163,7 @@ export class Message {
|
|||
this.header.subject = mimeWordEncode(headers.subject as string);
|
||||
} else if (/^(cc|bcc|to|from)/i.test(header)) {
|
||||
this.header[header.toLowerCase()] = convertPersonToAddress(
|
||||
headers[header] as string | string[]
|
||||
headers[header as 'cc' | 'bcc' | 'to' | 'from'] ?? ''
|
||||
);
|
||||
} else {
|
||||
// allow any headers the user wants to set??
|
||||
|
|
|
@ -17,7 +17,7 @@ function connect({
|
|||
return new Promise<void>((resolve, reject) => {
|
||||
const server = new SMTPServer({
|
||||
authMethods,
|
||||
secure: secure,
|
||||
secure,
|
||||
onAuth(auth, _session, callback) {
|
||||
const { accessToken, method, username, password } = auth;
|
||||
if (
|
||||
|
|
|
@ -84,23 +84,18 @@ test('synchronous queue failures are handled gracefully by client', async (t) =>
|
|||
})
|
||||
);
|
||||
|
||||
// @ts-expect-error need to check protected prop
|
||||
const { ready, sending, smtp } = tlsClient;
|
||||
const state = smtp.state();
|
||||
|
||||
t.log(
|
||||
`SMTPClient ${JSON.stringify(
|
||||
{
|
||||
// @ts-expect-error need to check protected prop
|
||||
ready: tlsClient.ready,
|
||||
// @ts-expect-error need to check protected prop
|
||||
sending: tlsClient.sending,
|
||||
state: tlsClient.smtp.state(),
|
||||
},
|
||||
null,
|
||||
'\t'
|
||||
).replace(/"/g, '')}`
|
||||
`SMTPClient ${JSON.stringify({ ready, sending, state }, null, '\t').replace(
|
||||
/"/g,
|
||||
''
|
||||
)}`
|
||||
);
|
||||
|
||||
// @ts-expect-error need to check protected prop
|
||||
t.false(tlsClient.ready);
|
||||
// @ts-expect-error need to check protected prop
|
||||
t.false(tlsClient.sending);
|
||||
t.is(tlsClient.smtp.state(), 0);
|
||||
t.false(ready);
|
||||
t.false(sending);
|
||||
t.is(state, 0);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue