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
548
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.0.1-alpha-20221228110541-2aa6aea to 0.0.1-alpha-20221228115139-6b81aa1

1

Body.d.ts

@@ -34,3 +34,2 @@ /// <reference types="node" />

text(): Promise<string>;
readable(): Readable | null;
}

48

index.js

@@ -98,13 +98,9 @@ 'use strict';

let reader;
let started = false;
this.readable = new stream.Readable({
construct(callback) {
try {
read() {
if (!started) {
started = true;
reader = underlyingSource.getReader();
callback(null);
}
catch (err) {
callback(err);
}
},
read() {
reader

@@ -130,19 +126,12 @@ .read()

else {
let started = false;
this.readable = new stream.Readable({
async construct(callback) {
var _a;
try {
const controller = createController(0, this);
async read(desiredSize) {
var _a, _b;
const controller = createController(desiredSize, this);
if (!started) {
started = true;
await ((_a = underlyingSource === null || underlyingSource === void 0 ? void 0 : underlyingSource.start) === null || _a === void 0 ? void 0 : _a.call(underlyingSource, controller));
controller._flush();
callback(null);
}
catch (err) {
callback(err);
}
},
async read(desiredSize) {
var _a;
const controller = createController(desiredSize, this);
await ((_a = underlyingSource === null || underlyingSource === void 0 ? void 0 : underlyingSource.pull) === null || _a === void 0 ? void 0 : _a.call(underlyingSource, controller));
await ((_b = underlyingSource === null || underlyingSource === void 0 ? void 0 : underlyingSource.pull) === null || _b === void 0 ? void 0 : _b.call(underlyingSource, controller));
controller._flush();

@@ -498,11 +487,2 @@ },

}
readable() {
if (this.bodyType === BodyInitType.Readable) {
return this.bodyInit;
}
if (this._body != null) {
return this._body.readable;
}
return null;
}
}

@@ -741,3 +721,7 @@

const requestFn = getRequestFnForProtocol(protocol);
const nodeReadable = fetchRequest.body;
const nodeReadable = (fetchRequest.body != null
? 'pipe' in fetchRequest.body
? fetchRequest.body
: stream.Readable.from(fetchRequest.body)
: null);
const nodeHeaders = getHeadersObj(fetchRequest.headers);

@@ -744,0 +728,0 @@ const abortListener = function abortListener(event) {

{
"name": "@whatwg-node/node-fetch",
"version": "0.0.1-alpha-20221228110541-2aa6aea",
"version": "0.0.1-alpha-20221228115139-6b81aa1",
"description": "Fetch API implementation for Node",

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

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