Skip to content

Commit 8be3fd8

Browse files
committed
Use typeof in benchmarks checks
1 parent 116111e commit 8be3fd8

File tree

84 files changed

+252
-252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+252
-252
lines changed

lib/node_modules/@stdlib/assert/is-absolute-path/benchmark/benchmark.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ bench( pkg, function benchmark( b ) {
3838
for ( i = 0; i < b.iterations; i++ ) {
3939
str = '/foo/bar/beep/boop/'+fromCodePoint( 97 + (i%26) );
4040
bool = isAbsolutePath( str );
41-
if ( !isBoolean( bool ) ) {
41+
if ( typeof bool !== 'boolean' ) {
4242
b.fail( 'should return a boolean' );
4343
}
4444
}
@@ -59,7 +59,7 @@ bench( pkg+':posix', function benchmark( b ) {
5959
for ( i = 0; i < b.iterations; i++ ) {
6060
str = '/foo/bar/beep/boop/'+fromCodePoint( 97 + (i%26) );
6161
bool = isAbsolutePath.posix( str );
62-
if ( !isBoolean( bool ) ) {
62+
if ( typeof bool !== 'boolean' ) {
6363
b.fail( 'should return a boolean' );
6464
}
6565
}
@@ -80,7 +80,7 @@ bench( pkg+':win32', function benchmark( b ) {
8080
for ( i = 0; i < b.iterations; i++ ) {
8181
str = 'C:\\foo\\bar\\beep\\boop\\'+fromCodePoint( 97 + (i%26) );
8282
bool = isAbsolutePath.win32( str );
83-
if ( !isBoolean( bool ) ) {
83+
if ( typeof bool !== 'boolean' ) {
8484
b.fail( 'should return a boolean' );
8585
}
8686
}

lib/node_modules/@stdlib/assert/is-alphanumeric/benchmark/benchmark.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ bench( pkg+'::single-character', function benchmark( b ) {
3838
for ( i = 0; i < b.iterations; i++ ) {
3939
str = fromCodePoint( (i%74)+48 );
4040
bool = isAlphaNumeric( str );
41-
if ( !isBoolean( bool ) ) {
41+
if ( typeof bool !== 'boolean' ) {
4242
b.fail( 'should return a boolean' );
4343
}
4444
}
@@ -59,7 +59,7 @@ bench( pkg+'::string', function benchmark( b ) {
5959
for ( i = 0; i < b.iterations; i++ ) {
6060
str = '0123456789' + fromCodePoint( (i%74)+48 );
6161
bool = isAlphaNumeric( str );
62-
if ( !isBoolean( bool ) ) {
62+
if ( typeof bool !== 'boolean' ) {
6363
b.fail( 'should return a boolean' );
6464
}
6565
}
@@ -82,7 +82,7 @@ bench( pkg+'::regexp-single-character', function benchmark( b ) {
8282
for ( i = 0; i < b.iterations; i++ ) {
8383
str = fromCodePoint( (i%74)+48 );
8484
bool = RE.test( str );
85-
if ( !isBoolean( bool ) ) {
85+
if ( typeof bool !== 'boolean' ) {
8686
b.fail( 'should return a boolean' );
8787
}
8888
}
@@ -105,7 +105,7 @@ bench( pkg+'::regexp-string', function benchmark( b ) {
105105
for ( i = 0; i < b.iterations; i++ ) {
106106
str = '0123456789' + fromCodePoint( (i%74)+48 );
107107
bool = RE.test( str );
108-
if ( !isBoolean( bool ) ) {
108+
if ( typeof bool !== 'boolean' ) {
109109
b.fail( 'should return a boolean' );
110110
}
111111
}

lib/node_modules/@stdlib/assert/is-bigint/benchmark/benchmark.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ bench( pkg+'::primitives', function benchmark( b ) {
5858
b.tic();
5959
for ( i = 0; i < b.iterations; i++ ) {
6060
bool = isBigInt( values[ i % values.length ] );
61-
if ( !isBoolean( bool ) ) {
61+
if ( typeof bool !== 'boolean' ) {
6262
b.fail( 'should return a boolean' );
6363
}
6464
}
@@ -85,7 +85,7 @@ bench( pkg+'::objects', function benchmark( b ) {
8585
b.tic();
8686
for ( i = 0; i < b.iterations; i++ ) {
8787
bool = isBigInt( values[ i % values.length ] );
88-
if ( !isBoolean( bool ) ) {
88+
if ( typeof bool !== 'boolean' ) {
8989
b.fail( 'should return a boolean' );
9090
}
9191
}
@@ -115,7 +115,7 @@ bench( pkg+'::primitives:isPrimitive', function benchmark( b ) {
115115
b.tic();
116116
for ( i = 0; i < b.iterations; i++ ) {
117117
bool = isBigInt.isPrimitive( values[ i % values.length ] );
118-
if ( !isBoolean( bool ) ) {
118+
if ( typeof bool !== 'boolean' ) {
119119
b.fail( 'should return a boolean' );
120120
}
121121
}
@@ -142,7 +142,7 @@ bench( pkg+'::objects:isPrimitive', function benchmark( b ) {
142142
b.tic();
143143
for ( i = 0; i < b.iterations; i++ ) {
144144
bool = isBigInt.isPrimitive( values[ i % values.length ] );
145-
if ( !isBoolean( bool ) ) {
145+
if ( typeof bool !== 'boolean' ) {
146146
b.fail( 'should return a boolean' );
147147
}
148148
}
@@ -172,7 +172,7 @@ bench( pkg+'::primitives:isObject', function benchmark( b ) {
172172
b.tic();
173173
for ( i = 0; i < b.iterations; i++ ) {
174174
bool = isBigInt.isObject( values[ i % values.length ] );
175-
if ( !isBoolean( bool ) ) {
175+
if ( typeof bool !== 'boolean' ) {
176176
b.fail( 'should return a boolean' );
177177
}
178178
}
@@ -199,7 +199,7 @@ bench( pkg+'::objects:isObject', function benchmark( b ) {
199199
b.tic();
200200
for ( i = 0; i < b.iterations; i++ ) {
201201
bool = isBigInt.isObject( values[ i % values.length ] );
202-
if ( !isBoolean( bool ) ) {
202+
if ( typeof bool !== 'boolean' ) {
203203
b.fail( 'should return a boolean' );
204204
}
205205
}
@@ -226,7 +226,7 @@ bench( pkg+'::primitives,bigints', opts, function benchmark( b ) {
226226
b.tic();
227227
for ( i = 0; i < b.iterations; i++ ) {
228228
bool = isBigInt( values[ i % values.length ] );
229-
if ( !isBoolean( bool ) ) {
229+
if ( typeof bool !== 'boolean' ) {
230230
b.fail( 'should return a boolean' );
231231
}
232232
}
@@ -253,7 +253,7 @@ bench( pkg+'::objects,bigints', opts, function benchmark( b ) {
253253
b.tic();
254254
for ( i = 0; i < b.iterations; i++ ) {
255255
bool = isBigInt( values[ i % values.length ] );
256-
if ( !isBoolean( bool ) ) {
256+
if ( typeof bool !== 'boolean' ) {
257257
b.fail( 'should return a boolean' );
258258
}
259259
}
@@ -280,7 +280,7 @@ bench( pkg+'::primitives,bigints:isPrimitive', opts, function benchmark( b ) {
280280
b.tic();
281281
for ( i = 0; i < b.iterations; i++ ) {
282282
bool = isBigInt.isPrimitive( values[ i % values.length ] );
283-
if ( !isBoolean( bool ) ) {
283+
if ( typeof bool !== 'boolean' ) {
284284
b.fail( 'should return a boolean' );
285285
}
286286
}
@@ -307,7 +307,7 @@ bench( pkg+'::objects,bigints:isPrimitive', opts, function benchmark( b ) {
307307
b.tic();
308308
for ( i = 0; i < b.iterations; i++ ) {
309309
bool = isBigInt.isPrimitive( values[ i % values.length ] );
310-
if ( !isBoolean( bool ) ) {
310+
if ( typeof bool !== 'boolean' ) {
311311
b.fail( 'should return a boolean' );
312312
}
313313
}
@@ -334,7 +334,7 @@ bench( pkg+'::primitives,bigints:isObject', opts, function benchmark( b ) {
334334
b.tic();
335335
for ( i = 0; i < b.iterations; i++ ) {
336336
bool = isBigInt.isObject( values[ i % values.length ] );
337-
if ( !isBoolean( bool ) ) {
337+
if ( typeof bool !== 'boolean' ) {
338338
b.fail( 'should return a boolean' );
339339
}
340340
}
@@ -361,7 +361,7 @@ bench( pkg+'::objects,bigints:isObject', opts, function benchmark( b ) {
361361
b.tic();
362362
for ( i = 0; i < b.iterations; i++ ) {
363363
bool = isBigInt.isObject( values[ i % values.length ] );
364-
if ( !isBoolean( bool ) ) {
364+
if ( typeof bool !== 'boolean' ) {
365365
b.fail( 'should return a boolean' );
366366
}
367367
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ bench( pkg+'::primitives', function benchmark( b ) {
4848
b.tic();
4949
for ( i = 0; i < b.iterations; i++ ) {
5050
bool = isBoolean( values[ i % values.length ] );
51-
if ( !isBoolean.isPrimitive( bool ) ) {
51+
if ( typeof bool !== 'boolean' ) {
5252
b.fail( 'should return a boolean' );
5353
}
5454
}
@@ -75,7 +75,7 @@ bench( pkg+'::objects', function benchmark( b ) {
7575
b.tic();
7676
for ( i = 0; i < b.iterations; i++ ) {
7777
bool = isBoolean( values[ i % values.length ] );
78-
if ( !isBoolean.isPrimitive( bool ) ) {
78+
if ( typeof bool !== 'boolean' ) {
7979
b.fail( 'should return a boolean' );
8080
}
8181
}
@@ -105,7 +105,7 @@ bench( pkg+'::primitives:isPrimitive', function benchmark( b ) {
105105
b.tic();
106106
for ( i = 0; i < b.iterations; i++ ) {
107107
bool = isBoolean.isPrimitive( values[ i % values.length ] );
108-
if ( !isBoolean.isPrimitive( bool ) ) {
108+
if ( typeof bool !== 'boolean' ) {
109109
b.fail( 'should return a boolean' );
110110
}
111111
}
@@ -132,7 +132,7 @@ bench( pkg+'::objects:isPrimitive', function benchmark( b ) {
132132
b.tic();
133133
for ( i = 0; i < b.iterations; i++ ) {
134134
bool = isBoolean.isPrimitive( values[ i % values.length ] );
135-
if ( !isBoolean.isPrimitive( bool ) ) {
135+
if ( typeof bool !== 'boolean' ) {
136136
b.fail( 'should return a boolean' );
137137
}
138138
}
@@ -162,7 +162,7 @@ bench( pkg+'::primitives:isObject', function benchmark( b ) {
162162
b.tic();
163163
for ( i = 0; i < b.iterations; i++ ) {
164164
bool = isBoolean.isObject( values[ i % values.length ] );
165-
if ( !isBoolean.isPrimitive( bool ) ) {
165+
if ( typeof bool !== 'boolean' ) {
166166
b.fail( 'should return a boolean' );
167167
}
168168
}
@@ -189,7 +189,7 @@ bench( pkg+'::objects:isObject', function benchmark( b ) {
189189
b.tic();
190190
for ( i = 0; i < b.iterations; i++ ) {
191191
bool = isBoolean.isObject( values[ i % values.length ] );
192-
if ( !isBoolean.isPrimitive( bool ) ) {
192+
if ( typeof bool !== 'boolean' ) {
193193
b.fail( 'should return a boolean' );
194194
}
195195
}

lib/node_modules/@stdlib/assert/is-circular-plain-object/benchmark/benchmark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ bench( pkg, function benchmark( b ) {
6161
b.tic();
6262
for ( i = 0; i < b.iterations; i++ ) {
6363
bool = isCircularPlainObject( values[ i%values.length ] );
64-
if ( !isBoolean( bool ) ) {
64+
if ( typeof bool !== 'boolean' ) {
6565
b.fail( 'should return a boolean' );
6666
}
6767
}

lib/node_modules/@stdlib/assert/is-complex-typed-array/benchmark/benchmark.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ bench( pkg, function benchmark( b ) {
7474
b.tic();
7575
for ( i = 0; i < b.iterations; i++ ) {
7676
bool = isComplexTypedArray( values[ i%values.length ] );
77-
if ( !isBoolean( bool ) ) {
77+
if ( typeof bool !== 'boolean' ) {
7878
b.fail( 'should return a boolean' );
7979
}
8080
}
@@ -106,7 +106,7 @@ bench( pkg+'::false', function benchmark( b ) {
106106
b.tic();
107107
for ( i = 0; i < b.iterations; i++ ) {
108108
bool = isComplexTypedArray( values[ i%values.length ] );
109-
if ( !isBoolean( bool ) ) {
109+
if ( typeof bool !== 'boolean' ) {
110110
b.fail( 'should return a boolean' );
111111
}
112112
}
@@ -131,7 +131,7 @@ bench( pkg+'::true', function benchmark( b ) {
131131
b.tic();
132132
for ( i = 0; i < b.iterations; i++ ) {
133133
bool = isComplexTypedArray( values[ i%values.length ] );
134-
if ( !isBoolean( bool ) ) {
134+
if ( typeof bool !== 'boolean' ) {
135135
b.fail( 'should return a boolean' );
136136
}
137137
}

lib/node_modules/@stdlib/assert/is-complex128array/benchmark/benchmark.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ bench( pkg, function benchmark( b ) {
5959
b.tic();
6060
for ( i = 0; i < b.iterations; i++ ) {
6161
bool = isComplex128Array( values[ i%values.length ] );
62-
if ( !isBoolean( bool ) ) {
62+
if ( typeof bool !== 'boolean' ) {
6363
b.fail( 'should return a boolean' );
6464
}
6565
}
@@ -84,7 +84,7 @@ bench( pkg+'::true', function benchmark( b ) {
8484
b.tic();
8585
for ( i = 0; i < b.iterations; i++ ) {
8686
bool = isComplex128Array( values[ i%values.length ] );
87-
if ( !isBoolean( bool ) ) {
87+
if ( typeof bool !== 'boolean' ) {
8888
b.fail( 'should return a boolean' );
8989
}
9090
}
@@ -116,7 +116,7 @@ bench( pkg+'::false', function benchmark( b ) {
116116
b.tic();
117117
for ( i = 0; i < b.iterations; i++ ) {
118118
bool = isComplex128Array( values[ i%values.length ] );
119-
if ( !isBoolean( bool ) ) {
119+
if ( typeof bool !== 'boolean' ) {
120120
b.fail( 'should return a boolean' );
121121
}
122122
}

lib/node_modules/@stdlib/assert/is-composite/benchmark/benchmark.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ bench( pkg+'::primitives', function benchmark( b ) {
5656
b.tic();
5757
for ( i = 0; i < b.iterations; i++ ) {
5858
bool = isComposite( values[ i % values.length ] );
59-
if ( !isBoolean( bool ) ) {
59+
if ( typeof bool !== 'boolean' ) {
6060
b.fail( 'should return a boolean' );
6161
}
6262
}
@@ -86,7 +86,7 @@ bench( pkg+'::objects', function benchmark( b ) {
8686
b.tic();
8787
for ( i = 0; i < b.iterations; i++ ) {
8888
bool = isComposite( values[ i % values.length ] );
89-
if ( !isBoolean( bool ) ) {
89+
if ( typeof bool !== 'boolean' ) {
9090
b.fail( 'should return a boolean' );
9191
}
9292
}
@@ -123,7 +123,7 @@ bench( pkg+'::primitives:isPrimitive', function benchmark( b ) {
123123
b.tic();
124124
for ( i = 0; i < b.iterations; i++ ) {
125125
bool = isComposite.isPrimitive( values[ i % values.length ] );
126-
if ( !isBoolean( bool ) ) {
126+
if ( typeof bool !== 'boolean' ) {
127127
b.fail( 'should return a boolean' );
128128
}
129129
}
@@ -153,7 +153,7 @@ bench( pkg+'::objects:isPrimitive', function benchmark( b ) {
153153
b.tic();
154154
for ( i = 0; i < b.iterations; i++ ) {
155155
bool = isComposite.isPrimitive( values[ i % values.length ] );
156-
if ( !isBoolean( bool ) ) {
156+
if ( typeof bool !== 'boolean' ) {
157157
b.fail( 'should return a boolean' );
158158
}
159159
}
@@ -190,7 +190,7 @@ bench( pkg+'::primitives:isObject', function benchmark( b ) {
190190
b.tic();
191191
for ( i = 0; i < b.iterations; i++ ) {
192192
bool = isComposite.isObject( values[ i % values.length ] );
193-
if ( !isBoolean( bool ) ) {
193+
if ( typeof bool !== 'boolean' ) {
194194
b.fail( 'should return a boolean' );
195195
}
196196
}
@@ -220,7 +220,7 @@ bench( pkg+'::objects:isObject', function benchmark( b ) {
220220
b.tic();
221221
for ( i = 0; i < b.iterations; i++ ) {
222222
bool = isComposite.isObject( values[ i % values.length ] );
223-
if ( !isBoolean( bool ) ) {
223+
if ( typeof bool !== 'boolean' ) {
224224
b.fail( 'should return a boolean' );
225225
}
226226
}

lib/node_modules/@stdlib/assert/is-cube-number/benchmark/benchmark.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ bench( pkg+'::primitives', function benchmark( b ) {
5656
b.tic();
5757
for ( i = 0; i < b.iterations; i++ ) {
5858
bool = isCubeNumber( values[ i % values.length ] );
59-
if ( !isBoolean( bool ) ) {
59+
if ( typeof bool !== 'boolean' ) {
6060
b.fail( 'should return a boolean' );
6161
}
6262
}
@@ -86,7 +86,7 @@ bench( pkg+'::objects', function benchmark( b ) {
8686
b.tic();
8787
for ( i = 0; i < b.iterations; i++ ) {
8888
bool = isCubeNumber( values[ i % values.length ] );
89-
if ( !isBoolean( bool ) ) {
89+
if ( typeof bool !== 'boolean' ) {
9090
b.fail( 'should return a boolean' );
9191
}
9292
}
@@ -123,7 +123,7 @@ bench( pkg+'::primitives:isPrimitive', function benchmark( b ) {
123123
b.tic();
124124
for ( i = 0; i < b.iterations; i++ ) {
125125
bool = isCubeNumber.isPrimitive( values[ i % values.length ] );
126-
if ( !isBoolean( bool ) ) {
126+
if ( typeof bool !== 'boolean' ) {
127127
b.fail( 'should return a boolean' );
128128
}
129129
}
@@ -153,7 +153,7 @@ bench( pkg+'::objects:isPrimitive', function benchmark( b ) {
153153
b.tic();
154154
for ( i = 0; i < b.iterations; i++ ) {
155155
bool = isCubeNumber.isPrimitive( values[ i % values.length ] );
156-
if ( !isBoolean( bool ) ) {
156+
if ( typeof bool !== 'boolean' ) {
157157
b.fail( 'should return a boolean' );
158158
}
159159
}
@@ -190,7 +190,7 @@ bench( pkg+'::primitives:isObject', function benchmark( b ) {
190190
b.tic();
191191
for ( i = 0; i < b.iterations; i++ ) {
192192
bool = isCubeNumber.isObject( values[ i % values.length ] );
193-
if ( !isBoolean( bool ) ) {
193+
if ( typeof bool !== 'boolean' ) {
194194
b.fail( 'should return a boolean' );
195195
}
196196
}
@@ -220,7 +220,7 @@ bench( pkg+'::objects:isObject', function benchmark( b ) {
220220
b.tic();
221221
for ( i = 0; i < b.iterations; i++ ) {
222222
bool = isCubeNumber.isObject( values[ i % values.length ] );
223-
if ( !isBoolean( bool ) ) {
223+
if ( typeof bool !== 'boolean' ) {
224224
b.fail( 'should return a boolean' );
225225
}
226226
}

0 commit comments

Comments
 (0)