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 Blob.arrayBuffer and Blob.text methods #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

coreybutler
Copy link

I needed Blob.arrayBuffer and Blob.text for an updated version of a CloudFlare Worker tool (forked from dollarshaveclub/cloudworker)I'm working on. The arrayBuffer is required to do Brotli de/compression (and other forms of compression) within a cloud worker.

Most of the required code already existed within the existing Blob.slice method. I abstracted it into its own function, calling it from within the slice method.

I ran unit tests before and after. An npm install flat out fails without updating the chai dependencies. I updated these. Prior to creating any updates, I ran the tests and there were a few errors for code unrelated to the Blob class. Upon completion, I ran the tests again and got the same result, suggesting anything Blob related passed without error.

I tried updating all of the dependencies, but Babel has changed enough that it caused the build to change (particularly the default fetch export). Those changes have obviously not been included in this PR, but I wanted there to be an awareness of them.

I've created a new npm package with these changes for my own purposes (@author.io/node-fetch), which is working well. So, if you choose not to merge this, other folks will know a place where they can still obtain these particular features.

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.

1 participant