<commit_before>"use strict";

const os = require("os");

const getErrorFor = (shouldBeAbsolute, data, schema) => {
	const message = shouldBeAbsolute ?
		`The provided value ${JSON.stringify(data)} is not an absolute path!${os.EOL}`
		: `A non absolut path is expected. However the provided value ${JSON.stringify(data)} is an absolute path!${os.EOL}`;

	return {
		keyword: "absolutePath",
		params: { absolutePath: data },
		message: message,
		parentSchema: schema,
	};
};
module.exports = (ajv) => ajv.addKeyword("absolutePath", {
	errors: true,
	type: "string",
	compile(expected, schema) {
		function callback(data) {
			const passes = expected === /^(?:[a-zA-Z]:)?(?:\/|\\)/.test(data);
			if(!passes) {
				getErrorFor(expected, data, schema);
				callback.errors = [getErrorFor(expected, data, schema)];
			}
			return passes;
		}
		callback.errors = [];
		return callback;
	}
});
<commit_msg>remove superfluous call to getError<commit_after>"use strict";

const os = require("os");

const getErrorFor = (shouldBeAbsolute, data, schema) => {
	const message = shouldBeAbsolute ?
		`The provided value ${JSON.stringify(data)} is not an absolute path!${os.EOL}`
		: `A non absolut path is expected. However the provided value ${JSON.stringify(data)} is an absolute path!${os.EOL}`;

	return {
		keyword: "absolutePath",
		params: { absolutePath: data },
		message: message,
		parentSchema: schema,
	};
};
module.exports = (ajv) => ajv.addKeyword("absolutePath", {
	errors: true,
	type: "string",
	compile(expected, schema) {
		function callback(data) {
			const passes = expected === /^(?:[a-zA-Z]:)?(?:\/|\\)/.test(data);
			if(!passes) {
				callback.errors = [getErrorFor(expected, data, schema)];
			}
			return passes;
		}
		callback.errors = [];
		return callback;
	}
});

{'fraction_non_alphanumeric': 0.17106001121704992, 'fraction_numerical': 0.0, 'mean_word_length': 4.27810650887574, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7630553', 'n_tokens_mistral': 627, 'n_tokens_neox': 585, 'n_words': 151}