Skip to content

Commit b6cd9cf

Browse files
committed
Avoid immediately invoked requires
1 parent 6440ba6 commit b6cd9cf

4 files changed

Lines changed: 32 additions & 31 deletions

File tree

lib/node_modules/@stdlib/utils/type-of/examples/index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020

2121
'use strict';
2222

23-
var hasMapSupport = require( '@stdlib/assert/has-map-support' )();
24-
var hasWeakMapSupport = require( '@stdlib/assert/has-weakmap-support' )();
25-
var hasSetSupport = require( '@stdlib/assert/has-set-support' )();
26-
var hasWeakSetSupport = require( '@stdlib/assert/has-weakset-support' )();
27-
var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' )();
23+
var hasMapSupport = require( '@stdlib/assert/has-map-support' );
24+
var hasWeakMapSupport = require( '@stdlib/assert/has-weakmap-support' );
25+
var hasSetSupport = require( '@stdlib/assert/has-set-support' );
26+
var hasWeakSetSupport = require( '@stdlib/assert/has-weakset-support' );
27+
var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' );
2828
var Float32Array = require( '@stdlib/array/float32' );
2929
var Float64Array = require( '@stdlib/array/float64' );
3030
var Int8Array = require( '@stdlib/array/int8' );
@@ -69,23 +69,23 @@ console.log( typeOf( {} ) );
6969
console.log( typeOf( function noop() {} ) );
7070
// => 'function'
7171

