@doctadevs/utils
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -12,2 +12,2 @@ import { BodyInit } from 'node-fetch'; | ||
}; | ||
export declare const request: ({ url, method, data, queryParams, token, contentType, }: RequestOptions) => Promise<any>; | ||
export declare const request: <DataT>({ url, method, data, queryParams, token, contentType, }: RequestOptions<DataT>) => Promise<any>; |
{ | ||
"name": "@doctadevs/utils", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"main": "dist/index.js", | ||
@@ -16,2 +16,3 @@ "types": "dist/index.d.ts", | ||
"scripts": { | ||
"dist": "tsc; npm version patch; git push; npm publish --access public", | ||
"build": "rm -rf dist; tsc -b", | ||
@@ -18,0 +19,0 @@ "prepublishOnly": "npm run build" |
@@ -12,3 +12,3 @@ import fetch, { BodyInit } from 'node-fetch'; | ||
export const request = async ({ | ||
export const request = async <DataT>({ | ||
url, | ||
@@ -20,3 +20,3 @@ method = 'GET', | ||
contentType = 'json', | ||
}: RequestOptions) => | ||
}: RequestOptions<DataT>) => | ||
fetch( | ||
@@ -23,0 +23,0 @@ `${url}${Object.entries(queryParams) |
Sorry, the diff of this file is not supported yet
7910