mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
readableFrom: make maxDuration optional
[ci skip]
This commit is contained in:
parent
02e0e513ef
commit
9d96902794
2 changed files with 3 additions and 3 deletions
|
@ -12,7 +12,7 @@ With `opt`, you can override the default options, which look like this:
|
|||
{
|
||||
when: new Date(),
|
||||
maxTransfers: 5, // maximum of 5 transfers
|
||||
maxDuration: 20, // maximum travel duration in minutes
|
||||
maxDuration: 20, // maximum travel duration in minutes, pass `null` for infinite
|
||||
products: {
|
||||
// These entries may vary from profile to profile!
|
||||
suburban: true,
|
||||
|
|
4
index.js
4
index.js
|
@ -470,7 +470,7 @@ const createClient = (profile, userAgent, request = _request) => {
|
|||
opt = Object.assign({
|
||||
when: Date.now(),
|
||||
maxTransfers: 5, // maximum of 5 transfers
|
||||
maxDuration: 20, // maximum travel duration in minutes
|
||||
maxDuration: 20, // maximum travel duration in minutes, pass `null` for infinite
|
||||
products: {}
|
||||
}, opt)
|
||||
if (Number.isNaN(+opt.when)) throw new Error('opt.when is invalid')
|
||||
|
@ -480,7 +480,7 @@ const createClient = (profile, userAgent, request = _request) => {
|
|||
meth: 'LocGeoReach',
|
||||
req: {
|
||||
loc: profile.formatLocation(profile, address, 'address'),
|
||||
maxDur: opt.maxDuration,
|
||||
maxDur: opt.maxDuration === null ? -1 : opt.maxDuration,
|
||||
maxChg: opt.maxTransfers,
|
||||
date: profile.formatDate(profile, opt.when),
|
||||
time: profile.formatTime(profile, opt.when),
|
||||
|
|
Loading…
Add table
Reference in a new issue