@koibanx/http
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -17,4 +17,5 @@ import { AxiosInstance } from 'axios'; | ||
put<B, O>({ url, headers, body }: Input<B>): Promise<Output<O>>; | ||
patch<B, O>({ url, headers, body }: Input<B>): Promise<Output<O>>; | ||
delete<O>({ url, headers, params }: Input<undefined>): Promise<Output<O>>; | ||
} | ||
export declare const client: (instance: AxiosInstance) => IClient; |
@@ -22,2 +22,5 @@ "use strict"; | ||
.catch((err) => handleError(err)); | ||
const httpPatch = (client) => ({ url, headers, body, }) => client.patch(url, body, { headers }) | ||
.then((res) => handleResponse(res)) | ||
.catch((err) => handleError(err)); | ||
const httpDelete = (client) => ({ url, headers, params, }) => client.delete(url, { headers, params }) | ||
@@ -30,4 +33,5 @@ .then((res) => handleResponse(res)) | ||
put: httpPut(instance), | ||
patch: httpPatch(instance), | ||
delete: httpDelete(instance), | ||
}); | ||
exports.client = client; |
@@ -75,2 +75,3 @@ "use strict"; | ||
put: httpClient.put, | ||
patch: httpClient.patch, | ||
delete: httpClient.delete, | ||
@@ -77,0 +78,0 @@ setHeader: (key, value) => instance.defaults.headers.setHeader(key, value), |
{ | ||
"name": "@koibanx/http", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "type": "commonjs", |
52194
1006