dark-sky-api
Advanced tools
Comparing version 0.2.1 to 0.3.0
{ | ||
"name": "dark-sky-api", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "a simple and robust dark sky api service for client-side js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -100,9 +100,3 @@ import darkSkySkeleton from 'dark-sky-skeleton'; | ||
.get() | ||
.then(({ currently }) => { | ||
currently.windDirection = degreeToCardinal(currently.windBearing); | ||
if (currently.nearestStormBearing) { | ||
currently.nearestStormDirection = degreeToCardinal(currently.nearestStormBearing); | ||
} | ||
return currently; | ||
}); | ||
.then(({ currently }) => this.processWeatherItem(currently)); | ||
} | ||
@@ -123,5 +117,17 @@ | ||
.get() | ||
.then(({ daily }) => daily); | ||
.then(({ daily }) => { | ||
daily.data = daily.data.map(item => this.processWeatherItem(item)); | ||
return daily; | ||
}); | ||
} | ||
processWeatherItem(item) { | ||
item.windDirection = degreeToCardinal(item.windBearing); | ||
if (item.nearestStormBearing) { | ||
item.nearestStormDirection = degreeToCardinal(item.nearestStormBearing); | ||
} | ||
item.dateTime = moment.unix(item.time); | ||
return item; | ||
} | ||
/** | ||
@@ -128,0 +134,0 @@ * Get units object showing units returned based on configured units |
28111
758