melhorias em contrução de rotas
This commit is contained in:
parent
5ed3207ecf
commit
cb86027ff9
5 changed files with 7 additions and 5 deletions
|
|
@ -22,7 +22,7 @@ export class TipagemRotas<T extends { [q: string]: string | undefined }> {
|
|||
acaoIr,
|
||||
rotulo,
|
||||
}: {
|
||||
caminho: string[] | string
|
||||
caminho: (string | null | undefined)[] | string
|
||||
acaoIr?: undefined | ((endereco: string) => undefined)
|
||||
|
||||
/** Rotulo da página
|
||||
|
|
@ -33,6 +33,8 @@ export class TipagemRotas<T extends { [q: string]: string | undefined }> {
|
|||
this._acaoIr = acaoIr
|
||||
|
||||
this._partesCaminho = (Array.isArray(caminho) ? caminho : [caminho])
|
||||
.filter(Boolean)
|
||||
.map((a) => String(a))
|
||||
.flatMap((a) => a.split("/"))
|
||||
.filter(Boolean)
|
||||
this.rotulo = rotulo
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue