Revision 0.26.0

This commit is contained in:
sinclair
2023-03-23 00:21:08 +09:00
parent 4379e312a4
commit 5df81a9c8a

View File

@@ -81,7 +81,7 @@ import { TRPCError } from '@trpc/server'
export function RpcType<T extends TSchema>(schema: T) {
return (value: unknown) => {
if (Value.Check(schema, value)) return value
const { path, message } = check.Errors(value).First()!
const { path, message } = Value.Errors(schema, value).First()!
throw new TRPCError({ message: `${message} for ${path}`, code: 'BAD_REQUEST' })
}
}