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

feat(streams): to ArrayBuffer/Blob/Json/Text #3631

Merged
merged 4 commits into from Sep 13, 2023

Conversation

lino-levan
Copy link
Contributor

Closes #3587.

import { concat } from "../bytes/concat.ts";

export async function arrayBufferFromReadableStream(
readableStream: ReadableStream,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to limit this type to ReadableStream<Uint8Array>?

@kt3k
Copy link
Member

kt3k commented Sep 12, 2023

@lino-levan
In my view streams/ is going to be mostly about ReadableStreams (especially after deprecating Reader/Writer-related stuff). So I think ReadableStream in API naming might sound redundant. How about toArrayBuffer, toBlob, toJson, and toText?

@lino-levan lino-levan changed the title feat(streams): arrayBuffer/blob/json/textFromReadableStream feat(streams): to ArrayBuffer/Blob/Json/Text Sep 12, 2023
Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kt3k kt3k merged commit 5c5ca87 into denoland:main Sep 13, 2023
9 checks passed
JakeAve pushed a commit to JakeAve/deno_std that referenced this pull request Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

streams: add APIs from stream-consumers
3 participants