add buffer support extension
This commit is contained in:
parent
8c7682251c
commit
712e263bfa
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user