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.15.0 to 1.16.0

.github/dependabot.yml

5

doc/history.md
# History
## 1.16.0
* update protodef definitions
* Replace varint assert with exception
## 1.15.0

@@ -4,0 +9,0 @@

9

package.json
{
"name": "protodef",
"version": "1.15.0",
"version": "1.16.0",
"description": "A simple yet powerful way to define binary protocols",
"main": "index.js",
"types": "index.d.ts",
"author": "roblabla <robinlambertz.dev@gmail.com>",

@@ -20,3 +21,3 @@ "scripts": {

"protodef-validator": "^1.3.0",
"readable-stream": "^3.0.3"
"readable-stream": "^4.4.0"
},

@@ -38,6 +39,6 @@ "engines": {

"jsonschema": "^1.2.4",
"mocha": "^5.2.0",
"mocha": "^10.2.0",
"protodef": "file:.",
"standard": "^16.0.3"
"standard": "^17.0.0"
}
}

@@ -23,3 +23,3 @@ ## Structures

### **container** ([ { name: String, type: Type }, ... ])
### **container** ([ { name: String, type: Type, ?anon: Bool }, ... ])
Arguments:

@@ -29,2 +29,3 @@ * [array] : a field

* * type : the type of field
* * anon : optional (either anon or name), a boolean to make field anonymous (also known as [unnamed field](https://gcc.gnu.org/onlinedocs/gcc/Unnamed-Fields.html))

@@ -40,4 +41,9 @@ Represents a list of named values.

{ "name": "z", "type": "i32" },
{ "name": "bitMap", "type": "u16" },
{ "name": "addBitMap", "type": "u16" }
{ "anon": true, "type": [
"container",
[
{ "name": "bitMap", "type": "u16" },
{ "name": "addBitMap", "type": "u16" }
]
] }
]

@@ -48,2 +54,4 @@ ]

**Note**: At the time of writing, implementations have limited support of `anon`.
### **count** ({ type: Type, countFor: Field })

@@ -66,2 +74,2 @@ Arguments:

```
Example of value: `4`
Example of value: `4`

@@ -6,2 +6,4 @@ {

"cstring": {
"title": "cstring",
"type": "array",
"items": [

@@ -8,0 +10,0 @@ {

@@ -92,4 +92,4 @@ const { PartialReadError } = require('../utils')

return {
value: value,
size: size
value,
size
}

@@ -96,0 +96,0 @@ }

@@ -1,3 +0,1 @@

const assert = require('assert')
const { getCount, sendCount, calcCount, PartialReadError } = require('../utils')

@@ -32,3 +30,3 @@

return {
size: size,
size,
value: mappedValue

@@ -81,3 +79,3 @@ }

shift += 7 // we only have 7 bits, MSB being the return-trigger
assert.ok(shift < 64, 'varint is too big') // Make sure our shift don't overflow.
if (shift > 64) throw new PartialReadError(`varint is too big: ${shift}`) // Make sure our shift don't overflow.
}

@@ -84,0 +82,0 @@ }

@@ -5,3 +5,3 @@ const ProtoDef = require('./protodef')

module.exports = {
ProtoDef: ProtoDef,
ProtoDef,
Serializer: require('./serializer').Serializer,

@@ -8,0 +8,0 @@ Parser: require('./serializer').Parser,

@@ -161,3 +161,3 @@ const { getFieldInfo, tryCatch } = require('./utils')

metadata: {
size: size
size
},

@@ -164,0 +164,0 @@ buffer: buffer.slice(0, size),

@@ -95,5 +95,5 @@ const Transform = require('readable-stream').Transform

module.exports = {
Serializer: Serializer,
Parser: Parser,
FullPacketParser: FullPacketParser
Serializer,
Parser,
FullPacketParser
}

@@ -76,11 +76,11 @@ function getField (countField, context) {

module.exports = {
getField: getField,
getFieldInfo: getFieldInfo,
addErrorField: addErrorField,
getCount: getCount,
sendCount: sendCount,
calcCount: calcCount,
tryCatch: tryCatch,
tryDoc: tryDoc,
PartialReadError: PartialReadError
getField,
getFieldInfo,
addErrorField,
getCount,
sendCount,
calcCount,
tryCatch,
tryDoc,
PartialReadError
}
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