(data: any)
| 3 | * BigInt values are converted to objects with a special marker |
| 4 | */ |
| 5 | export function stringifyWithBigInt(data: any): string { |
| 6 | return JSON.stringify(data, (_key, value) => { |
| 7 | if (typeof value === 'bigint') { |
| 8 | return { |
| 9 | __type: 'bigint', |
| 10 | value: value.toString(), |
| 11 | } |
| 12 | } |
| 13 | return value |
| 14 | }) |
| 15 | } |
| 16 | |
| 17 | /** |
| 18 | * Parse JSON and restore BigInt values |
no outgoing calls
no test coverage detected