@cucumber/messages
Advanced tools
Comparing version 14.0.0 to 14.0.1
{ | ||
"name": "@cucumber/messages", | ||
"version": "14.0.0", | ||
"version": "14.0.1", | ||
"description": "Protocol Buffer messages for Cucumber's inter-process communication", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
@@ -7,2 +7,2 @@ import { io } from './messages'; | ||
export declare function durationToMilliseconds(duration: messages.IDuration): number; | ||
export declare function addDurations(durationA: messages.IDuration, durationB: messages.IDuration): messages.Duration; | ||
export declare function addDurations(durationA: messages.IDuration, durationB: messages.IDuration): messages.IDuration; |
@@ -18,3 +18,3 @@ "use strict"; | ||
function timestampToMillisecondsSinceEpoch(timestamp) { | ||
var nanos = timestamp.nanos, seconds = timestamp.seconds; | ||
var seconds = timestamp.seconds, nanos = timestamp.nanos; | ||
return toMillis(seconds, nanos); | ||
@@ -24,3 +24,3 @@ } | ||
function durationToMilliseconds(duration) { | ||
var nanos = duration.nanos, seconds = duration.seconds; | ||
var seconds = duration.seconds, nanos = duration.nanos; | ||
return toMillis(seconds, nanos); | ||
@@ -30,3 +30,3 @@ } | ||
function addDurations(durationA, durationB) { | ||
var seconds = toNumber(durationA.seconds) + toNumber(durationB.seconds); | ||
var seconds = durationA.seconds + durationB.seconds; | ||
var nanos = durationA.nanos + durationB.nanos; | ||
@@ -40,5 +40,2 @@ if (nanos >= NANOSECONDS_PER_SECOND) { | ||
exports.addDurations = addDurations; | ||
function toNumber(x) { | ||
return typeof x === 'number' ? x : x.toNumber(); | ||
} | ||
function toSecondsAndNanos(milliseconds) { | ||
@@ -50,3 +47,3 @@ var seconds = Math.floor(milliseconds / MILLISECONDS_PER_SECOND); | ||
function toMillis(seconds, nanos) { | ||
var secondMillis = toNumber(seconds) * MILLISECONDS_PER_SECOND; | ||
var secondMillis = seconds * MILLISECONDS_PER_SECOND; | ||
var nanoMillis = nanos / NANOSECONDS_PER_MILLISECOND; | ||
@@ -53,0 +50,0 @@ return secondMillis + nanoMillis; |
{ | ||
"name": "@cucumber/messages", | ||
"version": "14.0.0", | ||
"version": "14.0.1", | ||
"description": "Protocol Buffer messages for Cucumber's inter-process communication", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
@@ -23,3 +23,3 @@ import { io } from './messages' | ||
): number { | ||
const { nanos, seconds } = timestamp | ||
const { seconds, nanos } = timestamp | ||
return toMillis(seconds, nanos) | ||
@@ -29,3 +29,3 @@ } | ||
export function durationToMilliseconds(duration: messages.IDuration) { | ||
const { nanos, seconds } = duration | ||
const { seconds, nanos } = duration | ||
return toMillis(seconds, nanos) | ||
@@ -37,4 +37,4 @@ } | ||
durationB: messages.IDuration | ||
) { | ||
let seconds = toNumber(durationA.seconds) + toNumber(durationB.seconds) | ||
): messages.IDuration { | ||
let seconds = durationA.seconds + durationB.seconds | ||
let nanos = durationA.nanos + durationB.nanos | ||
@@ -48,6 +48,2 @@ if (nanos >= NANOSECONDS_PER_SECOND) { | ||
function toNumber(x: number | Long): number { | ||
return typeof x === 'number' ? x : x.toNumber() | ||
} | ||
function toSecondsAndNanos(milliseconds: number) { | ||
@@ -61,6 +57,6 @@ const seconds = Math.floor(milliseconds / MILLISECONDS_PER_SECOND) | ||
function toMillis(seconds: number | Long, nanos: number) { | ||
const secondMillis = toNumber(seconds) * MILLISECONDS_PER_SECOND | ||
function toMillis(seconds: number, nanos: number): number { | ||
const secondMillis = seconds * MILLISECONDS_PER_SECOND | ||
const nanoMillis = nanos / NANOSECONDS_PER_MILLISECOND | ||
return secondMillis + nanoMillis | ||
} |
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
1265688
20039