mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
profile-based whitelist for walkingSpeed
This commit is contained in:
parent
0c145d352b
commit
9a89cd0dc8
2 changed files with 9 additions and 5 deletions
13
index.js
13
index.js
|
@ -182,11 +182,14 @@ const createClient = (profile, userAgent, request = _request) => {
|
||||||
if (!['slow','normal','fast'].includes(opt.walkingSpeed)) {
|
if (!['slow','normal','fast'].includes(opt.walkingSpeed)) {
|
||||||
throw new Error('opt.walkingSpeed must be one of these values: "slow", "normal", "fast".')
|
throw new Error('opt.walkingSpeed must be one of these values: "slow", "normal", "fast".')
|
||||||
}
|
}
|
||||||
const gisFltrL = [{
|
const gisFltrL = []
|
||||||
meta: 'foot_speed_' + opt.walkingSpeed,
|
if (profile.journeysWalkingSpeed) {
|
||||||
mode: 'FB',
|
gisFltrL.push({
|
||||||
type: 'M'
|
meta: 'foot_speed_' + opt.walkingSpeed,
|
||||||
}]
|
mode: 'FB',
|
||||||
|
type: 'M'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// With protocol version `1.16`, the VBB endpoint *used to* fail with
|
// With protocol version `1.16`, the VBB endpoint *used to* fail with
|
||||||
// `CGI_READ_FAILED` if you pass `numF`, the parameter for the number
|
// `CGI_READ_FAILED` if you pass `numF`, the parameter for the number
|
||||||
|
|
|
@ -142,6 +142,7 @@ const vbbProfile = {
|
||||||
formatStation,
|
formatStation,
|
||||||
|
|
||||||
journeysNumF: true,
|
journeysNumF: true,
|
||||||
|
journeysWalkingSpeed: true,
|
||||||
trip: true,
|
trip: true,
|
||||||
radar: true,
|
radar: true,
|
||||||
reachableFrom: true
|
reachableFrom: true
|
||||||
|
|
Loading…
Add table
Reference in a new issue