From 30ad8a5db2b905b644c118b81cffa3f5bf4affaf Mon Sep 17 00:00:00 2001 From: Alexey Date: Thu, 8 Aug 2019 22:16:05 +0300 Subject: [PATCH] bigInt instanceof fix --- src/stringifybigint.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stringifybigint.js b/src/stringifybigint.js index 1eb723c..c566259 100644 --- a/src/stringifybigint.js +++ b/src/stringifybigint.js @@ -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);