<commit_before>'use strict';

// MODULES //

var bench = require( '@stdlib/bench' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var pkg = require( './../package.json' ).name;
var RE_EXTNAME_WINDOWS = require( './../lib' );


// MAIN //

bench( pkg, function benchmark( b ) {
	var out;
	var str;
	var i;

	b.tic();
	for ( i = 0; i < b.iterations; i++ ) {
		str = 'C:\\foo\\bar\\beep\\boop'+String.fromCharCode( 97 + (i%26) )+'.js';
		out = RE_EXTNAME_WINDOWS.exec( str );
		if ( !out || !isString( out[ 1 ] ) ) {
			b.fail( 'should capture an extname' );
		}
	}
	b.toc();
	if ( !out || !isString( out[ 1 ] ) ) {
		b.fail( 'should capture an extname' );
	} else {
		b.pass( 'benchmark finished' );
	}
	b.end();
});<commit_msg>Use string utility<commit_after>'use strict';

// MODULES //

var bench = require( '@stdlib/bench' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var fromCodePoint = require( '@stdlib/string/from-code-point' );
var pkg = require( './../package.json' ).name;
var RE_EXTNAME_WINDOWS = require( './../lib' );


// MAIN //

bench( pkg, function benchmark( b ) {
	var out;
	var str;
	var i;

	b.tic();
	for ( i = 0; i < b.iterations; i++ ) {
		str = 'C:\\foo\\bar\\beep\\boop'+fromCodePoint( 97 + (i%26) )+'.js';
		out = RE_EXTNAME_WINDOWS.exec( str );
		if ( !out || !isString( out[ 1 ] ) ) {
			b.fail( 'should capture an extname' );
		}
	}
	b.toc();
	if ( !out || !isString( out[ 1 ] ) ) {
		b.fail( 'should capture an extname' );
	}
	b.pass( 'benchmark finished' );
	b.end();
});
{'fraction_non_alphanumeric': 0.2184873949579832, 'fraction_numerical': 0.00904977375565611, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6273407', 'n_tokens_mistral': 654, 'n_tokens_neox': 611, 'n_words': 153}