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

Jsonify: Convert undefined to null in union element of array #901

Merged

Conversation

m-shaka
Copy link
Contributor

@m-shaka m-shaka commented Jun 29, 2024

Jsonify doesn't handle correctly union type with undefined in array.
You get [1, null] from JSON.parse(JSON.stringify([1, undefined])).
Like tuple type, Array<undefined | T> should be converted to Array<null | T>

@sindresorhus sindresorhus changed the title fix: convert undefined to null in union array type Jsonify: Convert undefined to null in union element of array Jun 29, 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

Successfully merging this pull request may close these issues.

2 participants