mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
handle missing dirTxt 🐛
This commit is contained in:
parent
ab00a9360f
commit
6aa57d4616
3 changed files with 3 additions and 3 deletions
|
@ -21,7 +21,7 @@ const createParseArrOrDep = (profile, opt, data, prefix) => {
|
|||
stop: locations[parseInt(d.stbStop.locX)] || null,
|
||||
when: profile.parseDateTime(profile, d.date, t, tz),
|
||||
// todo: for arrivals, this is the *origin*, not the *direction*
|
||||
direction: prefix === DEPARTURE && profile.parseStationName(d.dirTxt) || null,
|
||||
direction: prefix === DEPARTURE && d.dirTxt && profile.parseStationName(d.dirTxt) || null,
|
||||
line: lines[parseInt(d.prodX)] || null,
|
||||
remarks: []
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ const createParseJourneyLeg = (profile, opt, data) => {
|
|||
// todo: pull `public` value from `profile.products`
|
||||
res.tripId = pt.jny.jid
|
||||
res.line = lines[parseInt(pt.jny.prodX)] || null
|
||||
res.direction = profile.parseStationName(pt.jny.dirTxt) || null
|
||||
res.direction = pt.jny.dirTxt && profile.parseStationName(pt.jny.dirTxt) || null
|
||||
|
||||
if (pt.dep.dPlatfS) res.departurePlatform = pt.dep.dPlatfS
|
||||
if (pt.arr.aPlatfS) res.arrivalPlatform = pt.arr.aPlatfS
|
||||
|
|
|
@ -13,7 +13,7 @@ const createParseMovement = (profile, opt, data) => {
|
|||
const pStopover = profile.parseStopover(profile, opt, data, m.date)
|
||||
|
||||
const res = {
|
||||
direction: profile.parseStationName(m.dirTxt),
|
||||
direction: m.dirTxt ? profile.parseStationName(m.dirTxt) : null,
|
||||
tripId: m.jid || null,
|
||||
line: lines[m.prodX] || null,
|
||||
location: m.pos ? {
|
||||
|
|
Loading…
Add table
Reference in a new issue