File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
lib/node_modules/@stdlib/assert/is-capitalized/benchmark Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 44
55var bench = require ( '@stdlib/bench' ) ;
66var isBoolean = require ( '@stdlib/assert/is-boolean' ) . isPrimitive ;
7+ var fromCodePoint = require ( '@stdlib/string/from-code-point' ) ;
78var pkg = require ( './../package.json' ) . name ;
89var isCapitalized = require ( './../lib' ) ;
910
@@ -16,16 +17,15 @@ bench( pkg, function benchmark( b ) {
1617
1718 b . tic ( ) ;
1819 for ( i = 0 ; i < b . iterations ; i ++ ) {
19- bool = isCapitalized ( String . fromCharCode ( i % 126 ) ) ;
20+ bool = isCapitalized ( fromCodePoint ( i % 126 ) ) ;
2021 if ( ! isBoolean ( bool ) ) {
2122 b . fail ( 'should return a boolean' ) ;
2223 }
2324 }
2425 b . toc ( ) ;
25- if ( isBoolean ( bool ) ) {
26- b . pass ( 'benchmark finished' ) ;
27- } else {
26+ if ( ! isBoolean ( bool ) ) {
2827 b . fail ( 'should return a boolean' ) ;
2928 }
29+ b . pass ( 'benchmark finished' ) ;
3030 b . end ( ) ;
3131} ) ;
You can’t perform that action at this time.
0 commit comments