forked from flightcontrolhq/superjson
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes flightcontrolhq#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.
- Loading branch information
1 parent
0ac86f0
commit 7311adc
Showing
3 changed files
with
19 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters