Skip to content

Commit

Permalink
fix: JSON.stringify cannot serialize BigInt.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewfian committed Apr 24, 2023
1 parent f4ba891 commit a7e546c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/pickletojson.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const replacer = (_, value) => {
if (value instanceof Set) {
return Array.from(value);
}
if (value === 'bigint') {
if (typeof value === 'bigint') {
return value.toString();
}
return value;
Expand Down
2 changes: 1 addition & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h1>Pickle Parser Demo</h1>
if (value instanceof Set) {
return Array.from(value);
}
if (value === 'bigint') {
if (typeof value === 'bigint') {
return value.toString();
}
return value;
Expand Down

0 comments on commit a7e546c

Please sign in to comment.