Class: RouterRoot
Extends
Constructors
new RouterRoot()
new RouterRoot():
RouterRoot
Returns
Overrides
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterRoot.ts:8
Properties
dynamic
readonly
dynamic:boolean
Whether or not the branch is dynamic.
Inherited from
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:14
name
readonly
name:string
The name of the branch.
Inherited from
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:9
node
readonly
node:RouterNode
The node this branch is associated with.
Inherited from
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:24
parent
readonly
parent:null
|RouterBranch
The parent branch, if any.
Inherited from
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:19
supportedMethods
supportedMethods: readonly
string
[] =[]
The methods supported by the branch's node or any of its children.
Inherited from
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:29
Accessors
children
Get Signature
get children():
RouterBranch
[]
The branches the branch is associated with
Version
7.0.0
Returns
Inherited from
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:52
empty
Get Signature
get empty():
boolean
Whether or not the branch is empty
Version
7.0.0
Returns
boolean
Inherited from
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:60
path
Get Signature
get path():
string
The path representing this branch
Version
7.0.0
Returns
string
Overrides
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterRoot.ts:33
Methods
_add()
protected
_add(parts
: readonlystring
[],index
:number
,route
:Route
<RouteOptions
>):RouterNode
Parameters
Parameter | Type |
---|---|
parts | readonly string [] |
index | number |
route | Route <RouteOptions > |
Returns
Inherited from
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:107
_find()
protected
_find(parts
: readonlystring
[],index
:number
):null
|RouterBranch
Parameters
Parameter | Type |
---|---|
parts | readonly string [] |
index | number |
Returns
null
| RouterBranch
Inherited from
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:187
_performAdd()
protected
_performAdd(parts
: readonlystring
[],index
:number
,route
:Route
<RouteOptions
>):RouterNode
Parameters
Parameter | Type |
---|---|
parts | readonly string [] |
index | number |
route | Route <RouteOptions > |
Returns
Inherited from
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:119
_performRemove()
protected
_performRemove(parts
: readonlystring
[],index
:number
,route
:Route
<RouteOptions
>):boolean
Parameters
Parameter | Type |
---|---|
parts | readonly string [] |
index | number |
route | Route <RouteOptions > |
Returns
boolean
Inherited from
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:151
_remove()
protected
_remove(parts
: readonlystring
[],index
:number
,route
:Route
<RouteOptions
>):boolean
Parameters
Parameter | Type |
---|---|
parts | readonly string [] |
index | number |
route | Route <RouteOptions > |
Returns
boolean
Inherited from
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:113
_updateSupportedChildrenMethods()
protected
_updateSupportedChildrenMethods():void
Returns
void
Inherited from
RouterBranch
._updateSupportedChildrenMethods
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:200
add()
add(
route
:Route
<RouteOptions
>):RouterNode
Adds a route to the branch
Parameters
Parameter | Type | Description |
---|---|---|
route | Route <RouteOptions > | The route to add |
Returns
The node the route was added to
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterRoot.ts:18
find()
find(
parts
: readonlystring
[]):null
|RouterBranch
Tries to find a branch given a path
Parameters
Parameter | Type | Description |
---|---|---|
parts | readonly string [] | The parts of a path to find a node from |
Returns
null
| RouterBranch
The branch found, or null if not found
Version
7.0.0
Inherited from
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:71
matches()
matches(
name
:string
):boolean
Checks if the given name matches the branch
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The name to match |
Returns
boolean
Whether or not the branch matches the name
Version
7.0.0
Inherited from
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:82
nodes()
nodes():
IterableIterator
<RouterNode
>
Returns
IterableIterator
<RouterNode
>
Inherited from
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:96
remove()
remove(
route
:Route
<RouteOptions
>):boolean
Removes a route from the branch
Parameters
Parameter | Type | Description |
---|---|---|
route | Route <RouteOptions > | The route to remove |
Returns
boolean
Whether or not the route was removed
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterRoot.ts:28
toString()
toString():
string
Returns the string representation of the branch
Returns
string
The string representation of the branch
Version
7.0.0
Overrides
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterRoot.ts:37
extractMethod()
static
extractMethod(path
:string
| readonlystring
[]):null
|"GET"
|"HEAD"
|"POST"
|"PUT"
|"DELETE"
|"CONNECT"
|"OPTIONS"
|"TRACE"
|"PATCH"
|"ACL"
|"BIND"
|"CHECKOUT"
|"COPY"
|"LINK"
|"LOCK"
|"M-SEARCH"
|"MERGE"
|"MKACTIVITY"
|"MKCALENDAR"
|"MKCOL"
|"MOVE"
|"NOTIFY"
|"PROPFIND"
|"PROPPATCH"
|"PURGE"
|"QUERY"
|"REBIND"
|"REPORT"
|"SEARCH"
|"SOURCE"
|"SUBSCRIBE"
|"UNBIND"
|"UNLINK"
|"UNLOCK"
|"UNSUBSCRIBE"
Parameters
Parameter | Type |
---|---|
path | string | readonly string [] |
Returns
null
| "GET"
| "HEAD"
| "POST"
| "PUT"
| "DELETE"
| "CONNECT"
| "OPTIONS"
| "TRACE"
| "PATCH"
| "ACL"
| "BIND"
| "CHECKOUT"
| "COPY"
| "LINK"
| "LOCK"
| "M-SEARCH"
| "MERGE"
| "MKACTIVITY"
| "MKCALENDAR"
| "MKCOL"
| "MOVE"
| "NOTIFY"
| "PROPFIND"
| "PROPPATCH"
| "PURGE"
| "QUERY"
| "REBIND"
| "REPORT"
| "SEARCH"
| "SOURCE"
| "SUBSCRIBE"
| "UNBIND"
| "UNLINK"
| "UNLOCK"
| "UNSUBSCRIBE"
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterRoot.ts:84
makeRoutePathForPiece()
static
makeRoutePathForPiece(directories
: readonlystring
[],name
:string
):string
Parameters
Parameter | Type |
---|---|
directories | readonly string [] |
name | string |
Returns
string
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterRoot.ts:41
normalize()
static
normalize(path
:undefined
|null
|string
):string
[]
Parameters
Parameter | Type |
---|---|
path | undefined | null | string |
Returns
string
[]
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterRoot.ts:61