diff --git a/src/types.ts b/src/types.ts index cb11ef9..65b9e2f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -54,7 +54,8 @@ type GetResultsType = T extends { data: any[] } ? T["data"][KnownKeysMatching] : never; -type NormalizeResponse = T & { data: GetResultsType }; +// Ensure that the type always returns the paginated results and not a mix of paginated results and the response object +type NormalizeResponse = Omit & { data: GetResultsType }; type DataType = "data" extends keyof T ? T["data"] : unknown;