lib: narrow ReadableStreamBYOBRequest.view return type to Uint8Array#63017
lib: narrow ReadableStreamBYOBRequest.view return type to Uint8Array#63017Jah-yee wants to merge 1 commit intonodejs:mainfrom
Conversation
Follow WHATWG streams spec update: whatwg/streams#1367 ReadableStreamBYOBRequest.view is always constructed as a Uint8Array. This changes the documented return type from ArrayBufferView to Uint8Array per the updated spec. Fixes: nodejs#62952
|
Hi @MattiasBuelens, thank you for your review on #62958! π This PR replaces #62958 with the corrected commit message (per your feedback on the line-length lint issue β the commit message was adjusted accordingly). The change is identical: a 1-line JSDoc type narrowing from The CI checks were cancelled (not failed) and appear to be pending. Could you please review this PR when you have a moment? Happy to address any feedback. Also tagging @gurgunday β thank you for the earlier feedback on #62958 as well! π |
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #63017 +/- ##
==========================================
- Coverage 89.65% 89.65% -0.01%
==========================================
Files 708 708
Lines 220374 220374
Branches 42264 42265 +1
==========================================
- Hits 197584 197570 -14
+ Misses 14656 14651 -5
- Partials 8134 8153 +19
π New features to boost your workflow:
|
Description
Follow WHATWG streams spec update: whatwg/streams#1367
ReadableStreamBYOBRequest.viewis always constructed as aUint8Array, and the specification will be updated to enforce this. This changes the documented return type fromArrayBufferViewtoUint8Array.Fix
Changed the JSDoc type annotation for
viewgetter from@type {ArrayBufferView}to@type {Uint8Array}inlib/internal/webstreams/readablestream.js.Relation to #62958
This PR replaces #62958, which was closed after the commit message lint check failed. The commit message was corrected (per feedback from @MattiasBuelens) and resubmitted as this new PR with the fix already applied.
Fixes #62952