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

@tomphttp/bare-client

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tomphttp/bare-client - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0-alpha

9

dist/BareTypes.d.ts

@@ -25,11 +25,2 @@ export declare type BareMethod = 'GET' | 'POST' | 'DELETE' | 'OPTIONS' | 'PUT' | 'PATCH' | 'UPDATE' | string;

}
export declare type BareBodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream | undefined | null;
export declare type BareFetchInit = {
method?: BareMethod;
headers?: Headers | BareHeaders;
body?: BareBodyInit;
cache?: BareCache;
redirect?: 'follow' | 'manual' | 'error' | string;
signal?: AbortSignal;
};
export interface BareMaintainer {

@@ -36,0 +27,0 @@ email?: string;

4

dist/Client.d.ts

@@ -1,2 +0,2 @@

import type { BareBodyInit, BareCache, BareHeaders, BareMethod, BareResponse, BareWebSocketMeta } from './BareTypes.js';
import type { BareCache, BareHeaders, BareMethod, BareResponse, BareWebSocketMeta } from './BareTypes.js';
export declare const statusEmpty: number[];

@@ -23,3 +23,3 @@ export declare const statusRedirect: number[];

abstract connect(remote: URL, protocols: string[], getRequestHeaders: GetRequestHeadersCallback, onMeta: MetaCallback, onReadyState: ReadyStateCallback, webSocketImpl: WebSocketImpl): WebSocket;
abstract request(method: BareMethod, requestHeaders: BareHeaders, body: BareBodyInit, remote: URL, cache: BareCache | undefined, duplex: string | undefined, signal: AbortSignal | undefined): Promise<BareResponse>;
abstract request(method: BareMethod, requestHeaders: BareHeaders, body: BodyInit | null, remote: URL, cache: BareCache | undefined, duplex: string | undefined, signal: AbortSignal | undefined): Promise<BareResponse>;
protected base: URL;

@@ -26,0 +26,0 @@ /**

@@ -549,4 +549,3 @@ // The user likely has overwritten all networking functions after importing bare-client

options.headers = this.createBareHeaders(remote, bareHeaders);
const request = new Request(this.http + '?cache=' + md5(remote.toString()), options);
const response = await fetch(request);
const response = await fetch(this.http + '?cache=' + md5(remote.toString()), options);
const readResponse = await this.readBareResponse(response);

@@ -781,2 +780,5 @@ const result = new Response(statusEmpty.includes(readResponse.status) ? undefined : response.body, {

: inputHeaders;
// @ts-ignore
const duplex = init?.duplex;
const body = init?.body || req.body;
let urlO = new URL(req.url);

@@ -789,5 +791,3 @@ const client = await this.demand();

headers.Host = urlO.host;
const response = await client.request(req.method, headers, req.body, urlO, req.cache,
// @ts-ignore
req.duplex, req.signal);
const response = await client.request(req.method, headers, body, urlO, req.cache, duplex, req.signal);
response.finalURL = urlO.toString();

@@ -794,0 +794,0 @@ const redirect = init?.redirect || req.redirect;

@@ -1,2 +0,2 @@

import type { BareBodyInit, BareCache, BareHeaders, BareMethod, BareResponse } from './BareTypes.js';
import type { BareCache, BareHeaders, BareMethod, BareResponse } from './BareTypes.js';
import { Client } from './Client.js';

@@ -9,5 +9,5 @@ import type { ReadyStateCallback, MetaCallback, GetRequestHeadersCallback } from './Client.js';

connect(remote: URL, protocols: string[], getRequestHeaders: GetRequestHeadersCallback, onMeta: MetaCallback, onReadyState: ReadyStateCallback): WebSocket;
request(method: BareMethod, requestHeaders: BareHeaders, body: BareBodyInit, remote: URL, cache: BareCache | undefined, duplex: string | undefined, signal: AbortSignal | undefined): Promise<BareResponse>;
request(method: BareMethod, requestHeaders: BareHeaders, body: BodyInit | null, remote: URL, cache: BareCache | undefined, duplex: string | undefined, signal: AbortSignal | undefined): Promise<BareResponse>;
private readBareResponse;
createBareHeaders(remote: URL, bareHeaders: BareHeaders, forwardHeaders?: string[], passHeaders?: string[], passStatus?: number[]): Headers;
}
{
"name": "@tomphttp/bare-client",
"version": "2.1.0",
"version": "2.2.0-alpha",
"homepage": "https://github.com/tomphttp",

@@ -5,0 +5,0 @@ "bugs": {

Sorry, the diff of this file is not supported yet

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