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

Buffer.from can take a Uint8Array #4343

Open
reviewher opened this issue Jul 9, 2017 · 0 comments
Open

Buffer.from can take a Uint8Array #4343

reviewher opened this issue Jul 9, 2017 · 0 comments
Labels
Accepting PRs Library definitions Issues or pull requests about core library definitions node

Comments

@reviewher
Copy link

This appears to be an oversight in the node.js documentation. Tracking issue nodejs/node#14118 .

The first part of the fix involves the Uint8Array case for Buffer.from:

static from(value: Uint8Array): Buffer;

The second part involves the original Buffer case. Since Buffer extends Uint8Array, the Uint8Array case also covers Buffer, so it might make sense to just remove static from(value: Buffer): Buffer; entirely

@vkurchatkin vkurchatkin added the Library definitions Issues or pull requests about core library definitions label Jul 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepting PRs Library definitions Issues or pull requests about core library definitions node
Projects
None yet
Development

No branches or pull requests

3 participants