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

Replace instanceOf with Buffer.isBuffer() #24

Closed
wants to merge 1 commit into from

Conversation

refi93
Copy link
Contributor

@refi93 refi93 commented Apr 28, 2021

Motivation: instanceOf check may fail in browser environment where multiple versions of the buffer package may be bundled together, hence resulting in different instances of Buffer being present in the code. A more "resilient" way of checking whether the parameter supplied is a buffer is the Buffer.isBuffer() method which I'm migrating to in this PR

Testing: yarn test passes

more info:
feross/buffer#154

@refi93 refi93 changed the title Replace instanceof with Buffer.isBuffer Replace instanceof with Buffer.isBuffer() Apr 28, 2021
@refi93 refi93 changed the title Replace instanceof with Buffer.isBuffer() Replace instanceOf with Buffer.isBuffer() Apr 28, 2021
pabigot pushed a commit that referenced this pull request Apr 29, 2021
instanceOf check may fail in browser environment where multiple
versions of the buffer package may be bundled together, hence
resulting in different instances of Buffer being present in the
code. A more resilient way of checking whether the parameter supplied
is a buffer is the Buffer.isBuffer() method which I'm migrating to in
this PR.

From #24.

Signed-off-by: Peter A. Bigot <[email protected]>
pabigot pushed a commit that referenced this pull request Apr 29, 2021
instanceOf check may fail in browser environment where multiple
versions of the buffer package may be bundled together, hence
resulting in different instances of Buffer being present in the
code. A more resilient way of checking whether the parameter supplied
is a buffer is the Buffer.isBuffer() method which I'm migrating to in
this PR.

From #24.

Signed-off-by: Peter A. Bigot <[email protected]>
pabigot pushed a commit that referenced this pull request Apr 29, 2021
instanceOf check may fail in browser environment where multiple
versions of the buffer package may be bundled together, hence
resulting in different instances of Buffer being present in the
code. A more resilient way of checking whether the parameter supplied
is a buffer is the Buffer.isBuffer() method which I'm migrating to in
this PR.

From #24.

Signed-off-by: Peter A. Bigot <[email protected]>
@pabigot
Copy link
Owner

pabigot commented Apr 29, 2021

Thanks; I reworked the commit message description to be self-contained using your edited text above, and added the necessary release update content. This is now merged as 739d75a and seems to be published correctly. If you notice any problems please let me know.

@pabigot pabigot closed this Apr 29, 2021
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.

2 participants