File tree 1 file changed +3
-2
lines changed
lib/node_modules/@stdlib/assert/is-ascii/benchmark
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
var bench = require ( '@stdlib/bench' ) ;
6
6
var isBoolean = require ( '@stdlib/assert/is-boolean' ) . isPrimitive ;
7
+ var fromCodePoint = require ( '@stdlib/string/from-code-point' ) ;
7
8
var pkg = require ( './../package.json' ) . name ;
8
9
var isASCII = require ( './../lib' ) ;
9
10
@@ -17,7 +18,7 @@ bench( pkg+'::single-character', function benchmark( b ) {
17
18
18
19
b . tic ( ) ;
19
20
for ( i = 0 ; i < b . iterations ; i ++ ) {
20
- str = String . fromCharCode ( i % 200 ) ;
21
+ str = fromCodePoint ( i % 200 ) ;
21
22
bool = isASCII ( str ) ;
22
23
if ( ! isBoolean ( bool ) ) {
23
24
b . fail ( 'should return a boolean' ) ;
@@ -38,7 +39,7 @@ bench( pkg+'::string', function benchmark( b ) {
38
39
39
40
b . tic ( ) ;
40
41
for ( i = 0 ; i < b . iterations ; i ++ ) {
41
- str = 'beep boop foo bar' + String . fromCharCode ( i % 200 ) ;
42
+ str = 'beep boop foo bar' + fromCodePoint ( i % 200 ) ;
42
43
bool = isASCII ( str ) ;
43
44
if ( ! isBoolean ( bool ) ) {
44
45
b . fail ( 'should return a boolean' ) ;
You can’t perform that action at this time.
0 commit comments