<commit_before>'use strict';

// MODULES //

var fs = require( 'fs' );
var join = require( 'path' ).join;
var isBrowser = require( '@stdlib/utils/is-browser' );
var readDir = require( '@stdlib/fs/read-dir' ).sync;
var extname = require( '@stdlib/utils/extname' );
var dataDir = require( './data_dir.js' );
var RE = require( './re_filename.js' );


// FUNCTIONS //

/**
* Generates a sorted list of JSON data file filenames by reading the file system.
*
* @private
* @returns {StringArray} filenames
*/
function read() {
	var fpath;
	var files;
	var stats;
	var out;
	var f;
	var i;

	files = readDir( dataDir );
	out = [];
	for ( i = 0; i < files.length; i++ ) {
		f = files[ i ];
		if ( extname( f ) === '.json' && RE.test( f ) ) {
			fpath = join( dataDir, f );
			stats = fs.statSync( fpath );
			if ( stats.isFile() ) {
				out.push( f );
			}
		}
	}
	return out.sort();
} // end FUNCTION read()


// MAIN //

var list;
if ( isBrowser ) {
	list = require( './browser_file_list.json' );
} else {
	list = read();
}


// EXPORTS //

module.exports = list;<commit_msg>Move variable declaration to top of scope<commit_after>'use strict';

// MODULES //

var fs = require( 'fs' );
var join = require( 'path' ).join;
var isBrowser = require( '@stdlib/utils/is-browser' );
var readDir = require( '@stdlib/fs/read-dir' ).sync;
var extname = require( '@stdlib/utils/extname' );
var dataDir = require( './data_dir.js' );
var RE = require( './re_filename.js' );


// VARIABLES //

var list;


// FUNCTIONS //

/**
* Generates a sorted list of JSON data file filenames by reading the file system.
*
* @private
* @returns {StringArray} filenames
*/
function read() {
	var fpath;
	var files;
	var stats;
	var out;
	var f;
	var i;

	files = readDir( dataDir );
	out = [];
	for ( i = 0; i < files.length; i++ ) {
		f = files[ i ];
		if ( extname( f ) === '.json' && RE.test( f ) ) {
			fpath = join( dataDir, f );
			stats = fs.statSync( fpath );
			if ( stats.isFile() ) {
				out.push( f );
			}
		}
	}
	return out.sort();
} // end FUNCTION read()


// MAIN //

if ( isBrowser ) {
	list = require( './browser_file_list.json' );
} else {
	list = read();
}


// EXPORTS //

module.exports = list;
{'fraction_non_alphanumeric': 0.1841502519468621, 'fraction_numerical': 0.0009161704076958314, 'mean_word_length': 2.8248686514886163, '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': '3135546', 'n_tokens_mistral': 853, 'n_tokens_neox': 808, 'n_words': 236}