diff --git a/src/zap.ts b/src/zap.ts index 5b8e8ed..d631763 100644 --- a/src/zap.ts +++ b/src/zap.ts @@ -325,10 +325,18 @@ export function fromRequest a // TODO: can we support more param types here? export type RouteParams = T extends `${string}:${infer P}?/${infer Rest}` ? {[K in P]?: string} & RouteParams + : T extends `${string}:${infer P}*/${infer Rest}` + ? {[K in P]?: string} & RouteParams + : T extends `${string}:${infer P}+/${infer Rest}` + ? {[K in P]: string} & RouteParams : T extends `${string}:${infer P}/${infer Rest}` ? {[K in P]: string} & RouteParams : T extends `${string}:${infer P}?` ? {[K in P]?: string} + : T extends `${string}:${infer P}*` + ? {[K in P]?: string} + : T extends `${string}:${infer P}+` + ? {[K in P]: string} : T extends `${string}:${infer P}` ? {[K in P]: string} : {}