From d0cdfb6921a348f5b15657646d027e4a20a5ccda Mon Sep 17 00:00:00 2001 From: Jacob Gillespie Date: Sat, 4 Jun 2022 21:18:54 +0100 Subject: [PATCH] Fix param array types --- src/zap.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/zap.ts b/src/zap.ts index d631763..07cae3b 100644 --- a/src/zap.ts +++ b/src/zap.ts @@ -326,17 +326,17 @@ export function fromRequest a 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 + ? {[K in P]?: string[]} & RouteParams : T extends `${string}:${infer P}+/${infer Rest}` - ? {[K in P]: string} & RouteParams + ? {[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} + ? {[K in P]?: string[]} : T extends `${string}:${infer P}+` - ? {[K in P]: string} + ? {[K in P]: string[]} : T extends `${string}:${infer P}` ? {[K in P]: string} : {}