add buffer support extension

This commit is contained in:
Brandon Egger 2023-08-22 14:15:46 -05:00
parent 8c7682251c
commit 712e263bfa

View File

@ -17,6 +17,15 @@ const getBaseUrl = () => {
return `http://localhost:${process.env.PORT ?? 3000}`; // dev SSR should use localhost
};
superjson.registerCustom<Buffer, number[]>(
{
isApplicable: (v): v is Buffer => v instanceof Buffer,
serialize: v => [...v],
deserialize: v => Buffer.from(v)
},
"buffer"
);
/** A set of type-safe react-query hooks for your tRPC API. */
export const api = createTRPCNext<AppRouter>({
config() {