node-opcua-variant 2.56.0 → 2.57.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/.mocharc.js CHANGED
@@ -1,11 +1,11 @@
1
- module.exports = {
2
- require: [
3
- "../../node_modules/source-map-support/register",
4
- "../../node_modules/ts-node/register/transpile-only",
5
- "../../node_modules/should",
6
- ],
7
- timeout: 20000,
8
- extension: ["js", "ts"],
9
- spec: ["test/*.ts", "test/*.js"],
10
- bail: true
11
- };
1
+ module.exports = {
2
+ require: [
3
+ "../../node_modules/source-map-support/register",
4
+ "../../node_modules/ts-node/register/transpile-only",
5
+ "../../node_modules/should",
6
+ ],
7
+ timeout: 20000,
8
+ extension: ["js", "ts"],
9
+ spec: ["test/*.ts", "test/*.js"],
10
+ bail: true
11
+ };
package/LICENSE CHANGED
@@ -1,20 +1,20 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2014-2021 Etienne Rossignon
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of
6
- this software and associated documentation files (the "Software"), to deal in
7
- the Software without restriction, including without limitation the rights to
8
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
- the Software, and to permit persons to whom the Software is furnished to do so,
10
- subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014-2021 Etienne Rossignon
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/nyc.config.js CHANGED
@@ -1,16 +1,16 @@
1
- module.exports = {
2
- "extension": [
3
- ".ts",
4
- ".tsx"
5
- ],
6
- "all": true,
7
- "include": [
8
- "dist/**/*.js",
9
- "source/**/*.ts",
10
-
11
- ],
12
- "exclude": [
13
- "**/*.spec.js"
14
- ],
15
- "check-coverage": true
16
- };
1
+ module.exports = {
2
+ "extension": [
3
+ ".ts",
4
+ ".tsx"
5
+ ],
6
+ "all": true,
7
+ "include": [
8
+ "dist/**/*.js",
9
+ "source/**/*.ts",
10
+
11
+ ],
12
+ "exclude": [
13
+ "**/*.spec.js"
14
+ ],
15
+ "check-coverage": true
16
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-variant",
3
- "version": "2.56.0",
3
+ "version": "2.57.0",
4
4
  "description": "pure nodejs OPCUA SDK - module -variant",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -13,13 +13,13 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "node-opcua-assert": "2.55.0",
16
- "node-opcua-basic-types": "2.56.0",
17
- "node-opcua-data-model": "2.56.0",
16
+ "node-opcua-basic-types": "2.57.0",
17
+ "node-opcua-data-model": "2.57.0",
18
18
  "node-opcua-enum": "2.55.0",
19
- "node-opcua-extension-object": "2.56.0",
20
- "node-opcua-factory": "2.56.0",
19
+ "node-opcua-extension-object": "2.57.0",
20
+ "node-opcua-factory": "2.57.0",
21
21
  "node-opcua-nodeid": "2.55.0",
22
- "node-opcua-utils": "2.56.0"
22
+ "node-opcua-utils": "2.57.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/lodash": "4.14.174",
@@ -28,8 +28,8 @@
28
28
  "node-opcua-benchmarker": "2.55.0",
29
29
  "node-opcua-binary-stream": "2.55.0",
30
30
  "node-opcua-debug": "2.55.0",
31
- "node-opcua-numeric-range": "2.56.0",
32
- "node-opcua-packet-analyzer": "2.56.0",
31
+ "node-opcua-numeric-range": "2.57.0",
32
+ "node-opcua-packet-analyzer": "2.57.0",
33
33
  "node-opcua-status-code": "2.56.0",
34
34
  "should": "^13.2.3",
35
35
  "source-map-support": "^0.5.20",
@@ -50,5 +50,5 @@
50
50
  "internet of things"
51
51
  ],
52
52
  "homepage": "http://node-opcua.github.io/",
53
- "gitHead": "9f6eac1c658c0d182fbe03cf58f799af468615eb"
53
+ "gitHead": "cb6a995ab35ea6231ffca85fbd0b624fe37119d2"
54
54
  }
