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

node-opcua-packet-assembler

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-opcua-packet-assembler - npm Package Compare versions

Comparing version 2.10.0 to 2.16.0

3

dist/packet_assembler.js

@@ -6,3 +6,2 @@ "use strict";

const node_opcua_assert_1 = require("node-opcua-assert");
const _ = require("underscore");
const doDebug = false;

@@ -17,3 +16,3 @@ class PacketAssembler extends events_1.EventEmitter {

this.minimumSizeInBytes = options.minimumSizeInBytes || 8;
node_opcua_assert_1.assert(_.isFunction(this.readMessageFunc), "packet assembler requires a readMessageFunc");
node_opcua_assert_1.assert(typeof this.readMessageFunc === "function", "packet assembler requires a readMessageFunc");
}

@@ -20,0 +19,0 @@ feed(data) {

{
"name": "node-opcua-packet-assembler",
"version": "2.10.0",
"version": "2.16.0",
"description": "pure nodejs OPCUA SDK - module -packet-assembler",

@@ -15,4 +15,3 @@ "main": "./dist/index.js",

"dependencies": {
"node-opcua-assert": "2.10.0",
"underscore": "^1.10.2"
"node-opcua-assert": "2.16.0"
},

@@ -35,3 +34,3 @@ "devDependencies": {

"homepage": "http://node-opcua.github.io/",
"gitHead": "f1c467c28f8bef1cc04ab54c57a555bd4c95ee45"
"gitHead": "9fa7d50952a7c39ff6790888a2bd6f32fe46836d"
}
import { EventEmitter } from "events";
import { assert } from "node-opcua-assert";
import * as _ from "underscore";

@@ -34,3 +33,2 @@ const doDebug = false;

export class PacketAssembler extends EventEmitter {
private readonly _stack: Buffer[];

@@ -50,3 +48,3 @@ private expectedLength: number;

this.minimumSizeInBytes = options.minimumSizeInBytes || 8;
assert(_.isFunction(this.readMessageFunc), "packet assembler requires a readMessageFunc");
assert(typeof this.readMessageFunc === "function", "packet assembler requires a readMessageFunc");
}

@@ -58,3 +56,2 @@

if (this.expectedLength === 0 && this.currentLength + data.length >= this.minimumSizeInBytes) {
// we are at a start of a block and there is enough data provided to read the length of the block

@@ -78,9 +75,6 @@ // let's build the whole data block with previous blocks already read.

if (this.expectedLength === 0 || this.currentLength + data.length < this.expectedLength) {
this._stack.push(data);
this.currentLength += data.length;
// expecting more data to complete current message chunk
} else if (this.currentLength + data.length === this.expectedLength) {
this.currentLength += data.length;

@@ -101,3 +95,2 @@

this.emit("message", messageChunk);
} else {

@@ -136,3 +129,2 @@ // there is more data in this chunk than expected...

}
}

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