From 1f5e38d89cd42bb0e9f1e57d78b39b546a259e3c Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Mon, 28 Aug 2017 21:41:59 +0200 Subject: [PATCH] Fix readable stream default highWaterMark --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index 1e83a83..70a8320 100644 --- a/index.js +++ b/index.js @@ -95,6 +95,11 @@ function split (matcher, mapper, options) { // this stream is in objectMode only in the readable part stream._readableState.objectMode = true + // objectMode default hwm is 16 and not 16384 + if (stream._readableState.highWaterMark && !options.highWaterMark) { + stream._readableState.highWaterMark = 16 + } + stream._last = '' stream._decoder = new StringDecoder('utf8') stream.matcher = matcher