-
Notifications
You must be signed in to change notification settings - Fork 253
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
Conversation
potentialBuffer.buffer, | ||
potentialBuffer.byteOffset, | ||
potentialBuffer.byteLength | ||
); |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
Rebased to resolve the merge conflict ( |
There was a problem hiding this 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
There was a problem hiding this 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?
If you merge this, yes. :) |
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?