Skip to content

Commit 6c2589b

Browse files
committed
Updated text forecast repacker, so we also support days without text forecasts (sunday, sunday people...)
1 parent 78af34f commit 6c2589b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/repack-text-forecast.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module.exports = (textForecast, areaIds) => {
22
return textForecast.textforecast.time.map(period => {
3-
const areas = period.forecasttype.location
3+
const { forecasttype } = period
4+
5+
const areas = forecasttype && forecasttype.location ? forecasttype.location : []
46
const filteredAreas = areaIds ? areas.filter(area => areaIds.includes(area['@_id'])) : areas
57

68
const areaForcasts = filteredAreas.map(area => {

0 commit comments

Comments
 (0)