-
Notifications
You must be signed in to change notification settings - Fork 98
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
feat: omit objects with empty values #24
Conversation
Isn't this a bit broad, possibly also removing stuff that should not be removed but fail as the param really should be there or the value really should be set? We will definitely need some tests around this to be confident enough that this is working as intended I would say :/ |
@janpio IMHO it does not make sense to set a value to null/undefined. And if the perpetrator intended to so he could simply set the value to However I can see your concern about breaking some stuff. Maybe we could ship this with a option e.g. ( |
@janpio I added some tests and fixed the implementation, also you will now have to pass |
Having tests is great - thanks for making the changes. |
I am not a super expert with Xcode projects, will review the best I can. I would favor renaming the option to something more meaningful, such as "dropFrameworksWithEmptyPath". Otherwise it looks good, thanks for contributing the test cases as well. |
@brodybits |
As I said I am not an Xcode expert so it would help if you could better explain the actual problem and proposed change in behavior. I find "NullOrUndefined" to be a bit ugly for the exported API. Also "dropUndefinedOrNull" does not give me a clear idea of what it actually does. |
@brodybits Maybe The problem is explained here: #23 My take on the solution is a broader approach, which not only works for the path "property". In my opinion it makes sense to omit a key from "writing" that has I do not think that anyone who is currently using this library intends to set any property value to However because I like the idea of having no breaking changes in patch/feature versions, I introduced the functionality to omit properties whose value is Example: Input Object:
Result without option disabled/current master:
Result with option enabled:
If you come up with a better name I will rename the option. Here are some of my suggestions:
|
I would probably favor |
@brodybits Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 from me
for the file cordova-node-xcode/lib/pbxProject.js |
Fixes #23
This is the quickest fix I could find