mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
parseArrOrDep, parseLocation: bugfixes 🐛
This commit is contained in:
parent
9ce72930b1
commit
1cc453b778
2 changed files with 2 additions and 2 deletions
|
@ -59,7 +59,7 @@ const createParseArrOrDep = (profile, opt, data, prefix) => {
|
||||||
.filter(rem => !!rem) // filter unparsable
|
.filter(rem => !!rem) // filter unparsable
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opt.stopovers && d.stopL) {
|
if (opt.stopovers && Array.isArray(d.stopL)) {
|
||||||
const parse = profile.parseStopover(profile, opt, data, d.date)
|
const parse = profile.parseStopover(profile, opt, data, d.date)
|
||||||
// Filter stations the train passes without stopping, as this doesn't comply with FPTF (yet).
|
// Filter stations the train passes without stopping, as this doesn't comply with FPTF (yet).
|
||||||
const stopovers = d.stopL.map(parse).filter(st => !st.passBy)
|
const stopovers = d.stopL.map(parse).filter(st => !st.passBy)
|
||||||
|
|
|
@ -25,7 +25,7 @@ const parseLocation = (profile, opt, {lines}, l) => {
|
||||||
const stop = {
|
const stop = {
|
||||||
type: l.isMainMast ? 'station' : 'stop',
|
type: l.isMainMast ? 'station' : 'stop',
|
||||||
id: res.id,
|
id: res.id,
|
||||||
name: l.name ? profile.parseStationName(l.name) : null,
|
name: l.name || id.O ? profile.parseStationName(l.name || id.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