mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
add todos
also remove dead code
This commit is contained in:
parent
cda96b6698
commit
36a8b388f2
9 changed files with 13 additions and 4 deletions
1
index.js
1
index.js
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 = {
|
||||
|
|
Loading…
Add table
Reference in a new issue