Documentation
    Preparing search index...

    Class MiddlewareStack<Input, Output, Context>

    Type Parameters

    • Input extends object = any
    • Output extends object = any
    • Context extends object = object
    Index

    Constructors

    Properties

    names: Set<string> = ...
    stack: Middleware<Input, Output, Context>[] = []

    Accessors

    • get height(): number

      Gives the number of entries of the stack.

      Returns number

      The height of the stack.

    Methods

    • Adds the middleware name to the local cache of middleware for quicker middleware validation.

      Parameters

      • name: string

        A middleware name to cache to check for name uniqueness on the stack.

      • silent: boolean = true

        An option to make this method go "BOOM!"

      Returns boolean

      An indicator that the name was successfully added to stack or that it already exists.

    • Remove deletes a middleware from the stack and cache.

      Parameters

      • name: string

        The name of the middleware to remove.

      Returns this

      The reference to this instance.

    • RemoveByTag deletes the middleware function(s) that have the given tag.

      Parameters

      • tag: string

        Indicates the middleware to remove by tag.

      Returns this

      The reference to this instance.

    • Provides a pluggable interface for manipulating this middleware stack instance. It should be used when performing multiple operations on a class instance in a transaction-like manner.

      Parameters

      Returns this

      The reference to this instance.