stream: minor stream/iter implementation edits#63132
Open
Renegade334 wants to merge 1 commit intonodejs:mainfrom
Open
stream: minor stream/iter implementation edits#63132Renegade334 wants to merge 1 commit intonodejs:mainfrom
Renegade334 wants to merge 1 commit intonodejs:mainfrom
Conversation
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
Collaborator
|
Review requested:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #63132 +/- ##
=======================================
Coverage 89.67% 89.68%
=======================================
Files 712 712
Lines 221251 221267 +16
Branches 42391 42394 +3
=======================================
+ Hits 198405 198438 +33
+ Misses 14669 14646 -23
- Partials 8177 8183 +6
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes:
arrayBufferViewToUint8Array()fromprimitiveToUint8Array(), as transform processing makes extensive use of this utility but exclusively to handle ABVs, which allows these cases to shortcut the other chunk typechecks.flattenTransformYieldSync()to flatten sync iterables in async pipelines. The spec text is not entirely clear how these cases should be flattened, but extrapolated from how sync iterables are handled in asyncfrom(), they should be handled the same as if they were being flattened in a sync pipeline, ie. they must not yield nested async iterators.concatBytes()for cloning a single chunk, by passing the chunk directly to the Uint8Array constructor.Buffer.concat()inconcatBytes()with a thin inline concatenation implementation.yield*inwithFlushAsync(): the operator preferentially async-iterates its target within an async generator, without the need to unwrap the iteration.Pseudo-tested by running the new-stream samples, which shows no changes between this PR and main.