Skip to content

Commit

Permalink
artificially limit number of results, fixes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
traines-source committed Dec 17, 2024
1 parent ed8683e commit e4a99d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ const createClient = (profile, userAgent, opt = {}) => {
const req = profile.transformJourneysQuery({profile, opt}, query);
const {res, common} = await profile.request({profile, opt}, userAgent, req);
const ctx = {profile, opt, common, res};
const journeys = res.verbindungen
const verbindungen = opt.results ? res.verbindungen.slice(0, opt.results) : res.verbindungen;
const journeys = verbindungen
.map(j => profile.parseJourney(ctx, j));

return {
Expand Down

0 comments on commit e4a99d4

Please sign in to comment.