v1.9.0 creates invalid json by including undefined values
src-code opened this issue · comments
Steve Carlson commented
There seems to be a regression in v1.9.0 where objects with undefined values are being included in the json output, which is invalid. For example:
serialize({
"foobar": undefined
});
Output:
{"foobar":undefined}
This is not valid json, and will fail when run through JSON.parse()
In v1.8.0 this worked correctly with the following output:
{}
Steve Carlson commented
Closing this as I guess it's intentional that this lib creates a superset of json
Jérémie Parker commented
Could you reopen as this looks like a breaking change that might have warranted a major version bump.
Ryuichi Okumura commented
I just released v1.9.1 (includes reverting #54) and v2.0.0 for this issue. Thanks!
Jérémie Parker commented
Thanks for the quick fix @okuryu !