<commit_before>#!/usr/bin/env node

'use strict';

var test = require('tape');
var path = require('path');
var fs = require('fs');
var existsSync = path.existsSync || fs.existsSync;

var args = process.argv.slice(2); // remove node, and script name

var argEquals = function (argName) {
	return function (arg) {
		return arg === argName;
	};
};
var not = function (fn) {
	return function () {
		return !fn.apply(this, arguments);
	};
};

var isBound = args.some(argEquals('--bound'));
var isProperty = args.some(argEquals('--property'));
var makeEntries = function (name) {
	return [name, name];
};
var moduleNames = args
	.filter(not(argEquals('--bound')))
	.filter(not(argEquals('--property')))
	.map(makeEntries);

if (moduleNames.length < 1) {
	var packagePath = path.join(process.cwd(), 'package.json');
	if (!existsSync(packagePath)) {
		console.error('Error: No package.json found in the current directory');
		console.error('at least one module name is required when not run in a directory with a package.json');
		process.exit(1);
	}
	var pkg = require(packagePath);
	if (!pkg.name) {
		console.error('Error: No "name" found in package.json');
		process.exit(2);
	}
	moduleNames.push([pkg.name + ' (current directory)', [path.join(process.cwd(), pkg.main || ''), process.cwd()]]);
}
var requireOrEvalError = function (name) {
	try {
		return require(name);
	} catch (e) {
		return new EvalError(e.message);
	}<commit_msg>[Refactor] skip all `--`-prefixed args.<commit_after>#!/usr/bin/env node

'use strict';

var test = require('tape');
var path = require('path');
var fs = require('fs');
var existsSync = path.existsSync || fs.existsSync;

var args = process.argv.slice(2); // remove node, and script name

var argEquals = function (argName) {
	return function (arg) {
		return arg === argName;
	};
};
var not = function (fn) {
	return function () {
		return !fn.apply(this, arguments);
	};
};
var isArg = function (x) {
	return x.slice(0, 2) === '--';
};

var isBound = args.some(argEquals('--bound'));
var isProperty = args.some(argEquals('--property'));
var makeEntries = function (name) {
	return [name, name];
};
var moduleNames = args.filter(not(isArg)).map(makeEntries);

if (moduleNames.length < 1) {
	var packagePath = path.join(process.cwd(), 'package.json');
	if (!existsSync(packagePath)) {
		console.error('Error: No package.json found in the current directory');
		console.error('at least one module name is required when not run in a directory with a package.json');
		process.exit(1);
	}
	var pkg = require(packagePath);
	if (!pkg.name) {
		console.error('Error: No "name" found in package.json');
		process.exit(2);
	}
	moduleNames.push([pkg.name + ' (current directory)', [path.join(process.cwd(), pkg.main || ''), process.cwd()]]);
}
var requireOrEvalError = function (name) {
	try {
		return require(name);
	} catch (e) {
		return new EvalError(e.message);
	}
{'fraction_non_alphanumeric': 0.17681660899653978, 'fraction_numerical': 0.0034602076124567475, 'mean_word_length': 4.517175572519084, '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': '6209220', 'n_tokens_mistral': 986, 'n_tokens_neox': 958, 'n_words': 262}