-
Notifications
You must be signed in to change notification settings - Fork 162
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
undefined
becomes null
after deserializing
#150
Comments
Can you elaborate on your use case? In general, it's not a good idea to distinguish |
Once case that I found was where we serialize/deserialize an entry of (I'm using msgpack as a browser replacement for |
May I suggest allowing for overriding this in a codec? Currently If this could instead be allowed to be overridden though, users can encode it if they want. My use case is to transfer an object from one place to another and maintain it exactly as is. Turning undefined into null alters the datatype, and allowing undefined to be there is different from not having it. |
@gfx |
prints "{ x: undefined } { x: null } false". This is a problem because now code checking for strict equality fails.
I was also not able to handle this in an extension codec because that is only called for non-primitive values.
ignoreUndefined: true
doesn't work in all cases:This is stated in the readme, but is there no way to retain this with an extension codec?
The text was updated successfully, but these errors were encountered: