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

Add Buffer property to buffer module #6179

Closed
wants to merge 1 commit into from

Conversation

motiz88
Copy link
Contributor

@motiz88 motiz88 commented Apr 21, 2018

Previously discussed or implemented in #5153, #3495, #2938, #3723, #3724 and maybe elsewhere.

This PR refines previous efforts by adding:

  1. A correct, unambiguous type for require("buffer").Buffer:
declare var Buffer: typeof global.Buffer;
  1. A test.

To be clear: Per the Node docs, explicitly importing Buffer is rarely needed, given its availability in the global scope, but correct. It happens to be a viable option in environments where "magic" support for Node globals is either undesirable or broken (the latter is currently the case for ES modules in Webpack).

@motiz88
Copy link
Contributor Author

motiz88 commented Apr 21, 2018

PR tests might fail due to the current state of master - this branch does pass tests on its own, see https://travis-ci.org/motiz88/flow/builds/369451624.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@fishythefish has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants