mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
18 lines
484 B
TypeScript
18 lines
484 B
TypeScript
import type { DataTransformer } from '@trpc/server';
|
|
import SuperJSON from 'superjson';
|
|
|
|
export const dataTransformer: DataTransformer = {
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
serialize: (data: any) => {
|
|
if (data instanceof FormData) {
|
|
return data;
|
|
}
|
|
|
|
return SuperJSON.serialize(data);
|
|
},
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
deserialize: (data: any) => {
|
|
return SuperJSON.deserialize(data);
|
|
},
|
|
};
|