node-opcua-buffer-utils 2.176.0 → 2.181.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.
@@ -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;
@@ -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 = exports.createFastUninitializedBuffer(l.length);
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
@@ -1 +1 @@
1
- {"version":3,"file":"buffer_utils.js","sourceRoot":"","sources":["../source/buffer_utils.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAuBH,gCASC;AAED,oCAIC;AApCD,EAAE;AACF,8FAA8F;AAC9F,4DAA4D;AAC5D,kEAAkE;AAClE,EAAE;AACF,iFAAiF;AACjF,2BAA2B;AAC3B,EAAE;AACF,qCAAqC;AACxB,QAAA,6BAA6B,GAAG,MAAM,CAAC,WAAW,CAAC;AAEhE;;;;;;;;;GASG;AACH,SAAgB,UAAU,CAAC,WAAmB;IAC1C,MAAM,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,CAAC,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC1D,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;AAED,SAAgB,YAAY,CAAC,MAAc;IACvC,MAAM,KAAK,GAAG,OAAO,CAAC,6BAA6B,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACnE,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACzB,OAAO,KAAK,CAAC;AACjB,CAAC"}
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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /***
2
2
  * @module node-opcua-buffer-utils
3
3
  */
4
- export * from "./buffer_utils";
4
+ export * from "./buffer_utils.js";
package/dist/index.js CHANGED
@@ -17,5 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /***
18
18
  * @module node-opcua-buffer-utils
19
19
  */
20
- __exportStar(require("./buffer_utils"), exports);
20
+ __exportStar(require("./buffer_utils.js"), exports);
21
21
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,iDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,oDAAkC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-buffer-utils",
3
- "version": "2.176.0",
3
+ "version": "2.181.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": "eslint source/**/*.ts"
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.176.0"
16
+ "node-opcua-benchmarker": "2.181.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": "a4569830a5a564a7ff3e8cf37c44fd35b3f72ac1",
31
+ "gitHead": "f8f472c59e681b2aa18ae1533c3d1e5f17614c5c",
32
32
  "files": [
33
33
  "dist",
34
34
  "source"
@@ -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 = exports.createFastUninitializedBuffer(l.length);
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
- }
package/source/index.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /***
2
2
  * @module node-opcua-buffer-utils
3
3
  */
4
- export * from "./buffer_utils";
4
+ export * from "./buffer_utils.js";