Files
pichunt/server/utils/json.ts
T
2025-08-09 14:58:38 +02:00

12 lines
241 B
TypeScript

import superjson from 'superjson';
export function sendJson<T extends object>(data: T) {
const hackData = {
...data,
toJSON() {
return this;
}
};
return superjson.stringify(hackData) as unknown as typeof hackData;
}