Comparing version 5.4.1 to 5.4.2
@@ -144,2 +144,3 @@ /* jshint node: true */ | ||
this._index = 0; // Next block index. | ||
this._remaining = undefined; // In the current block. | ||
this._needPush = false; | ||
@@ -238,3 +239,6 @@ this._finished = false; | ||
nBlocks++; | ||
this._decompress(block.data, this._createBlockCallback(chunkCb)); | ||
this._decompress( | ||
block.data, | ||
this._createBlockCallback(block.count, chunkCb) | ||
); | ||
} | ||
@@ -250,3 +254,3 @@ chunkCb(); | ||
BlockDecoder.prototype._createBlockCallback = function (cb) { | ||
BlockDecoder.prototype._createBlockCallback = function (count, cb) { | ||
var self = this; | ||
@@ -262,3 +266,3 @@ var index = this._index++; | ||
} else { | ||
self._queue.push(new BlockData(index, data, cb)); | ||
self._queue.push(new BlockData(index, data, cb, count)); | ||
if (self._needPush) { | ||
@@ -275,5 +279,5 @@ self._read(); | ||
var tap = this._blockTap; | ||
if (tap.pos >= tap.buf.length) { | ||
if (!this._remaining) { | ||
var data = this._queue.pop(); | ||
if (!data) { | ||
if (!data || !data.count) { | ||
if (this._finished) { | ||
@@ -287,2 +291,3 @@ this.push(null); | ||
data.cb(); | ||
this._remaining = data.count; | ||
tap.buf = data.buf; | ||
@@ -292,2 +297,3 @@ tap.pos = 0; | ||
this._remaining--; | ||
this.push(this._readValue(tap)); // The read is guaranteed valid. | ||
@@ -555,4 +561,3 @@ }; | ||
* This can be used to preserve block order since compression and decompression | ||
* can cause some some blocks to be returned out of order. The count is only | ||
* used when encoding. | ||
* can cause some some blocks to be returned out of order. | ||
*/ | ||
@@ -559,0 +564,0 @@ function BlockData(index, buf, cb, count) { |
{ | ||
"name": "avsc", | ||
"version": "5.4.1", | ||
"version": "5.4.2", | ||
"description": "Avro for JavaScript", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/mtth/avsc", |
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
256757
7969