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

protodef

Package Overview
Dependencies
Maintainers
2
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protodef - npm Package Compare versions

Comparing version 1.7.2 to 1.8.0

4

doc/history.md
# History
## 1.8.0
* add option not to log partial packets in full chunk parser
## 1.7.2

@@ -4,0 +8,0 @@

2

package.json
{
"name": "protodef",
"version": "1.7.2",
"version": "1.8.0",
"description": "A simple yet powerful way to define binary protocols",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -60,6 +60,7 @@ const Transform = require('readable-stream').Transform

class FullPacketParser extends Transform {
constructor (proto, mainType) {
constructor (proto, mainType, noErrorLogging = false) {
super({ readableObjectMode: true })
this.proto = proto
this.mainType = mainType
this.noErrorLogging = noErrorLogging
}

@@ -75,3 +76,3 @@

packet = this.parsePacketBuffer(chunk)
if (packet.metadata.size !== chunk.length) {
if (packet.metadata.size !== chunk.length && !this.noErrorLogging) {
console.log('Chunk size is ' + chunk.length + ' but only ' + packet.metadata.size + ' was read ; partial packet : ' +

@@ -78,0 +79,0 @@ JSON.stringify(packet.data) + '; buffer :' + chunk.toString('hex'))

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