MCPcopy Index your code
hub / github.com/TanStack/devtools / stringifyWithBigInt

Function stringifyWithBigInt

packages/event-bus/src/utils/json.ts:5–15  ·  view source on GitHub ↗
(data: any)

Source from the content-addressed store, hash-verified

3 * BigInt values are converted to objects with a special marker
4 */
5export 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

Callers 4

emitToClientsMethod · 0.90
emitToServerMethod · 0.90
json.test.tsFile · 0.90
emitEventToClientsMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected