Closed ZhangYiJiang closed 4 years ago
This might be considered a breaking change for TypeScript users. I'm not actually sure how semvar deals with types
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
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 returnnull