@@ -1,61 +1,61 @@
1
- import { Variant } from "./variant";
2
- import { DataType } from "./DataType_enum";
3
-
4
- // TODO
5
- /**
6
- * cast the variant value to match the type required by the variable
7
- * - the method will throw if no conversion is possible
8
- * - the original variant will not be modified if it already has the required type
9
- * - the variant will be modified accordingly to match the required type
10
- *
11
- * | .... | Byte | UInt16 | UInt32 | UInt64 | Boolean | SByte | Int16 | Int32 | Int64 | Float | Double | String | anything else |
12
- * | ------- | ---- | ------ | ------ | ------ | ------- | ----- | ----- | ------ | ----- | ----- | ------ | ------ | ------------- |
13
- * | Byte | - | OK | OK | OK | F=0;T<>0| <128 | OK | OK | OK | OK | OK | | |
14
- * | UInt16 |<=255 | - | OK | OK | F=0;T<>0| <128 |<2^15-1| OK | OK | OK | OK | | |
15
- * | UInt32 |<=255 |<2^16 | - | OK | F=0;T<>0| <128 |<2^15-1| <2^31-1| OK | OK | OK | | |
16
- * | UInt64 |<=255 |<2^16 |<2^31 | - | F=0;T<>0| <128 |<2^15-1| <2^31-1| OK | OK(*) | OK(*) | | |
17
- * | Boolean | x |F=0;T=1 |F=0;T=1 | F=0;T=1| - |F=0;T=1|F=0;T=1|F=0;T=1 |F=0;T=1|F=0;T=1|F=0;T=1 | | |
18
- * | SByte |>=0 | >=0 | >=0 | >=0 | F=0;T<>0| - | OK | OK | OK | OK | OK | | |
19
- * | Int16 |a<x<b | >=0 | OK | OK | F=0;T<>0|<128 | - | OK | OK | OK | OK | | |
20
- * | Int32 |a<x<b |a<x<b | >=0 | OK | F=0;T<>0|<128 | | - | OK | OK | OK | | |
21
- * | Int64 |a<x<b |a<x<b | a<x<b | >=0 | F=0;T<>0|<128 | - | | - | OK | OK | | |
22
- * | Float |err |err | err | err | F=0;T<>0| err | err | err | err | - | OK | | |
23
- * | Double |err |err | err | err | F=0;T<>0| err | err | err | err | * | - | | |
24
- * | String |err |err | err | err | err | err | err | err | err | err | err | - | |
25
- */
26
- /*
27
- export function castVariant(variant: Variant, targetDataType: DataType): Variant {
28
- if (targetDataType !== variant.dataType) {
29
- switch (targetDataType) {
30
- case DataType.SByte:
31
- case DataType.Int16:
32
- case DataType.Int32:
33
- case DataType.Int64:
34
- case DataType.Byte:
35
- case DataType.Int16:
36
- case DataType.UInt32:
37
- case DataType.UInt32:
38
- case DataType.UInt64:
39
- case DataType.Double:
40
- case DataType.Float:
41
- switch (variant.dataType) {
42
- case DataType.SByte:
43
- case DataType.Int16:
44
- case DataType.Int32:
45
- case DataType.Int64:
46
- case DataType.Byte:
47
- case DataType.UInt16:
48
- case DataType.UInt32:
49
- case DataType.UInt64:
50
- case DataType.Double:
51
- case DataType.Float:
52
- variant.dataType = targetDataType;
53
- break;
54
- }
55
- break;
56
- }
57
- }
58
-
59
- return variant;
60
- }
61
- */
1
+ import { Variant } from "./variant";
2
+ import { DataType } from "./DataType_enum";
3
+
4
+ // TODO
5
+ /**
6
+ * cast the variant value to match the type required by the variable
7
+ * - the method will throw if no conversion is possible
8
+ * - the original variant will not be modified if it already has the required type
9
+ * - the variant will be modified accordingly to match the required type
10
+ *
11
+ * | .... | Byte | UInt16 | UInt32 | UInt64 | Boolean | SByte | Int16 | Int32 | Int64 | Float | Double | String | anything else |
12
+ * | ------- | ---- | ------ | ------ | ------ | ------- | ----- | ----- | ------ | ----- | ----- | ------ | ------ | ------------- |
13
+ * | Byte | - | OK | OK | OK | F=0;T<>0| <128 | OK | OK | OK | OK | OK | | |
14
+ * | UInt16 |<=255 | - | OK | OK | F=0;T<>0| <128 |<2^15-1| OK | OK | OK | OK | | |
15
+ * | UInt32 |<=255 |<2^16 | - | OK | F=0;T<>0| <128 |<2^15-1| <2^31-1| OK | OK | OK | | |
16
+ * | UInt64 |<=255 |<2^16 |<2^31 | - | F=0;T<>0| <128 |<2^15-1| <2^31-1| OK | OK(*) | OK(*) | | |
17
+ * | Boolean | x |F=0;T=1 |F=0;T=1 | F=0;T=1| - |F=0;T=1|F=0;T=1|F=0;T=1 |F=0;T=1|F=0;T=1|F=0;T=1 | | |
18
+ * | SByte |>=0 | >=0 | >=0 | >=0 | F=0;T<>0| - | OK | OK | OK | OK | OK | | |
19
+ * | Int16 |a<x<b | >=0 | OK | OK | F=0;T<>0|<128 | - | OK | OK | OK | OK | | |
20
+ * | Int32 |a<x<b |a<x<b | >=0 | OK | F=0;T<>0|<128 | | - | OK | OK | OK | | |
21
+ * | Int64 |a<x<b |a<x<b | a<x<b | >=0 | F=0;T<>0|<128 | - | | - | OK | OK | | |
22
+ * | Float |err |err | err | err | F=0;T<>0| err | err | err | err | - | OK | | |
23
+ * | Double |err |err | err | err | F=0;T<>0| err | err | err | err | * | - | | |
24
+ * | String |err |err | err | err | err | err | err | err | err | err | err | - | |
25
+ */
26
+ /*
27
+ export function castVariant(variant: Variant, targetDataType: DataType): Variant {
28
+ if (targetDataType !== variant.dataType) {
29
+ switch (targetDataType) {
30
+ case DataType.SByte:
31
+ case DataType.Int16:
32
+ case DataType.Int32:
33
+ case DataType.Int64:
34
+ case DataType.Byte:
35
+ case DataType.Int16:
36
+ case DataType.UInt32:
37
+ case DataType.UInt32:
38
+ case DataType.UInt64:
39
+ case DataType.Double:
40
+ case DataType.Float:
41
+ switch (variant.dataType) {
42
+ case DataType.SByte:
43
+ case DataType.Int16:
44
+ case DataType.Int32:
45
+ case DataType.Int64:
46
+ case DataType.Byte:
47
+ case DataType.UInt16:
48
+ case DataType.UInt32:
49
+ case DataType.UInt64:
50
+ case DataType.Double:
51
+ case DataType.Float:
52
+ variant.dataType = targetDataType;
53
+ break;
54
+ }
55
+ break;
56
+ }
57
+ }
58
+
59
+ return variant;
60
+ }
61
+ */
package/source/index.ts CHANGED
@@ -1,8 +1,8 @@
1
- /**
2
- * @module node-opcua-variant
3
- */
4
- export * from "./DataType_enum";
5
- export * from "./VariantArrayType_enum";
6
- export * from "./variant";
7
- export * from "./adjust_variant";
8
- export * from "./cast_variant";
1
+ /**
2
+ * @module node-opcua-variant
3
+ */
4
+ export * from "./DataType_enum";
5
+ export * from "./VariantArrayType_enum";
6
+ export * from "./variant";
7
+ export * from "./adjust_variant";
8
+ export * from "./cast_variant";