Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 | 53x 434x 43x | import type { VehiclePosition } from "./interfaces/vehicles";
const MAX_AGE_MS = 90_000;
export function vehicleIsFresh(vehicle: Pick<VehiclePosition, "expires" | "time">, now: number): boolean {
return vehicle.expires > now && now - vehicle.time < MAX_AGE_MS;
}
export function isVehicleTripStale(receivedAt: number | undefined, now: number): boolean {
return !receivedAt || now - receivedAt >= MAX_AGE_MS;
}
|