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
713
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.57 to 0.9.58

20

cjs/createServerAdapter.js

@@ -68,14 +68,12 @@ "use strict";

for (const plugin of options.plugins) {
if (plugin != null) {
if (plugin.onRequest) {
onRequestHooks.push(plugin.onRequest);
}
if (plugin.onResponse) {
onResponseHooks.push(plugin.onResponse);
}
const disposeFn = plugin[disposablestack_1.DisposableSymbols.asyncDispose] || plugin[disposablestack_1.DisposableSymbols.dispose];
if (disposeFn != null) {
disposableStack.defer(disposeFn);
}
if (plugin.onRequest) {
onRequestHooks.push(plugin.onRequest);
}
if (plugin.onResponse) {
onResponseHooks.push(plugin.onResponse);
}
const disposeFn = plugin[disposablestack_1.DisposableSymbols.asyncDispose] || plugin[disposablestack_1.DisposableSymbols.dispose];
if (disposeFn != null) {
disposableStack.defer(disposeFn);
}
}

@@ -82,0 +80,0 @@ }

@@ -560,6 +560,3 @@ "use strict";

globalThis.process.once(event, function terminateHandler() {
return Promise.allSettled([...disposableStacks].map(stack => !stack.disposed &&
stack.disposeAsync().catch(e => {
console.error('Error while disposing:', e);
})));
return Promise.allSettled([...disposableStacks].map(stack => !stack.disposed && stack.disposeAsync()));
});

@@ -566,0 +563,0 @@ }

@@ -64,14 +64,12 @@ /* eslint-disable @typescript-eslint/ban-types */

for (const plugin of options.plugins) {
if (plugin != null) {
if (plugin.onRequest) {
onRequestHooks.push(plugin.onRequest);
}
if (plugin.onResponse) {
onResponseHooks.push(plugin.onResponse);
}
const disposeFn = plugin[DisposableSymbols.asyncDispose] || plugin[DisposableSymbols.dispose];
if (disposeFn != null) {
disposableStack.defer(disposeFn);
}
if (plugin.onRequest) {
onRequestHooks.push(plugin.onRequest);
}
if (plugin.onResponse) {
onResponseHooks.push(plugin.onResponse);
}
const disposeFn = plugin[DisposableSymbols.asyncDispose] || plugin[DisposableSymbols.dispose];
if (disposeFn != null) {
disposableStack.defer(disposeFn);
}
}

@@ -78,0 +76,0 @@ }

@@ -537,6 +537,3 @@ export function isAsyncIterable(body) {

globalThis.process.once(event, function terminateHandler() {
return Promise.allSettled([...disposableStacks].map(stack => !stack.disposed &&
stack.disposeAsync().catch(e => {
console.error('Error while disposing:', e);
})));
return Promise.allSettled([...disposableStacks].map(stack => !stack.disposed && stack.disposeAsync()));
});

@@ -543,0 +540,0 @@ }

{
"name": "@whatwg-node/server",
"version": "0.9.57",
"version": "0.9.58",
"description": "Fetch API compliant HTTP Server adapter",

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

import { FetchAPI, ServerAdapterRequestHandler, type ServerAdapterInitialContext } from '../types.js';
export type ServerAdapterPlugin<TServerContext = {}> = {
export interface ServerAdapterPlugin<TServerContext = {}> {
onRequest?: OnRequestHook<TServerContext & ServerAdapterInitialContext>;

@@ -7,3 +7,3 @@ onResponse?: OnResponseHook<TServerContext & ServerAdapterInitialContext>;

[Symbol.asyncDispose]?: () => PromiseLike<void> | void;
} | undefined;
}
export type OnRequestHook<TServerContext> = (payload: OnRequestEventPayload<TServerContext>) => Promise<void> | void;

@@ -10,0 +10,0 @@ export interface OnRequestEventPayload<TServerContext> {

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