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

Wrap blobs into a node stream #1092

Closed

Conversation

jimmywarting
Copy link
Collaborator

@jimmywarting jimmywarting commented Feb 11, 2021

  • Documentation update
  • Bug fix
  • New feature
  • Other, please explain:

What changes did you make? (provide an overview)
Regarding what type of blob.stream it is (whether it's a node stream, whatwg stream or just a async iterator that yields uint8arrays)
always wrap the stream it returns in to a node stream.

Which issue (if any) does this pull request address?
closes #1091

Is there anything you'd like reviewers to know?

buffer.Blob() is soon becoming a thing...

@jimmywarting jimmywarting added this to the Version 3.0.0 milestone Feb 11, 2021
@jimmywarting jimmywarting self-assigned this Feb 11, 2021
@jimmywarting
Copy link
Collaborator Author

Edit I also added a test for feature buffer.Blob and i also made a helper function to read blobs that don't have any stream function yet.

@jimmywarting
Copy link
Collaborator Author

jimmywarting commented Feb 11, 2021

there is three issues with buffer.Blob

  • don't have stream
  • don't have Symbol.toStringTag (a fix/pr have been made in nodejs)
  • slicing is not the same as in the spec, get ERR_OUT_OF_RANGE error when slicing something with lower/larger size

@jimmywarting jimmywarting changed the title Wrap blob stream into a node stream Wrap blobs into a node stream Feb 11, 2021
src/utils/blob-to-stream.js Outdated Show resolved Hide resolved
@jimmywarting
Copy link
Collaborator Author

guess we might as well turn this to v4's whatwg:stream instead

@jimmywarting jimmywarting modified the milestones: Version 3.0.0, Version 4.0.0 Jul 18, 2021
@jimmywarting
Copy link
Collaborator Author

picked up my old #924 PR instead.

@jimmywarting jimmywarting deleted the support-other-blobs branch January 27, 2022 15:53
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.

preparation for whatwg stream on blob.stream()
2 participants