Skip to content

Workery / routing / RouteMatcher

Class: RouteMatcher<E>

routing.RouteMatcher

Type parameters

NameType
Eunknown

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new RouteMatcher<E>(): RouteMatcher<E>

Type parameters

NameType
Eunknown

Returns

RouteMatcher<E>

Defined in

src/routing.ts:206

Properties

routes

routes: Route<any, any, E>[]

Defined in

src/routing.ts:203


tree

tree: RouteNode<E>

Defined in

src/routing.ts:204

Accessors

length

get length(): number

Returns

number

Defined in

src/routing.ts:217

Methods

[iterator]

[iterator](): IterableIterator<Route<any, any, E>>

Returns

IterableIterator<Route<any, any, E>>

Defined in

src/routing.ts:211


get

get(path): RouteNode<E>

Parameters

NameType
pathstring

Returns

RouteNode<E>

Defined in

src/routing.ts:221


set

set(path, values): RouteNode<E>

Parameters

NameType
pathnull | string
valuesObject
values.middleware?Middleware<E>[]

Returns

RouteNode<E>

Defined in

src/routing.ts:239


push

push(...routes): number

Parameters

NameType
...routesRoute<any, any, E>[]

Returns

number

Defined in

src/routing.ts:247


match

match(method, path): [undefined | null | Route<any, any, E>, Record<string, string>, Middleware<E>[]]

Parameters

NameType
methodstring
pathstring

Returns

[undefined | null | Route<any, any, E>, Record<string, string>, Middleware<E>[]]

Defined in

src/routing.ts:256