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

myfetchapi

Package Overview
Dependencies
Maintainers
1
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.5.0 to 1.6.0

16

dist/index.js

@@ -39,3 +39,8 @@ "use strict";

return { success: true, res };
return { success: false, msg: new Error(res.statusText) };
return {
success: false,
msg: new Error(
`statusCode: ${res.status}, response: "${await getText(res)}"`
)
};
} catch (err) {

@@ -45,4 +50,11 @@ return { success: false, msg: err };

}
async function getText(res) {
try {
return (await res.text()).substring(0, 250);
} catch (_) {
return "";
}
}
async function myFetch(input, init = {}, options) {
const maxRetry = options?.maxRetry === void 0 ? 3 : options.maxRetry === null ? 0 : options.maxRetry;
const maxRetry = options?.maxRetry === void 0 ? 3 : options.maxRetry === null ? 0 : options.maxRetry < 0 ? 0 : options.maxRetry;
return new Promise((resolve, reject) => {

@@ -49,0 +61,0 @@ const executeRequest = async (retryCount) => {

2

package.json
{
"name": "myfetchapi",
"version": "1.5.0",
"version": "1.6.0",
"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",

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