stream-json
Advanced tools
Comparing version 1.4.0 to 1.4.1
{ | ||
"name": "stream-json", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "stream-json is the micro-library of Node.js stream components for creating custom JSON processing pipelines with a minimal memory footprint. It can parse JSON files far exceeding available memory streaming individual primitives using a SAX-inspired API. Includes utilities to stream JSON database dumps.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/uhop/stream-json", |
@@ -113,2 +113,3 @@ # stream-json | ||
- 1.4.1 *Bugfix: `Stringer` with `makeArray` should produce empty array if no input.* | ||
- 1.4.0 *added `makeArray` functionality to `Stringer`. Thx all who asked for it!* | ||
@@ -115,0 +116,0 @@ - 1.3.3 *Bugfix: very large/infinite streams with garbage didn't fail. Thx [Arne Marschall](https://github.com/Disco1267)!* |
@@ -75,2 +75,6 @@ 'use strict'; | ||
_arrayFlush(callback) { | ||
if (this._transform === this._arrayTransform) { | ||
delete this._transform; | ||
this._transform({name: 'startArray'}, null, doNothing); | ||
} | ||
this._transform({name: 'endArray'}, null, callback); | ||
@@ -77,0 +81,0 @@ } |
@@ -170,2 +170,19 @@ 'use strict'; | ||
}, | ||
function test_stringer_no_input_as_array(t) { | ||
const async = t.startAsync('test_stringer_no_input_as_array'); | ||
const parser = makeParser({jsonStreaming: true}), | ||
stringer = new Stringer({makeArray: true}); | ||
let buffer = ''; | ||
parser.pipe(stringer); | ||
stringer.on('data', data => (buffer += data)); | ||
stringer.on('end', () => { | ||
eval(t.TEST('buffer === "[]"')); | ||
async.done(); | ||
}); | ||
new ReadString('').pipe(parser); | ||
}, | ||
function test_stringer_json_stream_primitives(t) { | ||
@@ -172,0 +189,0 @@ const async = t.startAsync('test_stringer_json_stream_primitives'); |
213779
4358
160
243