node-opcua-packet-analyzer
Advanced tools
Comparing version 2.49.0 to 2.51.0
@@ -40,3 +40,3 @@ "use strict"; | ||
const n = end - start; | ||
const strBuf = node_opcua_utils_1.buffer_ellipsis(buffer); | ||
const strBuf = (0, node_opcua_utils_1.buffer_ellipsis)(buffer); | ||
return (chalk.cyan("s:") + f(start, 4) + chalk.cyan(" e:") + f(end, 4) + chalk.cyan(" n:") + f(n, 4) + " " + chalk.yellow(strBuf)); | ||
@@ -64,5 +64,5 @@ } | ||
const stream = new node_opcua_binary_stream_1.BinaryStream(bufferExtract); | ||
const nodeId = node_opcua_basic_types_1.decodeNodeId(stream); | ||
const encodingMask = node_opcua_basic_types_1.decodeByte(stream); // 1 bin 2: xml | ||
const length = node_opcua_basic_types_1.decodeUInt32(stream); | ||
const nodeId = (0, node_opcua_basic_types_1.decodeNodeId)(stream); | ||
const encodingMask = (0, node_opcua_basic_types_1.decodeByte)(stream); // 1 bin 2: xml | ||
const length = (0, node_opcua_basic_types_1.decodeUInt32)(stream); | ||
display(chalk.green(" ExpandedNodId =") + " " + nodeId); | ||
@@ -77,3 +77,3 @@ display(chalk.green(" encoding mask =") + " " + encodingMask); | ||
encoding_byte: (encodingMask, valueEnum, start, end) => { | ||
node_opcua_assert_1.assert(valueEnum); | ||
(0, node_opcua_assert_1.assert)(valueEnum); | ||
const b = buffer.slice(start, end); | ||
@@ -114,3 +114,3 @@ display(" 012345678", hex_block(start, end, b)); | ||
if (value instanceof Buffer) { | ||
_hexDump = node_opcua_debug_1.hexDump(value); | ||
_hexDump = (0, node_opcua_debug_1.hexDump)(value); | ||
console.log(_hexDump); | ||
@@ -147,4 +147,4 @@ value = "<BUFFER>"; | ||
try { | ||
id = node_opcua_basic_types_1.decodeExpandedNodeId(stream); | ||
objMessage = node_opcua_factory_1.constructObject(id); | ||
id = (0, node_opcua_basic_types_1.decodeExpandedNodeId)(stream); | ||
objMessage = (0, node_opcua_factory_1.constructObject)(id); | ||
} | ||
@@ -174,8 +174,10 @@ catch (err) { | ||
console.log(" Error in ", err); | ||
console.log(" Error in ", err.stack); | ||
console.log(" objMessage ", util_1.inspect(objMessage, { colors: true })); | ||
if (err instanceof Error) { | ||
console.log(" Error in ", err.stack); | ||
} | ||
console.log(" objMessage ", (0, util_1.inspect)(objMessage, { colors: true })); | ||
} | ||
} | ||
function analyze_object_binary_encoding(obj) { | ||
node_opcua_assert_1.assert(obj); | ||
(0, node_opcua_assert_1.assert)(obj); | ||
const size = obj.binaryStoreSize(); | ||
@@ -189,3 +191,3 @@ console.log("-------------------------------------------------"); | ||
if (stream.buffer.length < 256) { | ||
console.log(node_opcua_debug_1.hexDump(stream.buffer)); | ||
console.log((0, node_opcua_debug_1.hexDump)(stream.buffer)); | ||
console.log("-------------------------------------------------"); | ||
@@ -192,0 +194,0 @@ } |
@@ -15,4 +15,4 @@ "use strict"; | ||
if (process.env.DEBUG) { | ||
console.log(node_opcua_debug_1.hexDump(buffer)); | ||
source_1.analyzePacket(buffer, id, 0, 0, options); | ||
console.log((0, node_opcua_debug_1.hexDump)(buffer)); | ||
(0, source_1.analyzePacket)(buffer, id, 0, 0, options); | ||
} | ||
@@ -39,3 +39,3 @@ } | ||
if (isArrayOrTypedArray(obj[p])) { | ||
node_opcua_test_helpers_1.assert_arrays_are_equal(objReloaded[p], obj[p]); | ||
(0, node_opcua_test_helpers_1.assert_arrays_are_equal)(objReloaded[p], obj[p]); | ||
} | ||
@@ -95,5 +95,5 @@ else { | ||
const expandedNodeId = obj.encodingDefaultBinary; | ||
const objReloaded = expandedNodeId ? node_opcua_factory_1.constructObject(expandedNodeId) : new obj.constructor(); | ||
const objReloaded = expandedNodeId ? (0, node_opcua_factory_1.constructObject)(expandedNodeId) : new obj.constructor(); | ||
objReloaded.decode(stream, options); | ||
redirectToNull(() => source_1.analyze_object_binary_encoding(obj)); | ||
redirectToNull(() => (0, source_1.analyze_object_binary_encoding)(obj)); | ||
compare(objReloaded, obj); | ||
@@ -100,0 +100,0 @@ return objReloaded; |
{ | ||
"name": "node-opcua-packet-analyzer", | ||
"version": "2.49.0", | ||
"version": "2.51.0", | ||
"description": "pure nodejs OPCUA SDK - module -packet-analyzer", | ||
@@ -15,9 +15,9 @@ "main": "./dist/source/index.js", | ||
"dependencies": { | ||
"chalk": "4.1.1", | ||
"node-opcua-assert": "2.42.0", | ||
"node-opcua-basic-types": "2.47.0", | ||
"node-opcua-binary-stream": "2.42.0", | ||
"node-opcua-debug": "2.42.0", | ||
"node-opcua-factory": "2.49.0", | ||
"node-opcua-utils": "2.44.0" | ||
"chalk": "4.1.2", | ||
"node-opcua-assert": "2.51.0", | ||
"node-opcua-basic-types": "2.51.0", | ||
"node-opcua-binary-stream": "2.51.0", | ||
"node-opcua-debug": "2.51.0", | ||
"node-opcua-factory": "2.51.0", | ||
"node-opcua-utils": "2.51.0" | ||
}, | ||
@@ -41,3 +41,3 @@ "devDependencies": { | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "81654553c6d317fd918ca99b749550eb5e951c23" | ||
"gitHead": "75feb111daf7ec65fa0111e4fa5beb8987fd4945" | ||
} |
@@ -205,3 +205,5 @@ // tslint:disable:no-bitwise | ||
console.log(" Error in ", err); | ||
console.log(" Error in ", err.stack); | ||
if (err instanceof Error) { | ||
console.log(" Error in ", err.stack); | ||
} | ||
console.log(" objMessage ", inspect(objMessage, { colors: true })); | ||
@@ -208,0 +210,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44282
689
+ Added@types/lodash@4.14.172(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addednode-opcua-assert@2.51.0(transitive)
+ Addednode-opcua-basic-types@2.51.0(transitive)
+ Addednode-opcua-binary-stream@2.51.0(transitive)
+ Addednode-opcua-buffer-utils@2.51.0(transitive)
+ Addednode-opcua-constants@2.51.0(transitive)
+ Addednode-opcua-date-time@2.51.0(transitive)
+ Addednode-opcua-debug@2.51.0(transitive)
+ Addednode-opcua-enum@2.51.0(transitive)
+ Addednode-opcua-factory@2.51.0(transitive)
+ Addednode-opcua-guid@2.51.0(transitive)
+ Addednode-opcua-nodeid@2.51.0(transitive)
+ Addednode-opcua-status-code@2.51.0(transitive)
+ Addednode-opcua-utils@2.51.0(transitive)
- Removed@types/lodash@4.14.170(transitive)
- Removedchalk@4.1.1(transitive)
- Removednode-opcua-assert@2.42.0(transitive)
- Removednode-opcua-basic-types@2.47.0(transitive)
- Removednode-opcua-binary-stream@2.42.0(transitive)
- Removednode-opcua-buffer-utils@2.42.0(transitive)
- Removednode-opcua-constants@2.42.0(transitive)
- Removednode-opcua-date-time@2.42.0(transitive)
- Removednode-opcua-debug@2.42.0(transitive)
- Removednode-opcua-enum@2.42.0(transitive)
- Removednode-opcua-factory@2.49.0(transitive)
- Removednode-opcua-guid@2.42.0(transitive)
- Removednode-opcua-nodeid@2.45.0(transitive)
- Removednode-opcua-status-code@2.42.0(transitive)
- Removednode-opcua-utils@2.44.0(transitive)
Updatedchalk@4.1.2
Updatednode-opcua-assert@2.51.0
Updatednode-opcua-debug@2.51.0
Updatednode-opcua-factory@2.51.0
Updatednode-opcua-utils@2.51.0