myfetchapi
Advanced tools
Comparing version 1.7.3 to 1.7.4
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
@@ -20,10 +18,2 @@ var __export = (target, all) => { | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
@@ -38,3 +28,2 @@ | ||
module.exports = __toCommonJS(src_exports); | ||
var nfetch = __toESM(require("./nodeFetch")); | ||
var MAX_CONCURRENT_REQUESTS = 500; | ||
@@ -48,6 +37,7 @@ var currentRequests = 0; | ||
try { | ||
const httpFunc = options?.useNodeFetch ? nfetch.fetch : fetch; | ||
const httpFunc = options?.useNodeFetch ? (await require("./nodeFetch.js")).fetch : fetch; | ||
const res = await httpFunc(input, init); | ||
const isOkay = options?.retryCondition ? await options.retryCondition(res) : res.ok; | ||
if (isOkay) return { success: true, res }; | ||
if (isOkay) | ||
return { success: true, res }; | ||
return { | ||
@@ -99,3 +89,4 @@ success: false, | ||
const nextRequest = queue.shift(); | ||
if (nextRequest) nextRequest(); | ||
if (nextRequest) | ||
nextRequest(); | ||
} | ||
@@ -102,0 +93,0 @@ } |
{ | ||
"name": "myfetchapi", | ||
"version": "1.7.3", | ||
"version": "1.7.4", | ||
"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", |
@@ -0,0 +0,0 @@ # myfetchapi |
@@ -0,0 +0,0 @@ { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
539024
13080
6