72-
if ( hasMapSupport ) {
72+
if ( hasMapSupport() ) {
7373
console.log( typeOf( new Map() ) );
7474
// => 'map'
7575
}
76-
if ( hasWeakMapSupport ) {
76+
if ( hasWeakMapSupport() ) {
7777
console.log( typeOf( new WeakMap() ) );
7878
// => 'weakmap'
7979
}
80-
if ( hasSetSupport ) {
80+
if ( hasSetSupport() ) {
8181
console.log( typeOf( new Set() ) );
8282
// => 'set'
8383
}
84-
if ( hasWeakSetSupport ) {
84+
if ( hasWeakSetSupport() ) {
8585
console.log( typeOf( new WeakSet() ) );
8686
// => 'weakset'
8787
}
88-
if ( hasSymbolSupport ) {
88+
if ( hasSymbolSupport() ) {
8989
console.log( typeOf( Symbol( 'beep' ) ) );
9090
// => 'symbol'
9191
}

lib/node_modules/@stdlib/utils/type-of/lib/fixtures/nodelist.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020

2121
// MODULES //
2222

23-
var root = require( 'system.global' )(); // eslint-disable-line stdlib/no-redeclare
23+
var systemGlobal = require( 'system.global' );
2424

2525

2626
// MAIN //
2727

28+
var root = systemGlobal(); // eslint-disable-line stdlib/no-redeclare
2829
var nodeList = root.document && root.document.childNodes;
2930

3031

lib/node_modules/@stdlib/utils/type-of/test/test.polyfill.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
// MODULES //
2424

2525
var tape = require( 'tape' );
26-
var hasMapSupport = require( '@stdlib/assert/has-map-support' )();
27-
var hasWeakMapSupport = require( '@stdlib/assert/has-weakmap-support' )();
28-
var hasSetSupport = require( '@stdlib/assert/has-set-support' )();
29-
var hasWeakSetSupport = require( '@stdlib/assert/has-weakset-support' )();
30-
var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' )();
26+
var hasMapSupport = require( '@stdlib/assert/has-map-support' );
27+
var hasWeakMapSupport = require( '@stdlib/assert/has-weakmap-support' );
28+
var hasSetSupport = require( '@stdlib/assert/has-set-support' );
29+
var hasWeakSetSupport = require( '@stdlib/assert/has-weakset-support' );
30+
var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' );
3131
var Float32Array = require( '@stdlib/array/float32' );
3232
var Float64Array = require( '@stdlib/array/float64' );
3333
var Int8Array = require( '@stdlib/array/int8' );
@@ -144,7 +144,7 @@ tape( 'the function returns a value\'s type', function test( t ) {
144144

145145
tape( 'the function supports Map objects (ES2015)', function test( t ) {
146146
var v;
147-
if ( hasMapSupport ) {
147+
if ( hasMapSupport() ) {
148148
v = typeOf( new Map() );
149149
t.equal( v, 'map', 'returns map' );
150150
}
@@ -153,7 +153,7 @@ tape( 'the function supports Map objects (ES2015)', function test( t ) {
153153

154154
tape( 'the function supports WeakMap objects (ES2015)', function test( t ) {
155155
var v;
156-
if ( hasWeakMapSupport ) {
156+
if ( hasWeakMapSupport() ) {
157157
v = typeOf( new WeakMap() );
158158
t.equal( v, 'weakmap', 'returns weakmap' );
159159
}
@@ -162,7 +162,7 @@ tape( 'the function supports WeakMap objects (ES2015)', function test( t ) {
162162

163163
tape( 'the function supports Set objects (ES2015)', function test( t ) {
164164
var v;
165-
if ( hasSetSupport ) {
165+
if ( hasSetSupport() ) {
166166
v = typeOf( new Set() );
167167
t.equal( v, 'set', 'returns set' );
168168
}
@@ -171,7 +171,7 @@ tape( 'the function supports Set objects (ES2015)', function test( t ) {
171171

172172
tape( 'the function supports WeakSet objects (ES2015)', function test( t ) {
173173
var v;
174-
if ( hasWeakSetSupport ) {
174+
if ( hasWeakSetSupport() ) {
175175
v = typeOf( new WeakSet() );
176176
t.equal( v, 'weakset', 'returns weakset' );
177177
}
@@ -180,7 +180,7 @@ tape( 'the function supports WeakSet objects (ES2015)', function test( t ) {
180180

181181
tape( 'the function supports Symbol objects (ES2015)', function test( t ) {
182182
var v;
183-
if ( hasSymbolSupport ) {
183+
if ( hasSymbolSupport() ) {
184184
v = typeOf( Symbol( 'beep' ) );
185185
t.equal( v, 'symbol', 'returns symbol' );
186186
}

lib/node_modules/@stdlib/utils/type-of/test/test.typeof.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
// MODULES //
2424

2525
var tape = require( 'tape' );
26-
var hasMapSupport = require( '@stdlib/assert/has-map-support' )();
27-
var hasWeakMapSupport = require( '@stdlib/assert/has-weakmap-support' )();
28-
var hasSetSupport = require( '@stdlib/assert/has-set-support' )();
29-
var hasWeakSetSupport = require( '@stdlib/assert/has-weakset-support' )();
30-
var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' )();
26+
var hasMapSupport = require( '@stdlib/assert/has-map-support' );
27+
var hasWeakMapSupport = require( '@stdlib/assert/has-weakmap-support' );
28+
var hasSetSupport = require( '@stdlib/assert/has-set-support' );
29+
var hasWeakSetSupport = require( '@stdlib/assert/has-weakset-support' );
30+
var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' );
3131
var Float32Array = require( '@stdlib/array/float32' );
3232
var Float64Array = require( '@stdlib/array/float64' );
3333
var Int8Array = require( '@stdlib/array/int8' );
@@ -144,7 +144,7 @@ tape( 'the function returns a value\'s type', function test( t ) {
144144

145145
tape( 'the function supports Map objects (ES2015)', function test( t ) {
146146
var v;
147-
if ( hasMapSupport ) {
147+
if ( hasMapSupport() ) {
148148
v = typeOf( new Map() );
149149
t.equal( v, 'map', 'returns map' );
150150
}
@@ -153,7 +153,7 @@ tape( 'the function supports Map objects (ES2015)', function test( t ) {
153153

154154
tape( 'the function supports WeakMap objects (ES2015)', function test( t ) {
155155
var v;
156-
if ( hasWeakMapSupport ) {
156+
if ( hasWeakMapSupport() ) {
157157
v = typeOf( new WeakMap() );
158158
t.equal( v, 'weakmap', 'returns weakmap' );
159159
}
@@ -162,7 +162,7 @@ tape( 'the function supports WeakMap objects (ES2015)', function test( t ) {
162162

163163
tape( 'the function supports Set objects (ES2015)', function test( t ) {
164164
var v;
165-
if ( hasSetSupport ) {
165+
if ( hasSetSupport() ) {
166166
v = typeOf( new Set() );
167167
t.equal( v, 'set', 'returns set' );
168168
}
@@ -171,7 +171,7 @@ tape( 'the function supports Set objects (ES2015)', function test( t ) {
171171

172172
tape( 'the function supports WeakSet objects (ES2015)', function test( t ) {
173173
var v;
174-
if ( hasWeakSetSupport ) {
174+
if ( hasWeakSetSupport() ) {
175175
v = typeOf( new WeakSet() );
176176
t.equal( v, 'weakset', 'returns weakset' );
177177
}
@@ -180,7 +180,7 @@ tape( 'the function supports WeakSet objects (ES2015)', function test( t ) {
180180

181181
tape( 'the function supports Symbol objects (ES2015)', function test( t ) {
182182
var v;
183-
if ( hasSymbolSupport ) {
183+
if ( hasSymbolSupport() ) {
184184
v = typeOf( Symbol( 'beep' ) );
185185
t.equal( v, 'symbol', 'returns symbol' );
186186
}

0 commit comments

Comments
 (0)