Skip to content

Commit 30b61f6

Browse files
committed
Refactor to avoid immediate require invocation
1 parent 31fe5ee commit 30b61f6

File tree

1 file changed

+7
-2
lines changed
  • lib/node_modules/@stdlib/assert/is-boolean/lib

1 file changed

+7
-2
lines changed

lib/node_modules/@stdlib/assert/is-boolean/lib/object.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@
2020

2121
// MODULES //
2222

23-
var hasToStringTag = require( '@stdlib/utils/detect-tostringtag-support' )();
23+
var hasToStringTag = require( '@stdlib/utils/detect-tostringtag-support' );
2424
var nativeClass = require( '@stdlib/utils/native-class' );
2525
var test = require( './try2serialize.js' );
2626

2727

28+
// VARIABLES //
29+
30+
var FLG = hasToStringTag();
31+
32+
2833
// MAIN //
2934

3035
/**
@@ -46,7 +51,7 @@ function isBoolean( value ) {
4651
if ( value instanceof Boolean ) {
4752
return true;
4853
}
49-
if ( hasToStringTag ) {
54+
if ( FLG ) {
5055
return test( value );
5156
}
5257
return ( nativeClass( value ) === '[object Boolean]' );

0 commit comments

Comments
 (0)