Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request is a rewrite of #139 that uses @davisp's approach to including pre-encoded JSON in the input.
It adds a new function
jiffy:partial_encode/2
that takes an array or object and returns a term that can later be included as part of the input in a futurejiffy:encode
call.It uses the atoms
$partial_array$
and$partial_object$
to mark these partially-encoded values. For the partially-encoded array we could technically usejson
but I added$partial_array$
because the partially-encoded array is not well-formed JSON while the JSON in{json, Json}
is, and I thought it was worth distinguishing the two.I did not test my code with native Erlang maps but I believe it will work if the tuple
{Key, Value}
returned byjiffy_partial_encode
is added to the map bymap:put(Key, Value, Map)
.