From 67fc5f601a020b83d0d5a20da5c2acf7b79d9c81 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Wed, 10 Nov 2021 11:54:01 +0200 Subject: [PATCH] fixup: lint --- lib/internal/streams/pipeline.js | 10 +++++----- test/parallel/test-stream-pipeline.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/internal/streams/pipeline.js b/lib/internal/streams/pipeline.js index 3c5434cb9e483e..5267c447e3826a 100644 --- a/lib/internal/streams/pipeline.js +++ b/lib/internal/streams/pipeline.js @@ -6,7 +6,6 @@ const { ArrayIsArray, Promise, - MathMax, SymbolAsyncIterator, } = primordials; @@ -322,7 +321,7 @@ function pipelineImpl(streams, callback, opts) { return ret; } -function pipe (src, dst) { +function pipe(src, dst) { if (typeof src.read !== 'function') { src.pipe(dst); return; @@ -334,7 +333,7 @@ function pipe (src, dst) { dst .on('drain', pump); - function end () { + function end() { dst.end(); } @@ -345,13 +344,14 @@ function pipe (src, dst) { dst._writableState?.objectMode ); - function pump () { + function pump() { if (dst.writableNeedDrain) { return; } while (true) { - const chunk = src.read((!objectMode && dst.writableHighwaterMark) || undefined); + const n = (!objectMode && dst.writableHighwaterMark) || undefined; + const chunk = src.read(n); if (chunk === null || !dst.write(chunk)) { return; } diff --git a/test/parallel/test-stream-pipeline.js b/test/parallel/test-stream-pipeline.js index f95084c93fe90e..8d4776a8bd21a5 100644 --- a/test/parallel/test-stream-pipeline.js +++ b/test/parallel/test-stream-pipeline.js @@ -22,7 +22,7 @@ const tsp = require('timers/promises'); let finished = false; const processed = []; const expected = [ - Buffer.from('abc') + Buffer.from('abc'), ]; const read = new Readable({ @@ -346,7 +346,7 @@ const tsp = require('timers/promises'); }; const expected = [ - Buffer.from('helloworld') + Buffer.from('helloworld'), ]; const rs = new Readable({