New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rest-api-kit

Package Overview
Dependencies
Maintainers
0
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rest-api-kit - npm Package Compare versions

Comparing version 0.0.36 to 0.0.37

4

dist/index.d.ts

@@ -67,4 +67,4 @@ type MethodType = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";

declare function createRequest(url?: string, method?: MethodType, body?: {}, headers?: {}, rest?: Partial<Omit<RequestType, "headers" | "url" | "method" | "body">>): Promise<any>;
declare function makeRequest(payload: string | Partial<RequestType>): Promise<any> | undefined;
declare function createRequest(url?: string, headers?: {}, method?: MethodType, body?: {}, rest?: Partial<Omit<RequestType, "headers" | "url" | "method" | "body">>): Promise<any>;
declare function makeRequest(payload: string | Partial<RequestType>, headers: Headers): Promise<any> | undefined;

@@ -71,0 +71,0 @@ /**

@@ -44,3 +44,3 @@ "use strict";

// src/apifunctions.ts
async function createRequest(url = "", method, body = {}, headers = {}, rest) {
async function createRequest(url = "", headers = {}, method, body = {}, rest) {
try {

@@ -69,3 +69,3 @@ let params = {

}
function makeRequest(payload) {
function makeRequest(payload, headers) {
if (!payload) {

@@ -75,6 +75,6 @@ return;

if (typeof payload === "string") {
return createRequest(payload);
return createRequest(payload, headers);
}
const { url, method, body, headers, ...rest } = payload;
return createRequest(url, method, body, headers, rest);
const { url, method, body, ...rest } = payload;
return createRequest(url, headers, method, body, rest);
}

@@ -337,5 +337,5 @@

body: params.bodyAsQueryParams ? {} : body,
headers,
method: params.method
}
},
headers
);

@@ -342,0 +342,0 @@ if (params.saveToCache) {

{
"name": "rest-api-kit",
"version": "0.0.36",
"version": "0.0.37",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "module": "dist/index.mjs",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc