parse fn signatures: bugfixes 🐛

This commit is contained in:
Jannis R 2018-06-26 11:47:43 +02:00
parent b6fbaa5825
commit 4c86b625c7
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
2 changed files with 3 additions and 3 deletions

View file

@ -6,14 +6,14 @@
// todo: d.stbStop.dProgType // todo: d.stbStop.dProgType
// todo: d.freq, d.freq.jnyL, see https://github.com/public-transport/hafas-client/blob/9203ed1481f08baacca41ac5e3c19bf022f01b0b/parse.js#L115 // todo: d.freq, d.freq.jnyL, see https://github.com/public-transport/hafas-client/blob/9203ed1481f08baacca41ac5e3c19bf022f01b0b/parse.js#L115
const createParseDeparture = (profile, opt, {stations, lines, remarks}) => { const createParseDeparture = (profile, opt, {locations, lines, remarks}) => {
const findRemark = rm => remarks[parseInt(rm.remX)] || null const findRemark = rm => remarks[parseInt(rm.remX)] || null
const parseDeparture = (d) => { const parseDeparture = (d) => {
const when = profile.parseDateTime(profile, d.date, d.stbStop.dTimeR || d.stbStop.dTimeS) const when = profile.parseDateTime(profile, d.date, d.stbStop.dTimeR || d.stbStop.dTimeS)
const res = { const res = {
journeyId: d.jid, journeyId: d.jid,
station: stations[parseInt(d.stbStop.locX)] || null, station: locations[parseInt(d.stbStop.locX)] || null,
when: when.toISO(), when: when.toISO(),
direction: profile.parseStationName(d.dirTxt), direction: profile.parseStationName(d.dirTxt),
line: lines[parseInt(d.prodX)] || null, line: lines[parseInt(d.prodX)] || null,

View file

@ -1,6 +1,6 @@
'use strict' 'use strict'
const createParseMovement = (profile, data) => { const createParseMovement = (profile, opt, data) => {
const {locations, lines, remarks, polylines} = data const {locations, lines, remarks, polylines} = data
// todo: what is m.dirGeo? maybe the speed? // todo: what is m.dirGeo? maybe the speed?