mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
bugfixes: fix undefined variables 🐛
This commit is contained in:
parent
db94a62649
commit
bc30309056
2 changed files with 3 additions and 6 deletions
|
@ -49,11 +49,8 @@ const fixMovement = ({parsed}, m) => {
|
||||||
// filter out POIs
|
// filter out POIs
|
||||||
// todo: make use of them, as some of them specify fare zones
|
// todo: make use of them, as some of them specify fare zones
|
||||||
parsed.nextStopovers = parsed.nextStopovers.filter(st => {
|
parsed.nextStopovers = parsed.nextStopovers.filter(st => {
|
||||||
const s = st.stop || {}
|
let s = st.stop || {}
|
||||||
if (s.station) {
|
if (s.station) s = s.station
|
||||||
s = s.station
|
|
||||||
if (s.station.type === 'stop' || s.station.type === 'station') return true
|
|
||||||
}
|
|
||||||
return s.type === 'stop' || s.type === 'station'
|
return s.type === 'stop' || s.type === 'station'
|
||||||
})
|
})
|
||||||
parsed.frames = parsed.frames.filter((f) => {
|
parsed.frames = parsed.frames.filter((f) => {
|
||||||
|
|
|
@ -27,7 +27,7 @@ const parseLocation = (ctx, l) => {
|
||||||
const stop = {
|
const stop = {
|
||||||
type: l.isMainMast ? 'station' : 'stop',
|
type: l.isMainMast ? 'station' : 'stop',
|
||||||
id: res.id,
|
id: res.id,
|
||||||
name: l.name || id.O ? profile.parseStationName(ctx, l.name || id.O) : null,
|
name: l.name || lid.O ? profile.parseStationName(ctx, l.name || lid.O) : null,
|
||||||
location: 'number' === typeof res.latitude ? res : null // todo: remove `.id`
|
location: 'number' === typeof res.latitude ? res : null // todo: remove `.id`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue