arrivals/departures: fix remarks parsing 🐛

This commit is contained in:
Jannis R 2018-06-28 13:32:42 +02:00
parent 58f183506e
commit 17aeacf594
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5

View file

@ -19,9 +19,10 @@ const createParseArrOrDep = (profile, opt, data, prefix) => {
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,
remarks: (d.remL remarks: ([]
? d.remL.map(ref => findRemark(hints, warnings, ref)) .concat(d.remL || [], d.msgL || [])
: [] .map(ref => findRemark(hints, warnings, ref))
.filter(rem => !!rem) // filter unparsable
), ),
// todo: res.trip from rawLine.prodCtx.num? // todo: res.trip from rawLine.prodCtx.num?
trip: +d.jid.split('|')[1] // todo: this seems brittle trip: +d.jid.split('|')[1] // todo: this seems brittle