adicionado testes de rotas e alrerado padroes
This commit is contained in:
parent
7e7cf8e7df
commit
f2eea9962b
8 changed files with 460 additions and 15 deletions
|
|
@ -106,10 +106,14 @@ export class TipagemRotas<T extends { [q: string]: any }> {
|
|||
** {q:"query"}
|
||||
*/
|
||||
|
||||
get parametros() {
|
||||
const url = new URL(
|
||||
typeof window !== "undefined" ? window.location.href : "http://localhost",
|
||||
)
|
||||
parametros(urlEntrada?: string) {
|
||||
const url = urlEntrada
|
||||
? new URL(urlEntrada)
|
||||
: new URL(
|
||||
typeof window !== "undefined"
|
||||
? window.location.href
|
||||
: "http://localhost",
|
||||
)
|
||||
const query = url.searchParams
|
||||
const queryObj = Object.fromEntries(query.entries())
|
||||
|
||||
|
|
@ -130,4 +134,5 @@ export class TipagemRotas<T extends { [q: string]: any }> {
|
|||
|
||||
return queryObj as Partial<T>
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue