Files
sign/packages/trpc/client/guards.ts
Adithya Krishna 2336e70495 chore: fix linting issues
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
2024-05-09 12:35:58 +05:30

8 lines
274 B
TypeScript

import { TRPCClientError } from '@trpc/client';
import type { AppRouter } from '../server/router';
export const isTRPCBadRequestError = (err: unknown): err is TRPCClientError<AppRouter> => {
return err instanceof TRPCClientError && err.shape?.code === 'BAD_REQUEST';
};