▸ Get current conditions
▸ Get forecast for a specific date
▸ Get weekly forecast
▸ Get hourly forecast
▸ Narrow weekly and hourly forecasts to just temperatures or precipitation or winds
▸ JSDoc documentation
▸ Jest tested
One intuitive feature I wanted was the ability to narrow weekly and hourly forecasts to just temperatures or precipitation or winds. And I wanted to do this by chaining.
weather.weekly yields an array of detailed objects for every day of the week,
weather.weekly.temperatures should yield an array of simplified objects with just the day of the week and the temperature for that day.
To accomplish this, I extended the Array class with getters that could yield the appropriately narrowed arrays.
weather.weekly yields a detailed array that can be handled like a regular array.
But this array also possesses getters that can yield further arrays.