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

feat(NODE-5959): make byte parsing utils available on onDemand library #662

Merged
merged 2 commits into from
Mar 19, 2024

Conversation

nbbeeken
Copy link
Contributor

@nbbeeken nbbeeken commented Mar 18, 2024

Description

What is changing?

  • Adds utf and number parsing utils to onDemand
Is there new documentation needed for these changes?

No

What is the motivation for this change?

A reviver will be receiving offsets into a BSON byte sequence and will need to interpret them at JS values. These utilities provide what we need without rewriting the logic they already implement. We do not necessarily need these to be part of the final API, the driver works on Node.js so we do not need the logic for switching between web and node. We also probably only need a subset of these functions as mentioned above, for example, toHex is for display purposes and likely does not have a use for what we aim to do with this API.

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 added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Mar 18, 2024
src/utils/byte_utils.ts Show resolved Hide resolved
src/utils/number_utils.ts Show resolved Hide resolved
@aditi-khare-mongoDB aditi-khare-mongoDB 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 18, 2024
@W-A-James W-A-James self-requested a review March 19, 2024 14:23
@aditi-khare-mongoDB aditi-khare-mongoDB merged commit efab49a into main Mar 19, 2024
5 checks passed
@aditi-khare-mongoDB aditi-khare-mongoDB deleted the NODE-5959-bytes branch March 19, 2024 20:00
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
3 participants