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

fetch-retry

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetch-retry - npm Package Compare versions

Comparing version 5.0.6 to 6.0.0

33

index.d.ts

@@ -1,28 +0,29 @@

/// <reference lib="dom" />
declare module 'fetch-retry' {
const _fetch: typeof fetch;
export type FetchLibrary = (input: any, init?: any) => Promise<any>;
type RequestDelayFunction = ((
export type RequestDelayFunction<F extends FetchLibrary> = (
attempt: number,
error: Error | null,
response: Response | null
) => number);
response: Awaited<ReturnType<F>> | null,
) => number;
type RequestRetryOnFunction = ((
export type RequestRetryOnFunction<F extends FetchLibrary> = (
attempt: number,
error: Error | null,
response: Response | null
) => boolean | Promise<boolean>);
response: Awaited<ReturnType<F>> | null,
) => boolean | Promise<boolean>;
export interface RequestInitRetryParams {
export type RequestInitRetryParams<F extends FetchLibrary> = {
retries?: number;
retryDelay?: number | RequestDelayFunction;
retryOn?: number[] | RequestRetryOnFunction;
}
retryDelay?: number | RequestDelayFunction<F>;
retryOn?: number[] | RequestRetryOnFunction<F>;
};
export type RequestInitWithRetry = RequestInit & RequestInitRetryParams;
export type RequestInitWithRetry<F extends FetchLibrary> = Parameters<F>[1] &
RequestInitRetryParams<F>;
function fetchBuilder(fetch: typeof _fetch, defaults?: RequestInitRetryParams): ((input: Parameters<typeof _fetch>[0], init?: RequestInitWithRetry) => Promise<Response>);
export default fetchBuilder;
export default function fetchBuilder<F extends FetchLibrary>(
fetch: F,
defaults?: RequestInitRetryParams<F>,
): (input: Parameters<F>[0], init?: RequestInitWithRetry<F>) => ReturnType<F>;
}
{
"name": "fetch-retry",
"version": "5.0.6",
"version": "6.0.0",
"description": "Extend any fetch library with retry functionality",

@@ -5,0 +5,0 @@ "repository": "https://github.com/jonbern/fetch-retry.git",

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