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

enable linter and simplify stream/consumers.js #2875

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Oct 9, 2024

Enablers linter and simplifies implementation by using Array.fromAsync()

@anonrig anonrig requested a review from jasnell October 9, 2024 15:58
@anonrig anonrig requested review from a team as code owners October 9, 2024 15:58
@anonrig anonrig requested a review from fhanau October 9, 2024 15:58
const chunks = [];
for await (const chunk of stream) chunks.push(chunk);
return new Blob(chunks);
return new Blob(await Array.fromAsync(stream));
Copy link
Member

Choose a reason for hiding this comment

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

hmm... The Array.fromAsync(...) is still only Stage 3 in tc39 so there's a slight risk here. However, changing it back later if necessary would be easy so... ok :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

@anonrig anonrig merged commit 1db8484 into main Oct 9, 2024
13 checks passed
@anonrig anonrig deleted the yagiz/streams-consumers branch October 9, 2024 16:14
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.

3 participants