Skip to main content

Class: MiddlewareStore

Since

1.0.0

Extends

Constructors

new MiddlewareStore()

new MiddlewareStore(): MiddlewareStore

Returns

MiddlewareStore

Overrides

Store<Middleware, 'middlewares'>.constructor

Defined in

projects/plugins/packages/api/src/lib/structures/MiddlewareStore.ts:13

Properties

sortedMiddlewares

readonly sortedMiddlewares: Middleware<MiddlewareOptions>[] = []

The sorted middlewares, in ascending order of see Middleware.position.

Defined in

projects/plugins/packages/api/src/lib/structures/MiddlewareStore.ts:11

Methods

clear()

clear(): void

Returns

void

Overrides

Store.clear

Defined in

projects/plugins/packages/api/src/lib/structures/MiddlewareStore.ts:43


delete()

delete(key: string): boolean

Parameters

ParameterType
keystring

Returns

boolean

true if an element in the Map existed and has been removed, or false if the element does not exist.

Overrides

Store.delete

Defined in

projects/plugins/packages/api/src/lib/structures/MiddlewareStore.ts:34


run()

run(request: ApiRequest, response: Response): Promise<void>

Parameters

ParameterType
requestApiRequest
responseResponse

Returns

Promise<void>

Defined in

projects/plugins/packages/api/src/lib/structures/MiddlewareStore.ts:17


set()

set(key: string, value: Middleware<MiddlewareOptions>): this

Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.

Parameters

ParameterType
keystring
valueMiddleware<MiddlewareOptions>

Returns

this

Overrides

Store.set

Defined in

projects/plugins/packages/api/src/lib/structures/MiddlewareStore.ts:24