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

Do not use Buffer.isBuffer - to allow cross context usage #171

Open
gpetrov opened this issue Jan 30, 2022 · 3 comments
Open

Do not use Buffer.isBuffer - to allow cross context usage #171

gpetrov opened this issue Jan 30, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@gpetrov
Copy link

gpetrov commented Jan 30, 2022

The bynode buffer is been checked first for valid buffer before evaluation, but if fails if the buffer is from other context because the node implementation is very strict. See https://stackoverflow.com/questions/44216449/why-isbuffer-returns-false-for-an-fs-readfilesync-call-without-encoding

So just replace it with, more easy direct isBuffer function like

https://github.com/feross/is-buffer/blob/master/index.js

@OsamaAbbas
Copy link
Collaborator

Good idea, thanks for the suggestion.

@OsamaAbbas OsamaAbbas added the enhancement New feature or request label Jan 30, 2022
@gpetrov
Copy link
Author

gpetrov commented Nov 10, 2023

Any news on this?

@OsamaAbbas
Copy link
Collaborator

Any news on this?

Honestly, I forgot about this suggestion. I will add it in the next version, hopefully soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants