Skip to content

Commit

Permalink
Merge pull request #8 from actual-experience/fix-conditional
Browse files Browse the repository at this point in the history
Move conditional type to fix inference
  • Loading branch information
EskiMojo14 authored Sep 29, 2023
2 parents 42f8f47 + 776897d commit b8df9b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import type {
import type { SerializedError, WrappedConstructor } from './utils';
import type {
ConditionalBool,
Id,
IfMaybeUndefined,
IsAny,
MaybePromise,
Expand Down Expand Up @@ -43,9 +42,9 @@ export type HandlerData<
/** The original request object */
req: NextApiRequest;
/** Request body, parsed with parsers.body */
body: Body;
body: IsAny<Body, unknown, Body>;
/** Request query, parsed with parsers.query */
query: Query;
query: IsAny<Query, NextApiRequest['query'], Query>;
/**
* Returned value from authentication function.
*
Expand Down Expand Up @@ -189,8 +188,8 @@ export type MethodBuilder<
<ReturnType = unknown>(): <Body = unknown, Query = NextApiRequest['query']>(
definition: MethodDefinition<
ReturnType,
IsAny<Body, unknown, Body>,
IsAny<Query, NextApiRequest['query'], Query>,
Body,
Query,
Authentication,
ExtraApi
>
Expand Down

0 comments on commit b8df9b8

Please sign in to comment.