diff --git a/src/streamHandler/RegexBlockStream.js b/src/streamHandler/RegexBlockStream.js index 5868319..ef39a67 100644 --- a/src/streamHandler/RegexBlockStream.js +++ b/src/streamHandler/RegexBlockStream.js @@ -52,7 +52,7 @@ class RegexBlockStream extends Transform{ _flush(next){ if(matchAllOnFlush){ // When requested, we'll match one last time over the remaining buffer - let chunk = this.readableBuffer.toString(); + let chunk = this.readableBuffer.join(''); let matches = chunk.match(this.matcher); // Match remaining buffer _writeMatches(matches); // Write matches including last element }