remove (arrival|departure).trip, movement.trip 💥

This commit is contained in:
Jannis R 2019-02-01 18:01:51 +01:00
parent fcc2a23fc1
commit 9c449958c4
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
3 changed files with 1 additions and 5 deletions

View file

@ -23,9 +23,7 @@ const createParseArrOrDep = (profile, opt, data, prefix) => {
// todo: for arrivals, this is the *origin*, not the *direction*
direction: prefix === DEPARTURE && profile.parseStationName(d.dirTxt) || null,
line: lines[parseInt(d.prodX)] || null,
remarks: [],
// todo: res.trip from rawLine.prodCtx.num?
trip: +d.jid.split('|')[1] // todo: this seems brittle
remarks: []
}
// todo: DRY with parseStopover

View file

@ -15,7 +15,6 @@ const createParseMovement = (profile, opt, data) => {
const res = {
direction: profile.parseStationName(m.dirTxt),
tripId: m.jid || null,
trip: m.jid && +m.jid.split('|')[1] || null, // todo: this seems brittle
line: lines[m.prodX] || null,
location: m.pos ? {
type: 'location',

View file

@ -331,7 +331,6 @@ const createValidateArrivalOrDeparture = (type, cfg) => {
a.strictEqual(typeof dep.tripId, 'string', name + '.tripId must be a string')
a.ok(dep.tripId, name + '.tripId must not be empty')
a.strictEqual(typeof dep.trip, 'number', name + '.trip must be a number')
anyOf(['stop', 'station'], val, dep.stop, name + '.stop')