Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "undefined is not encodable in msgpack" #64

Closed
skerit opened this issue Feb 28, 2018 · 3 comments · Fixed by #76
Closed

Error "undefined is not encodable in msgpack" #64

skerit opened this issue Feb 28, 2018 · 3 comments · Fixed by #76

Comments

@skerit
Copy link

skerit commented Feb 28, 2018

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 encodes undefined values to null, and that's what I'd like to accomplish.

@mcollina
Copy link
Owner

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).

@skerit
Copy link
Author

skerit commented Feb 28, 2018

Of course, but why not let us register an encoder for undefined?

@mcollina
Copy link
Owner

Would you like to send a pr?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants