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

node-opcua-extension-object

Package Overview
Dependencies
Maintainers
1
Versions
184
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-opcua-extension-object - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

10

package.json
{
"name": "node-opcua-extension-object",
"version": "0.3.0",
"version": "0.4.0",
"description": "pure nodejs OPCUA SDK - module -extension-object",

@@ -10,6 +10,6 @@ "main": "index.js",

"dependencies": {
"node-opcua-assert": "^0.3.0",
"node-opcua-basic-types": "^0.3.0",
"node-opcua-factory": "^0.3.0",
"node-opcua-nodeid": "^0.3.0"
"node-opcua-assert": "^0.4.0",
"node-opcua-basic-types": "^0.4.0",
"node-opcua-factory": "^0.4.0",
"node-opcua-nodeid": "^0.4.0"
},

@@ -16,0 +16,0 @@ "author": "Etienne Rossignon",

@@ -109,3 +109,20 @@ "use strict";

}
object.decode(stream);
// let verify that decode will use the expected number of bytes
const streamLengthBefore = stream.length;
try {
object.decode(stream);
}
catch(err) {
console.log("Cannot decode object ",err.message);
}
if (streamLengthBefore + length !== stream.length) {
// this may happen if the server or client do have a different OPCUA version
// for instance SubscriptionDiagnostics structure has been changed between OPCUA version 1.01 and 1.04
// causing 2 extra member to be added.
console.log("=========================================".bgWhite.red);
console.warn("WARNING => Extension object decoding error on ",object.constructor.name," expected size was", length, "actual size was ", stream.length - streamLengthBefore);
stream.length = streamLengthBefore + length;
}
return object;

@@ -116,2 +133,4 @@ }

exports.encodeExtensionObject =encodeExtensionObject;
exports.decodeExtensionObject =decodeExtensionObject;

@@ -118,0 +137,0 @@

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