node-opcua-variant 2.76.0 → 2.76.2
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/DataType_enum.d.ts +6 -6
- package/dist/DataType_enum.js +12 -12
- package/dist/VariantArrayType_enum.d.ts +13 -13
- package/dist/VariantArrayType_enum.js +18 -18
- package/dist/adjust_variant.d.ts +3 -3
- package/dist/adjust_variant.js +28 -28
- package/dist/cast_variant.d.ts +22 -22
- package/dist/cast_variant.js +60 -60
- package/dist/index.d.ts +9 -9
- package/dist/index.js +25 -25
- package/dist/variant.d.ts +83 -83
- package/dist/variant.js +929 -929
- package/dist/verify_rank_and_dimension.d.ts +13 -13
- package/dist/verify_rank_and_dimension.js +44 -44
- package/package.json +15 -15
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ValueRank indicates whether the Value Attribute of the Variable can be an Array and how many dimensions
|
|
3
|
-
* * n > 1 : the Value is an array with the specified number of dimensions.
|
|
4
|
-
* * OneDimension (1): The value is an array with one dimension.
|
|
5
|
-
* * OneOrMoreDimensions (0): The value is an array with one or more dimensions.
|
|
6
|
-
* * Scalar (-1): The value is not an array.
|
|
7
|
-
* * Any (-2): The value can be a scalar or an array with any number of dimensions.
|
|
8
|
-
* * ScalarOrOneDimension (-3): The value can be a scalar or a one dimensional array.
|
|
9
|
-
*/
|
|
10
|
-
export declare function verifyRankAndDimensions(options: {
|
|
11
|
-
valueRank?: number;
|
|
12
|
-
arrayDimensions?: number[] | null;
|
|
13
|
-
}): void;
|
|
1
|
+
/**
|
|
2
|
+
* ValueRank indicates whether the Value Attribute of the Variable can be an Array and how many dimensions
|
|
3
|
+
* * n > 1 : the Value is an array with the specified number of dimensions.
|
|
4
|
+
* * OneDimension (1): The value is an array with one dimension.
|
|
5
|
+
* * OneOrMoreDimensions (0): The value is an array with one or more dimensions.
|
|
6
|
+
* * Scalar (-1): The value is not an array.
|
|
7
|
+
* * Any (-2): The value can be a scalar or an array with any number of dimensions.
|
|
8
|
+
* * ScalarOrOneDimension (-3): The value can be a scalar or a one dimensional array.
|
|
9
|
+
*/
|
|
10
|
+
export declare function verifyRankAndDimensions(options: {
|
|
11
|
+
valueRank?: number;
|
|
12
|
+
arrayDimensions?: number[] | null;
|
|
13
|
+
}): void;
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.verifyRankAndDimensions = void 0;
|
|
4
|
-
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
5
|
-
/**
|
|
6
|
-
* ValueRank indicates whether the Value Attribute of the Variable can be an Array and how many dimensions
|
|
7
|
-
* * n > 1 : the Value is an array with the specified number of dimensions.
|
|
8
|
-
* * OneDimension (1): The value is an array with one dimension.
|
|
9
|
-
* * OneOrMoreDimensions (0): The value is an array with one or more dimensions.
|
|
10
|
-
* * Scalar (-1): The value is not an array.
|
|
11
|
-
* * Any (-2): The value can be a scalar or an array with any number of dimensions.
|
|
12
|
-
* * ScalarOrOneDimension (-3): The value can be a scalar or a one dimensional array.
|
|
13
|
-
*/
|
|
14
|
-
function verifyRankAndDimensions(options) {
|
|
15
|
-
options.arrayDimensions = options.arrayDimensions || null;
|
|
16
|
-
(0, node_opcua_assert_1.default)(options.arrayDimensions === null || Array.isArray(options.arrayDimensions));
|
|
17
|
-
// evaluate valueRank arrayDimensions is specified but valueRank is null
|
|
18
|
-
if (options.arrayDimensions && options.valueRank === undefined) {
|
|
19
|
-
options.valueRank = options.arrayDimensions.length || -1;
|
|
20
|
-
}
|
|
21
|
-
options.valueRank = options.valueRank === undefined ? -1 : options.valueRank || 0; // UInt32
|
|
22
|
-
(0, node_opcua_assert_1.default)(typeof options.valueRank === "number");
|
|
23
|
-
if (options.arrayDimensions && options.valueRank <= 0) {
|
|
24
|
-
if (options.arrayDimensions.length > 0) {
|
|
25
|
-
throw new Error("[CONFORMANCE] arrayDimensions must be null if valueRank <=0");
|
|
26
|
-
}
|
|
27
|
-
options.arrayDimensions = null;
|
|
28
|
-
}
|
|
29
|
-
// specify default arrayDimension if not provided
|
|
30
|
-
if (options.valueRank > 0 && (!options.arrayDimensions || options.arrayDimensions.length === 0)) {
|
|
31
|
-
options.arrayDimensions = new Array(options.valueRank).fill(0);
|
|
32
|
-
}
|
|
33
|
-
// istanbul ignore next
|
|
34
|
-
if (!options.arrayDimensions && options.valueRank > 0) {
|
|
35
|
-
throw new Error("[CONFORMANCE] arrayDimension must be specified if valueRank >0 " + options.valueRank);
|
|
36
|
-
}
|
|
37
|
-
if (options.valueRank > 0 && options.arrayDimensions.length !== options.valueRank) {
|
|
38
|
-
throw new Error("[CONFORMANCE] when valueRank> 0, arrayDimensions must have valueRank elements, this.valueRank =" +
|
|
39
|
-
options.valueRank +
|
|
40
|
-
" whereas arrayDimensions.length =" +
|
|
41
|
-
options.arrayDimensions.length);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.verifyRankAndDimensions = verifyRankAndDimensions;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.verifyRankAndDimensions = void 0;
|
|
4
|
+
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
5
|
+
/**
|
|
6
|
+
* ValueRank indicates whether the Value Attribute of the Variable can be an Array and how many dimensions
|
|
7
|
+
* * n > 1 : the Value is an array with the specified number of dimensions.
|
|
8
|
+
* * OneDimension (1): The value is an array with one dimension.
|
|
9
|
+
* * OneOrMoreDimensions (0): The value is an array with one or more dimensions.
|
|
10
|
+
* * Scalar (-1): The value is not an array.
|
|
11
|
+
* * Any (-2): The value can be a scalar or an array with any number of dimensions.
|
|
12
|
+
* * ScalarOrOneDimension (-3): The value can be a scalar or a one dimensional array.
|
|
13
|
+
*/
|
|
14
|
+
function verifyRankAndDimensions(options) {
|
|
15
|
+
options.arrayDimensions = options.arrayDimensions || null;
|
|
16
|
+
(0, node_opcua_assert_1.default)(options.arrayDimensions === null || Array.isArray(options.arrayDimensions));
|
|
17
|
+
// evaluate valueRank arrayDimensions is specified but valueRank is null
|
|
18
|
+
if (options.arrayDimensions && options.valueRank === undefined) {
|
|
19
|
+
options.valueRank = options.arrayDimensions.length || -1;
|
|
20
|
+
}
|
|
21
|
+
options.valueRank = options.valueRank === undefined ? -1 : options.valueRank || 0; // UInt32
|
|
22
|
+
(0, node_opcua_assert_1.default)(typeof options.valueRank === "number");
|
|
23
|
+
if (options.arrayDimensions && options.valueRank <= 0) {
|
|
24
|
+
if (options.arrayDimensions.length > 0) {
|
|
25
|
+
throw new Error("[CONFORMANCE] arrayDimensions must be null if valueRank <=0");
|
|
26
|
+
}
|
|
27
|
+
options.arrayDimensions = null;
|
|
28
|
+
}
|
|
29
|
+
// specify default arrayDimension if not provided
|
|
30
|
+
if (options.valueRank > 0 && (!options.arrayDimensions || options.arrayDimensions.length === 0)) {
|
|
31
|
+
options.arrayDimensions = new Array(options.valueRank).fill(0);
|
|
32
|
+
}
|
|
33
|
+
// istanbul ignore next
|
|
34
|
+
if (!options.arrayDimensions && options.valueRank > 0) {
|
|
35
|
+
throw new Error("[CONFORMANCE] arrayDimension must be specified if valueRank >0 " + options.valueRank);
|
|
36
|
+
}
|
|
37
|
+
if (options.valueRank > 0 && options.arrayDimensions.length !== options.valueRank) {
|
|
38
|
+
throw new Error("[CONFORMANCE] when valueRank> 0, arrayDimensions must have valueRank elements, this.valueRank =" +
|
|
39
|
+
options.valueRank +
|
|
40
|
+
" whereas arrayDimensions.length =" +
|
|
41
|
+
options.arrayDimensions.length);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.verifyRankAndDimensions = verifyRankAndDimensions;
|
|
45
45
|
//# sourceMappingURL=verify_rank_and_dimension.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-variant",
|
|
3
|
-
"version": "2.76.
|
|
3
|
+
"version": "2.76.2",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module -variant",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -13,24 +13,24 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"node-opcua-assert": "2.76.0",
|
|
16
|
-
"node-opcua-basic-types": "2.76.
|
|
17
|
-
"node-opcua-binary-stream": "2.76.
|
|
18
|
-
"node-opcua-data-model": "2.76.
|
|
19
|
-
"node-opcua-enum": "2.76.
|
|
20
|
-
"node-opcua-factory": "2.76.
|
|
21
|
-
"node-opcua-nodeid": "2.76.
|
|
16
|
+
"node-opcua-basic-types": "2.76.2",
|
|
17
|
+
"node-opcua-binary-stream": "2.76.2",
|
|
18
|
+
"node-opcua-data-model": "2.76.2",
|
|
19
|
+
"node-opcua-enum": "2.76.2",
|
|
20
|
+
"node-opcua-factory": "2.76.2",
|
|
21
|
+
"node-opcua-nodeid": "2.76.2",
|
|
22
22
|
"node-opcua-utils": "2.76.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@types/lodash": "4.14.
|
|
25
|
+
"@types/lodash": "4.14.184",
|
|
26
26
|
"@types/underscore": "^1.11.4",
|
|
27
27
|
"lodash": "4.17.21",
|
|
28
|
-
"node-opcua-benchmarker": "2.76.
|
|
29
|
-
"node-opcua-debug": "2.76.
|
|
30
|
-
"node-opcua-extension-object": "2.76.
|
|
31
|
-
"node-opcua-numeric-range": "2.76.
|
|
32
|
-
"node-opcua-packet-analyzer": "2.76.
|
|
33
|
-
"node-opcua-status-code": "2.76.
|
|
28
|
+
"node-opcua-benchmarker": "2.76.2",
|
|
29
|
+
"node-opcua-debug": "2.76.2",
|
|
30
|
+
"node-opcua-extension-object": "2.76.2",
|
|
31
|
+
"node-opcua-numeric-range": "2.76.2",
|
|
32
|
+
"node-opcua-packet-analyzer": "2.76.2",
|
|
33
|
+
"node-opcua-status-code": "2.76.2",
|
|
34
34
|
"should": "^13.2.3",
|
|
35
35
|
"underscore": "^1.13.4"
|
|
36
36
|
},
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"internet of things"
|
|
50
50
|
],
|
|
51
51
|
"homepage": "http://node-opcua.github.io/",
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "acb5ecaf1e1c71af3b63e80909d58447f3f298e7"
|
|
53
53
|
}
|