weathered
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -7,3 +7,3 @@ import { ClientOptions, ForecastResponse, AlertsResponse, ForecastType, AlertOptions } from './types'; | ||
private getUrl; | ||
getAlerts(options: AlertOptions): Promise<AlertsResponse>; | ||
getAlerts(active: boolean, options: AlertOptions): Promise<AlertsResponse>; | ||
private getPoint; | ||
@@ -10,0 +10,0 @@ getForecast(latitude: number, longitude: number, forecastType: ForecastType): Promise<ForecastResponse>; |
@@ -9,3 +9,3 @@ "use strict"; | ||
const defaultOptions = { | ||
userAgent: 'weathered module version 0.0.0' | ||
userAgent: 'weathered package' | ||
}; | ||
@@ -38,5 +38,5 @@ const API_ROOT = 'https://api.weather.gov/'; | ||
} | ||
getAlerts(options) { | ||
getAlerts(active, options) { | ||
const params = processOptions(options); | ||
const path = `alerts${options.active ? '/active' : ''}?${params}`; | ||
const path = `alerts${active ? '/active' : ''}?${params}`; | ||
return this.getPath(path); | ||
@@ -43,0 +43,0 @@ } |
@@ -23,9 +23,6 @@ declare type ForecastType = 'hourly' | 'baseline'; | ||
} | ||
interface ActiveOption { | ||
active: boolean; | ||
} | ||
interface UrgencyOption { | ||
urgency?: Urgency; | ||
} | ||
declare type AlertOptions = ActiveOption & UrgencyOption & XOR<AreaOption, XOR<PointOption, XOR<RegionOption, RegionTypeOption>>>; | ||
declare type AlertOptions = UrgencyOption & XOR<AreaOption, XOR<PointOption, XOR<RegionOption, RegionTypeOption>>>; | ||
interface ClientOptions { | ||
@@ -32,0 +29,0 @@ userAgent?: string; |
{ | ||
"name": "weathered", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "A JavaScript wrapper for the National Weather Service API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -6,3 +6,3 @@ import fetch from 'cross-fetch'; | ||
const defaultOptions: ClientOptions = { | ||
userAgent: 'weathered module version 0.0.0' | ||
userAgent: 'weathered package' | ||
}; | ||
@@ -47,5 +47,5 @@ | ||
getAlerts(options: AlertOptions) : Promise<AlertsResponse> { | ||
getAlerts(active: boolean, options: AlertOptions) : Promise<AlertsResponse> { | ||
const params = processOptions(options); | ||
const path = `alerts${ options.active ? '/active' : ''}?${params}`; | ||
const path = `alerts${ active ? '/active' : ''}?${params}`; | ||
return this.getPath(path); | ||
@@ -52,0 +52,0 @@ } |
@@ -40,5 +40,2 @@ type ForecastType = 'hourly' | 'baseline'; | ||
} | ||
interface ActiveOption { | ||
active: boolean; | ||
} | ||
@@ -49,3 +46,3 @@ interface UrgencyOption { | ||
type AlertOptions = ActiveOption & UrgencyOption & XOR<AreaOption, XOR<PointOption, XOR<RegionOption, RegionTypeOption>>>; | ||
type AlertOptions = UrgencyOption & XOR<AreaOption, XOR<PointOption, XOR<RegionOption, RegionTypeOption>>>; | ||
@@ -52,0 +49,0 @@ interface ClientOptions { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
19293
429