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-6102): Double.fromString prohibiting '+' character and prohibiting exponential notation #674

Merged
merged 6 commits into from
Apr 19, 2024

Conversation

aditi-khare-mongoDB
Copy link
Contributor

@aditi-khare-mongoDB aditi-khare-mongoDB commented Apr 18, 2024

Description

Double.fromString should allow '+' character in its input.
Double.fromString should allow exponential format.

What is changing?

See above. and also refactor some of the function to make the error messages more clear and the code's logic clearer as well.

Is there new documentation needed for these changes?

No, bug fix on an unreleased feature.

What is the motivation for this change?

See description.

Release Highlight

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@aditi-khare-mongoDB aditi-khare-mongoDB marked this pull request as ready for review April 18, 2024 18:52
@aditi-khare-mongoDB aditi-khare-mongoDB changed the title fix(NODE-6102): Double.fromString prohibiting '+' character fix(NODE-6102): Double.fromString prohibiting '+' character and prohibiting exponential notation Apr 18, 2024
Comment on lines +52 to +54
if (value === 'NaN') return new Double(NaN);
if (value === 'Infinity') return new Double(Infinity);
if (value === '-Infinity') return new Double(-Infinity);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactored these cases to have clearer notation.

@baileympearson baileympearson merged commit c58d1e2 into main Apr 19, 2024
5 checks passed
@baileympearson baileympearson deleted the NODE-6102/double-fromString-fix branch April 19, 2024 16:42
@nbbeeken nbbeeken added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Primary Review In Review with primary reviewer, not yet ready for team's eyes
Projects
None yet
3 participants