Type alias Middleware<I, O, II, OO>

Middleware<I, O, II, OO>: ((input, next) => Promise<O>)

A middleware is a function that encapsulates another function and transforms it

Type Parameters

  • I

    Input type of the middleware

  • O

    (Tranformed) Output type of the middleware

  • II

    (Tranformed) Input type of the encapsulated function

  • OO

    Output type of the encapsulated function

Type declaration

Remarks

They can both transform the input and output of the function, and add additional functionality around it.

Generated using TypeDoc