Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@injectivelabs/utils

Package Overview
Dependencies
Maintainers
9
Versions
309
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@injectivelabs/utils - npm Package Compare versions

Comparing version 1.0.15 to 1.0.16

2

dist/time.d.ts
import { BigNumberInBase, BigNumber } from './classes';
export declare const SECONDS_IN_A_DAY: BigNumber;
export declare const convertTimestampToMilliseconds: (timestamp: number) => number;
export declare const convertTimestampToMilliseconds: (timestamp: number | string) => number;
export declare const getUTCDateFromTimestamp: (timestamp: number) => string;

@@ -5,0 +5,0 @@ export declare const tomorrow: () => BigNumber;

@@ -7,9 +7,13 @@ "use strict";

const convertTimestampToMilliseconds = (timestamp) => {
const timestampInBigNumber = new classes_1.BigNumberInBase(timestamp);
if (timestamp.toString().length > 13) {
return parseInt(timestamp.toString().slice(0, 13), 10);
return timestampInBigNumber
.precision(13, classes_1.BigNumber.ROUND_HALF_UP)
.toNumber();
}
if (timestamp.toString().length < 13) {
return parseInt(`${timestamp}${'0'.repeat(13 - timestamp.toString().length)}`, 10);
const trailingZeros = 13 - timestamp.toString().length;
return timestampInBigNumber.times(Math.pow(10, trailingZeros)).toNumber();
}
return timestamp;
return timestampInBigNumber.toNumber();
};

@@ -16,0 +20,0 @@ exports.convertTimestampToMilliseconds = convertTimestampToMilliseconds;

{
"name": "@injectivelabs/utils",
"description": "List of utils and helper functions that can be reused throughout Injective's projects.",
"version": "1.0.15",
"version": "1.0.16",
"author": {

@@ -43,3 +43,3 @@ "name": "Bojan Angjelkoski",

},
"gitHead": "554b7c6e44ef563b46b82491cb4757575c51e6c9"
"gitHead": "81402967d829bf7d279dd84096899530b541b503"
}

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc