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

Klona (JSON) preserves undefined #45

Open
PointSingularity opened this issue Apr 30, 2024 · 0 comments
Open

Klona (JSON) preserves undefined #45

PointSingularity opened this issue Apr 30, 2024 · 0 comments

Comments

@PointSingularity
Copy link

PointSingularity commented Apr 30, 2024

I am not sure if this is wanted behavior, but if there is an array that has undefined as an element it stays as undefined.
JSON parse/stringify turns it into a null.

The same happens if a property is undefined, but with JSON it is completely stripped away.

In the README it says that undefined is only from supported from the lite, and JSON does not support undefined anyway.

Reproduction

I am assuming the way klona/json is intended to be used is we know in advance that our objects are JSON compatible in the first place, so this might be working as intended (but Map/Set are handled the same way as the JSON methods).

@PointSingularity PointSingularity changed the title Klona (JSON) preserves undefined in arrays Klona (JSON) preserves undefined Apr 30, 2024
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

1 participant