Socket
Socket
Sign inDemoInstall

myfetchapi

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

myfetchapi - npm Package Compare versions

Comparing version 1.7.0 to 1.7.1

19

dist/index.d.ts

@@ -8,7 +8,26 @@ import type * as nodefetch from "node-fetch";

export type myFetchOptions = {
/**
* set this to `true` in order to use nodejs features, e.g agents
*/
useNodeFetch?: boolean;
/**
* How many times a request will retry if it failed
*/
maxRetry?: number | null;
/**
* callback is called when the http(s) request is retrying
* @param err Error object
* @param count retry count
* @param max maxRetry
* @returns any
*/
retryCb?: (err: any, count: number, max: number) => any;
/**
* Normally the request is retried if the http(s) status isn't ok.
* Use this function to override and set your own condition.
* @param res http(s) Response object
* @returns boolean
*/
retryCondition?: (res: Response | nodefetch.Response) => boolean | Promise<boolean>;
};
export declare function myFetch(input: RequestInfo | nodefetch.RequestInfo, init?: RequestInit | nodefetch.RequestInit, options?: myFetchOptions): Promise<Response>;

2

dist/index.js

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

var SET_MAX_CONCURRENT_REQUESTS = (max) => {
MAX_CONCURRENT_REQUESTS = max;
MAX_CONCURRENT_REQUESTS = Math.max(1, max);
};

@@ -34,0 +34,0 @@ async function fetchWithConnection(input, init, options) {

{
"name": "myfetchapi",
"version": "1.7.0",
"version": "1.7.1",
"description": "mFetch is a JavaScript library that provides a utility function for making HTTP requests with queuing and retry functionality.",

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

@@ -39,3 +39,3 @@ # myfetchapi

- `input`: RequestInfo - The URL or Request object.
- `init` (optional): RequestInit - The request options.
- `init` (optional): RequestInit - The request [Options](https://www.npmjs.com/package/node-fetch#fetch-options) for the HTTP(S) request
- `options` (optional): myFetchOptions - Additional options.

@@ -53,2 +53,2 @@ - Returns: Promise<Response>

This project is licensed under the ISC License
This project is licensed under the MIT License

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