Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Mestery <mestery@protonmail.com>
  • Loading branch information
benjamingr and Mesteery committed Jan 23, 2022
1 parent cbaee24 commit 0be4340
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions doc/api/stream.md
Expand Up @@ -2140,7 +2140,7 @@ added: v17.4.0
aborted.
* Returns: {Promise} a promise for the final value of the reduction.

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

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

```mjs
import { Readable } from 'stream';
import { createReadStream } from 'fs';

const ten = await Readable.from([1, 2, 3, 4]).reduce((previous, data) => {
return previous + data;
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-stream-reduce.js
Expand Up @@ -105,5 +105,5 @@ function sum(p, c) {
{
// Test result is a Promise
const result = Readable.from([1, 2, 3, 4, 5]).reduce(sum, 0);
assert.strictEqual(result instanceof Promise, true);
assert.ok(result instanceof Promise);
}

0 comments on commit 0be4340

Please sign in to comment.