node-opcua-basic-types
Advanced tools
Comparing version 2.0.0-alpha.8 to 2.0.0-alpha.9
@@ -45,4 +45,4 @@ "use strict"; | ||
const nbDigits = Math.ceil(Math.log(Math.abs(float)) / Math.log(10)); | ||
const r = Math.pow(10, -nbDigits + 2); | ||
return Math.round(float * r) / r; | ||
const scale = Math.pow(10, -nbDigits + 2); | ||
return Math.round(float * scale) / scale; | ||
} | ||
@@ -49,0 +49,0 @@ exports.roundToFloat2 = roundToFloat2; |
{ | ||
"name": "node-opcua-basic-types", | ||
"version": "2.0.0-alpha.8", | ||
"version": "2.0.0-alpha.9", | ||
"description": "pure nodejs OPCUA SDK - module -basic-types", | ||
@@ -14,17 +14,17 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"node-opcua-assert": "^2.0.0-alpha.8", | ||
"node-opcua-binary-stream": "^2.0.0-alpha.8", | ||
"node-opcua-buffer-utils": "^2.0.0-alpha.8", | ||
"node-opcua-date-time": "^2.0.0-alpha.8", | ||
"node-opcua-enum": "^2.0.0-alpha.8", | ||
"node-opcua-guid": "^2.0.0-alpha.8", | ||
"node-opcua-nodeid": "^2.0.0-alpha.8", | ||
"node-opcua-status-code": "^2.0.0-alpha.8", | ||
"node-opcua-utils": "^2.0.0-alpha.8", | ||
"node-opcua-assert": "^2.0.0-alpha.9", | ||
"node-opcua-binary-stream": "^2.0.0-alpha.9", | ||
"node-opcua-buffer-utils": "^2.0.0-alpha.9", | ||
"node-opcua-date-time": "^2.0.0-alpha.9", | ||
"node-opcua-enum": "^2.0.0-alpha.9", | ||
"node-opcua-guid": "^2.0.0-alpha.9", | ||
"node-opcua-nodeid": "^2.0.0-alpha.9", | ||
"node-opcua-status-code": "^2.0.0-alpha.9", | ||
"node-opcua-utils": "^2.0.0-alpha.9", | ||
"underscore": "^1.9.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^10.12.15", | ||
"@types/node": "^10.12.18", | ||
"@types/underscore": "^1.8.9", | ||
"node-opcua-debug": "^2.0.0-alpha.8", | ||
"node-opcua-debug": "^2.0.0-alpha.9", | ||
"should": "13.2.3" | ||
@@ -47,3 +47,3 @@ }, | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "7bbf38d5a3cd29cb6aed6ca38078f4d89d3f956a" | ||
"gitHead": "cd7120d1840593757f0f3c9e53be4e85883dc0e6" | ||
} |
@@ -7,3 +7,3 @@ /*** | ||
import { BinaryStream } from "node-opcua-binary-stream"; | ||
import { createFastUninitializedBuffer } from "node-opcua-buffer-utils"; | ||
import { createFastUninitializedBuffer } from "node-opcua-buffer-utils"; | ||
@@ -10,0 +10,0 @@ import { getRandomInt } from "./utils"; |
@@ -49,4 +49,4 @@ /*** | ||
const nbDigits = Math.ceil(Math.log(Math.abs(float)) / Math.log(10)); | ||
const r = Math.pow(10, -nbDigits + 2); | ||
return Math.round(float * r) / r; | ||
const scale = Math.pow(10, -nbDigits + 2); | ||
return Math.round(float * scale) / scale; | ||
} | ||
@@ -53,0 +53,0 @@ |
@@ -13,2 +13,3 @@ /*** | ||
import { getRandomInt } from "./utils"; | ||
import { Guid } from "node-opcua-guid"; | ||
@@ -45,3 +46,3 @@ // tslint:disable:no-bitwise | ||
if (nodeId.identifierType === NodeIdType.NUMERIC) { | ||
if (isUInt8(nodeId.value) && | ||
if (isUInt8(nodeId.value as number) && | ||
!nodeId.namespace && | ||
@@ -52,3 +53,3 @@ !(nodeId as ExpandedNodeId).namespaceUri && | ||
} else if ( | ||
isUInt16(nodeId.value) && | ||
isUInt16(nodeId.value as number) && | ||
isUInt8(nodeId.namespace) && | ||
@@ -101,19 +102,19 @@ !(nodeId as ExpandedNodeId).namespaceUri && | ||
case EnumNodeIdEncoding.TwoBytes: | ||
stream.writeUInt8(nodeId ? nodeId.value : 0); | ||
stream.writeUInt8(nodeId ? nodeId.value as number : 0); | ||
break; | ||
case EnumNodeIdEncoding.FourBytes: | ||
stream.writeUInt8(nodeId.namespace); | ||
stream.writeUInt16(nodeId.value); | ||
stream.writeUInt16(nodeId.value as number); | ||
break; | ||
case EnumNodeIdEncoding.Numeric: | ||
stream.writeUInt16(nodeId.namespace); | ||
stream.writeUInt32(nodeId.value); | ||
stream.writeUInt32(nodeId.value as number); | ||
break; | ||
case EnumNodeIdEncoding.String: | ||
stream.writeUInt16(nodeId.namespace); | ||
encodeString(nodeId.value, stream); | ||
encodeString(nodeId.value as string, stream); | ||
break; | ||
case EnumNodeIdEncoding.ByteString: | ||
stream.writeUInt16(nodeId.namespace); | ||
encodeByteString(nodeId.value, stream); | ||
encodeByteString(nodeId.value as Buffer, stream); | ||
break; | ||
@@ -123,3 +124,3 @@ default: | ||
stream.writeUInt16(nodeId.namespace); | ||
encodeGuid(nodeId.value, stream); | ||
encodeGuid(nodeId.value as Guid, stream); | ||
break; | ||
@@ -126,0 +127,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92603
56
1835