Closed sunnylqm closed 3 years ago
I think a better way is to make a major version bump. Since the parsed result is a complex object, it is normal that some properties may be null/undefined and they should be noted both in doc and type declarations. Any uncertain property should be checked before use, which is common in javascript. If we use errors and even give an option in this parsing process, it won't be helpful in any way. Do we need different errors for different possible missing properties? No matter how we try/catch, in the end we still need to check before use right?
@sunnylqm Yep, a new major version sounds good. I will update that soon. Thx for your job!
@sunnylqm v1.0.0 has been published.
@sunnylqm Your pr will make a break change, which maybe affect someone. I think provide a
throwIconError
option is better. Such as