mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
fix(bikeshare): preserve unknown availability counts
This commit is contained in:
1 parent
c6f92da962
commit
9bee985abb
4 files changed
+58
No files matched your search
@@ -25,6 +25,7 @@ export function normalizeGbfsBool(value, fallback = true) {
|
||||
* @returns {number|null}
|
||||
*/
|
||||
export function toNonNegativeInteger(value, fallback = null) {
|
||||
if (value == null || value === '') return fallback;
|
||||
const n = Number(value);
|
||||
if (!Number.isFinite(n) || n < 0) return fallback;
|
||||
return Math.round(n);
|
||||
|
||||
Reference in new issue
Block a user