Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getWeather = cache('weather', async ({ latitude, longitude }: LatLon) => {
// notify('fetching weather data')
debug('fetching weather...')
const { body } = await HTTP.get(`https://api.forecast.io/forecast/${forecastIOApiKey}/${latitude},${longitude}`)
return body as IWeatherResponse
})
request (url, options = {}) {
options.headers = Object.assign({
Authorization: `Token ${this.token}`,
'User-Agent': this.version
}, options.headers)
return HTTP.get(`${GITHUB_API}${url}`, options)
}