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

stream: edit variables for readableStreamPipeTo #55769

Closed

Conversation

mertcanaltin
Copy link
Member

I tried to make it better using destructuring

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. web streams labels Nov 7, 2024
const preventCancel = options?.preventCancel;
const preventClose = options?.preventClose;
const signal = options?.signal;
const { preventAbort, preventCancel, preventClose, signal } = options;
Copy link
Member

Choose a reason for hiding this comment

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

Can't options also be null?

Copy link
Member Author

Choose a reason for hiding this comment

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

when I looked at the places where it was crossed, I saw that it was protected.

Copy link
Member

@RedYetiDev RedYetiDev Nov 8, 2024

Choose a reason for hiding this comment

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

The line right above (validateObject) allows a null value. We should account for that.

What if the user calls this function:
pipeThrough(..., null)

Than this'll throw a destructoring error

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks I made an update that prevents it from giving an error, but the old code was better in terms of readability

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.40%. Comparing base (7788999) to head (069f2a4).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55769      +/-   ##
==========================================
- Coverage   88.41%   88.40%   -0.01%     
==========================================
  Files         654      654              
  Lines      187752   187751       -1     
  Branches    36125    36120       -5     
==========================================
- Hits       165993   165977      -16     
- Misses      15000    15003       +3     
- Partials     6759     6771      +12     
Files with missing lines Coverage Δ
lib/internal/webstreams/readablestream.js 98.31% <100.00%> (-0.01%) ⬇️

... and 29 files with indirect coverage changes

@mertcanaltin
Copy link
Member Author

the old version is more readable and beautiful so I'm turning this off, thanks for the support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. web streams
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants