opcua-webapi-ts 1.2.0 → 1.2.1
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.
|
@@ -41,17 +41,28 @@ class UaExpandedNodeId {
|
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
43
43
|
toString() {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
let str = this._nodeId.toString();
|
|
45
|
+
if (this._serverIndex) {
|
|
46
|
+
str = "svr=" + this._serverIndex + ";" + str;
|
|
47
|
+
}
|
|
48
|
+
return str;
|
|
46
49
|
}
|
|
47
50
|
static from(nodeId) {
|
|
48
51
|
return new UaExpandedNodeId(nodeId);
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
54
|
exports.UaExpandedNodeId = UaExpandedNodeId;
|
|
55
|
+
const regexSvr = /^svr=([0-9]+);/;
|
|
52
56
|
function parseUaExpandedNodeId(value) {
|
|
53
|
-
let
|
|
54
|
-
|
|
57
|
+
let serverIndex = 0;
|
|
58
|
+
let nodeIdStr = value;
|
|
59
|
+
let matches = regexSvr.exec(value);
|
|
60
|
+
if (matches !== null) {
|
|
61
|
+
serverIndex = parseInt(matches[1], 10);
|
|
62
|
+
nodeIdStr = value.substring(matches[0].length);
|
|
63
|
+
}
|
|
64
|
+
let nodeId = (0, _1.parseUaNodeId)(nodeIdStr);
|
|
65
|
+
return new UaExpandedNodeId(nodeId, null, serverIndex);
|
|
55
66
|
}
|
|
56
67
|
function parseUaExpandedNodeIdOrNull(value) {
|
|
57
68
|
if (!value)
|
|
@@ -41,17 +41,28 @@ class UaExpandedNodeId {
|
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
43
43
|
toString() {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
let str = this._nodeId.toString();
|
|
45
|
+
if (this._serverIndex) {
|
|
46
|
+
str = "svr=" + this._serverIndex + ";" + str;
|
|
47
|
+
}
|
|
48
|
+
return str;
|
|
46
49
|
}
|
|
47
50
|
static from(nodeId) {
|
|
48
51
|
return new UaExpandedNodeId(nodeId);
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
54
|
exports.UaExpandedNodeId = UaExpandedNodeId;
|
|
55
|
+
const regexSvr = /^svr=([0-9]+);/;
|
|
52
56
|
function parseUaExpandedNodeId(value) {
|
|
53
|
-
let
|
|
54
|
-
|
|
57
|
+
let serverIndex = 0;
|
|
58
|
+
let nodeIdStr = value;
|
|
59
|
+
let matches = regexSvr.exec(value);
|
|
60
|
+
if (matches !== null) {
|
|
61
|
+
serverIndex = parseInt(matches[1], 10);
|
|
62
|
+
nodeIdStr = value.substring(matches[0].length);
|
|
63
|
+
}
|
|
64
|
+
let nodeId = (0, _1.parseUaNodeId)(nodeIdStr);
|
|
65
|
+
return new UaExpandedNodeId(nodeId, null, serverIndex);
|
|
55
66
|
}
|
|
56
67
|
function parseUaExpandedNodeIdOrNull(value) {
|
|
57
68
|
if (!value)
|