Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return of getMessageBody() in IMAP.ts is not respecting the Promise #15

Open
ropinheiro opened this issue Aug 24, 2020 · 0 comments
Open

Comments

@ropinheiro
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant