asset-pipe-js-reader
Advanced tools
Comparing version 1.0.0-beta.7 to 1.0.0-beta.8
@@ -42,3 +42,3 @@ 'use strict'; | ||
// bubbles up | ||
if (!this.rows.has(row.id)) { | ||
if (row && row.id && !this.rows.has(row.id)) { | ||
this.rows.set(row.id, row); | ||
@@ -65,8 +65,14 @@ } | ||
let count = 0; | ||
streams.forEach((strm, index) => { | ||
const orderDecorator = new OrderDecorator(index); | ||
streams.forEach((readStream, index) => { | ||
const tmpStream = new stream.PassThrough({ objectMode: true }); | ||
merged.add(tmpStream); | ||
strm.on('file found', (file) => { | ||
readStream.on('file found', (file) => { | ||
const orderDecorator = new OrderDecorator(index); | ||
readStream | ||
.pipe(JSONStream.parse('*')) | ||
.pipe(orderDecorator) | ||
.pipe(tmpStream); | ||
this.emit('file found', file); | ||
merged.add(strm.pipe(JSONStream.parse('*')).pipe(orderDecorator)); | ||
count++; | ||
@@ -81,3 +87,4 @@ if (count === streams.length) { | ||
}); | ||
strm.on('file not found', (file) => { | ||
readStream.on('file not found', (file) => { | ||
tmpStream.end(); | ||
this.emit('file not found', file); | ||
@@ -84,0 +91,0 @@ count++; |
{ | ||
"name": "asset-pipe-js-reader", | ||
"version": "1.0.0-beta.7", | ||
"version": "1.0.0-beta.8", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Trygve Lie", |
8082
101