Skip to content

Commit 84830fd

Browse files
authored
Merge pull request #265 from lorefnon/bigint-support
Support bigint in builtin serializer
2 parents 0f8ea50 + 9f3f094 commit 84830fd

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/runtime/browser/helper.jsonStringifyRecursive.ts

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ export function jsonStringifyRecursive(obj: unknown) {
99
// Store value in our collection
1010
cache.add(value);
1111
}
12+
if (typeof value === "bigint") {
13+
return `${value}`;
14+
}
1215
return value;
1316
});
1417
}

src/runtime/nodejs/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ export function transportJSON<LogObj>(json: LogObj & ILogObjMeta): void {
165165
// Store value in our collection
166166
cache.add(value);
167167
}
168+
if (typeof value === "bigint") {
169+
return `${value}`;
170+
}
168171
return value;
169172
});
170173
}

0 commit comments

Comments
 (0)