Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
feat: omit objects with empty values #24
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. (
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.
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
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: