I am not sure if this is wanted behavior, but if there is an array that has undefined as an element it stays as undefined.
JSON parse/stringify turns it into a null.
The same happens if a property is undefined, but with JSON it is completely stripped away.
In the README it says that undefined is only from supported from the lite, and JSON does not support undefined anyway.
I am assuming the way klona/json is intended to be used is we know in advance that our objects are JSON compatible in the first place, so this might be working as intended (but Map/Set are handled the same way as the JSON methods).
I am not sure if this is wanted behavior, but if there is an array that has
undefined
as an element it stays as undefined. JSON parse/stringify turns it into a null.The same happens if a property is
undefined
, but with JSON it is completely stripped away.In the
README
it says thatundefined
is only from supported from thelite
, and JSON does not supportundefined
anyway.Reproduction
I am assuming the way
klona/json
is intended to be used is we know in advance that our objects are JSON compatible in the first place, so this might be working as intended (but Map/Set are handled the same way as the JSON methods).