Skip to content

Commit 03cd443

Browse files
committed
Use typeof in benchmarks checks
1 parent 8be3fd8 commit 03cd443

File tree

78 files changed

+142
-142
lines changed

Some content is hidden

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

78 files changed

+142
-142
lines changed

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

Lines changed: 12 additions & 12 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 = isSymbol( values[ i % values.length ] );
59-
if ( !isBoolean( bool ) ) {
59+
if ( typeof bool !== 'boolean' ) {
6060
b.fail( 'should return a boolean' );
6161
}
6262
}
@@ -83,7 +83,7 @@ bench( pkg+'::objects', function benchmark( b ) {
8383
b.tic();
8484
for ( i = 0; i < b.iterations; i++ ) {
8585
bool = isSymbol( values[ i % values.length ] );
86-
if ( !isBoolean( bool ) ) {
86+
if ( typeof bool !== 'boolean' ) {
8787
b.fail( 'should return a boolean' );
8888
}
8989
}
@@ -113,7 +113,7 @@ bench( pkg+'::primitives:isPrimitive', function benchmark( b ) {
113113
b.tic();
114114
for ( i = 0; i < b.iterations; i++ ) {
115115
bool = isSymbol.isPrimitive( values[ i % values.length ] );
116-
if ( !isBoolean( bool ) ) {
116+
if ( typeof bool !== 'boolean' ) {
117117
b.fail( 'should return a boolean' );
118118
}
119119
}
@@ -140,7 +140,7 @@ bench( pkg+'::objects:isPrimitive', function benchmark( b ) {
140140
b.tic();
141141
for ( i = 0; i < b.iterations; i++ ) {
142142
bool = isSymbol.isPrimitive( values[ i % values.length ] );
143-
if ( !isBoolean( bool ) ) {
143+
if ( typeof bool !== 'boolean' ) {
144144
b.fail( 'should return a boolean' );
145145
}
146146
}
@@ -170,7 +170,7 @@ bench( pkg+'::primitives:isObject', function benchmark( b ) {
170170
b.tic();
171171
for ( i = 0; i < b.iterations; i++ ) {
172172
bool = isSymbol.isObject( values[ i % values.length ] );
173-
if ( !isBoolean( bool ) ) {
173+
if ( typeof bool !== 'boolean' ) {
174174
b.fail( 'should return a boolean' );
175175
}
176176
}
@@ -197,7 +197,7 @@ bench( pkg+'::objects:isObject', function benchmark( b ) {
197197
b.tic();
198198
for ( i = 0; i < b.iterations; i++ ) {
199199
bool = isSymbol.isObject( values[ i % values.length ] );
200-
if ( !isBoolean( bool ) ) {
200+
if ( typeof bool !== 'boolean' ) {
201201
b.fail( 'should return a boolean' );
202202
}
203203
}
@@ -224,7 +224,7 @@ bench( pkg+'::primitives,symbols', opts, function benchmark( b ) {
224224
b.tic();
225225
for ( i = 0; i < b.iterations; i++ ) {
226226
bool = isSymbol( values[ i % values.length ] );
227-
if ( !isBoolean( bool ) ) {
227+
if ( typeof bool !== 'boolean' ) {
228228
b.fail( 'should return a boolean' );
229229
}
230230
}
@@ -251,7 +251,7 @@ bench( pkg+'::objects,symbols', opts, function benchmark( b ) {
251251
b.tic();
252252
for ( i = 0; i < b.iterations; i++ ) {
253253
bool = isSymbol( values[ i % values.length ] );
254-
if ( !isBoolean( bool ) ) {
254+
if ( typeof bool !== 'boolean' ) {
255255
b.fail( 'should return a boolean' );
256256
}
257257
}
@@ -278,7 +278,7 @@ bench( pkg+'::primitives,symbols:isPrimitive', opts, function benchmark( b ) {
278278
b.tic();
279279
for ( i = 0; i < b.iterations; i++ ) {
280280
bool = isSymbol.isPrimitive( values[ i % values.length ] );
281-
if ( !isBoolean( bool ) ) {
281+
if ( typeof bool !== 'boolean' ) {
282282
b.fail( 'should return a boolean' );
283283
}
284284
}
@@ -305,7 +305,7 @@ bench( pkg+'::objects,symbols:isPrimitive', opts, function benchmark( b ) {
305305
b.tic();
306306
for ( i = 0; i < b.iterations; i++ ) {
307307
bool = isSymbol.isPrimitive( values[ i % values.length ] );
308-
if ( !isBoolean( bool ) ) {
308+
if ( typeof bool !== 'boolean' ) {
309309
b.fail( 'should return a boolean' );
310310
}
311311
}
@@ -332,7 +332,7 @@ bench( pkg+'::primitives,symbols:isObject', opts, function benchmark( b ) {
332332
b.tic();
333333
for ( i = 0; i < b.iterations; i++ ) {
334334
bool = isSymbol.isObject( values[ i % values.length ] );
335-
if ( !isBoolean( bool ) ) {
335+
if ( typeof bool !== 'boolean' ) {
336336
b.fail( 'should return a boolean' );
337337
}
338338
}
@@ -359,7 +359,7 @@ bench( pkg+'::objects,symbols:isObject', opts, function benchmark( b ) {
359359
b.tic();
360360
for ( i = 0; i < b.iterations; i++ ) {
361361
bool = isSymbol.isObject( values[ i % values.length ] );
362-
if ( !isBoolean( bool ) ) {
362+
if ( typeof bool !== 'boolean' ) {
363363
b.fail( 'should return a boolean' );
364364
}
365365
}

lib/node_modules/@stdlib/assert/is-triangular-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 = isTriangularNumber( 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 = isTriangularNumber( values[ i % values.length ] );
89-
if ( !isBoolean( bool ) ) {
89+
if ( typeof bool !== 'boolean' ) {
9090
b.fail( 'should return a boolean' );
9191
}
9292
}
@@ -124,7 +124,7 @@ bench( pkg+'::primitives:isPrimitive', function benchmark( b ) {
124124
b.tic();
125125
for ( i = 0; i < b.iterations; i++ ) {
126126
bool = isTriangularNumber.isPrimitive( values[ i % values.length ] );
127-
if ( !isBoolean( bool ) ) {
127+
if ( typeof bool !== 'boolean' ) {
128128
b.fail( 'should return a boolean' );
129129
}
130130
}
@@ -154,7 +154,7 @@ bench( pkg+'::objects:isPrimitive', function benchmark( b ) {
154154
b.tic();
155155
for ( i = 0; i < b.iterations; i++ ) {
156156
bool = isTriangularNumber.isPrimitive( values[ i % values.length ] );
157-
if ( !isBoolean( bool ) ) {
157+
if ( typeof bool !== 'boolean' ) {
158158
b.fail( 'should return a boolean' );
159159
}
160160
}
@@ -191,7 +191,7 @@ bench( pkg+'::primitives:isObject', function benchmark( b ) {
191191
b.tic();
192192
for ( i = 0; i < b.iterations; i++ ) {
193193
bool = isTriangularNumber.isObject( values[ i % values.length ] );
194-
if ( !isBoolean( bool ) ) {
194+
if ( typeof bool !== 'boolean' ) {
195195
b.fail( 'should return a boolean' );
196196
}
197197
}
@@ -221,7 +221,7 @@ bench( pkg+'::objects:isObject', function benchmark( b ) {
221221
b.tic();
222222
for ( i = 0; i < b.iterations; i++ ) {
223223
bool = isTriangularNumber.isObject( values[ i % values.length ] );
224-
if ( !isBoolean( bool ) ) {
224+
if ( typeof bool !== 'boolean' ) {
225225
b.fail( 'should return a boolean' );
226226
}
227227
}

lib/node_modules/@stdlib/datasets/img-acanthus-mollis/benchmark/benchmark.browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ bench( pkg+'::browser', function benchmark( b ) {
3434
b.tic();
3535
for ( i = 0; i < b.iterations; i++ ) {
3636
data = image();
37-
if ( !isBuffer( data ) ) {
37+
if ( typeof data !== 'object' ) {
3838
b.fail( 'should return a buffer object' );
3939
}
4040
}

lib/node_modules/@stdlib/datasets/img-acanthus-mollis/benchmark/benchmark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ bench( pkg, opts, function benchmark( b ) {
4242
b.tic();
4343
for ( i = 0; i < b.iterations; i++ ) {
4444
data = image();
45-
if ( !isBuffer( data ) ) {
45+
if ( typeof data !== 'object' ) {
4646
b.fail( 'should return a buffer object' );
4747
}
4848
}

lib/node_modules/@stdlib/datasets/img-airplane-from-above/benchmark/benchmark.browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ bench( pkg+'::browser', function benchmark( b ) {
3434
b.tic();
3535
for ( i = 0; i < b.iterations; i++ ) {
3636
data = image();
37-
if ( !isBuffer( data ) ) {
37+
if ( typeof data !== 'object' ) {
3838
b.fail( 'should return a buffer object' );
3939
}
4040
}

lib/node_modules/@stdlib/datasets/img-airplane-from-above/benchmark/benchmark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ bench( pkg, opts, function benchmark( b ) {
4242
b.tic();
4343
for ( i = 0; i < b.iterations; i++ ) {
4444
data = image();
45-
if ( !isBuffer( data ) ) {
45+
if ( typeof data !== 'object' ) {
4646
b.fail( 'should return a buffer object' );
4747
}
4848
}

lib/node_modules/@stdlib/datasets/img-allium-oreophilum/benchmark/benchmark.browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ bench( pkg+'::browser', function benchmark( b ) {
3434
b.tic();
3535
for ( i = 0; i < b.iterations; i++ ) {
3636
data = image();
37-
if ( !isBuffer( data ) ) {
37+
if ( typeof data !== 'object' ) {
3838
b.fail( 'should return a buffer object' );
3939
}
4040
}

lib/node_modules/@stdlib/datasets/img-allium-oreophilum/benchmark/benchmark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ bench( pkg, opts, function benchmark( b ) {
4242
b.tic();
4343
for ( i = 0; i < b.iterations; i++ ) {
4444
data = image();
45-
if ( !isBuffer( data ) ) {
45+
if ( typeof data !== 'object' ) {
4646
b.fail( 'should return a buffer object' );
4747
}
4848
}

lib/node_modules/@stdlib/datasets/img-black-canyon/benchmark/benchmark.browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ bench( pkg+'::browser', function benchmark( b ) {
3434
b.tic();
3535
for ( i = 0; i < b.iterations; i++ ) {
3636
data = image();
37-
if ( !isBuffer( data ) ) {
37+
if ( typeof data !== 'object' ) {
3838
b.fail( 'should return a buffer object' );
3939
}
4040
}

lib/node_modules/@stdlib/datasets/img-black-canyon/benchmark/benchmark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ bench( pkg, opts, function benchmark( b ) {
4242
b.tic();
4343
for ( i = 0; i < b.iterations; i++ ) {
4444
data = image();
45-
if ( !isBuffer( data ) ) {
45+
if ( typeof data !== 'object' ) {
4646
b.fail( 'should return a buffer object' );
4747
}
4848
}

0 commit comments

Comments
 (0)