mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
17 lines
365 B
JavaScript
17 lines
365 B
JavaScript
const parseTrip = (ctx, t) => { // t = raw trip
|
|
const {profile} = ctx;
|
|
|
|
// pretend the trip is a leg in a journey
|
|
const trip = profile.parseJourneyLeg(ctx, t);
|
|
trip.id = trip.tripId; // TODO journeyId
|
|
delete trip.tripId;
|
|
delete trip.reachable;
|
|
trip.cancelled = profile.parseCancelled(t);
|
|
|
|
// TODO opt.scheduledDays
|
|
return trip;
|
|
};
|
|
|
|
export {
|
|
parseTrip,
|
|
};
|