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): add byte parsing utilities to onDemand namespace #658

Closed
wants to merge 9 commits into from

Conversation

nbbeeken
Copy link
Contributor

Description

What is changing?

  • Added the following to onDemand:
    • ByteUtils (we only need the utf parsing function, we can reduce later?)
    • NumberUtils (reuse common int parsing code)
    • getSize (should move this back on to number utils probably, needed for parsing string sizes etc.)
Is there new documentation needed for these changes?

No.

What is the motivation for this change?

A reviver will be recieving offsets into a BSON byte sequence and will need to interpret them at JS values. These utitlities 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

Base automatically changed from NODE-5958-parseToStructure to main March 15, 2024 17:54
@nbbeeken nbbeeken closed this Mar 18, 2024
@nbbeeken nbbeeken deleted the NODE-5959-utf branch March 18, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants