remove unused code, minor changes

This commit is contained in:
Jannis R 2018-09-03 15:29:06 +02:00
parent b37bedba26
commit e98cec1734
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
5 changed files with 3 additions and 191 deletions

View file

@ -46,6 +46,7 @@ With `opt`, you can override the default options, which look like this:
earlierThan: null, // ref to get journeys earlier than the last query earlierThan: null, // ref to get journeys earlier than the last query
laterThan: null, // ref to get journeys later than the last query laterThan: null, // ref to get journeys later than the last query
results: 5, // how many journeys? results: 5, // how many journeys?
via: null, // let journeys pass this station via: null, // let journeys pass this station
stopovers: false, // return stations on the way? stopovers: false, // return stations on the way?

View file

@ -445,7 +445,7 @@ const createClient = (profile, userAgent, request = _request) => {
} }
}) })
.then((d) => { .then((d) => {
if (!Array.isArray(d.jnyL)) return [] if (!Array.isArray(d.jnyL) || d.jnyL.length === 0) return []
const parse = profile.parseMovement(profile, opt, { const parse = profile.parseMovement(profile, opt, {
locations: d.locations, locations: d.locations,

View file

@ -28,7 +28,7 @@ const md5 = input => createHash('md5').update(input).digest()
const request = (profile, userAgent, opt, data) => { const request = (profile, userAgent, opt, data) => {
const body = profile.transformReqBody({ const body = profile.transformReqBody({
lang: opt.language || 'en', lang: opt.language || 'en', // todo: is it `eng` actually?
svcReqL: [data] svcReqL: [data]
}) })
const req = profile.transformReq({ const req = profile.transformReq({

View file

@ -1,193 +1,5 @@
'use strict' 'use strict'
const hints = Object.assign(Object.create(null), {
fb: {
type: 'hint',
code: 'bicycle-conveyance',
summary: 'bicycles conveyed'
},
fr: {
type: 'hint',
code: 'bicycle-conveyance-reservation',
summary: 'bicycles conveyed, subject to reservation'
},
nf: {
type: 'hint',
code: 'no-bicycle-conveyance',
summary: 'bicycles not conveyed'
},
k2: {
type: 'hint',
code: '2nd-class-only',
summary: '2. class only'
},
eh: {
type: 'hint',
code: 'boarding-ramp',
summary: 'vehicle-mounted boarding ramp available'
},
ro: {
type: 'hint',
code: 'wheelchairs-space',
summary: 'space for wheelchairs'
},
oa: {
type: 'hint',
code: 'wheelchairs-space-reservation',
summary: 'space for wheelchairs, subject to reservation'
},
wv: {
type: 'hint',
code: 'wifi',
summary: 'WiFi available'
},
wi: {
type: 'hint',
code: 'wifi',
summary: 'WiFi available'
},
sn: {
type: 'hint',
code: 'snacks',
summary: 'snacks available for purchase'
},
mb: {
type: 'hint',
code: 'snacks',
summary: 'snacks available for purchase'
},
mp: {
type: 'hint',
code: 'snacks',
summary: 'snacks available for purchase at the seat'
},
bf: {
type: 'hint',
code: 'barrier-free',
summary: 'barrier-free'
},
rg: {
type: 'hint',
code: 'barrier-free-vehicle',
summary: 'barrier-free vehicle'
},
bt: {
type: 'hint',
code: 'on-board-bistro',
summary: 'Bordbistro available'
},
br: {
type: 'hint',
code: 'on-board-restaurant',
summary: 'Bordrestaurant available'
},
ki: {
type: 'hint',
code: 'childrens-area',
summary: `children's area available`
},
kk: {
type: 'hint',
code: 'parents-childrens-compartment',
summary: `parent-and-children compartment available`
},
kr: {
type: 'hint',
code: 'kids-service',
summary: 'DB Kids Service available'
},
ls: {
type: 'hint',
code: 'power-sockets',
summary: 'power sockets available'
},
ev: {
type: 'hint',
code: 'replacement-service',
summary: 'replacement service'
},
kl: {
type: 'hint',
code: 'air-conditioned',
summary: 'air-conditioned vehicle'
},
r0: {
type: 'hint',
code: 'upward-escalator',
summary: 'upward escalator'
},
au: {
type: 'hint',
code: 'elevator',
summary: 'elevator available'
},
ck: {
type: 'hint',
code: 'komfort-checkin',
summary: 'Komfort-Checkin available'
},
it: {
type: 'hint',
code: 'ice-sprinter',
summary: 'ICE Sprinter service'
},
rp: {
type: 'hint',
code: 'compulsory-reservation',
summary: 'compulsory seat reservation'
},
rm: {
type: 'hint',
code: 'optional-reservation',
summary: 'optional seat reservation'
},
scl: {
type: 'hint',
code: 'all-2nd-class-seats-reserved',
summary: 'all 2nd class seats reserved'
},
acl: {
type: 'hint',
code: 'all-seats-reserved',
summary: 'all seats reserved'
},
sk: {
type: 'hint',
code: 'oversize-luggage-forbidden',
summary: 'oversize luggage not allowed'
},
hu: {
type: 'hint',
code: 'animals-forbidden',
summary: 'animals not allowed, except guide dogs'
},
ik: {
type: 'hint',
code: 'baby-cot-required',
summary: 'baby cot/child seat required'
},
ee: {
type: 'hint',
code: 'on-board-entertainment',
summary: 'on-board entertainment available'
},
toilet: {
type: 'hint',
code: 'toilet',
summary: 'toilet available'
},
oc: {
type: 'hint',
code: 'wheelchair-accessible-toilet',
summary: 'wheelchair-accessible toilet available'
},
iz: {
type: 'hint',
code: 'intercity-2',
summary: 'Intercity 2'
}
})
const codesByIcon = Object.assign(Object.create(null), { const codesByIcon = Object.assign(Object.create(null), {
cancel: 'cancelled' cancel: 'cancelled'
}) })

View file

@ -41,7 +41,6 @@ const applyRemarks = (leg, hints, warnings, refs) => {
const createParseJourneyLeg = (profile, opt, data) => { const createParseJourneyLeg = (profile, opt, data) => {
const {locations, lines, hints, warnings, polylines} = data const {locations, lines, hints, warnings, polylines} = data
// todo: pt.status
// todo: pt.status, pt.isPartCncl // todo: pt.status, pt.isPartCncl
// todo: pt.isRchbl, pt.chRatingRT, pt.chgDurR, pt.minChg // todo: pt.isRchbl, pt.chRatingRT, pt.chgDurR, pt.minChg
// todo: pt.sDays // todo: pt.sDays