diff --git a/p/bvg/index.js b/p/bvg/index.js index ada1994f..ca1cdc7f 100644 --- a/p/bvg/index.js +++ b/p/bvg/index.js @@ -2,14 +2,12 @@ const shorten = require('vbb-short-station-name') const {to12Digit, to9Digit} = require('vbb-translate-ids') -const parseLineName = require('vbb-parse-line') const getStations = require('vbb-stations') const {parseHook} = require('../../lib/profile-hooks') const parseAndAddLocationDHID = require('../vbb/parse-loc-dhid') const { - parseLine: _parseLine, parseLocation: _parseLocation, parseArrival: _parseArrival, parseDeparture: _parseDeparture, @@ -45,19 +43,6 @@ const journeyLegOccupancyCodes = new Map([ ['text.occup.jny.max.13', 'high'], ]) -// todo: https://m.tagesspiegel.de/berlin/fahrerlebnis-wie-im-regionalexpress-so-faehrt-es-sich-in-der-neuen-express-s-bahn/25338674.html -const parseLineWithMoreDetails = ({parsed}, p) => { - parsed.name = p.name.replace(/^(bus|tram)\s+/i, '') - const details = parseLineName(parsed.name) - parsed.symbol = details.symbol - parsed.nr = details.nr - parsed.metro = details.metro - parsed.express = details.express - parsed.night = details.night - - return parsed -} - const parseLocation = ({parsed}, l) => { if ((parsed.type === 'stop' || parsed.type === 'station') && parsed.id[0] === '9') { parsed.name = shorten(parsed.name) @@ -181,7 +166,6 @@ const bvgProfile = { products, - parseLine: parseHook(_parseLine, parseLineWithMoreDetails), parseLocation: parseHook(_parseLocation, parseLocation), parseStationName: (ctx, name) => shorten(name), parseArrival: parseHook( diff --git a/test/e2e/bvg.js b/test/e2e/bvg.js index f19b42be..c7460db7 100644 --- a/test/e2e/bvg.js +++ b/test/e2e/bvg.js @@ -14,7 +14,6 @@ const createValidate = require('./lib/validate-fptf-with') const { cfg, validateStation, - validateLine, validateJourneyLeg, validateDeparture, validateMovement @@ -37,7 +36,6 @@ const when = cfg.when const validate = createValidate(cfg, { station: validateStation, - line: validateLine, journeyLeg: validateJourneyLeg, departure: validateDeparture, movement: validateMovement diff --git a/test/e2e/lib/vbb-bvg-validators.js b/test/e2e/lib/vbb-bvg-validators.js index 197d5b36..05850b41 100644 --- a/test/e2e/lib/vbb-bvg-validators.js +++ b/test/e2e/lib/vbb-bvg-validators.js @@ -6,7 +6,6 @@ const products = require('../../../p/bvg/products') const {createWhen} = require('./util') const { station: createValidateStation, - line: createValidateLine, journeyLeg: createValidateJourneyLeg, departure: createValidateDeparture, movement: createValidateMovement @@ -24,28 +23,6 @@ const cfg = { // todo: coordsOptional = false const validateStation = createValidateStation(cfg) -const _validateLine = createValidateLine(cfg) -const validateLine = (validate, l, name) => { - _validateLine(validate, l, name) - if (l.symbol !== null) { - a.strictEqual(typeof l.symbol, 'string', name + '.symbol must be a string') - a.ok(l.symbol, name + '.symbol must not be empty') - } - if (l.nr !== null) { - a.strictEqual(typeof l.nr, 'number', name + '.nr must be a string') - a.ok(l.nr, name + '.nr must not be empty') - } - if (l.metro !== null) { - a.strictEqual(typeof l.metro, 'boolean', name + '.metro must be a boolean') - } - if (l.express !== null) { - a.strictEqual(typeof l.express, 'boolean', name + '.express must be a boolean') - } - if (l.night !== null) { - a.strictEqual(typeof l.night, 'boolean', name + '.night must be a boolean') - } -} - const validateJourneyLeg = createValidateJourneyLeg(cfg) const validateDeparture = createValidateDeparture(cfg) @@ -55,7 +32,6 @@ const validateMovement = createValidateMovement(cfg) module.exports = { cfg, validateStation, - validateLine, validateJourneyLeg, validateDeparture, validateMovement diff --git a/test/e2e/vbb.js b/test/e2e/vbb.js index 05fc50e2..83751120 100644 --- a/test/e2e/vbb.js +++ b/test/e2e/vbb.js @@ -8,7 +8,6 @@ const products = require('../../p/vbb/products') const { cfg, validateStation, - validateLine, validateJourneyLeg, validateDeparture, validateMovement @@ -31,7 +30,6 @@ const when = cfg.when const validate = createValidate(cfg, { station: validateStation, - line: validateLine, journeyLeg: validateJourneyLeg, departure: validateDeparture, movement: validateMovement diff --git a/test/fixtures/bvg-arrivals.js b/test/fixtures/bvg-arrivals.js index 47b3d1bd..2e5a3a02 100644 --- a/test/fixtures/bvg-arrivals.js +++ b/test/fixtures/bvg-arrivals.js @@ -29,11 +29,6 @@ const sLandsbergerAllee = { productName: 'S', mode: 'train', product: 'suburban', - symbol: 'S', - nr: 8, - metro: false, - express: false, - night: false, }, { type: 'line', id: 's41', @@ -43,11 +38,6 @@ const sLandsbergerAllee = { productName: 'S', mode: 'train', product: 'suburban', - symbol: 'S', - nr: 41, - metro: false, - express: false, - night: false, }, { type: 'line', id: 's42', @@ -57,11 +47,6 @@ const sLandsbergerAllee = { productName: 'S', mode: 'train', product: 'suburban', - symbol: 'S', - nr: 42, - metro: false, - express: false, - night: false, }, { type: 'line', id: 's85', @@ -71,11 +56,6 @@ const sLandsbergerAllee = { productName: 'S', mode: 'train', product: 'suburban', - symbol: 'S', - nr: 85, - metro: false, - express: false, - night: false, }, { type: 'line', id: '56', @@ -85,11 +65,6 @@ const sLandsbergerAllee = { productName: 'Tram', mode: 'train', product: 'tram', - symbol: null, - nr: 56, - metro: false, - express: false, - night: false, }, { type: 'line', id: 'm2', @@ -99,11 +74,6 @@ const sLandsbergerAllee = { productName: 'Tram', mode: 'train', product: 'tram', - symbol: 'M', - nr: 2, - metro: true, - express: false, - night: false, }, { type: 'line', id: 'm5', @@ -113,11 +83,6 @@ const sLandsbergerAllee = { productName: 'Tram', mode: 'train', product: 'tram', - symbol: 'M', - nr: 5, - metro: true, - express: false, - night: false, }, { type: 'line', id: 'm6', @@ -127,11 +92,6 @@ const sLandsbergerAllee = { productName: 'Tram', mode: 'train', product: 'tram', - symbol: 'M', - nr: 6, - metro: true, - express: false, - night: false, }, { type: 'line', id: 'm8', @@ -141,11 +101,6 @@ const sLandsbergerAllee = { productName: 'Tram', mode: 'train', product: 'tram', - symbol: 'M', - nr: 8, - metro: true, - express: false, - night: false, }, { type: 'line', id: 'm10', @@ -155,11 +110,6 @@ const sLandsbergerAllee = { productName: 'Tram', mode: 'train', product: 'tram', - symbol: 'M', - nr: 10, - metro: true, - express: false, - night: false, }, { type: 'line', id: '156', @@ -169,11 +119,6 @@ const sLandsbergerAllee = { productName: 'Bus', mode: 'bus', product: 'bus', - symbol: null, - nr: 156, - metro: false, - express: false, - night: false, }, { type: 'line', id: 'm6', @@ -183,11 +128,6 @@ const sLandsbergerAllee = { productName: 'Bus', mode: 'bus', product: 'bus', - symbol: 'M', - nr: 6, - metro: true, - express: false, - night: false, }, { type: 'line', id: 's41', @@ -197,11 +137,6 @@ const sLandsbergerAllee = { productName: 'Bus', mode: 'bus', product: 'bus', - symbol: 'S', - nr: 41, - metro: false, - express: false, - night: false, }, { type: 'line', id: 's42', @@ -211,11 +146,6 @@ const sLandsbergerAllee = { productName: 'Bus', mode: 'bus', product: 'bus', - symbol: 'S', - nr: 42, - metro: false, - express: false, - night: false, }], } @@ -390,11 +320,6 @@ module.exports = [ id: 'berliner-verkehrsbetriebe', name: 'Berliner Verkehrsbetriebe' }, - symbol: 'M', - nr: 5, - metro: true, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -432,11 +357,6 @@ module.exports = [ id: 'berliner-verkehrsbetriebe', name: 'Berliner Verkehrsbetriebe' }, - symbol: 'M', - nr: 8, - metro: true, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -474,11 +394,6 @@ module.exports = [ id: 'berliner-verkehrsbetriebe', name: 'Berliner Verkehrsbetriebe' }, - symbol: 'M', - nr: 8, - metro: true, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -516,11 +431,6 @@ module.exports = [ id: 'berliner-verkehrsbetriebe', name: 'Berliner Verkehrsbetriebe' }, - symbol: null, - nr: 56, - metro: false, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -558,11 +468,6 @@ module.exports = [ id: 's-bahn-berlin-gmbh', name: 'S-Bahn Berlin GmbH' }, - symbol: 'S', - nr: 8, - metro: false, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -601,11 +506,6 @@ module.exports = [ id: 's-bahn-berlin-gmbh', name: 'S-Bahn Berlin GmbH' }, - symbol: 'S', - nr: 41, - metro: false, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -645,11 +545,6 @@ module.exports = [ id: 's-bahn-berlin-gmbh', name: 'S-Bahn Berlin GmbH' }, - symbol: 'S', - nr: 42, - metro: false, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -689,11 +584,6 @@ module.exports = [ id: 'berliner-verkehrsbetriebe', name: 'Berliner Verkehrsbetriebe' }, - symbol: null, - nr: 56, - metro: false, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -731,11 +621,6 @@ module.exports = [ id: 's-bahn-berlin-gmbh', name: 'S-Bahn Berlin GmbH' }, - symbol: 'S', - nr: 42, - metro: false, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -775,11 +660,6 @@ module.exports = [ id: 'berliner-verkehrsbetriebe', name: 'Berliner Verkehrsbetriebe' }, - symbol: 'M', - nr: 5, - metro: true, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -817,11 +697,6 @@ module.exports = [ id: 's-bahn-berlin-gmbh', name: 'S-Bahn Berlin GmbH' }, - symbol: 'S', - nr: 41, - metro: false, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -859,11 +734,6 @@ module.exports = [ id: 's-bahn-berlin-gmbh', name: 'S-Bahn Berlin GmbH' }, - symbol: 'S', - nr: 42, - metro: false, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -901,11 +771,6 @@ module.exports = [ id: 'berliner-verkehrsbetriebe', name: 'Berliner Verkehrsbetriebe' }, - symbol: 'M', - nr: 5, - metro: true, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -945,11 +810,6 @@ module.exports = [ id: 's-bahn-berlin-gmbh', name: 'S-Bahn Berlin GmbH' }, - symbol: 'S', - nr: 8, - metro: false, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -998,11 +858,6 @@ module.exports = [ id: 'berliner-verkehrsbetriebe', name: 'Berliner Verkehrsbetriebe' }, - symbol: 'M', - nr: 8, - metro: true, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -1040,11 +895,6 @@ module.exports = [ id: 'berliner-verkehrsbetriebe', name: 'Berliner Verkehrsbetriebe' }, - symbol: 'M', - nr: 8, - metro: true, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -1082,11 +932,6 @@ module.exports = [ id: 'berliner-verkehrsbetriebe', name: 'Berliner Verkehrsbetriebe' }, - symbol: null, - nr: 56, - metro: false, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -1126,11 +971,6 @@ module.exports = [ id: 's-bahn-berlin-gmbh', name: 'S-Bahn Berlin GmbH' }, - symbol: 'S', - nr: 85, - metro: false, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -1201,11 +1041,6 @@ module.exports = [ id: 's-bahn-berlin-gmbh', name: 'S-Bahn Berlin GmbH' }, - symbol: 'S', - nr: 41, - metro: false, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -1245,11 +1080,6 @@ module.exports = [ id: 's-bahn-berlin-gmbh', name: 'S-Bahn Berlin GmbH' }, - symbol: 'S', - nr: 42, - metro: false, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -1289,11 +1119,6 @@ module.exports = [ id: 's-bahn-berlin-gmbh', name: 'S-Bahn Berlin GmbH' }, - symbol: 'S', - nr: 42, - metro: false, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -1333,11 +1158,6 @@ module.exports = [ id: 's-bahn-berlin-gmbh', name: 'S-Bahn Berlin GmbH' }, - symbol: 'S', - nr: 42, - metro: false, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -1377,11 +1197,6 @@ module.exports = [ id: 's-bahn-berlin-gmbh', name: 'S-Bahn Berlin GmbH' }, - symbol: 'S', - nr: 42, - metro: false, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, @@ -1421,11 +1236,6 @@ module.exports = [ id: 's-bahn-berlin-gmbh', name: 'S-Bahn Berlin GmbH' }, - symbol: 'S', - nr: 42, - metro: false, - express: false, - night: false }, remarks: [ {type: 'hint', code: 'bf', text: 'barrierefrei'}, diff --git a/test/fixtures/bvg-journey.js b/test/fixtures/bvg-journey.js index bbdf187d..f7ce6bf3 100644 --- a/test/fixtures/bvg-journey.js +++ b/test/fixtures/bvg-journey.js @@ -706,11 +706,6 @@ module.exports = { id: 's-bahn-berlin-gmbh', name: 'S-Bahn Berlin GmbH' }, - symbol: 'S', - nr: 2, - metro: false, - express: false, - night: false }, direction: 'S Blankenfelde (TF)', arrivalPlatform: '1', diff --git a/test/fixtures/bvg-radar.js b/test/fixtures/bvg-radar.js index df18015f..9eaaf9e6 100644 --- a/test/fixtures/bvg-radar.js +++ b/test/fixtures/bvg-radar.js @@ -12,11 +12,6 @@ module.exports = [ public: true, mode: 'train', product: 'tram', - symbol: 'M', - nr: 4, - metro: true, - express: false, - night: false }, location: { type: 'location', @@ -396,11 +391,6 @@ module.exports = [ public: true, mode: 'train', product: 'suburban', - symbol: 'S', - nr: 9, - metro: false, - express: false, - night: false }, location: { type: 'location', @@ -780,11 +770,6 @@ module.exports = [ public: true, mode: 'train', product: 'subway', - symbol: 'U', - nr: 8, - metro: false, - express: false, - night: false }, location: { type: 'location', @@ -1164,11 +1149,6 @@ module.exports = [ public: true, mode: 'train', product: 'subway', - symbol: 'U', - nr: 5, - metro: false, - express: false, - night: false }, location: { type: 'location', @@ -1548,11 +1528,6 @@ module.exports = [ public: true, mode: 'train', product: 'subway', - symbol: 'U', - nr: 2, - metro: false, - express: false, - night: false }, location: { type: 'location', @@ -1932,11 +1907,6 @@ module.exports = [ public: true, mode: 'train', product: 'tram', - symbol: 'M', - nr: 6, - metro: true, - express: false, - night: false }, location: { type: 'location', @@ -2316,11 +2286,6 @@ module.exports = [ public: true, mode: 'train', product: 'tram', - symbol: 'M', - nr: 6, - metro: true, - express: false, - night: false }, location: { type: 'location', @@ -2700,11 +2665,6 @@ module.exports = [ public: true, mode: 'train', product: 'tram', - symbol: 'M', - nr: 5, - metro: true, - express: false, - night: false }, location: { type: 'location', diff --git a/test/fixtures/bvg-trip-with-occupancy.js b/test/fixtures/bvg-trip-with-occupancy.js index a6d6fad2..48d62d9c 100644 --- a/test/fixtures/bvg-trip-with-occupancy.js +++ b/test/fixtures/bvg-trip-with-occupancy.js @@ -19,11 +19,6 @@ module.exports = { id: 'berliner-verkehrsbetriebe', name: 'Berliner Verkehrsbetriebe' }, - symbol: null, - nr: 147, - metro: false, - express: false, - night: false }, remarks: [ { type: 'hint', code: 'bf', text: 'barrier-free' },