({ shape, error })
| 63 | const t = initTRPC.context<Context>().create({ |
| 64 | transformer: superjson, |
| 65 | errorFormatter({ shape, error }) { |
| 66 | return { |
| 67 | ...shape, |
| 68 | data: { |
| 69 | ...shape.data, |
| 70 | zodError: |
| 71 | error.cause instanceof ZodError ? z.flattenError(error.cause) : null, |
| 72 | }, |
| 73 | }; |
| 74 | }, |
| 75 | }); |
| 76 | |
| 77 | const enforceUserIsAuthed = t.middleware(async ({ ctx, next }) => { |
nothing calls this directly
no outgoing calls
no test coverage detected