wikibase-edit
Advanced tools
Comparing version
// Generated by scripts/postversion | ||
export const name = "wikibase-edit" | ||
export const version = "7.2.3" | ||
export const version = "7.2.4" | ||
export const homepage = "https://github.com/maxlath/wikibase-edit" | ||
export const issues = "https://github.com/maxlath/wikibase-edit/issues" | ||
@@ -0,4 +1,26 @@ | ||
import fetch from 'cross-fetch' | ||
import { debug, debugMode } from '../debug.js' | ||
let isNode | ||
try { | ||
isNode = process.versions.node != null | ||
} catch (err) { | ||
isNode = false | ||
} | ||
let agent | ||
if (isNode) { | ||
// Using a custom agent to set keepAlive=true | ||
// https://nodejs.org/api/http.html#http_class_http_agent | ||
// https://github.com/bitinn/node-fetch#custom-agent | ||
const http = await import('node:http') | ||
const https = await import('node:https') | ||
const httpAgent = new http.Agent({ keepAlive: true }) | ||
const httpsAgent = new https.Agent({ keepAlive: true }) | ||
agent = ({ protocol }) => protocol === 'http:' ? httpAgent : httpsAgent | ||
} | ||
export async function customFetch (url, { timeout, ...options } = {}) { | ||
options.agent = options.agent || agent | ||
if (debugMode) { | ||
@@ -5,0 +27,0 @@ const { method = 'get', headers, body } = options |
{ | ||
"name": "wikibase-edit", | ||
"version": "7.2.3", | ||
"version": "7.2.4", | ||
"description": "Edit Wikibase from NodeJS", | ||
@@ -42,2 +42,3 @@ "type": "module", | ||
"dependencies": { | ||
"cross-fetch": "^4.1.0", | ||
"crypto-js": "^4.1.1", | ||
@@ -44,0 +45,0 @@ "lodash.isequal": "^4.5.0", |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
110407
0.6%2766
0.69%5
25%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added