Closed skerit closed 5 years ago
undefined
is not null
in JS. If you encode an undefined
to a null
, then when you decode you will not get an undefined
.
In this library we support: deepEqual(decode(encode(data)), data)
.
Of course, but why not let us register an encoder for undefined
?
Would you like to send a pr?
Is there a reason why
undefined
is so, err, disliked in this package?I don't seem to be able to register an encoder for it, it's just hard coded in the
encoder.js
file to throw an error.The
msgpack-node
implementation just encodesundefined
values tonull
, and that's what I'd like to accomplish.