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.18-alpha-20240726144438-d85e825aca3e8ac57c7758d5ec88ed5c27358fcc to 0.5.18-alpha-20240726152542-5f316782934ecd79aef9ea23affd78bb05e47164

33

cjs/utils.js

@@ -16,16 +16,27 @@ "use strict";

const originalReadableFromWeb = stream_1.Readable.fromWeb;
if (originalReadableFromWeb.name !== 'ReadableFromWebPatchedByWhatWgNode') {
stream_1.Readable.fromWeb = function ReadableFromWebPatchedByWhatWgNode(stream) {
if (stream.readable != null) {
return stream.readable;
// eslint-disable-next-line no-inner-declarations
function ReadableFromWebPatchedByWhatWgNode(stream) {
if (stream.readable instanceof stream_1.Readable) {
return stream.readable;
}
return originalReadableFromWeb(stream);
}
if (typeof jest === 'object' &&
typeof afterEach === 'function' &&
originalReadableFromWeb.name !== 'ReadableFromWebPatchedByWhatWgNode') {
// To relax jest, we should remove the patch after each test
beforeEach(() => {
if (stream_1.Readable.fromWeb.name !== 'ReadableFromWebPatchedByWhatWgNode') {
stream_1.Readable.fromWeb = ReadableFromWebPatchedByWhatWgNode;
}
return originalReadableFromWeb(stream);
};
if (typeof jest === 'object' && typeof afterEach === 'function') {
// To relax jest, we should remove the patch after each test
afterEach(() => {
});
afterEach(() => {
if (stream_1.Readable.fromWeb.name === 'ReadableFromWebPatchedByWhatWgNode') {
stream_1.Readable.fromWeb = originalReadableFromWeb;
});
}
}
});
}
else if (originalReadableFromWeb.name !== 'ReadableFromWebPatchedByWhatWgNode') {
stream_1.Readable.fromWeb = ReadableFromWebPatchedByWhatWgNode;
}
}

@@ -32,0 +43,0 @@ catch (e) {

@@ -8,16 +8,27 @@ import { Readable } from 'stream';

const originalReadableFromWeb = Readable.fromWeb;
if (originalReadableFromWeb.name !== 'ReadableFromWebPatchedByWhatWgNode') {
Readable.fromWeb = function ReadableFromWebPatchedByWhatWgNode(stream) {
if (stream.readable != null) {
return stream.readable;
// eslint-disable-next-line no-inner-declarations
function ReadableFromWebPatchedByWhatWgNode(stream) {
if (stream.readable instanceof Readable) {
return stream.readable;
}
return originalReadableFromWeb(stream);
}
if (typeof jest === 'object' &&
typeof afterEach === 'function' &&
originalReadableFromWeb.name !== 'ReadableFromWebPatchedByWhatWgNode') {
// To relax jest, we should remove the patch after each test
beforeEach(() => {
if (Readable.fromWeb.name !== 'ReadableFromWebPatchedByWhatWgNode') {
Readable.fromWeb = ReadableFromWebPatchedByWhatWgNode;
}
return originalReadableFromWeb(stream);
};
if (typeof jest === 'object' && typeof afterEach === 'function') {
// To relax jest, we should remove the patch after each test
afterEach(() => {
});
afterEach(() => {
if (Readable.fromWeb.name === 'ReadableFromWebPatchedByWhatWgNode') {
Readable.fromWeb = originalReadableFromWeb;
});
}
}
});
}
else if (originalReadableFromWeb.name !== 'ReadableFromWebPatchedByWhatWgNode') {
Readable.fromWeb = ReadableFromWebPatchedByWhatWgNode;
}
}

@@ -24,0 +35,0 @@ catch (e) {

{
"name": "@whatwg-node/node-fetch",
"version": "0.5.18-alpha-20240726144438-d85e825aca3e8ac57c7758d5ec88ed5c27358fcc",
"version": "0.5.18-alpha-20240726152542-5f316782934ecd79aef9ea23affd78bb05e47164",
"description": "Fetch API implementation for Node",

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

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