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: accept Uint8Array where Buffer is accepted #432

Merged
merged 1 commit into from
Apr 27, 2021

Conversation

addaleax
Copy link
Contributor

@addaleax addaleax commented Apr 22, 2021

Also fixes NODE-3223 (ensureBuffer ignores byteLength/byteOffset).
This is the "proper" alternative to #418 and matches what e.g. Node.js APIs do.

Description

What changed?

potentialBuffer.buffer,
potentialBuffer.byteOffset,
potentialBuffer.byteLength
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know the bug was here before anyway, but I should absolutely have caught this during #429, sorry.

@nbbeeken nbbeeken requested review from a team, nbbeeken and dariakp and removed request for a team April 23, 2021 16:41
Copy link
Member

@durran durran left a comment

Choose a reason for hiding this comment

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

Tested this and looks good.

Also fixes NODE-3223 (ensureBuffer ignores byteLength/byteOffset).
This is the "proper" alternative to
mongodb#418 and matches what e.g.
Node.js APIs do.
@addaleax
Copy link
Contributor Author

Rebased to resolve the merge conflict (imports in ensure_buffer.ts)

Copy link
Contributor

@dariakp dariakp left a comment

Choose a reason for hiding this comment

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

I like this approach

Copy link
Contributor

@emadum emadum left a comment

Choose a reason for hiding this comment

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

LGTM, should #418 be closed?

@addaleax
Copy link
Contributor Author

LGTM, should #418 be closed?

If you merge this, yes. :)

@emadum emadum merged commit 4613763 into mongodb:master Apr 27, 2021
@addaleax addaleax deleted the 3223-dev branch April 27, 2021 16:06
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.

4 participants