chenquincy / app-info-parser

A javascript parser for parsing .ipa or .apk files. IPA/APK文件 js 解析器
MIT License
492 stars 116 forks source link

Do not bail out when parsing icon #53

Closed sunnylqm closed 3 years ago

chenquincy commented 3 years ago

@sunnylqm Your pr will make a break change, which maybe affect someone. I think provide a throwIconError option is better. Such as

parser.parse({
  throwIconError: true
})
sunnylqm commented 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?

chenquincy commented 3 years ago

@sunnylqm Yep, a new major version sounds good. I will update that soon. Thx for your job!

chenquincy commented 3 years ago

@sunnylqm v1.0.0 has been published.