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.3.0 to 1.3.1

15

dist/utils.js

@@ -30,4 +30,3 @@ "use strict";

var count = _ref.count,
countType = _ref.countType,
countTypeArgs = _ref.countTypeArgs;
countType = _ref.countType;

@@ -40,3 +39,3 @@ var c = 0;

var _tryDoc = tryDoc(function () {
return _this.read(buffer, offset, { type: countType, typeArgs: countTypeArgs }, rootNode);
return _this.read(buffer, offset, getFieldInfo(countType), rootNode);
}, "$count");

@@ -53,4 +52,3 @@

var count = _ref2.count,
countType = _ref2.countType,
countTypeArgs = _ref2.countTypeArgs;
countType = _ref2.countType;

@@ -60,3 +58,3 @@ if (typeof count !== "undefined" && len !== count) {

} else if (typeof countType !== "undefined") {
offset = this.write(len, buffer, offset, { type: countType, typeArgs: countTypeArgs }, rootNode);
offset = this.write(len, buffer, offset, getFieldInfo(countType), rootNode);
} else {

@@ -72,7 +70,6 @@ // TODO: Throw

var count = _ref3.count,
countType = _ref3.countType,
countTypeArgs = _ref3.countTypeArgs;
countType = _ref3.countType;
if (typeof count === "undefined" && typeof countType !== "undefined") return tryDoc(function () {
return _this2.sizeOf(len, { type: countType, typeArgs: countTypeArgs }, rootNode);
return _this2.sizeOf(len, getFieldInfo(countType), rootNode);
}, "$count");else return 0;

@@ -79,0 +76,0 @@ }

4

doc/history.md
# History
## 1.3.1
* fix countType : now behave as an ordinary type, remove undocumented countTypeArgs
## 1.3.0

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

{
"name": "protodef",
"version": "1.3.0",
"version": "1.3.1",
"description": "A simple yet powerful way to define binary protocols",

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

@@ -26,3 +26,3 @@

function getCount(buffer, offset, { count, countType, countTypeArgs }, rootNode) {
function getCount(buffer, offset, { count, countType }, rootNode) {
var c = 0;

@@ -35,3 +35,3 @@ var size = 0;

} else if (typeof countType !== "undefined") {
({size,value: c}=tryDoc(() => this.read(buffer, offset, { type: countType, typeArgs: countTypeArgs }, rootNode),"$count"));
({size,value: c}=tryDoc(() => this.read(buffer, offset, getFieldInfo(countType), rootNode),"$count"));
} else // TODO : broken schema, should probably error out.

@@ -42,7 +42,7 @@ c = 0;

function sendCount(len, buffer, offset, { count, countType, countTypeArgs }, rootNode) {
function sendCount(len, buffer, offset, { count, countType }, rootNode) {
if (typeof count !== "undefined" && len !== count) {
// TODO: Throw
} else if (typeof countType !== "undefined") {
offset = this.write(len, buffer, offset, { type: countType, typeArgs: countTypeArgs }, rootNode);
offset = this.write(len, buffer, offset, getFieldInfo(countType), rootNode);
} else {

@@ -54,5 +54,5 @@ // TODO: Throw

function calcCount(len, { count, countType, countTypeArgs }, rootNode) {
function calcCount(len, { count, countType }, rootNode) {
if (typeof count === "undefined" && typeof countType !== "undefined")
return tryDoc(() => this.sizeOf(len, { type: countType, typeArgs: countTypeArgs }, rootNode),"$count");
return tryDoc(() => this.sizeOf(len, getFieldInfo(countType), rootNode),"$count");
else

@@ -59,0 +59,0 @@ return 0;

Sorry, the diff of this file is not supported yet

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