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-6042): Binary.toString output with respect to position #663

Merged
merged 5 commits into from
Mar 26, 2024

Conversation

aditi-khare-mongoDB
Copy link
Contributor

@aditi-khare-mongoDB aditi-khare-mongoDB commented Mar 20, 2024

Description

Binary.toString and Binary.toJSON now respect position when printing out binary object.

What is changing?

See release highlights.

Is there new documentation needed for these changes?

No.

What is the motivation for this change?

Bug Fix.

Release Highlight

Binary.toString and Binary.toJSON now respect position when printing out binary object.

When the toString() or toJSON method is called on a Binary instance, it will print out until the instance's position property of the object, instead of the entire buffer.

Example:

new BSON.Binary().toString();
// old output: '\x00\x00\x00\x00...' (256 zeros)
// new output:  ' ' 

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 changed the title fix(NODE-5497): Binary.toString output with respect to position fix(NODE-6042): Binary.toString output with respect to position Mar 20, 2024
@aditi-khare-mongoDB aditi-khare-mongoDB marked this pull request as ready for review March 25, 2024 21:02
@W-A-James W-A-James self-requested a review March 26, 2024 15:03
@W-A-James W-A-James self-assigned this Mar 26, 2024
@W-A-James W-A-James added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Mar 26, 2024
Copy link
Contributor

@W-A-James W-A-James left a comment

Choose a reason for hiding this comment

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

Code LGTM, but for the release note, could you just make the code block have typescript syntax highlighting?

@W-A-James W-A-James added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Mar 26, 2024
@W-A-James W-A-James merged commit d7898f9 into main Mar 26, 2024
5 checks passed
@W-A-James W-A-James deleted the NODE-5497/binary-toString-fix branch March 26, 2024 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants