We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 78af34f commit 6c2589bCopy full SHA for 6c2589b
lib/repack-text-forecast.js
@@ -1,6 +1,8 @@
1
module.exports = (textForecast, areaIds) => {
2
return textForecast.textforecast.time.map(period => {
3
- const areas = period.forecasttype.location
+ const { forecasttype } = period
4
+
5
+ const areas = forecasttype && forecasttype.location ? forecasttype.location : []
6
const filteredAreas = areaIds ? areas.filter(area => areaIds.includes(area['@_id'])) : areas
7
8
const areaForcasts = filteredAreas.map(area => {
0 commit comments