GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: clarify transform._transform() callback argument logic by rafasofizada · Pull Request #48680 · nodejs/node

Conversation

@rafasofizada

@rafasofizada rafasofizada commented Jul 6, 2023

Copy link
Copy Markdown
Contributor

Edited / fixed version of #48653

Clarified that stream.Transform callback second argument is passed only if the first argument is null, i.e. no error occured processing the chunk.

From the way the documentation is written right now, I expected the second argument to be forwarded to transform.push(), even if the first argument is an Error. I was implementing a truncation stream, and passed both an Error ("stream exceeded maximum size"; could be optionally caught and ignored), and the last (truncated) chunk. Only after digging through the relevant implementaton I could confirm for sure that the second argument is entirely ignored if the first one is not null.

Please tell me if you want to adjust the wording somehow, or whether I should add an alternative example to the one following the line "In other words, the following are equivalent:". Hopefully you'll find this useful.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@rafasofizada
doc: clarify transform._transform() callback argument logic
a770015
Clarify that `transform._transform()` callback second argument is
used only if the first argument is `null`, i.e. no error occured
processing the chunk.
@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to Node.js documentation. stream Issues and PRs related to Node.js streams. labels Jul 6, 2023
@rafasofizada rafasofizada mentioned this pull request Jul 6, 2023
doc: clarified stream.Transform callback argument logic #48653
Closed
lpinca
lpinca approved these changes Jul 7, 2023
View reviewed changes
marsonya
marsonya approved these changes Jul 7, 2023
View reviewed changes
@lpinca lpinca added the commit-queue PRs queued for automated landing through the Commit Queue. label Jul 8, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Jul 8, 2023
@nodejs-github-bot
nodejs-github-bot merged commit eece8d7 into nodejs:main Jul 8, 2023
@nodejs-github-bot

nodejs-github-bot commented Jul 8, 2023

Copy link
Copy Markdown
Collaborator

Landed in eece8d7

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

juanarbol pushed a commit that referenced this pull request Jul 13, 2023
@rafasofizada @juanarbol
doc: clarify transform._transform() callback argument logic
caccb05
Clarify that `transform._transform()` callback second argument is
used only if the first argument is `null`, i.e. no error occured
processing the chunk.

PR-URL: #48680
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Akhil Marsonya <[email protected]>
@juanarbol juanarbol mentioned this pull request Jul 13, 2023
V20.5.0 proposal #48761
Merged
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
@rafasofizada @Ceres6
doc: clarify transform._transform() callback argument logic
5579c69
Clarify that `transform._transform()` callback second argument is
used only if the first argument is `null`, i.e. no error occured
processing the chunk.

PR-URL: nodejs#48680
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Akhil Marsonya <[email protected]>
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
@rafasofizada @Ceres6
doc: clarify transform._transform() callback argument logic
95c7722
Clarify that `transform._transform()` callback second argument is
used only if the first argument is `null`, i.e. no error occured
processing the chunk.

PR-URL: nodejs#48680
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Akhil Marsonya <[email protected]>
ruyadorno pushed a commit that referenced this pull request Sep 11, 2023
@rafasofizada @ruyadorno
doc: clarify transform._transform() callback argument logic
cb2e22c
Clarify that `transform._transform()` callback second argument is
used only if the first argument is `null`, i.e. no error occured
processing the chunk.

PR-URL: #48680
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Akhil Marsonya <[email protected]>
@ruyadorno ruyadorno mentioned this pull request Sep 11, 2023
v18.18.0 proposal #49220
Merged
ruyadorno pushed a commit that referenced this pull request Sep 13, 2023
@rafasofizada @ruyadorno
doc: clarify transform._transform() callback argument logic
616ecf0
Clarify that `transform._transform()` callback second argument is
used only if the first argument is `null`, i.e. no error occured
processing the chunk.

PR-URL: #48680
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Akhil Marsonya <[email protected]>
ruyadorno pushed a commit that referenced this pull request Sep 17, 2023
@rafasofizada @ruyadorno
doc: clarify transform._transform() callback argument logic
1aa798d
Clarify that `transform._transform()` callback second argument is
used only if the first argument is `null`, i.e. no error occured
processing the chunk.

PR-URL: #48680
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Akhil Marsonya <[email protected]>
@coderabbitai coderabbitai Bot mentioned this pull request Jul 24, 2026
fix: prevent gpsd JSON protocol messages leaking into NMEA0183 output SignalK/signalk-server#2857
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lpinca lpinca lpinca approved these changes
@marsonya marsonya marsonya approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

doc Issues and PRs related to Node.js documentation. stream Issues and PRs related to Node.js streams.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@rafasofizada @nodejs-github-bot @lpinca @marsonya
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.