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

Mark all function return values as nullable #47

Merged

Conversation

ZhangYiJiang
Copy link
Contributor

From the examples it seems that all functions can return null if the address is not parsable. This PR corrects the typing so that all functions are correctly marked as being able to return null

@ZhangYiJiang
Copy link
Contributor Author

This might be considered a breaking change for TypeScript users. I'm not actually sure how semvar deals with types

@svdo
Copy link

svdo commented Apr 19, 2020

Despite this being a major version increase according to semver, I hope this change can be merged and released as the types are incorrect at the moment, resulting in false compiler errors. For example, this code gives an error "expression is always true":

const emailValid = emailAddrs.parseOneAddress(email) !== null

@jackbearheart jackbearheart merged commit 3dff79e into jackbearheart:master Sep 16, 2020
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

Successfully merging this pull request may close these issues.

None yet

3 participants