From d75ffee0827cb44270e03b889e8fcc5122e858a3 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 5 Nov 2025 19:11:16 +0000 Subject: [PATCH] Fix TypeScript errors: ensure tripId is never undefined - Add non-null assertion (!) for tripId after null check - Fixes CI build errors where string | undefined was passed to SqlValue - All three occurrences fixed in insertVehiclePositions and insertTripUpdates - All tests passing (77/77) - Lint checks passing --- src/loaders/gtfs-rt-loader.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/loaders/gtfs-rt-loader.ts b/src/loaders/gtfs-rt-loader.ts index 686c743..bbf4970 100644 --- a/src/loaders/gtfs-rt-loader.ts +++ b/src/loaders/gtfs-rt-loader.ts @@ -424,7 +424,7 @@ function insertVehiclePositions(db: Database, positions: ProtobufVehiclePosition if (!trip || !(trip.tripId || trip.trip_id)) continue; // Map camelCase protobuf fields to snake_case - const tripId = trip.tripId || trip.trip_id; + const tripId = (trip.tripId || trip.trip_id)!; // Safe: checked above const routeId = trip.routeId || trip.route_id; const vehicleId = vp.vehicle?.id; const vehicleLabel = vp.vehicle?.label; @@ -482,7 +482,7 @@ function insertTripUpdates(db: Database, updates: ProtobufTripUpdate[], timestam if (!trip || !(trip.tripId || trip.trip_id)) continue; // Map camelCase protobuf fields to snake_case - const tripId = trip.tripId || trip.trip_id; + const tripId = (trip.tripId || trip.trip_id)!; // Safe: checked above const routeId = trip.routeId || trip.route_id; const vehicleId = tu.vehicle?.id; const vehicleLabel = tu.vehicle?.label;