Skip to main content

Class: MiddlewareStore

Defined in: projects/plugins/packages/api/src/lib/structures/MiddlewareStore.ts:7

Since

1.0.0

Extends

Constructors

new MiddlewareStore()

new MiddlewareStore(): MiddlewareStore

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

Returns

MiddlewareStore

Overrides

Store<Middleware, 'middlewares'>.constructor

Properties

sortedMiddlewares

readonly sortedMiddlewares: Middleware[] = []

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

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

Methods

clear()

clear(): void

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

Returns

void

Overrides

Store.clear


delete()

delete(key: string): boolean

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

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


run()

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

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

Parameters

ParameterType
requestApiRequest
responseResponse

Returns

Promise<void>


set()

set(key: string, value: Middleware): this

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

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

Returns

this

Overrides

Store.set