node-opcua-buffer-utils 2.176.0 → 2.179.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buffer_utils.d.ts +0 -2
- package/dist/buffer_utils.js +1 -18
- package/dist/buffer_utils.js.map +1 -1
- package/package.json +4 -4
- package/source/buffer_utils.ts +1 -18
package/dist/buffer_utils.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/***
|
|
2
2
|
* @module node-opcua-buffer-utils
|
|
3
3
|
*/
|
|
4
|
-
export declare const createFastUninitializedBuffer: (size: number) => Buffer<ArrayBuffer>;
|
|
5
4
|
/**
|
|
6
5
|
|
|
7
6
|
* turn a string make of hexadecimal bytes into a buffer
|
|
@@ -13,4 +12,3 @@ export declare const createFastUninitializedBuffer: (size: number) => Buffer<Arr
|
|
|
13
12
|
* @return {Buffer}
|
|
14
13
|
*/
|
|
15
14
|
export declare function makeBuffer(listOfBytes: string): Buffer;
|
|
16
|
-
export declare function clone_buffer(buffer: Buffer): Buffer;
|
package/dist/buffer_utils.js
CHANGED
|
@@ -3,19 +3,7 @@
|
|
|
3
3
|
* @module node-opcua-buffer-utils
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createFastUninitializedBuffer = void 0;
|
|
7
6
|
exports.makeBuffer = makeBuffer;
|
|
8
|
-
exports.clone_buffer = clone_buffer;
|
|
9
|
-
//
|
|
10
|
-
// note: new Buffer(size)# is deprecated since: v6.0. and is replaced with Buffer.allocUnsafe
|
|
11
|
-
// to ensure backward compatibility we have to replace
|
|
12
|
-
// new Buffer(size) with createFastUninitializedBuffer(size)
|
|
13
|
-
//
|
|
14
|
-
// Buffer.alloc and Buffer.allocUnsafe have been introduced in nodejs 5.1.0
|
|
15
|
-
// in node 0.11 new Buffer
|
|
16
|
-
//
|
|
17
|
-
// tslint:disable-next-line:ban-types
|
|
18
|
-
exports.createFastUninitializedBuffer = Buffer.allocUnsafe;
|
|
19
7
|
/**
|
|
20
8
|
|
|
21
9
|
* turn a string make of hexadecimal bytes into a buffer
|
|
@@ -28,7 +16,7 @@ exports.createFastUninitializedBuffer = Buffer.allocUnsafe;
|
|
|
28
16
|
*/
|
|
29
17
|
function makeBuffer(listOfBytes) {
|
|
30
18
|
const l = listOfBytes.split(" ");
|
|
31
|
-
const b =
|
|
19
|
+
const b = Buffer.allocUnsafe(l.length);
|
|
32
20
|
let i = 0;
|
|
33
21
|
l.forEach((value) => {
|
|
34
22
|
b.writeUInt8(parseInt(value, 16), i);
|
|
@@ -36,9 +24,4 @@ function makeBuffer(listOfBytes) {
|
|
|
36
24
|
});
|
|
37
25
|
return b;
|
|
38
26
|
}
|
|
39
|
-
function clone_buffer(buffer) {
|
|
40
|
-
const clone = exports.createFastUninitializedBuffer(buffer.length);
|
|
41
|
-
buffer.copy(clone, 0, 0);
|
|
42
|
-
return clone;
|
|
43
|
-
}
|
|
44
27
|
//# sourceMappingURL=buffer_utils.js.map
|
package/dist/buffer_utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer_utils.js","sourceRoot":"","sources":["../source/buffer_utils.ts"],"names":[],"mappings":";AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"buffer_utils.js","sourceRoot":"","sources":["../source/buffer_utils.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAYH,gCASC;AAnBD;;;;;;;;;GASG;AACH,SAAgB,UAAU,CAAC,WAAmB;IAC1C,MAAM,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACvC,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAChB,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACrC,CAAC,IAAI,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,CAAC;AACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-buffer-utils",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.179.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module buffer-utils",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
"build": "tsc -b",
|
|
9
9
|
"test": "mocha",
|
|
10
10
|
"clean": "npx rimraf -g node_modules dist *.tsbuildinfo",
|
|
11
|
-
"lint": "
|
|
11
|
+
"lint": "biome check --no-errors-on-unmatched ."
|
|
12
12
|
},
|
|
13
13
|
"author": "Etienne Rossignon",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"node-opcua-benchmarker": "2.
|
|
16
|
+
"node-opcua-benchmarker": "2.179.0"
|
|
17
17
|
},
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"internet of things"
|
|
29
29
|
],
|
|
30
30
|
"homepage": "http://node-opcua.github.io/",
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "c78c6ee424bae3c6e851fabd8e144390e2941f8a",
|
|
32
32
|
"files": [
|
|
33
33
|
"dist",
|
|
34
34
|
"source"
|
package/source/buffer_utils.ts
CHANGED
|
@@ -2,17 +2,6 @@
|
|
|
2
2
|
* @module node-opcua-buffer-utils
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
//
|
|
6
|
-
// note: new Buffer(size)# is deprecated since: v6.0. and is replaced with Buffer.allocUnsafe
|
|
7
|
-
// to ensure backward compatibility we have to replace
|
|
8
|
-
// new Buffer(size) with createFastUninitializedBuffer(size)
|
|
9
|
-
//
|
|
10
|
-
// Buffer.alloc and Buffer.allocUnsafe have been introduced in nodejs 5.1.0
|
|
11
|
-
// in node 0.11 new Buffer
|
|
12
|
-
//
|
|
13
|
-
// tslint:disable-next-line:ban-types
|
|
14
|
-
export const createFastUninitializedBuffer = Buffer.allocUnsafe;
|
|
15
|
-
|
|
16
5
|
/**
|
|
17
6
|
|
|
18
7
|
* turn a string make of hexadecimal bytes into a buffer
|
|
@@ -25,7 +14,7 @@ export const createFastUninitializedBuffer = Buffer.allocUnsafe;
|
|
|
25
14
|
*/
|
|
26
15
|
export function makeBuffer(listOfBytes: string): Buffer {
|
|
27
16
|
const l = listOfBytes.split(" ");
|
|
28
|
-
const b =
|
|
17
|
+
const b = Buffer.allocUnsafe(l.length);
|
|
29
18
|
let i = 0;
|
|
30
19
|
l.forEach((value) => {
|
|
31
20
|
b.writeUInt8(parseInt(value, 16), i);
|
|
@@ -33,9 +22,3 @@ export function makeBuffer(listOfBytes: string): Buffer {
|
|
|
33
22
|
});
|
|
34
23
|
return b;
|
|
35
24
|
}
|
|
36
|
-
|
|
37
|
-
export function clone_buffer(buffer: Buffer): Buffer {
|
|
38
|
-
const clone = exports.createFastUninitializedBuffer(buffer.length);
|
|
39
|
-
buffer.copy(clone, 0, 0);
|
|
40
|
-
return clone;
|
|
41
|
-
}
|