Socket
Socket
Sign inDemoInstall

@foxglove/rostime

Package Overview
Dependencies
0
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.1 to 1.1.2

6

dist/timeUtils.js

@@ -234,3 +234,3 @@ "use strict";

function toNanoSec({ sec, nsec }) {
return BigInt(sec) * BigInt(1e9) + BigInt(nsec);
return BigInt(sec) * 1000000000n + BigInt(nsec);
}

@@ -278,3 +278,5 @@ exports.toNanoSec = toNanoSec;

// and https://github.com/ros/roscpp_core/blob/7583b7d38c6e1c2e8623f6d98559c483f7a64c83/rostime/src/time.cpp#L536
return { sec: Math.trunc(Number(nsec / BigInt(1e9))), nsec: Number(nsec % BigInt(1e9)) };
//
// Note: BigInt(1e9) is slower than writing out the number
return { sec: Number(nsec / 1000000000n), nsec: Number(nsec % 1000000000n) };
}

@@ -281,0 +283,0 @@ exports.fromNanoSec = fromNanoSec;

{
"name": "@foxglove/rostime",
"version": "1.1.1",
"version": "1.1.2",
"description": "ROS (Robot Operating System) Time and Duration primitives and helper methods",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -5,2 +5,4 @@ # @foxglove/rostime

[![npm version](https://img.shields.io/npm/v/@foxglove/rostime.svg?style=flat)](https://www.npmjs.com/package/@foxglove/rostime)
## Introduction

@@ -7,0 +9,0 @@

@@ -252,3 +252,3 @@ // This Source Code Form is subject to the terms of the Mozilla Public

export function toNanoSec({ sec, nsec }: Time): bigint {
return BigInt(sec) * BigInt(1e9) + BigInt(nsec);
return BigInt(sec) * 1_000_000_000n + BigInt(nsec);
}

@@ -296,3 +296,5 @@

// and https://github.com/ros/roscpp_core/blob/7583b7d38c6e1c2e8623f6d98559c483f7a64c83/rostime/src/time.cpp#L536
return { sec: Math.trunc(Number(nsec / BigInt(1e9))), nsec: Number(nsec % BigInt(1e9)) };
//
// Note: BigInt(1e9) is slower than writing out the number
return { sec: Number(nsec / 1_000_000_000n), nsec: Number(nsec % 1_000_000_000n) };
}

@@ -299,0 +301,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc