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

v1.9.0 creates invalid json by including undefined values #57

Closed
src-code opened this issue Aug 30, 2019 · 4 comments
Closed

v1.9.0 creates invalid json by including undefined values #57

src-code opened this issue Aug 30, 2019 · 4 comments

Comments

@src-code
Copy link

src-code commented Aug 30, 2019

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:

{}
@src-code
Copy link
Author

Closing this as I guess it's intentional that this lib creates a superset of json

@p-j
Copy link

p-j commented Sep 4, 2019

Could you reopen as this looks like a breaking change that might have warranted a major version bump.

@okuryu
Copy link
Collaborator

okuryu commented Sep 4, 2019

I just released v1.9.1 (includes reverting #54) and v2.0.0 for this issue. Thanks!

@p-j
Copy link

p-j commented Sep 4, 2019

Thanks for the quick fix @okuryu !

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

No branches or pull requests

3 participants