node-opcua-binary-stream
Advanced tools
Comparing version 2.42.0 to 2.51.0
@@ -44,9 +44,9 @@ "use strict"; | ||
if (data === undefined) { | ||
this.buffer = node_opcua_buffer_utils_1.createFastUninitializedBuffer(1024); | ||
this.buffer = (0, node_opcua_buffer_utils_1.createFastUninitializedBuffer)(1024); | ||
} | ||
else if (typeof data === "number") { | ||
this.buffer = node_opcua_buffer_utils_1.createFastUninitializedBuffer(data); | ||
this.buffer = (0, node_opcua_buffer_utils_1.createFastUninitializedBuffer)(data); | ||
} | ||
else { | ||
node_opcua_assert_1.assert(data instanceof Buffer); | ||
(0, node_opcua_assert_1.assert)(data instanceof Buffer); | ||
this.buffer = data; | ||
@@ -71,4 +71,4 @@ } | ||
if (performCheck) { | ||
node_opcua_assert_1.assert(this.buffer.length >= this.length + 1, "not enough space in buffer"); | ||
node_opcua_assert_1.assert(value >= -128 && value < 128); | ||
(0, node_opcua_assert_1.assert)(this.buffer.length >= this.length + 1, "not enough space in buffer"); | ||
(0, node_opcua_assert_1.assert)(value >= -128 && value < 128); | ||
} | ||
@@ -85,4 +85,4 @@ this.buffer.writeInt8(value, this.length); | ||
if (performCheck) { | ||
node_opcua_assert_1.assert(this.buffer.length >= this.length + 1, "not enough space in buffer"); | ||
node_opcua_assert_1.assert(value >= 0 && value < 256, " writeUInt8 : out of bound "); | ||
(0, node_opcua_assert_1.assert)(this.buffer.length >= this.length + 1, "not enough space in buffer"); | ||
(0, node_opcua_assert_1.assert)(value >= 0 && value < 256, " writeUInt8 : out of bound "); | ||
} | ||
@@ -99,3 +99,3 @@ this.buffer.writeUInt8(value, this.length); | ||
if (performCheck) { | ||
node_opcua_assert_1.assert(this.buffer.length >= this.length + 2, "not enough space in buffer"); | ||
(0, node_opcua_assert_1.assert)(this.buffer.length >= this.length + 2, "not enough space in buffer"); | ||
} | ||
@@ -112,3 +112,3 @@ this.buffer.writeInt16LE(value, this.length); | ||
if (performCheck) { | ||
node_opcua_assert_1.assert(this.buffer.length >= this.length + 2, "not enough space in buffer"); | ||
(0, node_opcua_assert_1.assert)(this.buffer.length >= this.length + 2, "not enough space in buffer"); | ||
} | ||
@@ -125,3 +125,3 @@ this.buffer.writeUInt16LE(value, this.length); | ||
if (performCheck) { | ||
node_opcua_assert_1.assert(this.buffer.length >= this.length + 4, "not enough space in buffer"); | ||
(0, node_opcua_assert_1.assert)(this.buffer.length >= this.length + 4, "not enough space in buffer"); | ||
} | ||
@@ -139,5 +139,5 @@ this.buffer.writeInt32LE(value, this.length); | ||
if (performCheck) { | ||
node_opcua_assert_1.assert(this.buffer.length >= this.length + 4, "not enough space in buffer"); | ||
node_opcua_assert_1.assert(isFinite(value)); | ||
node_opcua_assert_1.assert(value >= 0 && value <= MAXUINT32); | ||
(0, node_opcua_assert_1.assert)(this.buffer.length >= this.length + 4, "not enough space in buffer"); | ||
(0, node_opcua_assert_1.assert)(isFinite(value)); | ||
(0, node_opcua_assert_1.assert)(value >= 0 && value <= MAXUINT32); | ||
} | ||
@@ -160,3 +160,3 @@ this.buffer.writeUInt32LE(value, this.length); | ||
if (performCheck) { | ||
node_opcua_assert_1.assert(this.buffer.length >= this.length + 4, "not enough space in buffer"); | ||
(0, node_opcua_assert_1.assert)(this.buffer.length >= this.length + 4, "not enough space in buffer"); | ||
} | ||
@@ -173,3 +173,3 @@ this.buffer.writeFloatLE(value, this.length); | ||
if (performCheck) { | ||
node_opcua_assert_1.assert(this.buffer.length >= this.length + 8, "not enough space in buffer"); | ||
(0, node_opcua_assert_1.assert)(this.buffer.length >= this.length + 8, "not enough space in buffer"); | ||
} | ||
@@ -187,3 +187,3 @@ this.buffer.writeDoubleLE(value, this.length); | ||
if (performCheck) { | ||
node_opcua_assert_1.assert(arrayBuf instanceof ArrayBuffer); | ||
(0, node_opcua_assert_1.assert)(arrayBuf instanceof ArrayBuffer); | ||
} | ||
@@ -225,3 +225,3 @@ const byteArr = new Uint8Array(arrayBuf); | ||
if (performCheck) { | ||
node_opcua_assert_1.assert(this.buffer.length >= this.length + 1); | ||
(0, node_opcua_assert_1.assert)(this.buffer.length >= this.length + 1); | ||
} | ||
@@ -291,3 +291,3 @@ const retVal = this.buffer.readUInt8(this.length); | ||
} | ||
node_opcua_assert_1.assert(buf instanceof Buffer); | ||
(0, node_opcua_assert_1.assert)(buf instanceof Buffer); | ||
this.writeInteger(buf.length); | ||
@@ -344,3 +344,3 @@ // make sure there is enough room in destination buffer | ||
if (performCheck) { | ||
node_opcua_assert_1.assert(this.length + length <= this.buffer.length, "not enough bytes in buffer"); | ||
(0, node_opcua_assert_1.assert)(this.length + length <= this.buffer.length, "not enough bytes in buffer"); | ||
} | ||
@@ -350,3 +350,3 @@ const slice = this.buffer.slice(this.length, this.length + length); | ||
if (performCheck) { | ||
node_opcua_assert_1.assert(slice.length === length); | ||
(0, node_opcua_assert_1.assert)(slice.length === length); | ||
} | ||
@@ -356,3 +356,3 @@ const byteArr = new Uint8Array(slice); | ||
if (performCheck) { | ||
node_opcua_assert_1.assert(byteArr.length === length); | ||
(0, node_opcua_assert_1.assert)(byteArr.length === length); | ||
} | ||
@@ -440,3 +440,3 @@ this.length += length; | ||
exports.calculateByteLength = calculateByteLength; | ||
const zeroLengthBuffer = node_opcua_buffer_utils_1.createFastUninitializedBuffer(0); | ||
const zeroLengthBuffer = (0, node_opcua_buffer_utils_1.createFastUninitializedBuffer)(0); | ||
//# sourceMappingURL=binaryStream.js.map |
@@ -54,3 +54,3 @@ "use strict"; | ||
offset = offset || 0; | ||
node_opcua_assert_1.assert(arrayBuf instanceof ArrayBuffer); | ||
(0, node_opcua_assert_1.assert)(arrayBuf instanceof ArrayBuffer); | ||
this.length += byteLength || arrayBuf.byteLength; | ||
@@ -72,3 +72,3 @@ } | ||
} | ||
const bufLength = binaryStream_1.calculateByteLength(str); | ||
const bufLength = (0, binaryStream_1.calculateByteLength)(str); | ||
this.writeUInt32(bufLength); | ||
@@ -75,0 +75,0 @@ this.length += bufLength; |
{ | ||
"name": "node-opcua-binary-stream", | ||
"version": "2.42.0", | ||
"version": "2.51.0", | ||
"description": "pure nodejs OPCUA SDK - module -binary-stream", | ||
@@ -14,7 +14,7 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"node-opcua-assert": "2.42.0", | ||
"node-opcua-buffer-utils": "2.42.0" | ||
"node-opcua-assert": "2.51.0", | ||
"node-opcua-buffer-utils": "2.51.0" | ||
}, | ||
"devDependencies": { | ||
"node-opcua-benchmarker": "2.42.0", | ||
"node-opcua-benchmarker": "2.51.0", | ||
"should": "^13.2.3" | ||
@@ -37,3 +37,3 @@ }, | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "09c4530a94c3ff0529c94269d31088abecd7e144" | ||
"gitHead": "75feb111daf7ec65fa0111e4fa5beb8987fd4945" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
53351
+ Addedchalk@4.1.2(transitive)
+ Addednode-opcua-assert@2.51.0(transitive)
+ Addednode-opcua-buffer-utils@2.51.0(transitive)
- Removedchalk@4.1.1(transitive)
- Removednode-opcua-assert@2.42.0(transitive)
- Removednode-opcua-buffer-utils@2.42.0(transitive)
Updatednode-opcua-assert@2.51.0