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

axios-retry

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-retry - npm Package Compare versions

Comparing version 4.4.1 to 4.4.2

8

dist/cjs/index.js

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

}
function setCurrentState(config, defaultOptions) {
function setCurrentState(config, defaultOptions, resetLastRequestTime = false) {
const currentState = getRequestOptions(config, defaultOptions || {});
currentState.retryCount = currentState.retryCount || 0;
currentState.lastRequestTime = currentState.lastRequestTime || Date.now();
if (!currentState.lastRequestTime || resetLastRequestTime) {
currentState.lastRequestTime = Date.now();
}
config[exports.namespace] = currentState;

@@ -191,3 +193,3 @@ return currentState;

var _a;
setCurrentState(config, defaultOptions);
setCurrentState(config, defaultOptions, true);
if ((_a = config[exports.namespace]) === null || _a === void 0 ? void 0 : _a.validateResponse) {

@@ -194,0 +196,0 @@ // by setting this, all HTTP responses will be go through the error interceptor first

@@ -77,6 +77,8 @@ import isRetryAllowed from 'is-retry-allowed';

}
function setCurrentState(config, defaultOptions) {
function setCurrentState(config, defaultOptions, resetLastRequestTime = false) {
const currentState = getRequestOptions(config, defaultOptions || {});
currentState.retryCount = currentState.retryCount || 0;
currentState.lastRequestTime = currentState.lastRequestTime || Date.now();
if (!currentState.lastRequestTime || resetLastRequestTime) {
currentState.lastRequestTime = Date.now();
}
config[namespace] = currentState;

@@ -156,3 +158,3 @@ return currentState;

const requestInterceptorId = axiosInstance.interceptors.request.use((config) => {
setCurrentState(config, defaultOptions);
setCurrentState(config, defaultOptions, true);
if (config[namespace]?.validateResponse) {

@@ -159,0 +161,0 @@ // by setting this, all HTTP responses will be go through the error interceptor first

{
"name": "axios-retry",
"version": "4.4.1",
"version": "4.4.2",
"author": "Rubén Norte <ruben.norte@softonic.com>",

@@ -5,0 +5,0 @@ "description": "Axios plugin that intercepts failed requests and retries them whenever posible.",

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