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

cross-fetch

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cross-fetch - npm Package Compare versions

Comparing version 3.1.2 to 3.1.3-alpha.4

46

index.d.ts

@@ -1,33 +0,19 @@

import type {
BodyInit,
Headers as BaseHeaders,
HeadersInit,
Request,
RequestInfo,
RequestInit,
Response,
ResponseInit,
} from "./lib.fetch"
import type { Headers as IterHeaders } from "./lib.fetch.iterable";
type Headers = BaseHeaders & IterHeaders;
/// <reference path="./lib.fetch.d.ts" />
export const fetch: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
type _fetch = typeof fetch
type _Response = Response
type _Request = Request
type _RequestInfo = RequestInfo
type _RequestInit = RequestInit
type _Headers = Headers
export const Request: {
prototype: Request;
new(input: RequestInfo, init?: RequestInit): Request;
};
export {
_fetch as fetch,
_Response as Response,
_Request as Request,
_RequestInfo as RequestInfo,
_RequestInit as RequestInit,
_Headers as Headers,
}
export const Response: {
prototype: Response;
new(body?: BodyInit | null, init?: ResponseInit): Response;
error(): Response;
redirect(url: string, status?: number): Response;
};
export const Headers: {
prototype: Headers;
new(init?: HeadersInit): Headers;
};
export default fetch;
export default _fetch

@@ -1,59 +0,75 @@

