Class: RouterBranch
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:5
Extended by
Constructors
new RouterBranch()
new RouterBranch(
name
:string
,dynamic
:boolean
,parent
:null
|RouterBranch
):RouterBranch
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:34
Parameters
Parameter | Type |
---|---|
name | string |
dynamic | boolean |
parent | null | RouterBranch |
Returns
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
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:14
Whether or not the branch is dynamic.
name
readonly
name:string
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:9
The name of the branch.
node
readonly
node:RouterNode
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:24
The node this branch is associated with.
parent
readonly
parent:null
|RouterBranch
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:19
The parent branch, if any.
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.
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
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
path
Get Signature
get path():
string
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:44
The path representing this branch
Version
7.0.0
Returns
string
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
_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
_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
_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
_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
_updateSupportedChildrenMethods()
protected
_updateSupportedChildrenMethods():void
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:200
Returns
void
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
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
nodes()
nodes():
IterableIterator
<RouterNode
>
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:96
Returns
IterableIterator
<RouterNode
>
toString()
toString():
string
Defined in: projects/plugins/packages/api/src/lib/structures/router/RouterBranch.ts:92
Returns the string representation of the branch
Returns
string
The string representation of the branch
Version
7.0.0