From 2a26704cc65d7be9c5b5d2a52fb282209d7618c9 Mon Sep 17 00:00:00 2001 From: Etienne Donneger Date: Wed, 29 May 2024 15:51:39 -0400 Subject: [PATCH] Fix wrong `extends` logic for `ValidUserParams` (#34) --- src/types/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/api.ts b/src/types/api.ts index 44d9344..905fe3e 100644 --- a/src/types/api.ts +++ b/src/types/api.ts @@ -9,7 +9,7 @@ export type EndpointParameters = z.infer; export type UsageResponse = z.infer; -export type ValidUserParams = { path: unknown; } extends EndpointParameters ? +export type ValidUserParams = EndpointParameters extends { path: unknown; } ? // Combine path and query parameters only if path exists to prevent "never" on intersection Extract, { query: unknown; }>["query"] & Extract, { path: unknown; }>["path"] :