diff --git a/docs/journeys.md b/docs/journeys.md index 845c922d..7b9776bd 100644 --- a/docs/journeys.md +++ b/docs/journeys.md @@ -48,7 +48,7 @@ With `opt`, you can override the default options, which look like this: earlierThan: null, // ref to get journeys earlier than the last query laterThan: null, // ref to get journeys later than the last query - results: 5, // how many journeys? + results: null, // number of journeys – `null` means "whatever HAFAS returns" via: null, // let journeys pass this station stopovers: false, // return stations on the way? transfers: -1, // Maximum nr of transfers. Default: Let HAFAS decide. diff --git a/index.js b/index.js index e5699cf0..90bd0747 100644 --- a/index.js +++ b/index.js @@ -133,7 +133,7 @@ const createClient = (profile, userAgent, request = _request) => { } opt = Object.assign({ - results: 5, // how many journeys? + results: null, // number of journeys – `null` means "whatever HAFAS returns" via: null, // let journeys pass this station? stopovers: false, // return stations on the way? transfers: -1, // maximum of 5 transfers @@ -208,7 +208,7 @@ const createClient = (profile, userAgent, request = _request) => { getPolyline: !!opt.polylines // todo: `getConGroups: false` what is this? } - if (profile.journeysNumF) query.numF = opt.results + if (profile.journeysNumF && opt.results !== null) query.numF = opt.results if (profile.journeysOutFrwd) query.outFrwd = outFrwd return request(profile, userAgent, opt, {