Skip to content

Commit d9d9233

Browse files
Retrigger stuck GH jobs
1 parent a7a3776 commit d9d9233

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/sdk/utils/safeJsonStringify.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Supports stringifying an object with bigints, treating bigints as strings.
3+
* @param obj - The object to stringify
4+
* @returns The stringified object
5+
*/
6+
export const safeJsonStringify = (obj: any): string =>
7+
JSON.stringify(
8+
obj,
9+
(_, value) => (typeof value === "bigint" ? value.toString() : value),
10+
2
11+
);

0 commit comments

Comments
 (0)