Skip to content

Commit ea5d783

Browse files
benjamingrMesteery
andcommitted
Apply suggestions from code review
Co-authored-by: Mestery <[email protected]>
1 parent c295bed commit ea5d783

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

doc/api/stream.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,7 +2140,7 @@ added: v17.4.0
21402140
aborted.
21412141
* Returns: {Promise} a promise for the final value of the reduction.
21422142

2143-
This method calls `fn` on each chunk of the stream in order passing it the
2143+
This method calls `fn` on each chunk of the stream in order passing it the
21442144
result from the calculation on the previous element. It returns a promise for
21452145
the final value of the reduction.
21462146

@@ -2150,7 +2150,6 @@ initial value. If the stream is empty, the promise is rejected with a
21502150

21512151
```mjs
21522152
import { Readable } from 'stream';
2153-
import { createReadStream } from 'fs';
21542153

21552154
const ten = await Readable.from([1, 2, 3, 4]).reduce((previous, data) => {
21562155
return previous + data;

test/parallel/test-stream-reduce.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,5 @@ function sum(p, c) {
105105
{
106106
// Test result is a Promise
107107
const result = Readable.from([1, 2, 3, 4, 5]).reduce(sum, 0);
108-
assert.strictEqual(result instanceof Promise, true);
108+
assert.ok(result instanceof Promise);
109109
}

0 commit comments

Comments
 (0)