@stepzen/fetch
Advanced tools
Comparing version 0.45.0-experimental.a6f5273 to 0.45.0-experimental.ee3795c
@@ -1,9 +0,7 @@ | ||
"use strict"; | ||
// Copyright IBM Corp. 2020, 2024 | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const http = require("http"); | ||
const https = require("https"); | ||
const node_fetch_1 = require("node-fetch"); | ||
import { Agent as HttpAgent } from 'node:http'; | ||
import { Agent as HttpsAgent } from 'node:https'; | ||
import fetchCJSModule from 'node-fetch'; | ||
// workaround for https://github.com/steprz/stepzen-cli/issues/934 | ||
const httpAgent = new http.Agent({ | ||
const httpAgent = new HttpAgent({ | ||
keepAlive: true, | ||
@@ -13,3 +11,3 @@ scheduling: 'lifo', | ||
}); | ||
const httpsAgent = new https.Agent({ | ||
const httpsAgent = new HttpsAgent({ | ||
keepAlive: true, | ||
@@ -30,3 +28,3 @@ scheduling: 'lifo', | ||
} | ||
return (0, node_fetch_1.default)(url, { | ||
return fetchCJSModule.default(url, { | ||
agent: urlstr.startsWith('https:') ? httpsAgent : httpAgent, | ||
@@ -36,3 +34,3 @@ ...init, | ||
}; | ||
exports.default = fetch; | ||
export default fetch; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@stepzen/fetch", | ||
"description": "StepZen implementation of the fetch() API for NodeJS", | ||
"version": "0.45.0-experimental.a6f5273", | ||
"version": "0.45.0-experimental.ee3795c", | ||
"author": "StepZen Ltd", | ||
@@ -11,11 +11,11 @@ "license": "MIT", | ||
], | ||
"type": "module", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"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\"", | ||
@@ -33,4 +33,3 @@ "test:single": "npm run build && mocha", | ||
"@types/license-checker": "^25.0.3", | ||
"@types/mocha": "^10.0.1", | ||
"@types/node": "^14.18.36", | ||
"@types/mocha": "^10.0.9", | ||
"@types/node-fetch": "^2.6.2", | ||
@@ -41,9 +40,14 @@ "chai": "^4.3.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": "a6f527388119c84983ac5c1e93150f4403054b01" | ||
"overrides": { | ||
"--comment--": "workaround for CVE-2024-21538", | ||
"cross-spawn": "^7.0.6" | ||
}, | ||
"gitHead": "ee3795c421d62df88bc5c8448883c36ff6787ecd" | ||
} |
// Copyright IBM Corp. 2020, 2024 | ||
import * as http from 'http' | ||
import * as https from 'https' | ||
import fetch0 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' | ||
// workaround for https://github.com/steprz/stepzen-cli/issues/934 | ||
const httpAgent = new http.Agent({ | ||
const httpAgent = new HttpAgent({ | ||
keepAlive: true, | ||
@@ -15,3 +15,3 @@ scheduling: 'lifo', | ||
const httpsAgent = new https.Agent({ | ||
const httpsAgent = new HttpsAgent({ | ||
keepAlive: true, | ||
@@ -35,3 +35,3 @@ scheduling: 'lifo', | ||
return fetch0(url, { | ||
return fetchCJSModule.default(url, { | ||
agent: urlstr.startsWith('https:') ? httpsAgent : httpAgent, | ||
@@ -38,0 +38,0 @@ ...init, |
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
6272
1
Yes
69