Skip to content

Commit

Permalink
Updated text forecast repacker, so we also support days without text …
Browse files Browse the repository at this point in the history
…forecasts (sunday, sunday people...)
  • Loading branch information
MatsAnd committed Jun 14, 2020
1 parent 78af34f commit 6c2589b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/repack-text-forecast.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module.exports = (textForecast, areaIds) => {
return textForecast.textforecast.time.map(period => {
const areas = period.forecasttype.location
const { forecasttype } = period

const areas = forecasttype && forecasttype.location ? forecasttype.location : []
const filteredAreas = areaIds ? areas.filter(area => areaIds.includes(area['@_id'])) : areas

const areaForcasts = filteredAreas.map(area => {
Expand Down

0 comments on commit 6c2589b

Please sign in to comment.