Skip to content

Commit

Permalink
Fix/prevent serializing symbols (#3)
Browse files Browse the repository at this point in the history
* fix: prevent serializing symbols

* bump version

---------

Co-authored-by: malo <[email protected]>
  • Loading branch information
maloguertin and malo authored Feb 4, 2023
1 parent f89e400 commit ba874a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "msw-trpc",
"version": "1.1.1",
"version": "1.1.2",
"description": "Trpc API for Mock Service Worker (MSW).",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions src/createTRPCMsw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const createTRPCMsw = <Router extends AnyRouter>(
type ExtractKeys<T extends Router[any], K extends keyof T = keyof T> = T[K] extends
| BuildProcedure<'query', any, any>
| BuildProcedure<'mutation', any, any>
| Router[any]
| AnyRouter
? K
: never

Expand Down Expand Up @@ -128,11 +128,11 @@ const createTRPCMsw = <Router extends AnyRouter>(
? Mutation<T, K>
: T[K] extends BuildProcedure<'query', any, any>
? Query<T, K>
: T[K] extends Router[any]
: T[K] extends AnyRouter
? MswTrpc<T[K]>
: never

type MswTrpc<T extends Router | Router[any]> = {
type MswTrpc<T extends Router | AnyRouter> = {
[key in keyof T as ExtractKeys<T, key>]: ExtractProcedureHandler<T, key>
}

Expand Down

0 comments on commit ba874a3

Please sign in to comment.