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
1
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.20 to 0.0.21

6

dist/index.d.ts

@@ -39,7 +39,7 @@ type MethodType = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";

};
type EndpointFix = Record<string, EndpointType<any, any>>;
type EndpointBuilder = <U, V>(endpoint: EndpointType<U, V>) => EndpointType<U, V>;
type BuildCallBackType = (builder: EndpointBuilder) => Record<string, EndpointType<any, any>>;
type RestBaseReturnType = {
createEndpoints: (callback: BuildCallBackType) => Record<string, () => QueryHookReturnType>;
endpoints: any;
createEndpoints: <T extends EndpointFix>(callback: (builder: EndpointBuilder) => T) => Record<`use${string & Capitalize<keyof T extends string ? keyof T : never>}`, () => QueryHookReturnType>;
endpoints: EndpointFix;
};

@@ -46,0 +46,0 @@

@@ -293,12 +293,14 @@ "use strict";

let endpoints = {};
const build = (endpoint) => {
function build(endpoint) {
return endpoint;
};
const createCustomHooks = () => {
}
;
function createCustomHooks(endpoints2) {
const customHooks = {};
for (const [endpointName, { url, params }] of Object.entries(endpoints)) {
for (const [endpointName, { url, params }] of Object.entries(endpoints2)) {
customHooks[`use${capitalizeFirstLetter(endpointName)}`] = () => useRest(url, { ...params, endpointName: endpointName.toLowerCase() }, restBaseOptions);
}
return customHooks;
};
}
;
const setEndpoints = (x) => {

@@ -310,3 +312,3 @@ endpoints = x;

setEndpoints(builtEndpoints);
return { ...createCustomHooks() };
return { ...createCustomHooks(builtEndpoints) };
};

@@ -313,0 +315,0 @@ return {

{
"name": "rest-api-kit",
"version": "0.0.20",
"version": "0.0.21",
"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