node-opcua-date-time
Advanced tools
Comparing version 0.5.0 to 2.0.0-alpha.2
{ | ||
"name": "node-opcua-date-time", | ||
"main": "./src/date_time.js", | ||
"version": "0.5.0", | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"version": "2.0.0-alpha.2", | ||
"description": "pure nodejs OPCUA SDK - module -date-time", | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "mocha test" | ||
@@ -11,9 +13,10 @@ }, | ||
"long": "^4.0.0", | ||
"node-opcua-assert": "^0.5.0", | ||
"node-opcua-assert": "^2.0.0-alpha.2", | ||
"underscore": "^1.9.1" | ||
}, | ||
"devDependencies": { | ||
"@types/underscore": "^1.8.9", | ||
"bignumber.js": "^7.2.1", | ||
"node-opcua-benchmarker": "^0.5.0", | ||
"node-opcua-binary-stream": "^0.5.0", | ||
"node-opcua-benchmarker": "^2.0.0-alpha.2", | ||
"node-opcua-binary-stream": "^2.0.0-alpha.2", | ||
"should": "13.2.3" | ||
@@ -36,3 +39,3 @@ }, | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "7c2f2dcb6ebdc49e57da1a028406a307df502d4e" | ||
"gitHead": "7f57dd90e9d8bd1abcb8d330b3470999ac51e33f" | ||
} |
"use strict"; | ||
const should = require("should"); | ||
const getCurrentClock= require("../src/date_time").getCurrentClock; | ||
const getCurrentClock= require("..").getCurrentClock; | ||
@@ -6,0 +6,0 @@ const Benchmarker = require("node-opcua-benchmarker").Benchmarker; |
@@ -8,8 +8,11 @@ "use strict"; | ||
const date_time = require(".."); | ||
const ec = require("../src/encode_decode"); | ||
const offsetFactor1601 = date_time.offsetFactor1601; | ||
const randomDateTime =date_time.randomDateTime; | ||
const decodeDateTime =date_time.decodeDateTime; | ||
const encodeDateTime =date_time.encodeDateTime; | ||
const offset_factor_1601 = date_time.offset_factor_1601; | ||
const offset = offset_factor_1601[0]; | ||
const factor = offset_factor_1601[1]; | ||
const offset = offsetFactor1601[0]; | ||
const factor = offsetFactor1601[1]; | ||
const Long = require("long"); | ||
const getCurrentClock= require("..").getCurrentClock; | ||
@@ -129,3 +132,3 @@ | ||
const stream = new BinaryStream(buf); | ||
const date = ec.decodeDateTime(stream); | ||
const date = decodeDateTime(stream); | ||
//xx console.log("DDD = ",date.toUTCString(), " ms=", date.getMilliseconds()); | ||
@@ -171,4 +174,4 @@ date.toISOString().should.eql("2013-12-12T07:36:09.747Z"); | ||
function bn_hundredNanoSecondFrom1601ToDate_big_number(high, low) { | ||
const offset = offset_factor_1601[0]; | ||
const factor = offset_factor_1601[1]; | ||
const offset = offsetFactor1601[0]; | ||
const factor = offsetFactor1601[1]; | ||
let value = new BigNumber(high).times(0x100000000).plus(low).div(factor).minus(offset); | ||
@@ -285,3 +288,3 @@ value = parseInt(value, 10); | ||
for (i = 0; i < 100; i++) { | ||
dates_to_check.push(ec.randomDateTime()); | ||
dates_to_check.push(randomDateTime()); | ||
} | ||
@@ -302,3 +305,3 @@ let date, check_date, check_date_bn; | ||
isValidInt32(hl[1]).should.eql(true); | ||
ec.encodeDateTime(date, bs); | ||
encodeDateTime(date, bs); | ||
bs.rewind(); | ||
@@ -512,6 +515,6 @@ } | ||
ec.encodeDateTime(date,stream); | ||
encodeDateTime(date,stream); | ||
stream.rewind(); | ||
const dateVerif1 = ec.decodeDateTime(stream); | ||
const dateVerif1 = decodeDateTime(stream); | ||
@@ -522,3 +525,2 @@ dateVerif1.getTime().should.eql(date.getTime()); | ||
const getCurrentClock= require("../src/date_time").getCurrentClock; | ||
@@ -525,0 +527,0 @@ it("should convert a time to 100nano and back",function() { |
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
60516
18
1101
5
+ Addedansi-styles@4.3.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addednode-opcua-assert@2.120.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedbetter-assert@1.0.2(transitive)
- Removedcallsite@1.0.0(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removednode-opcua-assert@0.5.0(transitive)
- Removedsupports-color@5.5.0(transitive)