Class: RouterBranch
Extended by
Constructors
new RouterBranch()
new RouterBranch(
name
:string
,dynamic
:boolean
,parent
:null
|RouterBranch
):RouterBranch
Parameters
Parameter | Type |
---|---|
name | string |
dynamic | boolean |
parent | null | RouterBranch |
Returns
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:34
Properties
_dynamicChild
private
_dynamicChild:null
|RouterBranch
=null
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:32
_staticChildren
private
_staticChildren:RouterBranch
[] =[]
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:31
dynamic
readonly
dynamic:boolean
Whether or not the branch is dynamic.
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:14
name
readonly
name:string
The name of the branch.
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:9
node
readonly
node:RouterNode
The node this branch is associated with.
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:24
parent
readonly
parent:null
|RouterBranch
The parent branch, if any.
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.
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
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
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
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:44
Methods
_add()
protected
_add(parts
: readonlystring
[],index
:number
,route
:Route
<RouteOptions
>):RouterNode
Parameters
Parameter | Type |
---|---|
parts | readonly string [] |
index | number |
route | Route <RouteOptions > |
Returns
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
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
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
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
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:113
_updateSupportedChildrenMethods()
protected
_updateSupportedChildrenMethods():void
Returns
void
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:200
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
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
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:82
nodes()
nodes():
IterableIterator
<RouterNode
>
Returns
IterableIterator
<RouterNode
>
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:96
toString()
toString():
string
Returns the string representation of the branch
Returns
string
The string representation of the branch
Version
7.0.0
Defined in
projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:92