stream-json
Advanced tools
Comparing version 1.1.2 to 1.1.3
{ | ||
"name": "stream-json", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"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", |
@@ -94,3 +94,5 @@ 'use strict'; | ||
if (this._open_number) { | ||
this.push({name: 'endNumber'}); | ||
if (this._streamNumbers) { | ||
this.push({name: 'endNumber'}); | ||
} | ||
this._open_number = false; | ||
@@ -144,3 +146,5 @@ if (this._packNumbers) { | ||
if (this._open_number) { | ||
this.push({name: 'endNumber'}); | ||
if (this._streamNumbers) { | ||
this.push({name: 'endNumber'}); | ||
} | ||
this._open_number = false; | ||
@@ -158,4 +162,6 @@ if (this._packNumbers) { | ||
this._open_number = true; | ||
this.push({name: 'startNumber'}); | ||
this.push({name: 'numberChunk', value: '-'}); | ||
if (this._streamNumbers) { | ||
this.push({name: 'startNumber'}); | ||
this.push({name: 'numberChunk', value: '-'}); | ||
} | ||
if (this._packNumbers) { | ||
@@ -168,4 +174,6 @@ this._accumulator = '-'; | ||
this._open_number = true; | ||
this.push({name: 'startNumber'}); | ||
this.push({name: 'numberChunk', value: '0'}); | ||
if (this._streamNumbers) { | ||
this.push({name: 'startNumber'}); | ||
this.push({name: 'numberChunk', value: '0'}); | ||
} | ||
if (this._packNumbers) { | ||
@@ -172,0 +180,0 @@ this._accumulator = '0'; |
@@ -105,2 +105,4 @@ # stream-json | ||
- 1.1.3 *fixed `Parser` streaming numbers when shouldn't, thx [Grzegorz Lachowski](https://github.com/gregolsky)!* | ||
- 1.1.2 *fixed `Stringer` not escaping some symbols, thx [Pavel Bardov](https://github.com/pbardov)!* | ||
- 1.1.1 *minor updates in docs and comments.* | ||
@@ -107,0 +109,0 @@ - 1.1.0 *added `Disassembler`.* |
@@ -155,3 +155,3 @@ 'use strict'; | ||
const input = '{"a": 1, "b": true, "c": ["d"]}', | ||
const input = '{"a": 1, "b": true, "c": ["d"], "e": -2, "f": 0}', | ||
pipeline = new ReadString(input).pipe(new Parser({streamValues: false})), | ||
@@ -162,3 +162,3 @@ result = []; | ||
pipeline.on('end', () => { | ||
eval(t.ASSERT('result.length === 10')); | ||
eval(t.ASSERT('result.length === 14')); | ||
eval(t.TEST("result[0].name === 'startObject'")); | ||
@@ -173,3 +173,7 @@ eval(t.TEST("result[1].name === 'keyValue' && result[1].val === 'a'")); | ||
eval(t.TEST("result[8].name === 'endArray'")); | ||
eval(t.TEST("result[9].name === 'endObject'")); | ||
eval(t.TEST("result[9].name === 'keyValue' && result[9].val === 'e'")); | ||
eval(t.TEST("result[10].name === 'numberValue' && result[10].val === '-2'")); | ||
eval(t.TEST("result[11].name === 'keyValue' && result[11].val === 'f'")); | ||
eval(t.TEST("result[12].name === 'numberValue' && result[12].val === '0'")); | ||
eval(t.TEST("result[13].name === 'endObject'")); | ||
async.done(); | ||
@@ -176,0 +180,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
184379
3498
143
220