Compare commits

...

2 Commits

Author SHA1 Message Date
ritschwumm 9526eeb667
Merge 2cb897238c into 3a4ba01e01 2023-05-14 19:14:16 -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
1 changed files with 1 additions and 1 deletions

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 {