@libsql/isomorphic-fetch
Advanced tools
Comparing version 0.2.5 to 0.3.0
19
node.js
@@ -1,21 +0,6 @@ | ||
import http from 'http'; | ||
import https from 'https'; | ||
const _Request = Request; | ||
const _Headers = Headers; | ||
const httpAgent = new http.Agent({ keepAlive: true }); | ||
const httpsAgent = new https.Agent({ keepAlive: true }); | ||
const _fetch = fetch; | ||
function agentSelector(parsedUrl) { | ||
if (parsedUrl.protocol === 'https:') { | ||
return httpsAgent; | ||
} else { | ||
return httpAgent; | ||
} | ||
} | ||
function fetchWithAgentSelection(resource, options = {}) { | ||
return fetch(resource, { agent: agentSelector, ...options }); | ||
} | ||
export { fetchWithAgentSelection as fetch, _Request as Request, _Headers as Headers}; | ||
export { _fetch as fetch, _Request as Request, _Headers as Headers}; |
{ | ||
"name": "@libsql/isomorphic-fetch", | ||
"version": "0.2.5", | ||
"version": "0.3.0", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "fetch", |
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
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
5
3516
66