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
736
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.4.6-alpha-20220922124249-c941ae6 to 0.4.6-alpha-20220922203506-26c69f1

5

index.d.ts
/// <reference types="node" />
/// <reference lib="webworker" />
import type { IncomingMessage, ServerResponse } from 'node:http';
import type { RequestListener, ServerResponse } from 'node:http';
import { NodeRequest } from './utils';

@@ -37,4 +37,3 @@ export interface ServerAdapterBaseObject<TServerContext, THandleRequest extends ServerAdapterRequestHandler<TServerContext> = ServerAdapterRequestHandler<TServerContext>> {

*/
requestListener(req: IncomingMessage, res: ServerResponse, ctx: TServerContext): void;
requestListener(req: IncomingMessage, res: ServerResponse, ...ctx: Partial<TServerContext>[]): void;
requestListener: RequestListener;
/**

@@ -41,0 +40,0 @@ * Proxy to requestListener to mimic Node middlewares

9

index.js

@@ -194,10 +194,5 @@ 'use strict';

}
async function requestListener(nodeRequest, serverResponse, ...ctx) {
async function requestListener(nodeRequest, serverResponse) {
const waitUntilPromises = [];
let serverContext = {};
if ((ctx === null || ctx === void 0 ? void 0 : ctx.length) > 0) {
serverContext = Object.assign({}, serverContext, ...ctx);
}
const response = await handleNodeRequest(nodeRequest, {
...serverContext,
req: nodeRequest,

@@ -281,3 +276,3 @@ res: serverResponse,

if (isReadable(input) && isServerResponse(initOrCtxOrRes)) {
return requestListener(input, initOrCtxOrRes, ...ctx);
return requestListener(input, initOrCtxOrRes);
}

@@ -284,0 +279,0 @@ if (isServerResponse(initOrCtxOrRes)) {

{
"name": "@whatwg-node/server",
"version": "0.4.6-alpha-20220922124249-c941ae6",
"version": "0.4.6-alpha-20220922203506-26c69f1",
"description": "Fetch API compliant HTTP Server adapter",

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