Skip to content

MiddlewareOverride

type MiddlewareOverride = Exclude<HandlerResult, undefined | null> | void

Middleware hooks may either keep the current handler result by returning undefined / void, or replace it by returning any explicit handler result.

null is intentionally excluded: at runtime null is rejected by normalizeHandlerResult the same way undefined is. A middleware that wants to pass through the current result should return undefined / void.

Learn: Overview

Last updated: