-
Notifications
You must be signed in to change notification settings - Fork 629
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
feat(streams/unstable): toByteStream()
#6046
Conversation
This might be useful in some cases, but I'm not sure if it's common to call this operation/util 'upgrade'...('upgrade' reminds me of upgrading http connection to websocket connection). How about calling this 'toReadableByteStream'? @crowlKats @lucacasonato What do you think about this? |
I use a similar function a lot in the cbor pull request and thought it's unique enough and useful enough to offer as a utility. I also found if you don't end up enqueuing or responding in each pull then you end up with that promise left in the event loop error. |
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6046 +/- ##
==========================================
+ Coverage 96.75% 96.76% +0.01%
==========================================
Files 508 509 +1
Lines 39140 39185 +45
Branches 5793 5803 +10
==========================================
+ Hits 37869 37917 +48
+ Misses 1229 1226 -3
Partials 42 42 ☔ View full report in Codecov by Sentry. |
upgradeReadable()
toByteStream()
I'd just like to say that getting this function right was quite hard as there always seemed like another hiccup. I've found that when using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
This pull request introduces a small function to
@std/streams
that allows someone to easily upgrade aReadableStream<Uint8Array>
to support BYOB if it doesn't already.Example