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

pretty-time

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pretty-time - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

8

index.js

@@ -11,2 +11,3 @@ /*!

var isNumber = require('is-number');
var nano = require('nanoseconds');
var utils = require('./utils');

@@ -25,3 +26,6 @@ var scale = {

function pretty(time, smallest, digits) {
if (!Array.isArray(time) || time.length !== 2) {
if (!isNumber(time) && !Array.isArray(time)) {
throw new TypeError('expected an array or number in nanoseconds');
}
if (Array.isArray(time) && time.length !== 2) {
throw new TypeError('expected an array from process.hrtime()');

@@ -35,3 +39,3 @@ }

var num = ((+time[0]) * 1e9) + (+time[1]);
var num = isNumber(time) ? time : nano(time);
var res = '';

@@ -38,0 +42,0 @@ var prev;

{
"name": "pretty-time",
"description": "Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds.",
"version": "0.1.2",
"version": "0.2.0",
"homepage": "https://github.com/jonschlinkert/pretty-time",

@@ -24,3 +24,4 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

"dependencies": {
"is-number": "^2.0.2"
"is-number": "^2.0.2",
"nanoseconds": "^0.1.0"
},

@@ -27,0 +28,0 @@ "devDependencies": {

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