Skip to content

Commit

Permalink
Merge pull request #265 from lorefnon/bigint-support
Browse files Browse the repository at this point in the history
Support bigint in builtin serializer
  • Loading branch information
terehov authored Nov 6, 2023
2 parents 0f8ea50 + 9f3f094 commit 84830fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/runtime/browser/helper.jsonStringifyRecursive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export function jsonStringifyRecursive(obj: unknown) {
// Store value in our collection
cache.add(value);
}
if (typeof value === "bigint") {
return `${value}`;
}
return value;
});
}
3 changes: 3 additions & 0 deletions src/runtime/nodejs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ export function transportJSON<LogObj>(json: LogObj & ILogObjMeta): void {
// Store value in our collection
cache.add(value);
}
if (typeof value === "bigint") {
return `${value}`;
}
return value;
});
}
Expand Down

0 comments on commit 84830fd

Please sign in to comment.