From 12290afad89909363e68b123b1b23250c66f5a0d Mon Sep 17 00:00:00 2001 From: malo Date: Sat, 4 Feb 2023 14:09:33 -0500 Subject: [PATCH 1/2] fix: prevent serializing symbols --- src/createTRPCMsw.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/createTRPCMsw.ts b/src/createTRPCMsw.ts index 86e5cd5..bbccc2c 100644 --- a/src/createTRPCMsw.ts +++ b/src/createTRPCMsw.ts @@ -82,7 +82,7 @@ const createTRPCMsw = ( type ExtractKeys = T[K] extends | BuildProcedure<'query', any, any> | BuildProcedure<'mutation', any, any> - | Router[any] + | AnyRouter ? K : never @@ -128,11 +128,11 @@ const createTRPCMsw = ( ? Mutation : T[K] extends BuildProcedure<'query', any, any> ? Query - : T[K] extends Router[any] + : T[K] extends AnyRouter ? MswTrpc : never - type MswTrpc = { + type MswTrpc = { [key in keyof T as ExtractKeys]: ExtractProcedureHandler } From f0b5b4671aee164ffaa722074c05d5a9f87cacd9 Mon Sep 17 00:00:00 2001 From: malo Date: Sat, 4 Feb 2023 14:11:12 -0500 Subject: [PATCH 2/2] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0a21bd9..e9d4344 100644 --- a/package.json +++ b/package.json @@ -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",