In the file: https://github.com/Apress/modern-full-stack-development/blob/master/mailbag/server/src/IMAP.ts
I think the code for the last line of getMessageBody() should be something like:
return parsed.text !== void 0 ? parsed.text : "";
instead of just
return parsed.text;
That's because we are promising a <string>, but parsed.text is a <string?>, causing warnings that we are not returning what we are promising, as the undefined possibility is not being covered.