Navigation Menu

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

Render NaN as 'NaN', to make diffs visible in JSONified objects. #27

Merged
merged 3 commits into from Jul 29, 2019

Conversation

wolframkriesing
Copy link
Contributor

I had a test failing and it showed me the same JSON.stringified object in expected as in actual. The difference was that one value was NaN. This will render NaN as the string "NaN", to make this difference visible.

@rluba
Copy link
Owner

rluba commented Jul 29, 2019

Thank you, Wolfram.

What would you think of rendering it as <NaN>? It’s not valid JSON, but it lets you distinguish between NaN and the string 'NaN'.

@wolframkriesing
Copy link
Contributor Author

@rluba done. Good idea!

@rluba rluba merged commit 8fa8ec7 into rluba:master Jul 29, 2019
@rluba
Copy link
Owner

rluba commented Jul 29, 2019

Thank you! 👌

@rluba
Copy link
Owner

rluba commented Jul 29, 2019

Released as v3.2.5.

@wolframkriesing wolframkriesing deleted the render-NaN-not-as-null branch August 3, 2019 12:53
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.

None yet

2 participants