• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

node-opcua / node-opcua / 22636309940

03 Mar 2026 06:03PM UTC coverage: 92.756% (+1.9%) from 90.81%
22636309940

push

github

erossignon
test: disable ENOENT on overlapping trustCertificate invocations in test environments with concurrency tests

18684 of 22141 branches covered (84.39%)

23 of 37 new or added lines in 1 file covered. (62.16%)

5775 existing lines in 228 files now uncovered.

160668 of 173216 relevant lines covered (92.76%)

875869.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.8
/packages/node-opcua-buffer-utils/source/buffer_utils.ts
1
/***
2✔
2
 * @module node-opcua-buffer-utils
2✔
3
 */
2✔
4

2✔
5
//
2✔
6
// note: new Buffer(size)#  is deprecated since: v6.0. and is replaced with Buffer.allocUnsafe
2✔
7
//       to ensure backward compatibility we have to replace
2✔
8
//       new Buffer(size) with createFastUninitializedBuffer(size)
2✔
9
//
2✔
10
//       Buffer.alloc and Buffer.allocUnsafe have been introduced in nodejs 5.1.0
2✔
11
//  in node 0.11 new Buffer
2✔
12
//
2✔
13
// tslint:disable-next-line:ban-types
2✔
14
export const createFastUninitializedBuffer = Buffer.allocUnsafe;
2✔
15

2✔
16
/**
2✔
17

2✔
18
 * turn a string make of hexadecimal bytes into a buffer
2✔
19
 *
2✔
20
 * @example
2✔
21
 *     const buffer = makeBuffer("BE EF");
2✔
22
 *
2✔
23
 * @param listOfBytes
2✔
24
 * @return {Buffer}
2✔
25
 */
2✔
26
export function makeBuffer(listOfBytes: string): Buffer {
2✔
27
    const l = listOfBytes.split(" ");
2✔
28
    const b = exports.createFastUninitializedBuffer(l.length);
2✔
29
    let i = 0;
2✔
30
    l.forEach((value) => {
2✔
31
        b.writeUInt8(parseInt(value, 16), i);
898✔
32
        i += 1;
898✔
33
    });
2✔
34
    return b;
2✔
35
}
2✔
36

2✔
UNCOV
37
export function clone_buffer(buffer: Buffer): Buffer {
×
38
    const clone = exports.createFastUninitializedBuffer(buffer.length);
×
39
    buffer.copy(clone, 0, 0);
×
40
    return clone;
×
UNCOV
41
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc