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

fix(NODE-4464):stringify and parse negative zero to and from $numberDouble: -0.0 #531

Merged
merged 2 commits into from
Dec 2, 2022

Conversation

nbbeeken
Copy link
Contributor

Description

What is changing?

EJSON when in relaxed: false mode (cannonical) is supposed to serialize negative zero to a double.

What is the motivation for this change?

EJSON implementation correctness

Double check the following

  • Ran npm run lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: <type>(NODE-xxxx)<!>: <description>
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@jimmywarting

This comment was marked as off-topic.

@nbbeeken

This comment was marked as off-topic.

@jimmywarting

This comment was marked as off-topic.

@nbbeeken nbbeeken marked this pull request as ready for review November 30, 2022 21:57
src/extended_json.ts Outdated Show resolved Hide resolved
src/double.ts Outdated Show resolved Hide resolved
src/extended_json.ts Outdated Show resolved Hide resolved
@baileympearson
Copy link
Contributor

Can we change the title of the PR to accurately reflect the contents? The PR now handles parsing ejson with negative zeroes as well.

@nbbeeken nbbeeken changed the title fix(NODE-4464): stringify negative zero to $numberDouble: -0.0 fix(NODE-4464):stringify and parse negative zero to and from $numberDouble: -0.0 Dec 1, 2022
@baileympearson baileympearson merged commit a469e91 into main Dec 2, 2022
@baileympearson baileympearson deleted the NODE-4464-neg-zero-ejson branch December 2, 2022 14:58
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.

3 participants