Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@whatwg-node/node-fetch

Package Overview
Dependencies
Maintainers
1
Versions
509
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@whatwg-node/node-fetch - npm Package Compare versions

Comparing version 0.5.17-alpha-20240726115125-ab31308a7b0579cdd0a19007f92db672cf1eaa85 to 0.5.17-alpha-20240726134117-83e8f8204e0f1386db741961d187a4ea92d82686

18

cjs/Request.js

@@ -5,2 +5,4 @@ "use strict";

exports.PonyfillRequest = void 0;
const http_1 = require("http");
const https_1 = require("https");
const Body_js_1 = require("./Body.js");

@@ -79,3 +81,19 @@ const Headers_js_1 = require("./Headers.js");

}
this._agent = requestInit?.agent;
}
get agent() {
if (this._agent != null) {
return this._agent;
}
// Disable agent when running in jest
if (globalThis['libcurl'] || typeof jest === 'object') {
return false;
}
if (this.url.startsWith('http:')) {
return http_1.globalAgent;
}
else if (this.url.startsWith('https:')) {
return https_1.globalAgent;
}
}
get signal() {

@@ -82,0 +100,0 @@ // Create a new signal only if needed

var _a;
import { globalAgent as httpGlobalAgent } from 'http';
import { globalAgent as httpsGlobalAgent } from 'https';
import { PonyfillBody } from './Body.js';

@@ -75,3 +77,19 @@ import { isHeadersLike, PonyfillHeaders } from './Headers.js';

}
this._agent = requestInit?.agent;
}
get agent() {
if (this._agent != null) {
return this._agent;
}
// Disable agent when running in jest
if (globalThis['libcurl'] || typeof jest === 'object') {
return false;
}
if (this.url.startsWith('http:')) {
return httpGlobalAgent;
}
else if (this.url.startsWith('https:')) {
return httpsGlobalAgent;
}
}
get signal() {

@@ -78,0 +96,0 @@ // Create a new signal only if needed

2

package.json
{
"name": "@whatwg-node/node-fetch",
"version": "0.5.17-alpha-20240726115125-ab31308a7b0579cdd0a19007f92db672cf1eaa85",
"version": "0.5.17-alpha-20240726134117-83e8f8204e0f1386db741961d187a4ea92d82686",
"description": "Fetch API implementation for Node",

@@ -5,0 +5,0 @@ "sideEffects": false,

@@ -1,2 +0,3 @@

import { Agent } from 'http';
import { Agent as HTTPAgent } from 'http';
import { Agent as HTTPSAgent } from 'https';
import { BodyPonyfillInit, PonyfillBody, PonyfillBodyOptions } from './Body.js';

@@ -9,3 +10,3 @@ import { PonyfillHeadersInit } from './Headers.js';

headersSerializer?: HeadersSerializer;
agent?: Agent;
agent?: HTTPAgent | HTTPSAgent | false;
};

@@ -29,4 +30,5 @@ type HeadersSerializer = (headers: Headers, onContentLength?: (contentLength: string) => void) => string[];

url: string;
agent?: Agent;
duplex: 'half' | 'full';
private _agent;
get agent(): false | HTTPAgent | undefined;
private _signal;

@@ -33,0 +35,0 @@ get signal(): AbortSignal;

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc