chore: update for deno 1.33.x (#1139)

Co-authored-by: Luca Casonato <hello@lcas.dev>
This commit is contained in:
Marvin Hagemeister
2023-04-30 10:30:30 +02:00
committed by GitHub
co-authored by Luca Casonato
parent ab73242933
commit c224db7cb7
6 changed files with 14 additions and 7 deletions
+8 -3
View File
@@ -146,10 +146,15 @@ export function router<T = unknown>(
const res = route.pattern.exec(req.url);
if (res !== null) {
const groups = res?.pathname.groups ?? {};
const groups: Record<string, string> = {};
const matched = res?.pathname.groups;
for (const key in groups) {
groups[key] = decodeURIComponent(groups[key]);
for (const key in matched) {
const value = matched[key];
if (value !== undefined) {
groups[key] = decodeURIComponent(value);
}
}
for (const [method, handler] of Object.entries(route.methods)) {