// Generated by resolving typescript/lib/lib.dom.d.ts from typescript@4.2.3
export interface RequestInit {
declare function fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
/** This Fetch API interface represents a resource request. */
interface Request extends Body {
/**
* A BodyInit object or null to set request's body.
* Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
*/
body?: BodyInit | null;
readonly cache: RequestCache;
/**
* A string indicating how the request will interact with the browser's cache to set request's cache.
* Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL.
*/
cache?: RequestCache;
readonly credentials: RequestCredentials;
/**
* A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials.
* Returns the kind of resource requested by request, e.g., "document" or "script".
*/
credentials?: RequestCredentials;
readonly destination: RequestDestination;
/**
* A Headers object, an object literal, or an array of two-item arrays to set request's headers.
* Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header.
*/
headers?: HeadersInit;
readonly headers: Headers;
/**
* A cryptographic hash of the resource to be fetched by request. Sets request's integrity.
* Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]
*/
integrity?: string;
readonly integrity: string;
/**
* A boolean to set request's keepalive.
* Returns a boolean indicating whether or not request is for a history navigation (a.k.a. back-foward navigation).
*/
keepalive?: boolean;
readonly isHistoryNavigation: boolean;
/**
* A string to set request's method.
* Returns a boolean indicating whether or not request is for a reload navigation.
*/
method?: string;
readonly isReloadNavigation: boolean;
/**
* A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode.
* Returns a boolean indicating whether or not request can outlive the global in which it was created.
*/
mode?: RequestMode;
readonly keepalive: boolean;
/**
* A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect.
* Returns request's HTTP method, which is "GET" by default.
*/
redirect?: RequestRedirect;
readonly method: string;
/**
* A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer.
* Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs.
*/
referrer?: string;
readonly mode: RequestMode;
/**
* A referrer policy to set request's referrerPolicy.
* Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.
*/
referrerPolicy?: ReferrerPolicy;
readonly redirect: RequestRedirect;
/**
* An AbortSignal to set request's signal.
* Returns the referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made.
*/
signal?: AbortSignal | null;
readonly referrer: string;
/**
* Can only be null. Used to disassociate request from any Window.
* Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer.
*/
window?: any;
readonly referrerPolicy: ReferrerPolicy;
/**
* Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
*/
readonly signal: AbortSignal;
/**
* Returns the URL of request as a string.
*/
readonly url: string;
clone(): Request;
}
declare var Request: {
prototype: Request;
new(input: RequestInfo, init?: RequestInit): Request;
};
/** This Fetch API interface represents the response to a request. */
export interface Response extends Body {
interface Response extends Body {
readonly headers: Headers;

@@ -70,149 +86,116 @@ readonly ok: boolean;

export interface ResponseInit {
headers?: HeadersInit;
status?: number;
statusText?: string;
}
declare var Response: {
prototype: Response;
new(body?: BodyInit | null, init?: ResponseInit): Response;
error(): Response;
redirect(url: string, status?: number): Response;
};
/** A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system. */
export interface Blob {
readonly size: number;
readonly type: string;
arrayBuffer(): Promise<ArrayBuffer>;
slice(start?: number, end?: number, contentType?: string): Blob;
stream(): ReadableStream;
text(): Promise<string>;
}
/** Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data". */
export interface FormData {
append(name: string, value: string | Blob, fileName?: string): void;
/** This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs. You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence. */
interface Headers {
append(name: string, value: string): void;
delete(name: string): void;
get(name: string): FormDataEntryValue | null;
getAll(name: string): FormDataEntryValue[];
get(name: string): string | null;
has(name: string): boolean;
set(name: string, value: string | Blob, fileName?: string): void;
forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
set(name: string, value: string): void;
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
}
export interface URLSearchParams {
declare var Headers: {
prototype: Headers;
new(init?: HeadersInit): Headers;
};
interface Headers {
[Symbol.iterator](): IterableIterator<[string, string]>;
/**
* Appends a specified key/value pair as a new search parameter.
* Returns an iterator allowing to go through all key/value pairs contained in this object.
*/
append(name: string, value: string): void;
entries(): IterableIterator<[string, string]>;
/**
* Deletes the given search parameter, and its associated value, from the list of all search parameters.
* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.
*/
delete(name: string): void;
keys(): IterableIterator<string>;
/**
* Returns the first value associated to the given search parameter.
* Returns an iterator allowing to go through all values of the key/value pairs contained in this object.
*/
get(name: string): string | null;
/**
* Returns all the values association with a given search parameter.
*/
getAll(name: string): string[];
/**
* Returns a Boolean indicating if such a search parameter exists.
*/
has(name: string): boolean;
/**
* Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
*/
set(name: string, value: string): void;
sort(): void;
/**
* Returns a string containing a query string suitable for use in a URL. Does not include the question mark.
*/
toString(): string;
forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void;
values(): IterableIterator<string>;
}
/** This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */
export interface ReadableStream<R = any> {
readonly locked: boolean;
cancel(reason?: any): Promise<void>;
getReader(): ReadableStreamDefaultReader<R>;
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
pipeTo(dest: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
tee(): [ReadableStream<R>, ReadableStream<R>];
}
type RequestInfo = Request | string;
/** This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.  You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence. */
export interface Headers {
append(name: string, value: string): void;
delete(name: string): void;
get(name: string): string | null;
has(name: string): boolean;
set(name: string, value: string): void;
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
}
/** This Fetch API interface represents a resource request. */
export interface Request extends Body {
interface RequestInit {
/**
* Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
* A BodyInit object or null to set request's body.
*/
readonly cache: RequestCache;
body?: BodyInit | null;
/**
* Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL.
* A string indicating how the request will interact with the browser's cache to set request's cache.
*/
readonly credentials: RequestCredentials;
cache?: RequestCache;
/**
* Returns the kind of resource requested by request, e.g., "document" or "script".
* A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials.
*/
readonly destination: RequestDestination;
credentials?: RequestCredentials;
/**
* Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header.
* A Headers object, an object literal, or an array of two-item arrays to set request's headers.
*/
readonly headers: Headers;
headers?: HeadersInit;
/**
* Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]
* A cryptographic hash of the resource to be fetched by request. Sets request's integrity.
*/
readonly integrity: string;
integrity?: string;
/**
* Returns a boolean indicating whether or not request is for a history navigation (a.k.a. back-foward navigation).
* A boolean to set request's keepalive.
*/
readonly isHistoryNavigation: boolean;
keepalive?: boolean;
/**
* Returns a boolean indicating whether or not request is for a reload navigation.
* A string to set request's method.
*/
readonly isReloadNavigation: boolean;
method?: string;
/**
* Returns a boolean indicating whether or not request can outlive the global in which it was created.
* A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode.
*/
readonly keepalive: boolean;
mode?: RequestMode;
/**
* Returns request's HTTP method, which is "GET" by default.
* A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect.
*/
readonly method: string;
redirect?: RequestRedirect;
/**
* Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs.
* A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer.
*/
readonly mode: RequestMode;
referrer?: string;
/**
* Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.
* A referrer policy to set request's referrerPolicy.
*/
readonly redirect: RequestRedirect;
referrerPolicy?: ReferrerPolicy;
/**
* Returns the referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made.
* An AbortSignal to set request's signal.
*/
readonly referrer: string;
signal?: AbortSignal | null;
/**
* Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer.
* Can only be null. Used to disassociate request from any Window.
*/
readonly referrerPolicy: ReferrerPolicy;
/**
* Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
*/
readonly signal: AbortSignal;
/**
* Returns the URL of request as a string.
*/
readonly url: string;
clone(): Request;
window?: any;
}
interface Body {
readonly body: ReadableStream<Uint8Array> | null;
readonly bodyUsed: boolean;
arrayBuffer(): Promise<ArrayBuffer>;
blob(): Promise<Blob>;
formData(): Promise<FormData>;
json(): Promise<any>;
text(): Promise<string>;
}
type RequestCache = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
type RequestCredentials = "include" | "omit" | "same-origin";
type RequestDestination = "" | "audio" | "audioworklet" | "document" | "embed" | "font" | "image" | "manifest" | "object" | "paintworklet" | "report" | "script" | "sharedworker" | "style" | "track" | "video" | "worker" | "xslt";
type RequestMode = "cors" | "navigate" | "no-cors" | "same-origin";
type RequestRedirect = "error" | "follow" | "manual";
type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
export interface AbortSignal extends EventTarget {
interface AbortSignal extends EventTarget {
/**

@@ -229,60 +212,62 @@ * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.

export interface Body {
readonly body: ReadableStream<Uint8Array> | null;
readonly bodyUsed: boolean;
type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect";
type BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream<Uint8Array> | string;
interface ResponseInit {
headers?: HeadersInit;
status?: number;
statusText?: string;
}
type HeadersInit = Headers | string[][] | Record<string, string>;
/** This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */
interface ReadableStream<R = any> {
readonly locked: boolean;
cancel(reason?: any): Promise<void>;
getReader(): ReadableStreamDefaultReader<R>;
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
pipeTo(dest: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
tee(): [ReadableStream<R>, ReadableStream<R>];
}
/** A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system. */
interface Blob {
readonly size: number;
readonly type: string;
arrayBuffer(): Promise<ArrayBuffer>;
blob(): Promise<Blob>;
formData(): Promise<FormData>;
json(): Promise<any>;
slice(start?: number, end?: number, contentType?: string): Blob;
stream(): ReadableStream;
text(): Promise<string>;
}
export interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
read(): Promise<ReadableStreamDefaultReadResult<R>>;
releaseLock(): void;
/** Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data". */
interface FormData {
append(name: string, value: string | Blob, fileName?: string): void;
delete(name: string): void;
get(name: string): FormDataEntryValue | null;
getAll(name: string): FormDataEntryValue[];
has(name: string): boolean;
set(name: string, value: string | Blob, fileName?: string): void;
forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
}
export interface ReadableWritablePair<R = any, W = any> {
readable: ReadableStream<R>;
interface FormData {
[Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;
/**
* Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.
*
* Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
* Returns an array of key, value pairs for every entry in the list.
*/
writable: WritableStream<W>;
}
export interface StreamPipeOptions {
preventAbort?: boolean;
preventCancel?: boolean;
entries(): IterableIterator<[string, FormDataEntryValue]>;
/**
* Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
*
* Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
*
* Errors and closures of the source and destination streams propagate as follows:
*
* An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination.
*
* An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source.
*
* When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error.
*
* If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source.
*
* The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set.
* Returns a list of keys in the list.
*/
preventClose?: boolean;
signal?: AbortSignal;
keys(): IterableIterator<string>;
/**
* Returns a list of values in the list.
*/
values(): IterableIterator<FormDataEntryValue>;
}
/** This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing. */
export interface WritableStream<W = any> {
readonly locked: boolean;
abort(reason?: any): Promise<void>;
getWriter(): WritableStreamDefaultWriter<W>;
}
/** EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them. */
export interface EventTarget {
interface EventTarget {
/**

@@ -313,3 +298,3 @@ * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

/** An event which takes place in the DOM. */
export interface Event {
interface Event {
/**

@@ -382,7 +367,7 @@ * Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.

export interface AbortSignalEventMap {
interface AbortSignalEventMap {
"abort": Event;
}
export interface AddEventListenerOptions extends EventListenerOptions {
interface AddEventListenerOptions extends EventListenerOptions {
once?: boolean;

@@ -392,13 +377,116 @@ passive?: boolean;

export interface EventListenerOptions {
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
interface EventListenerOptions {
capture?: boolean;
}
/** Provides information about files and allows JavaScript in a web page to access their content. */
export interface File extends Blob {
readonly lastModified: number;
readonly name: string;
type BufferSource = ArrayBufferView | ArrayBuffer;
interface URLSearchParams {
/**
* Appends a specified key/value pair as a new search parameter.
*/
append(name: string, value: string): void;
/**
* Deletes the given search parameter, and its associated value, from the list of all search parameters.
*/
delete(name: string): void;
/**
* Returns the first value associated to the given search parameter.
*/
get(name: string): string | null;
/**
* Returns all the values association with a given search parameter.
*/
getAll(name: string): string[];
/**
* Returns a Boolean indicating if such a search parameter exists.
*/
has(name: string): boolean;
/**
* Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
*/
set(name: string, value: string): void;
sort(): void;
/**
* Returns a string containing a query string suitable for use in a URL. Does not include the question mark.
*/
toString(): string;
forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void;
}
export interface ReadableStreamGenericReader {
interface URLSearchParams {
[Symbol.iterator](): IterableIterator<[string, string]>;
/**
* Returns an array of key, value pairs for every entry in the search params.
*/
entries(): IterableIterator<[string, string]>;
/**
* Returns a list of keys in the search params.
*/
keys(): IterableIterator<string>;
/**
* Returns a list of values in the search params.
*/
values(): IterableIterator<string>;
}
interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
read(): Promise<ReadableStreamDefaultReadResult<R>>;
releaseLock(): void;
}
interface ReadableWritablePair<R = any, W = any> {
readable: ReadableStream<R>;
/**
* Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.
*
* Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
*/
writable: WritableStream<W>;
}
interface StreamPipeOptions {
preventAbort?: boolean;
preventCancel?: boolean;
/**
* Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
*
* Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
*
* Errors and closures of the source and destination streams propagate as follows:
*
* An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination.
*
* An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source.
*
* When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error.
*
* If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source.
*
* The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set.
*/
preventClose?: boolean;
signal?: AbortSignal;
}
/** This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing. */
interface WritableStream<W = any> {
readonly locked: boolean;
abort(reason?: any): Promise<void>;
getWriter(): WritableStreamDefaultWriter<W>;
}
type FormDataEntryValue = File | string;
interface EventListener {
(evt: Event): void;
}
interface EventListenerObject {
handleEvent(evt: Event): void;
}
interface ReadableStreamGenericReader {
readonly closed: Promise<undefined>;

@@ -408,4 +496,6 @@ cancel(reason?: any): Promise<void>;

type ReadableStreamDefaultReadResult<T> = ReadableStreamDefaultReadValueResult<T> | ReadableStreamDefaultReadDoneResult;
/** This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink. */
export interface WritableStreamDefaultWriter<W = any> {
interface WritableStreamDefaultWriter<W = any> {
readonly closed: Promise<undefined>;

@@ -420,11 +510,9 @@ readonly desiredSize: number | null;

export interface EventListener {
(evt: Event): void;
/** Provides information about files and allows JavaScript in a web page to access their content. */
interface File extends Blob {
readonly lastModified: number;
readonly name: string;
}
export interface EventListenerObject {
handleEvent(evt: Event): void;
}
export interface ReadableStreamDefaultReadValueResult<T> {
interface ReadableStreamDefaultReadValueResult<T> {
done: false;

@@ -434,20 +522,5 @@ value: T;

export interface ReadableStreamDefaultReadDoneResult {
interface ReadableStreamDefaultReadDoneResult {
done: true;
value?: undefined;
}
export type BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream<Uint8Array> | string;
export type HeadersInit = Headers | string[][] | Record<string, string>;
export type RequestInfo = Request | string;
export type BufferSource = ArrayBufferView | ArrayBuffer;
export type RequestCache = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
export type RequestCredentials = "include" | "omit" | "same-origin";
export type RequestMode = "cors" | "navigate" | "no-cors" | "same-origin";
export type RequestRedirect = "error" | "follow" | "manual";
export type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
export type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect";
export type FormDataEntryValue = File | string;
export type RequestDestination = "" | "audio" | "audioworklet" | "document" | "embed" | "font" | "image" | "manifest" | "object" | "paintworklet" | "report" | "script" | "sharedworker" | "style" | "track" | "video" | "worker" | "xslt";
export declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
export type ReadableStreamDefaultReadResult<T> = ReadableStreamDefaultReadValueResult<T> | ReadableStreamDefaultReadDoneResult;
{
"name": "cross-fetch",
"version": "3.1.2",
"version": "3.1.3-alpha.4",
"description": "Universal WHATWG Fetch API for Node, Browsers and React Native",

@@ -9,15 +9,12 @@ "homepage": "https://github.com/lquixada/cross-fetch",

"react-native": "dist/react-native-ponyfill.js",
"typings": "index.d.ts",
"types": "index.d.ts",
"scripts": {
"prepare": "husky install"
},
"lint-staged": {
"*.js": [
"make build",
"standard --fix"
]
},
"husky": {
"hooks": {
"commit-msg": "commitlint --edit $1",
"pre-commit": "make build && lint-staged",
"pre-push": "make"
}
},
"standard": {

@@ -38,3 +35,5 @@ "env": [

"test.js",
"test.*.js"
"test.*.js",
"api.spec.js",
"*.ts"
]

@@ -62,2 +61,7 @@ },

},
"standard-version": {
"skip": {
"changelog": true
}
},
"repository": {

@@ -78,2 +82,5 @@ "type": "git",

"@commitlint/config-conventional": "12.0.1",
"@types/chai": "4.2.15",
"@types/mocha": "8.2.2",
"@types/node": "14.14.36",
"body-parser": "1.19.0",

@@ -84,3 +91,3 @@ "chai": "4.3.4",

"express": "4.17.1",
"husky": "4.3.8",
"husky": "5.2.0",
"lint-staged": "10.5.4",

@@ -91,4 +98,4 @@ "mocha": "8.3.2",

"nyc": "15.1.0",
"ora": "5.3.0",
"rollup": "2.41.2",
"ora": "5.4.0",
"rollup": "2.42.1",
"rollup-plugin-copy": "3.4.0",

@@ -100,4 +107,5 @@ "rollup-plugin-terser": "7.0.2",

"standard": "16.0.3",
"standard-version": "9.1.1",
"typescript": "4.2.3",
"webpack": "5.25.0",
"webpack": "5.27.1",
"webpack-cli": "4.5.0",

@@ -110,4 +118,3 @@ "whatwg-fetch": "3.0.0"

"index.d.ts",
"lib.fetch.d.ts",
"lib.fetch.iterable.d.ts"
"lib.fetch.d.ts"
],

@@ -114,0 +121,0 @@ "keywords": [

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