Socket
Socket
Sign inDemoInstall

msgpack5

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

msgpack5 - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

11

lib/streams.js

@@ -83,3 +83,5 @@

function decodeWithHeader(buf, enc, done) {
this._chunks.append(buf)
// needed for recursive invocation
if (buf)
this._chunks.append(buf)

@@ -105,6 +107,11 @@ // we need to parse the header

this.emit('error', err)
return;
}
}
done()
if (this._chunks.length > 0) {
this._transform(null, enc, done)
}
else
done()
}

@@ -111,0 +118,0 @@

3

package.json
{
"name": "msgpack5",
"version": "1.2.0",
"version": "1.3.0",
"description": "A msgpack v5 implementation for node.js, with extension points",

@@ -33,2 +33,3 @@ "main": "index.js",

"devDependencies": {
"bl": "^0.9.3",
"faucet": "0.0.1",

@@ -35,0 +36,0 @@ "jshint": "^2.5.2",

var test = require('tape').test
, msgpack = require('../')
, BufferList = require('bl')

@@ -186,1 +187,30 @@ test('must send an object through', function(t) {

})
test('concatenated buffers work', function(t) {
var pack = msgpack()
, encoder = pack.encoder()
, decoder = pack.decoder()
, data = [
{ hello: 1 }
, { hello: 2 }
, { hello: 3 }
]
t.plan(data.length)
var bl = new BufferList()
encoder.on('data', bl.append.bind(bl))
data.forEach(encoder.write.bind(encoder))
decoder.on('data', function(d) {
t.deepEqual(d, data.shift())
})
encoder.once('finish', function() {
var buf = bl.slice()
decoder.write(buf)
})
encoder.end()
})
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