melhoria de tipagem
This commit is contained in:
parent
9c06033134
commit
46869e2ed0
4 changed files with 14 additions and 4 deletions
|
|
@ -32,7 +32,12 @@ export class TipagemRotas<T extends { [q: string]: string | undefined }> {
|
|||
** "/caminho"
|
||||
*/
|
||||
get caminho() {
|
||||
return `/${this._partesCaminho.join("/")}`
|
||||
let ret = `/${this._partesCaminho.join("/")}`
|
||||
ret = ret.replace(/\/+/g, "/")
|
||||
if (ret.length > 1 && ret.endsWith("/")) {
|
||||
ret = ret.slice(0, -1)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
/** Define o caminho completo da rota
|
||||
** mCaminho.caminho = "/novoCaminho"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue