<commit_before>#!/usr/bin/env node
'use strict';

const fs = require('fs');

const beautifyText = require('beautify-text');
const glob = require('glob');
const through2 = require('through2');

if (process.argv.length > 2) {
	process.argv
		.slice(2)
		.map(pattern => glob.sync(pattern)) // extract matched filenames
		.reduce((acc, curr) => acc.concat(curr)) // concat all arrays into one
		// TODO: Deduplicate
		// .reduce((acc, curr) => acc.includes(curr) ? acc : acc.concat(curr))
		.forEach((filename) => {
			let fileReadStream = fs.createReadStream(filename);
			beautifyStream(fileReadStream);
		});
} else {
	beautifyStream(process.stdin);
}

function beautifyStream(stream) {
	const beautify = through2(function (chunk, enc, callback) {
		this.push(beautifyText(chunk.toString()));<commit_msg>Remove parentheses from around arrow function arg<commit_after>#!/usr/bin/env node
'use strict';

const fs = require('fs');

const beautifyText = require('beautify-text');
const glob = require('glob');
const through2 = require('through2');

if (process.argv.length > 2) {
	process.argv
		.slice(2)
		.map(pattern => glob.sync(pattern)) // extract matched filenames
		.reduce((acc, curr) => acc.concat(curr)) // concat all arrays into one
		// TODO: Deduplicate
		// .reduce((acc, curr) => acc.includes(curr) ? acc : acc.concat(curr))
		.forEach(filename => {
			let fileReadStream = fs.createReadStream(filename);
			beautifyStream(fileReadStream);
		});
} else {
	beautifyStream(process.stdin);
}

function beautifyStream(stream) {
	const beautify = through2(function (chunk, enc, callback) {
		this.push(beautifyText(chunk.toString()));
{'fraction_non_alphanumeric': 0.16199756394640683, 'fraction_numerical': 0.0060901339829476245, 'mean_word_length': 4.80565371024735, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '2687415', 'n_tokens_mistral': 562, 'n_tokens_neox': 535, 'n_words': 119}