Skip to content

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

@ropinheiro

Description

@ropinheiro

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions