fix(bikeshare): preserve unknown availability counts

This commit is contained in:
Rudy Celekli committed 2026-10-15 16:56:11 -04:00
1 parent c6f92da962
commit 9bee985abb
4 files changed
+58

No files matched your search

+1
View File
@@ -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);