Skip to content

Commit 1aa798d

Browse files
rafasofizadaruyadorno
authored andcommitted
doc: clarify transform._transform() callback argument logic
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 <luigipinca@gmail.com> Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
1 parent d723e87 commit 1aa798d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

doc/api/stream.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4507,7 +4507,8 @@ The `callback` function must be called only when the current chunk is completely
45074507
consumed. The first argument passed to the `callback` must be an `Error` object
45084508
if an error occurred while processing the input or `null` otherwise. If a second
45094509
argument is passed to the `callback`, it will be forwarded on to the
4510-
`transform.push()` method. In other words, the following are equivalent:
4510+
`transform.push()` method, but only if the first argument is falsy. In other
4511+
words, the following are equivalent:
45114512

45124513
```js
45134514
transform.prototype._transform = function(data, encoding, callback) {

0 commit comments

Comments
 (0)