Socket
Socket
Sign inDemoInstall

@vitrical/utils

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitrical/utils - npm Package Compare versions

Comparing version 1.6.5 to 1.6.6

39

api.js

@@ -7,17 +7,24 @@ "use strict";

exports.makeMicroserviceRequest = exports.request = exports.removeUndefined = exports.handleApiError = exports.ApiError = void 0;
const axios_1 = __importDefault(require("axios"));
const axios_retry_1 = __importDefault(require("axios-retry"));
(0, axios_retry_1.default)(axios_1.default, {
retries: 3,
retryDelay: (retryCount) => {
console.log(`retry attempt: ${retryCount}`);
return retryCount * 2000;
},
retryCondition: (error) => {
if (!error.response) {
return false;
}
return error.response.status === 503;
},
});
const a = require('axios');
var Axios = !!a?.request ? a : 'default' in a ? a.default : undefined;
if (Axios) {
(0, axios_retry_1.default)(Axios, {
retries: 3,
retryDelay: (retryCount) => {
console.log(`retry attempt: ${retryCount}`);
return retryCount * 2000;
},
retryCondition: (error) => {
if (!error.response) {
return false;
}
return error.response.status === 503;
},
});
}
else {
console.log('Axios not found');
console.log(a);
}
function isFetchAvailable() {

@@ -135,3 +142,3 @@ return typeof fetch !== 'undefined';

const newStack = new Error().stack;
if (isFetchAvailable() && (!isXMLHttpRequestAvailable() || !axios_1.default?.request)) {
if (isFetchAvailable() && (!isXMLHttpRequestAvailable() || !Axios)) {
const bodyData = formData !== undefined

@@ -214,3 +221,3 @@ ? formData

}
const request = axios_1.default.request({
const request = Axios.request({
method: lcaseMethod,

@@ -217,0 +224,0 @@ url,

{
"name": "@vitrical/utils",
"version": "1.6.5",
"version": "1.6.6",
"description": "Collection of useful functions and typings",

@@ -25,3 +25,3 @@ "main": "index.js",

"@types/jsonwebtoken": "^9.0.5",
"axios": "^1.6.5",
"axios": "^1.7.2",
"axios-retry": "^4.4.0",

@@ -28,0 +28,0 @@ "jsonwebtoken": "^9.0.2",

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