add todos

also remove dead code
This commit is contained in:
Jannis R 2020-03-18 21:35:43 +01:00
parent cda96b6698
commit 36a8b388f2
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
9 changed files with 13 additions and 4 deletions

View file

@ -198,6 +198,7 @@ const createClient = (profile, userAgent, opt = {}) => {
getIV: false, // todo: walk & bike as alternatives?
getPolyline: !!opt.polylines
// todo: `getConGroups: false` what is this?
// todo: what is getEco, fwrd?
}
if (profile.journeysNumF && opt.results !== null) query.numF = opt.results
if (profile.journeysOutFrwd) query.outFrwd = outFrwd

View file

@ -35,7 +35,9 @@ const request = (ctx, userAgent, reqData) => {
const {profile, opt} = ctx
const body = profile.transformReqBody(ctx, {
lang: opt.language || 'en', // todo: is it `eng` actually?
// todo: is it `eng` actually?
// RSAG has `deu` instead of `de`
lang: opt.language || 'en',
svcReqL: [reqData]
})
if (DEBUG) console.error(JSON.stringify(body))

View file

@ -23,6 +23,7 @@ const transformReqBody = (ctx, body) => {
return body
}
// 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)

View file

@ -1,5 +1,6 @@
'use strict'
// todo: generate from https://reiseauskunft.bahn.de/addons/fachkonfig-utf8.cfg ?
const c = {
NONE: Symbol('no loyaly card'),
BAHNCARD: Symbol('Bahncard'),

View file

@ -24,6 +24,7 @@ const transformReqBody = (ctx, body) => {
return body
}
// 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)

View file

@ -7,6 +7,7 @@ const DEPARTURE = 'd'
// todo: what is d.jny.dirFlg?
// todo: d.stbStop.dProgType/d.stbStop.aProgType
// todo: d.stbStop.dProdX/aProdX can be different than d.prodX
const createParseArrOrDep = (prefix) => {
if (prefix !== ARRIVAL && prefix !== DEPARTURE) throw new Error('invalid prefix')

View file

@ -23,6 +23,7 @@ const linkTypesByCode = Object.assign(Object.create(null), {
// "RES_JNY_DTL" // only shown in journey detail
// ]
// todo: https://github.com/public-transport/hafas-client/issues/5
// todo: expose h.type somehow
const parseHint = (ctx, h) => {
// todo: C

View file

@ -8,7 +8,10 @@ const ADDRESS = 'A'
const leadingZeros = /^0+/
// todo: what is s.rRefL?
// todo: what is l.wt? is it "weight"?
// - `6733` for 8013074 with p/vmt
// - `3933` for 8012092 with p/vmt
// - `2062` for 8010168 with p/vmt
const parseLocation = (ctx, l) => {
const {profile, opt} = ctx

View file

@ -18,8 +18,6 @@ const testDepartures = require('./lib/departures')
const testDeparturesInDirection = require('./lib/departures-in-direction')
const testArrivals = require('./lib/arrivals')
const isObj = o => o !== null && 'object' === typeof o && !Array.isArray(o)
const when = createWhen('Europe/Berlin', 'de-DE')
const cfg = {