Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

avsc

Package Overview
Dependencies
Maintainers
1
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

avsc - npm Package Compare versions

Comparing version 3.1.2 to 3.1.3

37

lib/files.js

@@ -136,3 +136,2 @@ /* jshint node: true */

this._index = 0; // Next block index.
this._pending = 0; // Number of blocks undergoing decompression.
this._needPush = false;

@@ -143,4 +142,4 @@ this._finished = false;

this._finished = true;
if (!this._pending) {
this.push(null);
if (this._needPush) {
this._read();
}

@@ -214,18 +213,25 @@ });

var nBlocks = 1;
var block;
while ((block = tryReadBlock(tap))) {
nBlocks++;
if (!this._syncMarker.equals(block.sync)) {
// TODO: Maybe improve error handling to try and recover other blocks.
cb(new Error('invalid sync marker'));
return;
}
this._decompress(block.data, this._createBlockCallback());
this._decompress(block.data, this._createBlockCallback(chunkCb));
}
chunkCb();
cb();
function chunkCb() {
if (!--nBlocks) {
cb();
}
}
};
BlockDecoder.prototype._createBlockCallback = function () {
BlockDecoder.prototype._createBlockCallback = function (cb) {
var self = this;
var index = this._index++;
this._pending++;

@@ -235,10 +241,9 @@ return function (err, data) {

self.emit('error', err);
return;
} else {
self._queue.push(new BlockData(index, data));
if (self._needPush) {
self._read();
}
}
self._pending--;
self._queue.push(new BlockData(index, data));
if (self._needPush) {
self._needPush = false;
self._read();
}
cb();
};

@@ -248,2 +253,4 @@ };

BlockDecoder.prototype._read = function () {
this._needPush = false;
var tap = this._blockTap;

@@ -253,3 +260,3 @@ if (tap.pos >= tap.buf.length) {

if (!data) {
if (this._finished && !this._pending) {
if (this._finished) {
this.push(null);

@@ -256,0 +263,0 @@ } else {

{
"name": "avsc",
"version": "3.1.2",
"description": "Blazing fast serialization",
"version": "3.1.3",
"description": "Blazingly fast serialization",
"homepage": "https://github.com/mtth/avsc",

@@ -6,0 +6,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc