rest-api-kit
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -14,4 +14,7 @@ type MethodType = "GET" | "POST" | "PUT" | "DELETE"; | ||
declare function makeRequest(payload: string | RequestType): Promise<any> | undefined; | ||
declare function createRequest(url?: string, method?: MethodType, body?: {}, headers?: { | ||
"Content-Type": string; | ||
}, rest?: Partial<Omit<RequestType, "headers" | "url" | "method" | "body">>): Promise<any>; | ||
declare function makeRequest(payload: string | Partial<RequestType>): Promise<any> | undefined; | ||
export { makeRequest }; | ||
export { createRequest, makeRequest }; |
@@ -23,2 +23,3 @@ "use strict"; | ||
__export(src_exports, { | ||
createRequest: () => createRequest, | ||
makeRequest: () => makeRequest | ||
@@ -41,3 +42,3 @@ }); | ||
}; | ||
if (method || method !== "GET") { | ||
if (method && method !== "GET") { | ||
params = { | ||
@@ -67,3 +68,4 @@ body: JSON.stringify(body), | ||
0 && (module.exports = { | ||
createRequest, | ||
makeRequest | ||
}); |
{ | ||
"name": "rest-api-kit", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "dist/index.js", | ||
@@ -8,3 +8,5 @@ "module": "dist/index.mjs", | ||
"scripts": { | ||
"build": "tsup" | ||
"build": "tsup", | ||
"test": "jest", | ||
"test:watch": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch" | ||
}, | ||
@@ -19,2 +21,7 @@ "keywords": [ | ||
"devDependencies": { | ||
"@types/jest": "^29.5.12", | ||
"jest": "^29.7.0", | ||
"jest-cli": "^27.4.3", | ||
"jest-fetch-mock": "^3.0.3", | ||
"ts-jest": "^29.1.3", | ||
"tsup": "^8.0.2", | ||
@@ -21,0 +28,0 @@ "typescript": "^5.4.5" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
6178
9
155
7