stream-json
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -124,3 +124,3 @@ 'use strict'; | ||
// update the last stack | ||
last.splice(commonLength, lastLength - commonLength, ...stack.slice(commonLength)); | ||
this._lastStack = [].concat(stack); | ||
} | ||
@@ -127,0 +127,0 @@ } |
{ | ||
"name": "stream-json", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"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", |
@@ -91,4 +91,3 @@ # stream-json | ||
npm install --save stream-json | ||
# or: | ||
yarn add stream-json | ||
# or: yarn add stream-json | ||
``` | ||
@@ -106,2 +105,3 @@ | ||
- 1.1.4 *fixed `Filter` going haywire, thx [@codebling](https://github.com/codebling)!* | ||
- 1.1.3 *fixed `Parser` streaming numbers when shouldn't, thx [Grzegorz Lachowski](https://github.com/gregolsky)!* | ||
@@ -108,0 +108,0 @@ - 1.1.2 *fixed `Stringer` not escaping some symbols, thx [Pavel Bardov](https://github.com/pbardov)!* |
@@ -46,3 +46,7 @@ 'use strict'; | ||
const input = '{"a": 1, "b": true, "c": ["d"]}', | ||
pipeline = chain([readString(input), parser({packKeys: true, packValues: false, streamValues: false}), filter({filter: /^(|a|c)$/, streamValues: false})]), | ||
pipeline = chain([ | ||
readString(input), | ||
parser({packKeys: true, packValues: false, streamValues: false}), | ||
filter({filter: /^(|a|c)$/, streamValues: false}) | ||
]), | ||
result = []; | ||
@@ -99,15 +103,8 @@ | ||
}, | ||
function test_filter_default_value(t) { | ||
const async = t.startAsync('test_filter_default_value'); | ||
function test_filter_bug46(t) { | ||
const async = t.startAsync('test_filter_bug46'); | ||
const data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; | ||
const data = [{data: {a: 1, b: 2}, x: 1}, {data: {a: 3, b: 4}, y: 2}]; | ||
const pipeline = chain([ | ||
readString(JSON.stringify(data)), | ||
parser(), | ||
filter({ | ||
defaultValue: [], | ||
filter: stack => stack.length == 1 && typeof stack[0] == 'number' && stack[0] % 2 | ||
}) | ||
]); | ||
const pipeline = chain([readString(JSON.stringify(data)), parser(), filter({filter: /data/})]); | ||
@@ -117,3 +114,3 @@ const asm = Assembler.connectTo(pipeline); | ||
pipeline.on('end', () => { | ||
eval(t.TEST('t.unify(asm.current, [2, 4, 6, 8, 10])')); | ||
eval(t.TEST('t.unify(asm.current, [{data: {a: 1, b: 2}}, {data: {a: 3, b: 4}}])')); | ||
async.done(); | ||
@@ -120,0 +117,0 @@ }); |
Sorry, the diff of this file is not supported yet
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
3509
183613