Class: RouterRoot
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterRoot.ts:7
Extends
Constructors
new RouterRoot()
new RouterRoot():
RouterRoot
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterRoot.ts:8
Returns
Overrides
Properties
dynamic
readonly
dynamic:boolean
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:14
Whether or not the branch is dynamic.
Inherited from
name
readonly
name:string
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:9
The name of the branch.
Inherited from
node
readonly
node:RouterNode
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:24
The node this branch is associated with.
Inherited from
parent
readonly
parent:null
|RouterBranch
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:19
The parent branch, if any.
Inherited from
supportedMethods
supportedMethods: readonly
string
[] =[]
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:29
The methods supported by the branch's node or any of its children.
Inherited from
Accessors
children
Get Signature
get children():
RouterBranch
[]
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:52
The branches the branch is associated with
Version
7.0.0
Returns
Inherited from
empty
Get Signature
get empty():
boolean
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:60
Whether or not the branch is empty
Version
7.0.0
Returns
boolean
Inherited from
path
Get Signature
get path():
string
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterRoot.ts:33
The path representing this branch
Version
7.0.0
Returns
string
Overrides
Methods
_add()
protected
_add(parts
: readonlystring
[],index
:number
,route
:Route
):RouterNode
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:107
Parameters
Parameter | Type |
---|---|
parts | readonly string [] |
index | number |
route | Route |
Returns
Inherited from
_find()
protected
_find(parts
: readonlystring
[],index
:number
):null
|RouterBranch
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:187
Parameters
Parameter | Type |
---|---|
parts | readonly string [] |
index | number |
Returns
null
| RouterBranch
Inherited from
_performAdd()
protected
_performAdd(parts
: readonlystring
[],index
:number
,route
:Route
):RouterNode
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:119
Parameters
Parameter | Type |
---|---|
parts | readonly string [] |
index | number |
route | Route |
Returns
Inherited from
_performRemove()
protected
_performRemove(parts
: readonlystring
[],index
:number
,route
:Route
):boolean
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:151
Parameters
Parameter | Type |
---|---|
parts | readonly string [] |
index | number |
route | Route |
Returns
boolean
Inherited from
_remove()
protected
_remove(parts
: readonlystring
[],index
:number
,route
:Route
):boolean
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:113
Parameters
Parameter | Type |
---|---|
parts | readonly string [] |
index | number |
route | Route |
Returns
boolean
Inherited from
_updateSupportedChildrenMethods()
protected
_updateSupportedChildrenMethods():void
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:200
Returns
void
Inherited from
RouterBranch
._updateSupportedChildrenMethods
add()
add(
route
:Route
):RouterNode
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterRoot.ts:18
Adds a route to the branch
Parameters
Parameter | Type | Description |
---|---|---|
route | Route | The route to add |
Returns
The node the route was added to
find()
find(
parts
: readonlystring
[]):null
|RouterBranch
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:71
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
matches()
matches(
name
:string
):boolean
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:82
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
nodes()
nodes():
IterableIterator
<RouterNode
>
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:96
Returns
IterableIterator
<RouterNode
>
Inherited from
remove()
remove(
route
:Route
):boolean
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterRoot.ts:28
Removes a route from the branch
Parameters
Parameter | Type | Description |
---|---|---|
route | Route | The route to remove |
Returns
boolean
Whether or not the route was removed
toString()
toString():
string
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterRoot.ts:37
Returns the string representation of the branch
Returns
string
The string representation of the branch
Version
7.0.0
Overrides
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"
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterRoot.ts:84
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"
makeRoutePathForPiece()
static
makeRoutePathForPiece(directories
: readonlystring
[],name
:string
):string
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterRoot.ts:41
Parameters
Parameter | Type |
---|---|
directories | readonly string [] |
name | string |
Returns
string
normalize()
static
normalize(path
:undefined
|null
|string
):string
[]
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterRoot.ts:61
Parameters
Parameter | Type |
---|---|
path | undefined | null | string |
Returns
string
[]