Compare commits

..

2 commits

Author SHA1 Message Date
121593
a6d3b611b9
Merge 74fa7b3c57 into a60cf63b2e 2025-12-10 18:37:46 +01:00
121593
74fa7b3c57 fix: stationBoard entries can be nullish
When no entries are present an error was thrown when calling `entries.flat()`
2025-12-10 18:29:26 +01:00

View file

@ -111,7 +111,7 @@ const createClient = (profile, userAgent, opt = {}) => {
const {res} = await profile.request({profile, opt}, userAgent, req);
const ctx = {profile, opt, common, res};
let results = (res[resultsField] || res.items || res.bahnhofstafelAbfahrtPositionen || res.bahnhofstafelAnkunftPositionen || res.entries?.flat() || [])
let results = (res[resultsField] || res.items || res.bahnhofstafelAbfahrtPositionen || res.bahnhofstafelAnkunftPositionen || (res.entries?.flat() ?? []))
.map(res => parse(ctx, res)); // TODO sort?, slice
if (!opt.includeRelatedStations) {