From 9c449958c417c832af61aae46607cc05dbff25a5 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Fri, 1 Feb 2019 18:01:51 +0100 Subject: [PATCH] remove (arrival|departure).trip, movement.trip :boom: --- parse/arrival-or-departure.js | 4 +--- parse/movement.js | 1 - test/lib/validators.js | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/parse/arrival-or-departure.js b/parse/arrival-or-departure.js index 4936792c..b45c0cc8 100644 --- a/parse/arrival-or-departure.js +++ b/parse/arrival-or-departure.js @@ -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 diff --git a/parse/movement.js b/parse/movement.js index 6a89e88a..e797872b 100644 --- a/parse/movement.js +++ b/parse/movement.js @@ -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', diff --git a/test/lib/validators.js b/test/lib/validators.js index 56b4440b..44293482 100644 --- a/test/lib/validators.js +++ b/test/lib/validators.js @@ -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')