Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@koibanx/http

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@koibanx/http - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

lib/utils/statusCode.d.ts

8

lib/Client.d.ts
import { AxiosInstance } from 'axios';
import { StatusCode } from './utils/statusCode';
export declare type Input<B> = {

@@ -6,13 +7,14 @@ url: string;

headers?: Record<string, string>;
params?: any;
};
export declare type Output<O> = {
status: number;
status: StatusCode;
body: O;
};
export interface IClient {
get<O>({ url, headers }: Input<undefined>): Promise<Output<O>>;
get<O>({ url, headers, params }: Input<undefined>): Promise<Output<O>>;
post<B, O>({ url, headers, body }: Input<B>): Promise<Output<O>>;
put<B, O>({ url, headers }: Input<B>): Promise<Output<O>>;
put<B, O>({ url, headers, body }: Input<B>): Promise<Output<O>>;
delete<O>({ url, headers }: Input<undefined>): Promise<Output<O>>;
}
export declare const client: (instance: AxiosInstance) => IClient;

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

});
const httpGet = (client) => ({ url, headers, }) => client.get(url, { headers })
const httpGet = (client) => ({ url, headers, params, }) => client.get(url, { headers, params })
.then((res) => handleResponse(res))

@@ -16,0 +16,0 @@ .catch((err) => handleError(err));

@@ -5,2 +5,3 @@ import { Interceptor } from './Interceptor';

export { Interceptor } from './Interceptor';
export { StatusCode } from './utils/statusCode';
/**

@@ -7,0 +8,0 @@ *

@@ -6,5 +6,8 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.StatusCode = void 0;
const axios_1 = __importDefault(require("axios"));
const Interceptor_1 = require("./Interceptor");
const Client_1 = require("./Client");
var statusCode_1 = require("./utils/statusCode");
Object.defineProperty(exports, "StatusCode", { enumerable: true, get: function () { return statusCode_1.StatusCode; } });
/**

@@ -11,0 +14,0 @@ * Module Http for Default

{
"name": "@koibanx/http",
"version": "0.0.2",
"version": "0.0.3",
"description": "",

@@ -5,0 +5,0 @@ "type": "commonjs",

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