Skip to content

Commit

Permalink
bigInt instanceof fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pertsev committed Aug 8, 2019
1 parent 3b304ab commit 30ad8a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stringifybigint.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports.stringifyBigInts = stringifyBigInts;
module.exports.unstringifyBigInts = unstringifyBigInts;

function stringifyBigInts(o) {
if ((typeof(o) == "bigint") || (o instanceof bigInt)) {
if ((typeof(o) == "bigint") || o.isZero !== undefined) {
return o.toString(10);
} else if (Array.isArray(o)) {
return o.map(stringifyBigInts);
Expand Down

0 comments on commit 30ad8a5

Please sign in to comment.