encoding
encoding copied to clipboard
fix(json): improve handling of omitempty with embedded pointers
This PR fixes #63 by improving the handling of embedded pointers. Not surprisingly, these are a tricky bunch to contend with, so I've included a few test cases to demonstrate the efficacy of this change, but would appreciate some feedback on additional test cases to include.
In short, when passing a value to the "is empty" func, previously we weren't following pointers properly when they were embedded since we failed to track the pointer addresses own offset. This fix still feels kinda janky to me, especially to someone not especially comfortable with dealing with pointers like this, but it seems to get the job done.