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

@whatwg-node/server

Package Overview
Dependencies
Maintainers
1
Versions
726
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@whatwg-node/server - npm Package Compare versions

Comparing version 0.9.44 to 0.9.45-rc-20240726141659-db760872102e9eaeee7ae466944a23ed5192955a

17

cjs/utils.js

@@ -266,7 +266,22 @@ "use strict";

async function sendAsyncIterable(serverResponse, asyncIterable) {
let closed = false;
const closeEventListener = () => {
closed = true;
};
serverResponse.once('error', closeEventListener);
serverResponse.once('close', closeEventListener);
serverResponse.once('finish', () => {
serverResponse.removeListener('close', closeEventListener);
});
for await (const chunk of asyncIterable) {
if (closed) {
break;
}
if (!serverResponse
// @ts-expect-error http and http2 writes are actually compatible
.write(chunk)) {
break;
if (closed) {
break;
}
await new Promise(resolve => serverResponse.once('drain', resolve));
}

@@ -273,0 +288,0 @@ }

@@ -244,7 +244,22 @@ import { URL } from '@whatwg-node/fetch';

async function sendAsyncIterable(serverResponse, asyncIterable) {
let closed = false;
const closeEventListener = () => {
closed = true;
};
serverResponse.once('error', closeEventListener);
serverResponse.once('close', closeEventListener);
serverResponse.once('finish', () => {
serverResponse.removeListener('close', closeEventListener);
});
for await (const chunk of asyncIterable) {
if (closed) {
break;
}
if (!serverResponse
// @ts-expect-error http and http2 writes are actually compatible
.write(chunk)) {
break;
if (closed) {
break;
}
await new Promise(resolve => serverResponse.once('drain', resolve));
}

@@ -251,0 +266,0 @@ }

2

package.json
{
"name": "@whatwg-node/server",
"version": "0.9.44",
"version": "0.9.45-rc-20240726141659-db760872102e9eaeee7ae466944a23ed5192955a",
"description": "Fetch API compliant HTTP Server adapter",

@@ -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