• 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

95.74
/packages/node-opcua-data-model/source/node_class_mask.ts
1
/**
2✔
2
 * @module node-opcua-data-model
2✔
3
 */
2✔
4
// tslint:disable:no-bitwise
2✔
5

2✔
6
// Specifies the NodeClasses of the TargetNodes. Only TargetNodes with the
2✔
7
// selected NodeClasses are returned. The NodeClasses are assigned the
2✔
8
// following bits:
2✔
9
// If set to zero, then all NodeClasses are returned.
2✔
10
// @example
2✔
11
//    var mask = NodeClassMask.get("Object |  ObjectType");
2✔
12
//    mask.value.should.eql(1 + (1<<3));
2✔
13

2✔
14
export enum NodeClassMask {
10✔
15
    Object = 1 << 0,
10✔
16
    Variable = 1 << 1,
10✔
17
    Method = 1 << 2,
10✔
18
    ObjectType = 1 << 3,
10✔
19
    VariableType = 1 << 4,
10✔
20
    ReferenceType = 1 << 5,
10✔
21
    DataType = 1 << 6,
10✔
22
    View = 1 << 7
10✔
23
}
10✔
24

2✔
25
interface Enum {
2✔
26
    [id: string]: number;
2✔
27
}
2✔
28

2✔
29
function makeFlagFromString<Type>(type: Enum, str: string): Type {
463,452✔
30
    const flags = str.split(" | ");
463,452✔
31
    let result: any = 0;
463,452✔
32
    for (const flag of flags) {
463,452✔
33
        result |= type[flag];
493,994✔
34
    }
493,994✔
35
    return result as Type;
463,452✔
36
}
463,452✔
37

2✔
38
// @example
2✔
39
//      makeNodeClassMask("Method | Object").should.eql(5);
2✔
40
export function makeNodeClassMask(str: string): NodeClassMask {
463,452✔
41
    const classMask = makeFlagFromString<NodeClassMask>(NodeClassMask as any, str);
463,452✔
42
    /* c8 ignore next */
2✔
43
    if (!classMask) {
2✔
UNCOV
44
        throw new Error(" cannot find class mask for " + str);
×
UNCOV
45
    }
×
46
    return classMask;
463,452✔
47
}
463,452✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc