Skip to content

Commit 08fbf94

Browse files
committed
fix: apply review feedback
1 parent c785fec commit 08fbf94

File tree

1 file changed

+12
-2
lines changed
  • lib/node_modules/@stdlib/assert/has-bigint-support/lib

1 file changed

+12
-2
lines changed

lib/node_modules/@stdlib/assert/has-bigint-support/lib/main.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@
2020

2121
// MODULES //
2222

23-
var BigInt = require( '@stdlib/bigint/ctor' );
23+
var getGlobal = require( '@stdlib/utils/global' );
24+
25+
26+
// VARIABLES //
27+
28+
var Global = getGlobal();
2429

2530

2631
// MAIN //
@@ -35,7 +40,12 @@ var BigInt = require( '@stdlib/bigint/ctor' );
3540
* // returns <boolean>
3641
*/
3742
function hasBigIntSupport() {
38-
return ( BigInt !== null );
43+
return (
44+
typeof Global.BigInt === 'function' &&
45+
typeof BigInt === 'function' && // eslint-disable-line stdlib/require-globals, stdlib/no-builtin-big-int
46+
typeof Global.BigInt( '1' ) === 'bigint' &&
47+
typeof BigInt( '1' ) === 'bigint' // eslint-disable-line stdlib/require-globals, no-undef, stdlib/no-builtin-big-int
48+
);
3949
}
4050

4151

0 commit comments

Comments
 (0)