@stepzen/fetch
Advanced tools
Comparing version 0.45.0-experimental.32a4304 to 0.45.0-experimental.6baaa11
@@ -1,4 +0,4 @@ | ||
import { RequestInfo, RequestInit, Response } from 'node-fetch'; | ||
declare const fetch: (url: RequestInfo, init?: RequestInit) => Promise<Response>; | ||
import type { RequestInfo, RequestInit, Response } from 'node-fetch'; | ||
declare const fetch: (url: RequestInfo | URL, init?: RequestInit) => Promise<Response>; | ||
export default fetch; | ||
//# sourceMappingURL=index.d.ts.map |
// Copyright IBM Corp. 2020, 2024 | ||
import { Agent as HttpAgent } from 'node:http'; | ||
import { Agent as HttpsAgent } from 'node:https'; | ||
import fetchCJSModule from 'node-fetch'; | ||
import fetch0 from 'node-fetch'; | ||
// workaround for https://github.com/steprz/stepzen-cli/issues/934 | ||
@@ -27,3 +27,3 @@ const httpAgent = new HttpAgent({ | ||
} | ||
return fetchCJSModule.default(url, { | ||
return fetch0(url, { | ||
agent: urlstr.startsWith('https:') ? httpsAgent : httpAgent, | ||
@@ -30,0 +30,0 @@ ...init, |
{ | ||
"name": "@stepzen/fetch", | ||
"description": "StepZen implementation of the fetch() API for NodeJS", | ||
"version": "0.45.0-experimental.32a4304", | ||
"version": "0.45.0-experimental.6baaa11", | ||
"author": "StepZen Ltd", | ||
@@ -15,8 +15,7 @@ "license": "MIT", | ||
"engines": { | ||
"node": ">=14.0.1", | ||
"npm": ">=6.14" | ||
"node": ">=18.0" | ||
}, | ||
"scripts": { | ||
"clean": "rm -rf lib tsconfig.tsbuildinfo", | ||
"build": "../../node_modules/.bin/tsc -b", | ||
"build": "tsc -b", | ||
"test": "npm run build && nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"", | ||
@@ -28,3 +27,3 @@ "test:single": "npm run build && mocha", | ||
"debug": "^4.3.4", | ||
"node-fetch": "^2.6.9" | ||
"node-fetch": "^3.3.2" | ||
}, | ||
@@ -35,5 +34,3 @@ "devDependencies": { | ||
"@types/license-checker": "^25.0.3", | ||
"@types/mocha": "^10.0.1", | ||
"@types/node": "^14.18.36", | ||
"@types/node-fetch": "^2.6.2", | ||
"@types/mocha": "^10.0.9", | ||
"chai": "^4.3.10", | ||
@@ -43,9 +40,14 @@ "fancy-test": "^1.4.10", | ||
"license-checker": "^25.0.1", | ||
"mocha": "^10.2.0", | ||
"mocha": "^10.8.2", | ||
"mock-fs": "^4.13.0", | ||
"nyc": "^15.1.0", | ||
"prettier": "^2.8.3", | ||
"ts-node": "^10.8.2" | ||
"ts-node": "^10.9.2", | ||
"typescript": ">=5 <5.4" | ||
}, | ||
"gitHead": "32a43047da221d51d7680e769ed11f766dcaaba5" | ||
"overrides": { | ||
"--comment--": "workaround for CVE-2024-21538", | ||
"cross-spawn": "^7.0.6" | ||
}, | ||
"gitHead": "6baaa119f672aaf963108ce412e02ba5079d0445" | ||
} |
// Copyright IBM Corp. 2020, 2024 | ||
import type {RequestInfo, RequestInit, Response} from 'node-fetch' | ||
import {Agent as HttpAgent} from 'node:http' | ||
import {Agent as HttpsAgent} from 'node:https' | ||
import fetchCJSModule from 'node-fetch' | ||
import {RequestInfo, RequestInit, Response} from 'node-fetch' | ||
import fetch0 from 'node-fetch' | ||
@@ -22,3 +23,3 @@ // workaround for https://github.com/steprz/stepzen-cli/issues/934 | ||
const fetch = async ( | ||
url: RequestInfo, | ||
url: RequestInfo | URL, | ||
init?: RequestInit, | ||
@@ -35,3 +36,3 @@ ): Promise<Response> => { | ||
return fetchCJSModule.default(url, { | ||
return fetch0(url, { | ||
agent: urlstr.startsWith('https:') ? httpsAgent : httpAgent, | ||
@@ -38,0 +39,0 @@ ...init, |
Sorry, the diff of this file is not supported yet
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
6218
14
+ Addeddata-uri-to-buffer@4.0.1(transitive)
+ Addedfetch-blob@3.2.0(transitive)
+ Addedformdata-polyfill@4.0.10(transitive)
+ Addednode-domexception@1.0.0(transitive)
+ Addednode-fetch@3.3.2(transitive)
+ Addedweb-streams-polyfill@3.3.3(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
Updatednode-fetch@^3.3.2