Skip to content

Add support for NaN/Infinity serialization - #1954

Merged
exyi merged 2 commits into
mainfrom
float-nans
Sep 28, 2025
Merged

Add support for NaN/Infinity serialization#1954
exyi merged 2 commits into
mainfrom
float-nans

Conversation

@exyi

@exyi exyi commented Aug 20, 2025

Copy link
Copy Markdown
Member

Resolves #1400

@exyi
exyi requested review from Copilot and tomasherceg August 20, 2025 14:51

This comment was marked as resolved.

return { value: +value, wasCoerced: value !== +value };
}

if (value != value || value === "NaN") {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (value != value || value === "NaN") {
if (Number.isNaN(value) || value === "NaN") {

@exyi
exyi merged commit d0383e9 into main Sep 28, 2025
14 checks passed
@exyi
exyi deleted the float-nans branch September 28, 2025 10:22
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.

Handle floating point NaN, Infinity and -Infinity

3 participants