From bf8837aa81972769d649223d649e347d50a9bf0d Mon Sep 17 00:00:00 2001 From: jaawerth Date: Thu, 15 Mar 2018 23:13:55 -0400 Subject: [PATCH 1/2] Add null to the end of the source array in readArray to close the stream. Fixes #2 --- test/test.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test.js b/test/test.js index 4d4d9e2..1c24789 100644 --- a/test/test.js +++ b/test/test.js @@ -7,8 +7,10 @@ var stream = require('../'), transduce = require('any-transduce'), test = require('tape') -function readArray(source){ - var read = new Readable() + +function readArray(_source){ + var source = _source.concat(null), + read = new Readable() read._read = function(){ read.push(source.shift()) } From 5d08f4e471e4111c7d1cfbfd490433f7d3264082 Mon Sep 17 00:00:00 2001 From: jaawerth Date: Thu, 15 Mar 2018 23:15:53 -0400 Subject: [PATCH 2/2] swap out stream core lib for readable-stream mirror for stable streams api across node versions --- package.json | 3 +++ test/test.js | 4 ++-- transduce-stream.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 85087ea..f99159e 100644 --- a/package.json +++ b/package.json @@ -28,5 +28,8 @@ "transduce": "^0.8.0", "transducers-js": "^0.4.158", "transducers.js": "^0.3.1" + }, + "dependencies": { + "readable-stream": "^2.3.5" } } diff --git a/test/test.js b/test/test.js index 1c24789..0f9ab7b 100644 --- a/test/test.js +++ b/test/test.js @@ -1,7 +1,7 @@ "use strict" var stream = require('../'), - Readable = require('stream').Readable, - Writable = require('stream').Writable, + Readable = require('readable-stream').Readable, + Writable = require('readable-stream').Writable, string = require('transduce/string'), tap = require('transduce/transducers/tap'), transduce = require('any-transduce'), diff --git a/transduce-stream.js b/transduce-stream.js index 3ac9e35..9fde1b2 100644 --- a/transduce-stream.js +++ b/transduce-stream.js @@ -1,6 +1,6 @@ "use strict" var util = require('util'), - Transform = require('stream').Transform + Transform = require('readable-stream').Transform module.exports = TransduceStream