jzon
jzon copied to clipboard
Implement `replacer` equivalent in `stringify`
Using JSON.stringify in JS, there is a replacer function that can be provided.
This serves for as a point-of-serialize coercion of values and offers an alternative way to handle the hard problem of coercing to JSON.
I think it'd be a good idea to implement here. For the case of excluding keys, I've settled on the behaviour of
- Exclude the field -
nil - Include the field -
t - Include the field, and use a replacement value
(values t "replacement")
Can this be closed now? If not, what's left?
@fstamour congrats I just closed it w/ 923fd268d24d799c6e8b3ea98a92c069fcfeae39 which I think was the last remaining edge-case? There might be some other weird case but future people will have to deal with it