nate-react-api-helpers
Advanced tools
Comparing version
@@ -10,7 +10,7 @@ import { ParsedUrlQueryInput } from 'querystring'; | ||
[k: string]: string | Blob; | ||
}): Promise<T | ErrResponse>; | ||
post<T>(path: string, body: any): Promise<T | ErrResponse>; | ||
put<T>(path: string, body: any): Promise<T | ErrResponse>; | ||
get<T>(path: string, urlParameters?: ParsedUrlQueryInput): Promise<T | ErrResponse>; | ||
handleResponse<T>(result: Response): Promise<T | ErrResponse>; | ||
}): Promise<T>; | ||
post<T>(path: string, body: any): Promise<T>; | ||
put<T>(path: string, body: any): Promise<T>; | ||
get<T>(path: string, urlParameters?: ParsedUrlQueryInput): Promise<T>; | ||
handleResponse<T>(result: Response): Promise<T>; | ||
} | ||
@@ -17,0 +17,0 @@ export interface ErrResponse { |
@@ -175,2 +175,5 @@ "use strict"; | ||
} | ||
if ("error" in jsonData) { | ||
throw new Error(jsonData.error); | ||
} | ||
return [2 /*return*/, jsonData]; | ||
@@ -177,0 +180,0 @@ } |
{ | ||
"name": "nate-react-api-helpers", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
35145
0.19%737
0.41%