Skip to content

Commit

Permalink
[Fix] use has-bigints for more robust BigInt detection
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Aug 6, 2021
1 parent 3b44080 commit 7bb9d7a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion index.js
@@ -1,6 +1,8 @@
'use strict';

if (typeof BigInt === 'function') {
var hasBigInts = require('has-bigints')();

if (hasBigInts) {
var bigIntValueOf = BigInt.prototype.valueOf;
var tryBigInt = function tryBigIntObject(value) {
try {
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -38,6 +38,7 @@
"aud": "^1.1.5",
"auto-changelog": "^2.2.1",
"eslint": "^7.25.0",
"has-bigints": "^1.0.1",
"has-symbols": "^1.0.2",
"nyc": "^10.3.2",
"object-inspect": "^1.10.2",
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Expand Up @@ -2,7 +2,7 @@

var test = require('tape');
var inspect = require('object-inspect');
var hasBigInts = typeof BigInt === 'function';
var hasBigInts = require('has-bigints')();
var hasSymbols = require('has-symbols')();
var hasToStringTag = require('has-tostringtag/shams')();

Expand Down

0 comments on commit 7bb9d7a

Please sign in to comment.