Zulu-Inuoe/jzon

Implement `replacer` equivalent in `stringify`

Zulu-Inuoe opened this issue · 2 comments

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

  1. Exclude the field - nil
  2. Include the field - t
  3. 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/ 923fd26 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