node-opcua-nodeid 2.125.0 → 2.133.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/expanded_nodeid.d.ts +8 -20
- package/dist/expanded_nodeid.js +5 -23
- package/dist/expanded_nodeid.js.map +1 -1
- package/dist/nodeid.d.ts +126 -53
- package/dist/nodeid.js +127 -68
- package/dist/nodeid.js.map +1 -1
- package/package.json +5 -6
- package/source/expanded_nodeid.ts +9 -22
- package/source/nodeid.ts +158 -73
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
/**
|
|
3
2
|
* @module node-opcua-nodeid
|
|
4
3
|
*/
|
|
@@ -27,17 +26,8 @@ import { NodeId, NodeIdType } from "./nodeid";
|
|
|
27
26
|
* NamespaceUri. The ServerIndex flag in the NodeId encoding byte indicates whether the
|
|
28
27
|
* ServerIndex is present in the stream. The ServerIndex is omitted if it is equal to zero.
|
|
29
28
|
*
|
|
30
|
-
* @class ExpandedNodeId
|
|
31
|
-
* @extends NodeId
|
|
32
29
|
*
|
|
33
30
|
*
|
|
34
|
-
*
|
|
35
|
-
* @param identifierType - the nodeID type
|
|
36
|
-
* @param value - the node id value. The type of Value depends on identifierType.
|
|
37
|
-
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
38
|
-
* @param namespaceUri - NamespaceUri
|
|
39
|
-
* @param serverIndex - the server Index
|
|
40
|
-
* @constructor
|
|
41
31
|
*/
|
|
42
32
|
export declare class ExpandedNodeId extends NodeId {
|
|
43
33
|
static nullExpandedNodeId: ExpandedNodeId;
|
|
@@ -45,24 +35,22 @@ export declare class ExpandedNodeId extends NodeId {
|
|
|
45
35
|
namespaceUri: null | string;
|
|
46
36
|
serverIndex: number;
|
|
47
37
|
constructor(forDeserialization: null);
|
|
48
|
-
constructor(identifierType: NodeIdType, value: number | string | Guid | Buffer, namespace: number, namespaceUri?: null | string, serverIndex?: number);
|
|
49
38
|
/**
|
|
50
|
-
* @
|
|
51
|
-
* @
|
|
39
|
+
* @param identifierType - the nodeID type
|
|
40
|
+
* @param value - the node id value. The type of Value depends on identifierType.
|
|
41
|
+
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
42
|
+
* @param namespaceUri - NamespaceUri
|
|
43
|
+
* @param serverIndex - the server Index
|
|
52
44
|
*/
|
|
45
|
+
constructor(identifierType: NodeIdType, value: number | string | Guid | Buffer, namespace: number, namespaceUri?: null | string, serverIndex?: number);
|
|
53
46
|
toString(): string;
|
|
54
47
|
/**
|
|
55
|
-
* convert nodeId to a JSON string. same as {@link
|
|
56
|
-
* @method toJSON
|
|
57
|
-
* @return {String}
|
|
48
|
+
* convert nodeId to a JSON string. same as {@link toString }
|
|
58
49
|
*/
|
|
59
50
|
toJSON(): any;
|
|
60
51
|
}
|
|
61
52
|
export declare function coerceExpandedNodeId(value: unknown): ExpandedNodeId;
|
|
62
53
|
/**
|
|
63
|
-
*
|
|
64
|
-
* @param value
|
|
65
|
-
* @param [namespace=0] the namespace
|
|
66
|
-
* @return {ExpandedNodeId}
|
|
54
|
+
* create an expanded nodeId
|
|
67
55
|
*/
|
|
68
56
|
export declare function makeExpandedNodeId(value: unknown, namespace?: number): ExpandedNodeId;
|
package/dist/expanded_nodeid.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ExpandedNodeId = void 0;
|
|
4
|
+
exports.coerceExpandedNodeId = coerceExpandedNodeId;
|
|
5
|
+
exports.makeExpandedNodeId = makeExpandedNodeId;
|
|
4
6
|
const nodeid_1 = require("./nodeid");
|
|
5
7
|
/**
|
|
6
8
|
* An ExpandedNodeId extends the NodeId structure.
|
|
@@ -25,17 +27,8 @@ const nodeid_1 = require("./nodeid");
|
|
|
25
27
|
* NamespaceUri. The ServerIndex flag in the NodeId encoding byte indicates whether the
|
|
26
28
|
* ServerIndex is present in the stream. The ServerIndex is omitted if it is equal to zero.
|
|
27
29
|
*
|
|
28
|
-
* @class ExpandedNodeId
|
|
29
|
-
* @extends NodeId
|
|
30
30
|
*
|
|
31
31
|
*
|
|
32
|
-
*
|
|
33
|
-
* @param identifierType - the nodeID type
|
|
34
|
-
* @param value - the node id value. The type of Value depends on identifierType.
|
|
35
|
-
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
36
|
-
* @param namespaceUri - NamespaceUri
|
|
37
|
-
* @param serverIndex - the server Index
|
|
38
|
-
* @constructor
|
|
39
32
|
*/
|
|
40
33
|
class ExpandedNodeId extends nodeid_1.NodeId {
|
|
41
34
|
static fromNodeId(nodeId, namespaceUri, serverIndex) {
|
|
@@ -46,10 +39,6 @@ class ExpandedNodeId extends nodeid_1.NodeId {
|
|
|
46
39
|
this.namespaceUri = namespaceUri || null;
|
|
47
40
|
this.serverIndex = serverIndex || 0;
|
|
48
41
|
}
|
|
49
|
-
/**
|
|
50
|
-
* @method toString
|
|
51
|
-
* @return {string}
|
|
52
|
-
*/
|
|
53
42
|
toString() {
|
|
54
43
|
let str = nodeid_1.NodeId.prototype.toString.call(this);
|
|
55
44
|
if (this.namespaceUri) {
|
|
@@ -61,9 +50,7 @@ class ExpandedNodeId extends nodeid_1.NodeId {
|
|
|
61
50
|
return str;
|
|
62
51
|
}
|
|
63
52
|
/**
|
|
64
|
-
* convert nodeId to a JSON string. same as {@link
|
|
65
|
-
* @method toJSON
|
|
66
|
-
* @return {String}
|
|
53
|
+
* convert nodeId to a JSON string. same as {@link toString }
|
|
67
54
|
*/
|
|
68
55
|
toJSON() {
|
|
69
56
|
return this.toString();
|
|
@@ -75,12 +62,8 @@ function coerceExpandedNodeId(value) {
|
|
|
75
62
|
const n = (0, nodeid_1.coerceNodeId)(value);
|
|
76
63
|
return new ExpandedNodeId(n.identifierType, n.value, n.namespace, /*namespaceUri*/ null, /*serverIndex*/ 0);
|
|
77
64
|
}
|
|
78
|
-
exports.coerceExpandedNodeId = coerceExpandedNodeId;
|
|
79
65
|
/**
|
|
80
|
-
*
|
|
81
|
-
* @param value
|
|
82
|
-
* @param [namespace=0] the namespace
|
|
83
|
-
* @return {ExpandedNodeId}
|
|
66
|
+
* create an expanded nodeId
|
|
84
67
|
*/
|
|
85
68
|
function makeExpandedNodeId(value, namespace) {
|
|
86
69
|
if (value === undefined && namespace === undefined) {
|
|
@@ -106,5 +89,4 @@ function makeExpandedNodeId(value, namespace) {
|
|
|
106
89
|
namespace = namespace || 0;
|
|
107
90
|
return new ExpandedNodeId(nodeid_1.NodeIdType.NUMERIC, valueInt, namespace, namespaceUri, serverIndex);
|
|
108
91
|
}
|
|
109
|
-
exports.makeExpandedNodeId = makeExpandedNodeId;
|
|
110
92
|
//# sourceMappingURL=expanded_nodeid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expanded_nodeid.js","sourceRoot":"","sources":["../source/expanded_nodeid.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"expanded_nodeid.js","sourceRoot":"","sources":["../source/expanded_nodeid.ts"],"names":[],"mappings":";;;AAuFA,oDAGC;AAID,gDAyBC;AAnHD,qCAA4D;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAa,cAAe,SAAQ,eAAM;IAG/B,MAAM,CAAC,UAAU,CAAC,MAAc,EAAE,YAAqB,EAAE,WAAoB;QAChF,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;IAChH,CAAC;IAoBD,YACI,cAAkC,EAClC,KAAuC,EACvC,SAAkB,EAClB,YAA4B,EAC5B,WAAoB;QAEpB,KAAK,CAAC,cAAc,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,YAAY,IAAI,IAAI,CAAC;QACzC,IAAI,CAAC,WA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EAAE,CAAC;QAClC,0CAA0C;QAC1C,CAAC,GAAG,KAAK,CAAC;QACV,OAAO,IAAI,cAAc,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC;IACrG,CAAC;IACD,IAAI,KAAK,YAAY,eAAM,EAAE,CAAC;QAC1B,0BAA0B;QAC1B,CAAC,GAAG,KAAK,CAAC;QACV,OAAO,IAAI,cAAc,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,SAAS,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;IACjG,CAAC;IAED,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAe,EAAE,EAAE,CAAC,CAAC;IAC/C,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,oCAAoC,GAAG,KAAK,CAAC,CAAC;IAClE,CAAC;IACD,SAAS,GAAG,SAAS,IAAI,CAAC,CAAC;IAC3B,OAAO,IAAI,cAAc,CAAC,mBAAU,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;AAClG,CAAC"}
|
package/dist/nodeid.d.ts
CHANGED
|
@@ -1,90 +1,124 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Guid } from "node-opcua-guid";
|
|
3
2
|
/**
|
|
4
3
|
* `NodeIdType` an enumeration that specifies the possible types of a `NodeId` value.
|
|
5
4
|
*/
|
|
6
5
|
export declare enum NodeIdType {
|
|
7
|
-
/**
|
|
8
|
-
* @static
|
|
9
|
-
* @property NUMERIC
|
|
10
|
-
* @default 0x1
|
|
11
|
-
*/
|
|
12
6
|
NUMERIC = 1,
|
|
13
|
-
/**
|
|
14
|
-
* @static
|
|
15
|
-
* @property STRING
|
|
16
|
-
* @default 0x2
|
|
17
|
-
*/
|
|
18
7
|
STRING = 2,
|
|
19
|
-
/**
|
|
20
|
-
* @static
|
|
21
|
-
* @property GUID
|
|
22
|
-
* @default 0x3
|
|
23
|
-
*/
|
|
24
8
|
GUID = 3,
|
|
25
|
-
/**
|
|
26
|
-
* @static
|
|
27
|
-
* @property BYTESTRING
|
|
28
|
-
* @default 0x4
|
|
29
|
-
*/
|
|
30
9
|
BYTESTRING = 4
|
|
31
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* `NodeId` specialization for numeric nodeIds.
|
|
13
|
+
*/
|
|
32
14
|
export interface INodeIdNumeric extends NodeId {
|
|
33
15
|
identifierType: NodeIdType.NUMERIC;
|
|
34
16
|
value: number;
|
|
35
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* `NodeId` specialization for GUID nodeIds.
|
|
20
|
+
*/
|
|
36
21
|
export interface INodeIdGuid extends NodeId {
|
|
37
22
|
identifierType: NodeIdType.GUID;
|
|
38
23
|
value: string;
|
|
39
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* `NodeId` specialization for ByteString nodeIds (opaque).
|
|
27
|
+
*/
|
|
40
28
|
export interface INodeIdByteString extends NodeId {
|
|
41
29
|
identifierType: NodeIdType.BYTESTRING;
|
|
42
30
|
value: Buffer;
|
|
43
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* `NodeId` specialization for String nodeId.
|
|
34
|
+
*/
|
|
44
35
|
export interface INodeIdString extends NodeId {
|
|
45
36
|
identifierType: NodeIdType.STRING;
|
|
46
37
|
value: string;
|
|
47
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* `NodeId` specialization for all possible types of NodeIds.
|
|
41
|
+
*/
|
|
48
42
|
export type INodeId = INodeIdNumeric | INodeIdGuid | INodeIdString | INodeIdByteString;
|
|
49
43
|
/**
|
|
50
|
-
* Construct a node ID
|
|
51
44
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
45
|
+
* This class holds a OPC-UA node identifier.
|
|
46
|
+
*
|
|
47
|
+
* Nodes are unambiguously identified using a constructed
|
|
48
|
+
* identifier called the NodeId. Some Servers may accept
|
|
49
|
+
* alternative NodeIds in addition to the canonical NodeId
|
|
50
|
+
* represented in this Attribute.
|
|
51
|
+
*
|
|
52
|
+
* A Server shall persist the NodeId of a Node, that is,
|
|
53
|
+
* it shall not generate new
|
|
54
|
+
* NodeIds when rebooting.
|
|
54
55
|
*
|
|
55
|
-
* ``` javascript
|
|
56
|
-
* const nodeId = new NodeId(NodeIdType.NUMERIC,123,1);
|
|
57
|
-
* ```
|
|
58
|
-
* @constructor
|
|
59
56
|
*/
|
|
60
57
|
export declare class NodeId {
|
|
61
58
|
static NodeIdType: typeof NodeIdType;
|
|
62
59
|
static nullNodeId: NodeId;
|
|
63
60
|
static resolveNodeId: (a: string | NodeId) => NodeId;
|
|
61
|
+
/**
|
|
62
|
+
*/
|
|
64
63
|
static sameNodeId: (n1: NodeId, n2: NodeId) => boolean;
|
|
65
64
|
identifierType: NodeIdType;
|
|
66
65
|
value: number | string | Buffer | Guid;
|
|
67
66
|
namespace: number;
|
|
68
67
|
/**
|
|
68
|
+
* construct a node Id from a type, a value and a namespace index.
|
|
69
|
+
*
|
|
69
70
|
* @param identifierType - the nodeID type
|
|
70
71
|
* @param value - the node id value. The type of Value depends on identifierType.
|
|
71
72
|
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
*
|
|
76
|
+
* ```javascript
|
|
77
|
+
* const nodeId = new NodeId(NodeIdType.NUMERIC,123,1);
|
|
78
|
+
* ```
|
|
72
79
|
*/
|
|
73
80
|
constructor(identifierType?: NodeIdType | null, value?: number | string | Buffer | Guid, namespace?: number);
|
|
74
81
|
/**
|
|
75
82
|
* get the string representation of the nodeID.
|
|
76
83
|
*
|
|
77
|
-
* @method toString
|
|
78
84
|
* @example
|
|
79
85
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
86
|
+
* by default, toString will return the "ns=" representation
|
|
87
|
+
*
|
|
88
|
+
* ```javascript
|
|
89
|
+
* const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
|
|
90
|
+
* console.log(nodeid.toString());
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* ```
|
|
94
|
+
* >"ns=1;i=123"
|
|
95
|
+
* ```
|
|
96
|
+
* @example
|
|
97
|
+
*
|
|
98
|
+
* toString can also be used to make the nsu= version of the nodeid.
|
|
99
|
+
*
|
|
100
|
+
* ```javascript
|
|
101
|
+
* const namespaceArray = ["http://opcfoundation.com/UA/","http://mynamespace2"];
|
|
102
|
+
* const nodeid = new NodeId(NodeIdType.STRING, "Hello",1);
|
|
103
|
+
* console.log(nodeid.toString({namespaceArray}));
|
|
104
|
+
* ```
|
|
105
|
+
* ```
|
|
106
|
+
* >"nsu=http://mynamespace;i=123"
|
|
107
|
+
* ```
|
|
108
|
+
* @example
|
|
109
|
+
*
|
|
110
|
+
* passing an addressSpace to the toString options will decorate the nodeId
|
|
111
|
+
* with the BrowseName of the node.
|
|
112
|
+
*
|
|
113
|
+
* ```javascript
|
|
114
|
+
* const addressSpace = getAddressSpace();
|
|
115
|
+
* const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
|
|
116
|
+
* console.log(nodeid.toString({addressSpace}));
|
|
117
|
+
* ```
|
|
118
|
+
* ```
|
|
119
|
+
* >"nsu=http://mynamespace;i=123 (MyBrowseName)"
|
|
120
|
+
* ```
|
|
84
121
|
*
|
|
85
|
-
* ```
|
|
86
|
-
* >"ns=1;i=123"
|
|
87
|
-
* ```
|
|
88
122
|
*
|
|
89
123
|
* @param [options.addressSpace] {AddressSpace}
|
|
90
124
|
* @return {String}
|
|
@@ -94,7 +128,7 @@ export declare class NodeId {
|
|
|
94
128
|
namespaceArray?: string[];
|
|
95
129
|
}): string;
|
|
96
130
|
/**
|
|
97
|
-
* convert nodeId to a JSON string. same as {@link NodeId
|
|
131
|
+
* convert nodeId to a JSON string. same as {@link NodeId.toString }
|
|
98
132
|
*/
|
|
99
133
|
toJSON(options?: {
|
|
100
134
|
namespaceArray?: string[];
|
|
@@ -105,45 +139,84 @@ export declare class NodeId {
|
|
|
105
139
|
*/
|
|
106
140
|
isEmpty(): boolean;
|
|
107
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* anything that could be turned into a nodeId
|
|
144
|
+
*/
|
|
108
145
|
export type NodeIdLike = string | NodeId | number;
|
|
146
|
+
/**
|
|
147
|
+
*
|
|
148
|
+
*/
|
|
109
149
|
export interface ResolveNodeIdOptions {
|
|
110
150
|
namespaceArray?: string[];
|
|
111
151
|
defaultNamespaceIndex?: number;
|
|
112
152
|
}
|
|
113
153
|
/**
|
|
114
154
|
* Convert a value into a nodeId:
|
|
115
|
-
* @class opcua
|
|
116
|
-
* @method coerceNodeId
|
|
117
|
-
* @static
|
|
118
155
|
*
|
|
119
156
|
* @description:
|
|
120
157
|
* - if nodeId is a string of form : "i=1234" => nodeId({value=1234, identifierType: NodeIdType.NUMERIC})
|
|
121
158
|
* - if nodeId is a string of form : "s=foo" => nodeId({value="foo", identifierType: NodeIdType.STRING})
|
|
122
159
|
* - if nodeId is a string of form : "b=ABCD=" => nodeId({value=decodeBase64("ABCD="), identifierType: NodeIdType.BYTESTRING})
|
|
123
160
|
* - if nodeId is a {@link NodeId} : coerceNodeId returns value
|
|
124
|
-
* @param value
|
|
125
|
-
* @param namespaceOptions {number}
|
|
126
|
-
* @param namespaceOptions.namespace {number}
|
|
127
|
-
* @param namespaceOptions.namespaceArray {number}
|
|
128
161
|
*
|
|
129
162
|
*/
|
|
130
163
|
export declare function coerceNodeId(value: unknown, namespaceOptions?: number | ResolveNodeIdOptions): NodeId;
|
|
131
164
|
/**
|
|
132
165
|
* construct a node Id from a value and a namespace.
|
|
133
|
-
*
|
|
134
|
-
* @method makeNodeId
|
|
135
|
-
* @static
|
|
166
|
+
*
|
|
136
167
|
* @param {String|Buffer} value
|
|
137
|
-
* @param [namespace]=0 {Number} the node id namespace
|
|
168
|
+
* @param [namespace]=0 {Number} optional (default=0), the node id namespace
|
|
138
169
|
* @return {NodeId}
|
|
139
170
|
*/
|
|
140
171
|
export declare function makeNodeId(value: string | Buffer | number, namespace?: number): NodeId;
|
|
141
172
|
/**
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
* @
|
|
145
|
-
*
|
|
146
|
-
* @
|
|
173
|
+
* resolveNodeId can be helpful to convert a wellknown Node Name to a nodeid
|
|
174
|
+
* if a wellknown node name cannot be detected, the function falls back to
|
|
175
|
+
* calling coerceNodeId {@link coerceNodeId}.
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```javascript
|
|
179
|
+
* const nodeId = resolveNodeId("ObjectsFolder");
|
|
180
|
+
* console.log(nodeId.toString());
|
|
181
|
+
* ```
|
|
182
|
+
* ```text
|
|
183
|
+
* >ns=0;i=85
|
|
184
|
+
* ```
|
|
185
|
+
*
|
|
186
|
+
* ```javascript
|
|
187
|
+
* const nodeId = resolveNodeId("HasComponent");
|
|
188
|
+
* console.log(nodeId.toString());
|
|
189
|
+
* ```
|
|
190
|
+
* ```text
|
|
191
|
+
* >ns=0;i=33
|
|
192
|
+
* ```
|
|
193
|
+
*
|
|
194
|
+
* ```javascript
|
|
195
|
+
* const nodeId = resolveNodeId("ns=1;i=4444");
|
|
196
|
+
* console.log(nodeId.toString());
|
|
197
|
+
* ```
|
|
198
|
+
* ```text
|
|
199
|
+
* >ns=1;i=4444
|
|
200
|
+
* ```
|
|
201
|
+
*
|
|
147
202
|
*/
|
|
148
203
|
export declare function resolveNodeId(nodeIdOrString: NodeIdLike, options?: ResolveNodeIdOptions): NodeId;
|
|
204
|
+
/**
|
|
205
|
+
*
|
|
206
|
+
* The sameNodeId function is used to compare two NodeId objects to
|
|
207
|
+
* determine if they are identical. This comparison is based on the
|
|
208
|
+
* identifier type, namespace, and value of the NodeId objects.
|
|
209
|
+
*
|
|
210
|
+
|
|
211
|
+
*
|
|
212
|
+
* @return {boolean} Returns true if the two NodeId objects are
|
|
213
|
+
* identical, otherwise returns false.
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* ```javascript
|
|
217
|
+
* const nodeId1: NodeId = new NodeId(NodeIdType.STRING, "example", 1);
|
|
218
|
+
* const nodeId2: NodeId = coerceNodeId("ns=1;s=example");
|
|
219
|
+
* const areSame = sameNodeId(nodeId1, nodeId2); // returns true
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
149
222
|
export declare function sameNodeId(n1: NodeId, n2: NodeId): boolean;
|
package/dist/nodeid.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.NodeId = exports.NodeIdType = void 0;
|
|
4
|
+
exports.coerceNodeId = coerceNodeId;
|
|
5
|
+
exports.makeNodeId = makeNodeId;
|
|
6
|
+
exports.resolveNodeId = resolveNodeId;
|
|
7
|
+
exports.sameNodeId = sameNodeId;
|
|
4
8
|
/* eslint-disable complexity */
|
|
5
9
|
/**
|
|
6
10
|
* @module node-opcua-nodeid
|
|
@@ -8,67 +12,58 @@ exports.sameNodeId = exports.resolveNodeId = exports.makeNodeId = exports.coerce
|
|
|
8
12
|
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
9
13
|
const node_opcua_constants_1 = require("node-opcua-constants");
|
|
10
14
|
const node_opcua_guid_1 = require("node-opcua-guid");
|
|
15
|
+
const doDebug = false;
|
|
11
16
|
/**
|
|
12
17
|
* `NodeIdType` an enumeration that specifies the possible types of a `NodeId` value.
|
|
13
18
|
*/
|
|
14
19
|
var NodeIdType;
|
|
15
20
|
(function (NodeIdType) {
|
|
16
|
-
/**
|
|
17
|
-
* @static
|
|
18
|
-
* @property NUMERIC
|
|
19
|
-
* @default 0x1
|
|
20
|
-
*/
|
|
21
21
|
NodeIdType[NodeIdType["NUMERIC"] = 1] = "NUMERIC";
|
|
22
|
-
/**
|
|
23
|
-
* @static
|
|
24
|
-
* @property STRING
|
|
25
|
-
* @default 0x2
|
|
26
|
-
*/
|
|
27
22
|
NodeIdType[NodeIdType["STRING"] = 2] = "STRING";
|
|
28
|
-
/**
|
|
29
|
-
* @static
|
|
30
|
-
* @property GUID
|
|
31
|
-
* @default 0x3
|
|
32
|
-
*/
|
|
33
23
|
NodeIdType[NodeIdType["GUID"] = 3] = "GUID";
|
|
34
|
-
/**
|
|
35
|
-
* @static
|
|
36
|
-
* @property BYTESTRING
|
|
37
|
-
* @default 0x4
|
|
38
|
-
*/
|
|
39
24
|
NodeIdType[NodeIdType["BYTESTRING"] = 4] = "BYTESTRING";
|
|
40
25
|
})(NodeIdType || (exports.NodeIdType = NodeIdType = {}));
|
|
41
|
-
|
|
42
|
-
function defaultValue(identifierType: NodeIdType.STRING):
|
|
43
|
-
function defaultValue(identifierType: NodeIdType.NUMERIC): 0;
|
|
44
|
-
function defaultValue(identifierType: NodeIdType.GUID):
|
|
45
|
-
*/
|
|
26
|
+
// function defaultValue(identifierType: NodeIdType.BYTESTRING): null;
|
|
27
|
+
// function defaultValue(identifierType: NodeIdType.STRING): "";
|
|
28
|
+
// function defaultValue(identifierType: NodeIdType.NUMERIC): 0;
|
|
29
|
+
// function defaultValue(identifierType: NodeIdType.GUID): string;
|
|
46
30
|
function defaultValue(identifierType) {
|
|
47
31
|
switch (identifierType) {
|
|
48
32
|
case NodeIdType.GUID: return node_opcua_guid_1.emptyGuid;
|
|
49
33
|
case NodeIdType.BYTESTRING: return null; // Buffer.alloc(0);
|
|
50
34
|
case NodeIdType.STRING: return "";
|
|
51
35
|
case NodeIdType.NUMERIC: return 0;
|
|
36
|
+
default:
|
|
37
|
+
throw new Error("invalid identifierType");
|
|
52
38
|
}
|
|
53
39
|
}
|
|
54
|
-
const doDebug = false;
|
|
55
40
|
/**
|
|
56
|
-
* Construct a node ID
|
|
57
41
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
42
|
+
* This class holds a OPC-UA node identifier.
|
|
43
|
+
*
|
|
44
|
+
* Nodes are unambiguously identified using a constructed
|
|
45
|
+
* identifier called the NodeId. Some Servers may accept
|
|
46
|
+
* alternative NodeIds in addition to the canonical NodeId
|
|
47
|
+
* represented in this Attribute.
|
|
48
|
+
*
|
|
49
|
+
* A Server shall persist the NodeId of a Node, that is,
|
|
50
|
+
* it shall not generate new
|
|
51
|
+
* NodeIds when rebooting.
|
|
60
52
|
*
|
|
61
|
-
* ``` javascript
|
|
62
|
-
* const nodeId = new NodeId(NodeIdType.NUMERIC,123,1);
|
|
63
|
-
* ```
|
|
64
|
-
* @constructor
|
|
65
53
|
*/
|
|
66
54
|
class NodeId {
|
|
67
|
-
;
|
|
68
55
|
/**
|
|
56
|
+
* construct a node Id from a type, a value and a namespace index.
|
|
57
|
+
*
|
|
69
58
|
* @param identifierType - the nodeID type
|
|
70
59
|
* @param value - the node id value. The type of Value depends on identifierType.
|
|
71
60
|
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
*
|
|
64
|
+
* ```javascript
|
|
65
|
+
* const nodeId = new NodeId(NodeIdType.NUMERIC,123,1);
|
|
66
|
+
* ```
|
|
72
67
|
*/
|
|
73
68
|
constructor(identifierType, value, namespace) {
|
|
74
69
|
if (identifierType === null || identifierType === undefined) {
|
|
@@ -82,7 +77,8 @@ class NodeId {
|
|
|
82
77
|
this.namespace = namespace || 0;
|
|
83
78
|
// namespace shall be a UInt16
|
|
84
79
|
(0, node_opcua_assert_1.assert)(this.namespace >= 0 && this.namespace <= 0xffff, "NodeId: invalid namespace value");
|
|
85
|
-
(0, node_opcua_assert_1.assert)(this.identifierType !== NodeIdType.NUMERIC ||
|
|
80
|
+
(0, node_opcua_assert_1.assert)(this.identifierType !== NodeIdType.NUMERIC ||
|
|
81
|
+
(this.value !== null && this.value >= 0 && this.value <= 0xffffffff));
|
|
86
82
|
(0, node_opcua_assert_1.assert)(this.identifierType !== NodeIdType.GUID || (0, node_opcua_guid_1.isValidGuid)(this.value), "NodeId: Guid is invalid");
|
|
87
83
|
(0, node_opcua_assert_1.assert)(this.identifierType !== NodeIdType.STRING || typeof this.value === "string", "cannot empty string");
|
|
88
84
|
if (this.identifierType === NodeIdType.GUID) {
|
|
@@ -92,25 +88,54 @@ class NodeId {
|
|
|
92
88
|
/**
|
|
93
89
|
* get the string representation of the nodeID.
|
|
94
90
|
*
|
|
95
|
-
* @method toString
|
|
96
91
|
* @example
|
|
97
92
|
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
93
|
+
* by default, toString will return the "ns=" representation
|
|
94
|
+
*
|
|
95
|
+
* ```javascript
|
|
96
|
+
* const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
|
|
97
|
+
* console.log(nodeid.toString());
|
|
98
|
+
* ```
|
|
99
|
+
*
|
|
100
|
+
* ```
|
|
101
|
+
* >"ns=1;i=123"
|
|
102
|
+
* ```
|
|
103
|
+
* @example
|
|
104
|
+
*
|
|
105
|
+
* toString can also be used to make the nsu= version of the nodeid.
|
|
106
|
+
*
|
|
107
|
+
* ```javascript
|
|
108
|
+
* const namespaceArray = ["http://opcfoundation.com/UA/","http://mynamespace2"];
|
|
109
|
+
* const nodeid = new NodeId(NodeIdType.STRING, "Hello",1);
|
|
110
|
+
* console.log(nodeid.toString({namespaceArray}));
|
|
111
|
+
* ```
|
|
112
|
+
* ```
|
|
113
|
+
* >"nsu=http://mynamespace;i=123"
|
|
114
|
+
* ```
|
|
115
|
+
* @example
|
|
116
|
+
*
|
|
117
|
+
* passing an addressSpace to the toString options will decorate the nodeId
|
|
118
|
+
* with the BrowseName of the node.
|
|
119
|
+
*
|
|
120
|
+
* ```javascript
|
|
121
|
+
* const addressSpace = getAddressSpace();
|
|
122
|
+
* const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
|
|
123
|
+
* console.log(nodeid.toString({addressSpace}));
|
|
124
|
+
* ```
|
|
125
|
+
* ```
|
|
126
|
+
* >"nsu=http://mynamespace;i=123 (MyBrowseName)"
|
|
127
|
+
* ```
|
|
102
128
|
*
|
|
103
|
-
* ```
|
|
104
|
-
* >"ns=1;i=123"
|
|
105
|
-
* ```
|
|
106
129
|
*
|
|
107
130
|
* @param [options.addressSpace] {AddressSpace}
|
|
108
131
|
* @return {String}
|
|
109
132
|
*/
|
|
110
133
|
toString(options) {
|
|
111
134
|
const addressSpace = options ? options.addressSpace : null;
|
|
112
|
-
const namespacePart = options?.namespaceArray
|
|
113
|
-
|
|
135
|
+
const namespacePart = options?.namespaceArray
|
|
136
|
+
? this.namespace == 0
|
|
137
|
+
? ""
|
|
138
|
+
: `nsu=${options.namespaceArray[this.namespace] || `<unknown namespace with index ${this.namespace}>`};`
|
|
114
139
|
: `ns=${this.namespace};`;
|
|
115
140
|
let str;
|
|
116
141
|
const _this = this;
|
|
@@ -150,7 +175,7 @@ class NodeId {
|
|
|
150
175
|
return str;
|
|
151
176
|
}
|
|
152
177
|
/**
|
|
153
|
-
* convert nodeId to a JSON string. same as {@link NodeId
|
|
178
|
+
* convert nodeId to a JSON string. same as {@link NodeId.toString }
|
|
154
179
|
*/
|
|
155
180
|
toJSON(options) {
|
|
156
181
|
return this.toString(options);
|
|
@@ -183,6 +208,9 @@ class NodeId {
|
|
|
183
208
|
}
|
|
184
209
|
exports.NodeId = NodeId;
|
|
185
210
|
NodeId.NodeIdType = NodeIdType;
|
|
211
|
+
/**
|
|
212
|
+
* a fixed instance of a null NodeId
|
|
213
|
+
*/
|
|
186
214
|
NodeId.nullNodeId = new Proxy(new NodeId(NodeIdType.NUMERIC, 0, 0), {
|
|
187
215
|
get: (target, prop) => {
|
|
188
216
|
return target[prop];
|
|
@@ -191,6 +219,9 @@ NodeId.nullNodeId = new Proxy(new NodeId(NodeIdType.NUMERIC, 0, 0), {
|
|
|
191
219
|
throw new Error("Cannot assign a value to constant NodeId.nullNodeId");
|
|
192
220
|
}
|
|
193
221
|
});
|
|
222
|
+
/**
|
|
223
|
+
* @private
|
|
224
|
+
*/
|
|
194
225
|
const regexNamespaceI = /ns=([0-9]+);i=([0-9]+)/;
|
|
195
226
|
const regexNamespaceS = /ns=([0-9]+);s=(.*)/;
|
|
196
227
|
const regexNamespaceB = /ns=([0-9]+);b=(.*)/;
|
|
@@ -202,22 +233,14 @@ const regexNamespaceNSU_B = /nsu=(.+);b=(.*)/;
|
|
|
202
233
|
const regexNamespaceNSU_G = /nsu=(.+);g=([0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12})/;
|
|
203
234
|
/**
|
|
204
235
|
* Convert a value into a nodeId:
|
|
205
|
-
* @class opcua
|
|
206
|
-
* @method coerceNodeId
|
|
207
|
-
* @static
|
|
208
236
|
*
|
|
209
237
|
* @description:
|
|
210
238
|
* - if nodeId is a string of form : "i=1234" => nodeId({value=1234, identifierType: NodeIdType.NUMERIC})
|
|
211
239
|
* - if nodeId is a string of form : "s=foo" => nodeId({value="foo", identifierType: NodeIdType.STRING})
|
|
212
240
|
* - if nodeId is a string of form : "b=ABCD=" => nodeId({value=decodeBase64("ABCD="), identifierType: NodeIdType.BYTESTRING})
|
|
213
241
|
* - if nodeId is a {@link NodeId} : coerceNodeId returns value
|
|
214
|
-
* @param value
|
|
215
|
-
* @param namespaceOptions {number}
|
|
216
|
-
* @param namespaceOptions.namespace {number}
|
|
217
|
-
* @param namespaceOptions.namespaceArray {number}
|
|
218
242
|
*
|
|
219
243
|
*/
|
|
220
|
-
// eslint-disable-next-line max-statements
|
|
221
244
|
function coerceNodeId(value, namespaceOptions) {
|
|
222
245
|
let matches;
|
|
223
246
|
let twoFirst;
|
|
@@ -301,15 +324,12 @@ function coerceNodeId(value, namespaceOptions) {
|
|
|
301
324
|
}
|
|
302
325
|
return new NodeId(identifierType, value, namespace);
|
|
303
326
|
}
|
|
304
|
-
exports.coerceNodeId = coerceNodeId;
|
|
305
327
|
const regEx1 = /^(s|g|b|i|ns)=/;
|
|
306
328
|
/**
|
|
307
329
|
* construct a node Id from a value and a namespace.
|
|
308
|
-
*
|
|
309
|
-
* @method makeNodeId
|
|
310
|
-
* @static
|
|
330
|
+
*
|
|
311
331
|
* @param {String|Buffer} value
|
|
312
|
-
* @param [namespace]=0 {Number} the node id namespace
|
|
332
|
+
* @param [namespace]=0 {Number} optional (default=0), the node id namespace
|
|
313
333
|
* @return {NodeId}
|
|
314
334
|
*/
|
|
315
335
|
function makeNodeId(value, namespace) {
|
|
@@ -337,7 +357,6 @@ function makeNodeId(value, namespace) {
|
|
|
337
357
|
const nodeId = new NodeId(identifierType, value, namespace);
|
|
338
358
|
return nodeId;
|
|
339
359
|
}
|
|
340
|
-
exports.makeNodeId = makeNodeId;
|
|
341
360
|
// reverse maps
|
|
342
361
|
let _nodeIdToNameIndex = {};
|
|
343
362
|
let _nameToNodeIdIndex = {};
|
|
@@ -366,11 +385,35 @@ function reverse_map(nodeId) {
|
|
|
366
385
|
return _nodeIdToNameIndex[nodeId];
|
|
367
386
|
}
|
|
368
387
|
/**
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
* @
|
|
372
|
-
*
|
|
373
|
-
* @
|
|
388
|
+
* resolveNodeId can be helpful to convert a wellknown Node Name to a nodeid
|
|
389
|
+
* if a wellknown node name cannot be detected, the function falls back to
|
|
390
|
+
* calling coerceNodeId {@link coerceNodeId}.
|
|
391
|
+
*
|
|
392
|
+
* @example
|
|
393
|
+
* ```javascript
|
|
394
|
+
* const nodeId = resolveNodeId("ObjectsFolder");
|
|
395
|
+
* console.log(nodeId.toString());
|
|
396
|
+
* ```
|
|
397
|
+
* ```text
|
|
398
|
+
* >ns=0;i=85
|
|
399
|
+
* ```
|
|
400
|
+
*
|
|
401
|
+
* ```javascript
|
|
402
|
+
* const nodeId = resolveNodeId("HasComponent");
|
|
403
|
+
* console.log(nodeId.toString());
|
|
404
|
+
* ```
|
|
405
|
+
* ```text
|
|
406
|
+
* >ns=0;i=33
|
|
407
|
+
* ```
|
|
408
|
+
*
|
|
409
|
+
* ```javascript
|
|
410
|
+
* const nodeId = resolveNodeId("ns=1;i=4444");
|
|
411
|
+
* console.log(nodeId.toString());
|
|
412
|
+
* ```
|
|
413
|
+
* ```text
|
|
414
|
+
* >ns=1;i=4444
|
|
415
|
+
* ```
|
|
416
|
+
*
|
|
374
417
|
*/
|
|
375
418
|
function resolveNodeId(nodeIdOrString, options) {
|
|
376
419
|
let nodeId;
|
|
@@ -383,8 +426,25 @@ function resolveNodeId(nodeIdOrString, options) {
|
|
|
383
426
|
}
|
|
384
427
|
return nodeId;
|
|
385
428
|
}
|
|
386
|
-
exports.resolveNodeId = resolveNodeId;
|
|
387
429
|
NodeId.resolveNodeId = resolveNodeId;
|
|
430
|
+
/**
|
|
431
|
+
*
|
|
432
|
+
* The sameNodeId function is used to compare two NodeId objects to
|
|
433
|
+
* determine if they are identical. This comparison is based on the
|
|
434
|
+
* identifier type, namespace, and value of the NodeId objects.
|
|
435
|
+
*
|
|
436
|
+
|
|
437
|
+
*
|
|
438
|
+
* @return {boolean} Returns true if the two NodeId objects are
|
|
439
|
+
* identical, otherwise returns false.
|
|
440
|
+
*
|
|
441
|
+
* @example
|
|
442
|
+
* ```javascript
|
|
443
|
+
* const nodeId1: NodeId = new NodeId(NodeIdType.STRING, "example", 1);
|
|
444
|
+
* const nodeId2: NodeId = coerceNodeId("ns=1;s=example");
|
|
445
|
+
* const areSame = sameNodeId(nodeId1, nodeId2); // returns true
|
|
446
|
+
* ```
|
|
447
|
+
*/
|
|
388
448
|
function sameNodeId(n1, n2) {
|
|
389
449
|
if (n1.identifierType !== n2.identifierType) {
|
|
390
450
|
return false;
|
|
@@ -403,6 +463,5 @@ function sameNodeId(n1, n2) {
|
|
|
403
463
|
throw new Error("Invalid identifier type");
|
|
404
464
|
}
|
|
405
465
|
}
|
|
406
|
-
exports.sameNodeId = sameNodeId;
|
|
407
466
|
NodeId.sameNodeId = sameNodeId;
|
|
408
467
|
//# sourceMappingURL=nodeid.js.map
|
package/dist/nodeid.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeid.js","sourceRoot":"","sources":["../source/nodeid.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B;;GAEG;AACH,yDAA2C;AAC3C,+DAQ8B;AAC9B,qDAA8E;AAE9E;;GAEG;AACH,IAAY,UAyBX;AAzBD,WAAY,UAAU;IAClB;;;;OAIG;IACH,iDAAc,CAAA;IACd;;;;OAIG;IACH,+CAAa,CAAA;IACb;;;;OAIG;IACH,2CAAW,CAAA;IACX;;;;OAIG;IACH,uDAAiB,CAAA;AACrB,CAAC,EAzBW,UAAU,0BAAV,UAAU,QAyBrB;AACD;;;;EAIE;AACF,SAAS,YAAY,CAAC,cAA0B;IAC5C,QAAQ,cAAc,EAAE,CAAC;QACrB,KAAK,UAAU,CAAC,IAAI,CAAC,CAAC,OAAO,2BAAS,CAAC;QACvC,KAAK,UAAU,CAAC,UAAU,CAAC,CAAC,OAAO,IAAqB,CAAC,CAAA,mBAAmB;QAC5E,KAAK,UAAU,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC;QAClC,KAAK,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;AACL,CAAC;AAqBD,MAAM,OAAO,GAAG,KAAK,CAAC;AACtB;;;;;;;;;;GAUG;AACH,MAAa,MAAM;IAO+B,CAAC;IAG/C;;;;OAIG;IACH,YAAY,cAAkC,EAAE,KAAuC,EAAE,SAAkB;QAGvG,IAAI,cAAc,KAAK,IAAI,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YAC1D,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;YACzC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;YACf,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;YACnB,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;QAChC,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,QAAQ,EAAE,CAAC,cAAc,EAAE,CAAC;QACxB,KAAK,UAAU,CAAC,OAAO,CAAC;QACxB,KAAK,UAAU,CAAC,MAAM,CAAC;QACvB,KAAK,UAAU,CAAC,IAAI;YAChB,OAAO,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,KAAK,CAAC;QACjC,KAAK,UAAU,CAAC,UAAU;YACtB,OAAQ,EAAE,CAAC,KAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAM,EAAE,CAAC,KAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACzF;YACI,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnD,CAAC;AACL,CAAC;AACD,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "node-opcua-nodeid",
|
|
3
3
|
"main": "./dist/index.js",
|
|
4
4
|
"types": "./dist/index.d.ts",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.133.0",
|
|
6
6
|
"description": "pure nodejs OPCUA SDK - module nodeid",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc -b",
|
|
@@ -13,12 +13,11 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"node-opcua-assert": "2.120.0",
|
|
15
15
|
"node-opcua-constants": "2.125.0",
|
|
16
|
-
"node-opcua-guid": "2.
|
|
16
|
+
"node-opcua-guid": "2.133.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"node-opcua-benchmarker": "2.
|
|
20
|
-
"node-opcua-debug": "2.
|
|
21
|
-
"should": "^13.2.3"
|
|
19
|
+
"node-opcua-benchmarker": "2.133.0",
|
|
20
|
+
"node-opcua-debug": "2.133.0"
|
|
22
21
|
},
|
|
23
22
|
"author": "Etienne Rossignon",
|
|
24
23
|
"license": "MIT",
|
|
@@ -35,7 +34,7 @@
|
|
|
35
34
|
"internet of things"
|
|
36
35
|
],
|
|
37
36
|
"homepage": "http://node-opcua.github.io/",
|
|
38
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "921bb04f2e7ce3109dd051ff27a2210edf700344",
|
|
39
38
|
"files": [
|
|
40
39
|
"dist",
|
|
41
40
|
"source"
|
|
@@ -27,17 +27,8 @@ import { coerceNodeId, NodeId, NodeIdType } from "./nodeid";
|
|
|
27
27
|
* NamespaceUri. The ServerIndex flag in the NodeId encoding byte indicates whether the
|
|
28
28
|
* ServerIndex is present in the stream. The ServerIndex is omitted if it is equal to zero.
|
|
29
29
|
*
|
|
30
|
-
* @class ExpandedNodeId
|
|
31
|
-
* @extends NodeId
|
|
32
30
|
*
|
|
33
31
|
*
|
|
34
|
-
*
|
|
35
|
-
* @param identifierType - the nodeID type
|
|
36
|
-
* @param value - the node id value. The type of Value depends on identifierType.
|
|
37
|
-
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
38
|
-
* @param namespaceUri - NamespaceUri
|
|
39
|
-
* @param serverIndex - the server Index
|
|
40
|
-
* @constructor
|
|
41
32
|
*/
|
|
42
33
|
export class ExpandedNodeId extends NodeId {
|
|
43
34
|
public static nullExpandedNodeId = new ExpandedNodeId(NodeIdType.NUMERIC, 0, 0);
|
|
@@ -50,6 +41,13 @@ export class ExpandedNodeId extends NodeId {
|
|
|
50
41
|
public serverIndex: number;
|
|
51
42
|
|
|
52
43
|
public constructor(forDeserialization: null);
|
|
44
|
+
/**
|
|
45
|
+
* @param identifierType - the nodeID type
|
|
46
|
+
* @param value - the node id value. The type of Value depends on identifierType.
|
|
47
|
+
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
48
|
+
* @param namespaceUri - NamespaceUri
|
|
49
|
+
* @param serverIndex - the server Index
|
|
50
|
+
*/
|
|
53
51
|
public constructor(
|
|
54
52
|
identifierType: NodeIdType,
|
|
55
53
|
value: number | string | Guid | Buffer,
|
|
@@ -68,11 +66,6 @@ export class ExpandedNodeId extends NodeId {
|
|
|
68
66
|
this.namespaceUri = namespaceUri || null;
|
|
69
67
|
this.serverIndex = serverIndex || 0;
|
|
70
68
|
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* @method toString
|
|
74
|
-
* @return {string}
|
|
75
|
-
*/
|
|
76
69
|
public toString(): string {
|
|
77
70
|
let str = NodeId.prototype.toString.call(this);
|
|
78
71
|
if (this.namespaceUri) {
|
|
@@ -85,9 +78,7 @@ export class ExpandedNodeId extends NodeId {
|
|
|
85
78
|
}
|
|
86
79
|
|
|
87
80
|
/**
|
|
88
|
-
* convert nodeId to a JSON string. same as {@link
|
|
89
|
-
* @method toJSON
|
|
90
|
-
* @return {String}
|
|
81
|
+
* convert nodeId to a JSON string. same as {@link toString }
|
|
91
82
|
*/
|
|
92
83
|
public toJSON(): any {
|
|
93
84
|
return this.toString();
|
|
@@ -98,12 +89,8 @@ export function coerceExpandedNodeId(value: unknown): ExpandedNodeId {
|
|
|
98
89
|
const n = coerceNodeId(value);
|
|
99
90
|
return new ExpandedNodeId(n.identifierType, n.value, n.namespace, /*namespaceUri*/ null, /*serverIndex*/ 0);
|
|
100
91
|
}
|
|
101
|
-
|
|
102
92
|
/**
|
|
103
|
-
*
|
|
104
|
-
* @param value
|
|
105
|
-
* @param [namespace=0] the namespace
|
|
106
|
-
* @return {ExpandedNodeId}
|
|
93
|
+
* create an expanded nodeId
|
|
107
94
|
*/
|
|
108
95
|
export function makeExpandedNodeId(value: unknown, namespace?: number): ExpandedNodeId {
|
|
109
96
|
if (value === undefined && namespace === undefined) {
|
package/source/nodeid.ts
CHANGED
|
@@ -13,99 +13,108 @@ import {
|
|
|
13
13
|
VariableTypeIds
|
|
14
14
|
} from "node-opcua-constants";
|
|
15
15
|
import { emptyGuid, Guid, isValidGuid, normalizeGuid } from "node-opcua-guid";
|
|
16
|
-
|
|
16
|
+
const doDebug = false;
|
|
17
17
|
/**
|
|
18
18
|
* `NodeIdType` an enumeration that specifies the possible types of a `NodeId` value.
|
|
19
19
|
*/
|
|
20
20
|
export enum NodeIdType {
|
|
21
|
-
/**
|
|
22
|
-
* @static
|
|
23
|
-
* @property NUMERIC
|
|
24
|
-
* @default 0x1
|
|
25
|
-
*/
|
|
26
21
|
NUMERIC = 0x01,
|
|
27
|
-
/**
|
|
28
|
-
* @static
|
|
29
|
-
* @property STRING
|
|
30
|
-
* @default 0x2
|
|
31
|
-
*/
|
|
32
22
|
STRING = 0x02,
|
|
33
|
-
/**
|
|
34
|
-
* @static
|
|
35
|
-
* @property GUID
|
|
36
|
-
* @default 0x3
|
|
37
|
-
*/
|
|
38
23
|
GUID = 0x03,
|
|
39
|
-
/**
|
|
40
|
-
* @static
|
|
41
|
-
* @property BYTESTRING
|
|
42
|
-
* @default 0x4
|
|
43
|
-
*/
|
|
44
24
|
BYTESTRING = 0x04
|
|
45
25
|
}
|
|
46
|
-
|
|
47
|
-
function defaultValue(identifierType: NodeIdType.
|
|
48
|
-
function defaultValue(identifierType: NodeIdType.
|
|
49
|
-
function defaultValue(identifierType: NodeIdType.
|
|
50
|
-
|
|
51
|
-
function defaultValue(identifierType: NodeIdType): string |
|
|
26
|
+
|
|
27
|
+
// function defaultValue(identifierType: NodeIdType.BYTESTRING): null;
|
|
28
|
+
// function defaultValue(identifierType: NodeIdType.STRING): "";
|
|
29
|
+
// function defaultValue(identifierType: NodeIdType.NUMERIC): 0;
|
|
30
|
+
// function defaultValue(identifierType: NodeIdType.GUID): string;
|
|
31
|
+
function defaultValue(identifierType: NodeIdType): string | 0 | Buffer {
|
|
52
32
|
switch (identifierType) {
|
|
53
33
|
case NodeIdType.GUID: return emptyGuid;
|
|
54
34
|
case NodeIdType.BYTESTRING: return null as any as Buffer;// Buffer.alloc(0);
|
|
55
35
|
case NodeIdType.STRING: return "";
|
|
56
36
|
case NodeIdType.NUMERIC: return 0;
|
|
37
|
+
default:
|
|
38
|
+
throw new Error("invalid identifierType");
|
|
57
39
|
}
|
|
58
40
|
}
|
|
59
|
-
|
|
41
|
+
/**
|
|
42
|
+
* `NodeId` specialization for numeric nodeIds.
|
|
43
|
+
*/
|
|
60
44
|
export interface INodeIdNumeric extends NodeId {
|
|
61
45
|
identifierType: NodeIdType.NUMERIC;
|
|
62
46
|
value: number;
|
|
63
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* `NodeId` specialization for GUID nodeIds.
|
|
50
|
+
*/
|
|
64
51
|
export interface INodeIdGuid extends NodeId {
|
|
65
52
|
identifierType: NodeIdType.GUID;
|
|
66
53
|
value: string;
|
|
67
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* `NodeId` specialization for ByteString nodeIds (opaque).
|
|
57
|
+
*/
|
|
68
58
|
export interface INodeIdByteString extends NodeId {
|
|
69
59
|
identifierType: NodeIdType.BYTESTRING;
|
|
70
60
|
value: Buffer;
|
|
71
61
|
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* `NodeId` specialization for String nodeId.
|
|
65
|
+
*/
|
|
72
66
|
export interface INodeIdString extends NodeId {
|
|
73
67
|
identifierType: NodeIdType.STRING;
|
|
74
68
|
value: string;
|
|
75
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* `NodeId` specialization for all possible types of NodeIds.
|
|
72
|
+
*/
|
|
76
73
|
export type INodeId = INodeIdNumeric | INodeIdGuid | INodeIdString | INodeIdByteString;
|
|
77
74
|
|
|
78
75
|
|
|
79
|
-
|
|
76
|
+
|
|
80
77
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
78
|
+
*
|
|
79
|
+
* This class holds a OPC-UA node identifier.
|
|
80
|
+
*
|
|
81
|
+
* Nodes are unambiguously identified using a constructed
|
|
82
|
+
* identifier called the NodeId. Some Servers may accept
|
|
83
|
+
* alternative NodeIds in addition to the canonical NodeId
|
|
84
|
+
* represented in this Attribute.
|
|
85
|
+
*
|
|
86
|
+
* A Server shall persist the NodeId of a Node, that is,
|
|
87
|
+
* it shall not generate new
|
|
88
|
+
* NodeIds when rebooting.
|
|
85
89
|
*
|
|
86
|
-
* ``` javascript
|
|
87
|
-
* const nodeId = new NodeId(NodeIdType.NUMERIC,123,1);
|
|
88
|
-
* ```
|
|
89
|
-
* @constructor
|
|
90
90
|
*/
|
|
91
91
|
export class NodeId {
|
|
92
92
|
public static NodeIdType = NodeIdType;
|
|
93
93
|
public static nullNodeId: NodeId;
|
|
94
94
|
public static resolveNodeId: (a: string | NodeId) => NodeId;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
*/
|
|
95
98
|
public static sameNodeId: (n1: NodeId, n2: NodeId) => boolean;
|
|
96
99
|
|
|
97
100
|
public identifierType: NodeIdType;
|
|
98
|
-
public value: number | string | Buffer | Guid
|
|
101
|
+
public value: number | string | Buffer | Guid;
|
|
99
102
|
public namespace: number;
|
|
100
103
|
|
|
101
104
|
/**
|
|
105
|
+
* construct a node Id from a type, a value and a namespace index.
|
|
106
|
+
*
|
|
102
107
|
* @param identifierType - the nodeID type
|
|
103
108
|
* @param value - the node id value. The type of Value depends on identifierType.
|
|
104
109
|
* @param namespace - the index of the related namespace (optional , default value = 0 )
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
*
|
|
113
|
+
* ```javascript
|
|
114
|
+
* const nodeId = new NodeId(NodeIdType.NUMERIC,123,1);
|
|
115
|
+
* ```
|
|
105
116
|
*/
|
|
106
117
|
constructor(identifierType?: NodeIdType | null, value?: number | string | Buffer | Guid, namespace?: number) {
|
|
107
|
-
|
|
108
|
-
|
|
109
118
|
if (identifierType === null || identifierType === undefined) {
|
|
110
119
|
this.identifierType = NodeIdType.NUMERIC;
|
|
111
120
|
this.value = 0;
|
|
@@ -114,12 +123,15 @@ export class NodeId {
|
|
|
114
123
|
}
|
|
115
124
|
|
|
116
125
|
this.identifierType = identifierType;
|
|
117
|
-
this.value = value || defaultValue(identifierType);
|
|
126
|
+
this.value = value || defaultValue(identifierType as NodeIdType);
|
|
118
127
|
this.namespace = namespace || 0;
|
|
119
128
|
|
|
120
129
|
// namespace shall be a UInt16
|
|
121
130
|
assert(this.namespace >= 0 && this.namespace <= 0xffff, "NodeId: invalid namespace value");
|
|
122
|
-
assert(
|
|
131
|
+
assert(
|
|
132
|
+
this.identifierType !== NodeIdType.NUMERIC ||
|
|
133
|
+
(this.value !== null && (this.value as number) >= 0 && (this.value as number) <= 0xffffffff)
|
|
134
|
+
);
|
|
123
135
|
assert(this.identifierType !== NodeIdType.GUID || isValidGuid(this.value as string), "NodeId: Guid is invalid");
|
|
124
136
|
assert(this.identifierType !== NodeIdType.STRING || typeof this.value === "string", "cannot empty string");
|
|
125
137
|
if (this.identifierType === NodeIdType.GUID) {
|
|
@@ -130,26 +142,55 @@ export class NodeId {
|
|
|
130
142
|
/**
|
|
131
143
|
* get the string representation of the nodeID.
|
|
132
144
|
*
|
|
133
|
-
* @method toString
|
|
134
145
|
* @example
|
|
135
146
|
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
147
|
+
* by default, toString will return the "ns=" representation
|
|
148
|
+
*
|
|
149
|
+
* ```javascript
|
|
150
|
+
* const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
|
|
151
|
+
* console.log(nodeid.toString());
|
|
152
|
+
* ```
|
|
153
|
+
*
|
|
154
|
+
* ```
|
|
155
|
+
* >"ns=1;i=123"
|
|
156
|
+
* ```
|
|
157
|
+
* @example
|
|
158
|
+
*
|
|
159
|
+
* toString can also be used to make the nsu= version of the nodeid.
|
|
160
|
+
*
|
|
161
|
+
* ```javascript
|
|
162
|
+
* const namespaceArray = ["http://opcfoundation.com/UA/","http://mynamespace2"];
|
|
163
|
+
* const nodeid = new NodeId(NodeIdType.STRING, "Hello",1);
|
|
164
|
+
* console.log(nodeid.toString({namespaceArray}));
|
|
165
|
+
* ```
|
|
166
|
+
* ```
|
|
167
|
+
* >"nsu=http://mynamespace;i=123"
|
|
168
|
+
* ```
|
|
169
|
+
* @example
|
|
170
|
+
*
|
|
171
|
+
* passing an addressSpace to the toString options will decorate the nodeId
|
|
172
|
+
* with the BrowseName of the node.
|
|
173
|
+
*
|
|
174
|
+
* ```javascript
|
|
175
|
+
* const addressSpace = getAddressSpace();
|
|
176
|
+
* const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
|
|
177
|
+
* console.log(nodeid.toString({addressSpace}));
|
|
178
|
+
* ```
|
|
179
|
+
* ```
|
|
180
|
+
* >"nsu=http://mynamespace;i=123 (MyBrowseName)"
|
|
181
|
+
* ```
|
|
140
182
|
*
|
|
141
|
-
* ```
|
|
142
|
-
* >"ns=1;i=123"
|
|
143
|
-
* ```
|
|
144
183
|
*
|
|
145
184
|
* @param [options.addressSpace] {AddressSpace}
|
|
146
185
|
* @return {String}
|
|
147
186
|
*/
|
|
148
|
-
public toString(options?: { addressSpace?: any
|
|
187
|
+
public toString(options?: { addressSpace?: any; namespaceArray?: string[] }): string {
|
|
149
188
|
const addressSpace = options ? options.addressSpace : null;
|
|
150
189
|
|
|
151
|
-
const namespacePart: string = options?.namespaceArray
|
|
152
|
-
|
|
190
|
+
const namespacePart: string = options?.namespaceArray
|
|
191
|
+
? this.namespace == 0
|
|
192
|
+
? ""
|
|
193
|
+
: `nsu=${options.namespaceArray[this.namespace] || `<unknown namespace with index ${this.namespace}>`};`
|
|
153
194
|
: `ns=${this.namespace};`;
|
|
154
195
|
|
|
155
196
|
let str;
|
|
@@ -169,7 +210,7 @@ export class NodeId {
|
|
|
169
210
|
if (this.value) {
|
|
170
211
|
str = `${namespacePart}b=${(this.value as Buffer).toString("base64")}`;
|
|
171
212
|
} else {
|
|
172
|
-
str = `${
|
|
213
|
+
str = `${namespacePart}b=<null>`;
|
|
173
214
|
}
|
|
174
215
|
break;
|
|
175
216
|
}
|
|
@@ -190,9 +231,9 @@ export class NodeId {
|
|
|
190
231
|
}
|
|
191
232
|
|
|
192
233
|
/**
|
|
193
|
-
* convert nodeId to a JSON string. same as {@link NodeId
|
|
234
|
+
* convert nodeId to a JSON string. same as {@link NodeId.toString }
|
|
194
235
|
*/
|
|
195
|
-
public toJSON(options?: {namespaceArray?: string[]}): string {
|
|
236
|
+
public toJSON(options?: { namespaceArray?: string[] }): string {
|
|
196
237
|
return this.toString(options);
|
|
197
238
|
}
|
|
198
239
|
|
|
@@ -224,6 +265,9 @@ export class NodeId {
|
|
|
224
265
|
}
|
|
225
266
|
}
|
|
226
267
|
|
|
268
|
+
/**
|
|
269
|
+
* a fixed instance of a null NodeId
|
|
270
|
+
*/
|
|
227
271
|
NodeId.nullNodeId = new Proxy(
|
|
228
272
|
new NodeId(NodeIdType.NUMERIC, 0, 0),
|
|
229
273
|
{
|
|
@@ -236,8 +280,14 @@ NodeId.nullNodeId = new Proxy(
|
|
|
236
280
|
});
|
|
237
281
|
|
|
238
282
|
|
|
283
|
+
/**
|
|
284
|
+
* anything that could be turned into a nodeId
|
|
285
|
+
*/
|
|
239
286
|
export type NodeIdLike = string | NodeId | number;
|
|
240
287
|
|
|
288
|
+
/**
|
|
289
|
+
* @private
|
|
290
|
+
*/
|
|
241
291
|
const regexNamespaceI = /ns=([0-9]+);i=([0-9]+)/;
|
|
242
292
|
const regexNamespaceS = /ns=([0-9]+);s=(.*)/;
|
|
243
293
|
const regexNamespaceB = /ns=([0-9]+);b=(.*)/;
|
|
@@ -250,28 +300,23 @@ const regexNamespaceNSU_B = /nsu=(.+);b=(.*)/;
|
|
|
250
300
|
const regexNamespaceNSU_G = /nsu=(.+);g=([0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12})/;
|
|
251
301
|
|
|
252
302
|
|
|
303
|
+
/**
|
|
304
|
+
*
|
|
305
|
+
*/
|
|
253
306
|
export interface ResolveNodeIdOptions {
|
|
254
307
|
namespaceArray?: string[];
|
|
255
308
|
defaultNamespaceIndex?: number ;
|
|
256
309
|
}
|
|
257
310
|
/**
|
|
258
311
|
* Convert a value into a nodeId:
|
|
259
|
-
* @class opcua
|
|
260
|
-
* @method coerceNodeId
|
|
261
|
-
* @static
|
|
262
312
|
*
|
|
263
313
|
* @description:
|
|
264
314
|
* - if nodeId is a string of form : "i=1234" => nodeId({value=1234, identifierType: NodeIdType.NUMERIC})
|
|
265
315
|
* - if nodeId is a string of form : "s=foo" => nodeId({value="foo", identifierType: NodeIdType.STRING})
|
|
266
316
|
* - if nodeId is a string of form : "b=ABCD=" => nodeId({value=decodeBase64("ABCD="), identifierType: NodeIdType.BYTESTRING})
|
|
267
317
|
* - if nodeId is a {@link NodeId} : coerceNodeId returns value
|
|
268
|
-
* @param value
|
|
269
|
-
* @param namespaceOptions {number}
|
|
270
|
-
* @param namespaceOptions.namespace {number}
|
|
271
|
-
* @param namespaceOptions.namespaceArray {number}
|
|
272
318
|
*
|
|
273
319
|
*/
|
|
274
|
-
// eslint-disable-next-line max-statements
|
|
275
320
|
export function coerceNodeId(value: unknown, namespaceOptions?: number | ResolveNodeIdOptions): NodeId {
|
|
276
321
|
let matches;
|
|
277
322
|
let twoFirst;
|
|
@@ -354,11 +399,9 @@ export function coerceNodeId(value: unknown, namespaceOptions?: number | Resolve
|
|
|
354
399
|
const regEx1 = /^(s|g|b|i|ns)=/;
|
|
355
400
|
/**
|
|
356
401
|
* construct a node Id from a value and a namespace.
|
|
357
|
-
*
|
|
358
|
-
* @method makeNodeId
|
|
359
|
-
* @static
|
|
402
|
+
*
|
|
360
403
|
* @param {String|Buffer} value
|
|
361
|
-
* @param [namespace]=0 {Number} the node id namespace
|
|
404
|
+
* @param [namespace]=0 {Number} optional (default=0), the node id namespace
|
|
362
405
|
* @return {NodeId}
|
|
363
406
|
*/
|
|
364
407
|
export function makeNodeId(value: string | Buffer | number, namespace?: number): NodeId {
|
|
@@ -420,11 +463,35 @@ function reverse_map(nodeId: string) {
|
|
|
420
463
|
}
|
|
421
464
|
|
|
422
465
|
/**
|
|
423
|
-
*
|
|
424
|
-
*
|
|
425
|
-
* @
|
|
426
|
-
*
|
|
427
|
-
* @
|
|
466
|
+
* resolveNodeId can be helpful to convert a wellknown Node Name to a nodeid
|
|
467
|
+
* if a wellknown node name cannot be detected, the function falls back to
|
|
468
|
+
* calling coerceNodeId {@link coerceNodeId}.
|
|
469
|
+
*
|
|
470
|
+
* @example
|
|
471
|
+
* ```javascript
|
|
472
|
+
* const nodeId = resolveNodeId("ObjectsFolder");
|
|
473
|
+
* console.log(nodeId.toString());
|
|
474
|
+
* ```
|
|
475
|
+
* ```text
|
|
476
|
+
* >ns=0;i=85
|
|
477
|
+
* ```
|
|
478
|
+
*
|
|
479
|
+
* ```javascript
|
|
480
|
+
* const nodeId = resolveNodeId("HasComponent");
|
|
481
|
+
* console.log(nodeId.toString());
|
|
482
|
+
* ```
|
|
483
|
+
* ```text
|
|
484
|
+
* >ns=0;i=33
|
|
485
|
+
* ```
|
|
486
|
+
*
|
|
487
|
+
* ```javascript
|
|
488
|
+
* const nodeId = resolveNodeId("ns=1;i=4444");
|
|
489
|
+
* console.log(nodeId.toString());
|
|
490
|
+
* ```
|
|
491
|
+
* ```text
|
|
492
|
+
* >ns=1;i=4444
|
|
493
|
+
* ```
|
|
494
|
+
*
|
|
428
495
|
*/
|
|
429
496
|
export function resolveNodeId(nodeIdOrString: NodeIdLike, options?: ResolveNodeIdOptions): NodeId {
|
|
430
497
|
let nodeId;
|
|
@@ -440,6 +507,24 @@ export function resolveNodeId(nodeIdOrString: NodeIdLike, options?: ResolveNodeI
|
|
|
440
507
|
|
|
441
508
|
NodeId.resolveNodeId = resolveNodeId;
|
|
442
509
|
|
|
510
|
+
/**
|
|
511
|
+
*
|
|
512
|
+
* The sameNodeId function is used to compare two NodeId objects to
|
|
513
|
+
* determine if they are identical. This comparison is based on the
|
|
514
|
+
* identifier type, namespace, and value of the NodeId objects.
|
|
515
|
+
*
|
|
516
|
+
|
|
517
|
+
*
|
|
518
|
+
* @return {boolean} Returns true if the two NodeId objects are
|
|
519
|
+
* identical, otherwise returns false.
|
|
520
|
+
*
|
|
521
|
+
* @example
|
|
522
|
+
* ```javascript
|
|
523
|
+
* const nodeId1: NodeId = new NodeId(NodeIdType.STRING, "example", 1);
|
|
524
|
+
* const nodeId2: NodeId = coerceNodeId("ns=1;s=example");
|
|
525
|
+
* const areSame = sameNodeId(nodeId1, nodeId2); // returns true
|
|
526
|
+
* ```
|
|
527
|
+
*/
|
|
443
528
|
export function sameNodeId(n1: NodeId, n2: NodeId): boolean {
|
|
444
529
|
if (n1.identifierType !== n2.identifierType) {
|
|
445
530
|
return false;
|