@opentripplanner/humanize-distance
Advanced tools
Comparing version 0.0.22 to 1.0.0
@@ -17,8 +17,7 @@ "use strict"; | ||
function humanizeDistanceStringMetric(meters) { | ||
let km = meters / 1000; | ||
const km = meters / 1000; | ||
if (km > 100) { | ||
// 100 km => 999999999 km | ||
km = km.toFixed(0); | ||
return `${km} km`; | ||
return `${km.toFixed(0)} km`; | ||
} | ||
@@ -28,4 +27,3 @@ | ||
// 1.1 km => 99.9 km | ||
km = km.toFixed(1); | ||
return `${km} km`; | ||
return `${km.toFixed(1)} km`; | ||
} // 1m => 999m | ||
@@ -32,0 +30,0 @@ |
{ | ||
"name": "@opentripplanner/humanize-distance", | ||
"version": "0.0.22", | ||
"version": "1.0.0", | ||
"description": "Pretty print a string for a certain distance", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"repository": "https://github.com/opentripplanner/otp-ui.git", | ||
@@ -10,3 +11,6 @@ "author": "Evan Siroky", | ||
"private": false, | ||
"gitHead": "9ee3a7184fffb2401e9ccc0930b743ae028a1b0f" | ||
"gitHead": "644c72e0d08f8daf93b44eaf0deec88a1e16f414", | ||
"scripts": { | ||
"tsc": "tsc" | ||
} | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5375
9
120
1
1