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
735
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.10.0-alpha-20241125135107-f57895e3cc8e9724899983c32c8b503cbd283558 to 0.10.0-alpha-20241125142132-d9f044a9ea5bb1f5c81f5bc09c613fdd5be81281

16

cjs/createServerAdapter.js

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

for (const plugin of options.plugins) {
if (plugin.onRequest) {
onRequestHooks.push(plugin.onRequest);
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.onResponse) {
onResponseHooks.push(plugin.onResponse);
}
}

@@ -76,0 +82,0 @@ }

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

for (const plugin of options.plugins) {
if (plugin.onRequest) {
onRequestHooks.push(plugin.onRequest);
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.onResponse) {
onResponseHooks.push(plugin.onResponse);
}
}

@@ -72,0 +78,0 @@ }

{
"name": "@whatwg-node/server",
"version": "0.10.0-alpha-20241125135107-f57895e3cc8e9724899983c32c8b503cbd283558",
"version": "0.10.0-alpha-20241125142132-d9f044a9ea5bb1f5c81f5bc09c613fdd5be81281",
"description": "Fetch API compliant HTTP Server adapter",

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

import { FetchAPI, ServerAdapterRequestHandler, type ServerAdapterInitialContext } from '../types.js';
export interface ServerAdapterPlugin<TServerContext = {}> {
export type ServerAdapterPlugin<TServerContext = {}> = {
onRequest?: OnRequestHook<TServerContext & ServerAdapterInitialContext>;
onResponse?: OnResponseHook<TServerContext & ServerAdapterInitialContext>;
}
[Symbol.dispose]?: () => void;
[Symbol.asyncDispose]?: () => PromiseLike<void> | void;
} | undefined;
export type OnRequestHook<TServerContext> = (payload: OnRequestEventPayload<TServerContext>) => Promise<void> | void;

@@ -7,0 +9,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