You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
unfortunatly ran into issue with serialization of the Decimal data type as shown by the below error:
would be great if superjson supported this? or am I doing something wrong?
I'd rather not resort to have to using maps as shown in this fix prisma/prisma-examples#3047 and our current fallback of JSON.parse(JSON.stringify(result) is somewhat inefficient I imagine
The text was updated successfully, but these errors were encountered:
Hi @Skn0tt , sounds good - a bit tight with time at the moment (since this issue isn't our highest priority atm) but yeah this is something I'll likely look into - will try to contribute a PR when I can!
Fixesflightcontrolhq#152
Add support for serialization of Decimal data type.
* **src/transformer.ts**
- Import the Decimal class from the `decimal.js` library.
- Add a transformation rule for the Decimal data type.
- Update the `compositeRules` array to include the new Decimal transformation rule.
* **src/index.ts**
- Register a custom transformer for the Decimal data type in the `SuperJSON` class constructor.
* **src/index.test.ts**
- Update the test case for Decimal.js to use the built-in transformer.
tried to use superjson as a solution for this issue vercel/next.js#11993, as suggested in https://github.com/blitz-js/superjson#using-with-nextjs
unfortunatly ran into issue with serialization of the Decimal data type as shown by the below error:
would be great if superjson supported this? or am I doing something wrong?
I'd rather not resort to have to using maps as shown in this fix prisma/prisma-examples#3047 and our current fallback of
JSON.parse(JSON.stringify(result)
is somewhat inefficient I imagineThe text was updated successfully, but these errors were encountered: