From active-helpers
serializeDecimals: generated from the source of active-grid.
Exported by @workspace/. Generated from the package source; part of the index of every export.
Functions, hooks and constants#
- Type
<T>(obj: T) => T
Recursively convert decimal.js instances (Prisma Decimal) to plain numbers, so a query result can cross the server-to-client boundary, which does not serialize class instances. The conversion is to and therefore lossy beyond double precision; a caller that needs exact digits must convert to a string itself.
Arrays and plain objects are rebuilt recursively (a __ key stays an own property); Date and Reg instances are returned unchanged.