Socket
Socket
Sign inDemoInstall

ms

Package Overview
Dependencies
0
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.6.0 to 0.6.1

24

index.js

@@ -96,11 +96,17 @@ /**

function long(ms) {
if (ms == d) return Math.round(ms / d) + ' day';
if (ms > d) return Math.round(ms / d) + ' days';
if (ms == h) return Math.round(ms / h) + ' hour';
if (ms > h) return Math.round(ms / h) + ' hours';
if (ms == m) return Math.round(ms / m) + ' minute';
if (ms > m) return Math.round(ms / m) + ' minutes';
if (ms == s) return Math.round(ms / s) + ' second';
if (ms > s) return Math.round(ms / s) + ' seconds';
return ms + ' ms';
return plural(ms, d, 'day')
|| plural(ms, h, 'hour')
|| plural(ms, m, 'minute')
|| plural(ms, s, 'second')
|| ms + ' ms';
}
/**
* Pluralization helper.
*/
function plural(ms, n, name) {
if (ms < n) return;
if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name;
return Math.ceil(ms / n) + ' ' + name + 's';
}
{
"name": "ms",
"version": "0.6.0",
"version": "0.6.1",
"description": "Tiny ms conversion utility",

@@ -5,0 +5,0 @@ "main": "./index",

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