Compare commits

...

4 Commits

Author SHA1 Message Date
ritschwumm e786031372
Merge 2cb897238c into fc175932f6 2023-09-11 20:19:10 -06:00
eleith fc175932f6
Merge pull request #342 from eleith/eleith-timeout-type
prepare more fine grained type for node 20
2023-09-05 20:45:34 -07:00
eleith e11fac696b prepare more fine grained type for node 20
fixes #341
2023-09-05 20:42:19 -07:00
ritschwumm 2cb897238c
allow exactOptionalPropertyTypes in tsc 4.8.4
this leaves out the name property AddressObject instead of setting it to undefined.

typescript 4.4 has a new check exactOptionalPropertyTypes which prevents accidentally confounding a missing property with a property which does exist, but has a value of undefined.

for maximum type safety, i'd like to keep this enabled in my project - but if i do, tsc complains about emailjs being imprecise about its types.
2022-10-11 13:58:45 +02:00
4 changed files with 4 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{
"name": "emailjs",
"description": "send text/html emails and attachments (files, streams and strings) from node.js to any smtp server",
"version": "4.0.2",
"version": "4.0.3",
"author": "eleith",
"contributors": [
"izuzak",

View File

@ -130,7 +130,7 @@ function convertAddressTokens(tokens: AddressToken[]) {
// http://tools.ietf.org/html/rfc2822#appendix-A.1.3
if (isGroup) {
addressObjects.push({
name: texts.length === 0 ? undefined : texts.join(' '),
...(texts.length === 0 ? {} : { name: texts.join(' ') }),
group: groups.length > 0 ? addressparser(groups.join(',')) : [],
});
} else {

View File

@ -30,7 +30,7 @@ export class SMTPClient {
protected sending = false;
protected ready = false;
protected timer: NodeJS.Timer | null = null;
protected timer: NodeJS.Timeout | null = null;
/**
* Create a standard SMTP client backed by a self-managed SMTP connection.