Comparing version 9.0.0 to 9.1.0
@@ -17,2 +17,5 @@ import parseMilliseconds from 'parse-ms'; | ||
const sign = milliseconds < 0 ? '-' : ''; | ||
milliseconds = milliseconds < 0 ? -milliseconds : milliseconds; // Cannot use `Math.abs()` because of BigInt support. | ||
if (options.colonNotation) { | ||
@@ -47,3 +50,3 @@ options.compact = false; | ||
valueString = valueString ?? String(value); | ||
valueString ??= String(value); | ||
if (options.colonNotation) { | ||
@@ -127,3 +130,3 @@ const wholeDigits = valueString.includes('.') ? valueString.split('.')[0].length : valueString.length; | ||
if (result.length === 0) { | ||
return '0' + (options.verbose ? ' milliseconds' : 'ms'); | ||
return sign + '0' + (options.verbose ? ' milliseconds' : 'ms'); | ||
} | ||
@@ -136,3 +139,3 @@ | ||
return result.join(separator); | ||
return sign + result.join(separator); | ||
} |
{ | ||
"name": "pretty-ms", | ||
"version": "9.0.0", | ||
"version": "9.1.0", | ||
"description": "Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s`", | ||
@@ -52,5 +52,5 @@ "license": "MIT", | ||
"ava": "^6.0.1", | ||
"tsd": "^0.30.4", | ||
"xo": "^0.56.0" | ||
"tsd": "^0.31.0", | ||
"xo": "^0.58.0" | ||
} | ||
} |
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
12340
202