<commit_before>'use strict';

/*!
 * snakeskin-loader
 * https://github.com/SnakeskinTpl/snakeskin-loader
 *
 * Released under the MIT license
 * https://github.com/SnakeskinTpl/snakeskin-loader/blob/master/LICENSE
 */

const
	$C = require('collection.js/compiled'),
	parent = module.parent;

const
	path = require('path'),
	loaderUtils = require('loader-utils'),
	snakeskin = require('snakeskin'),
	beautify = require('js-beautify'),
	exists = require('exists-sync');

module.exports = function (source) {
	this.cacheable && this.cacheable();

	const
		ssrc = path.join(process.cwd(), '.snakeskinrc'),
		cb = this.async();

	let opts = loaderUtils.parseQuery(this.query);
	if (!this.query && exists(ssrc)) {
		opts = snakeskin.toObj(ssrc);
	}

	opts = $C(opts).reduce((map, val, key) => {
		map[key] = parse(val);
		return map;

	}, Object.assign({
		module: 'cjs',
		eol: '\n',
		pack: true
	}, this.options.snakeskin));

	const
		eol = opts.eol,
		prettyPrint = opts.prettyPrint,
		nRgxp = /\r?\n|\r/g;

	if (opts.exec && opts.prettyPrint) {
		opts.prettyPrint = false;
	}

	opts.debug = {};
	opts.cache = false;
	opts.throws = true;

	const
		file = this.resourcePath,
		info = {file};

	function cache() {
		$C(opts.debug.files).forEach((bool, filePath) => this.addDependency(filePath));
	}

	if (opts.adapter || opts.jsx) {
		return require(opts.jsx ? 'ss2react' : opts.adapter).adapter(source, opts, info).then(
			(res) => {
				cache();
				cb(null, res);
			},

			(err) => {
				cb(err);
			}
		);
	}

	try {
		const
			tpls = {};

		if (opts.exec) {
			opts.module = 'cjs';
			opts.context = tpls;
		}
<commit_msg>:wrench:<commit_after>'use strict';

/*!
 * snakeskin-loader
 * https://github.com/SnakeskinTpl/snakeskin-loader
 *
 * Released under the MIT license
 * https://github.com/SnakeskinTpl/snakeskin-loader/blob/master/LICENSE
 */

const
	$C = require('collection.js/compiled'),
	parent = module.parent;

const
	path = require('path'),
	loaderUtils = require('loader-utils'),
	snakeskin = require('snakeskin'),
	beautify = require('js-beautify'),
	exists = require('exists-sync');

module.exports = function (source) {
	this.cacheable && this.cacheable();

	const
		ssrc = path.join(process.cwd(), '.snakeskinrc'),
		cb = this.async();

	let opts = loaderUtils.parseQuery(this.query);
	if (!this.query && exists(ssrc)) {
		opts = snakeskin.toObj(ssrc);
	}

	opts = $C(opts).reduce((map, val, key) => {
		map[key] = parse(val);
		return map;

	}, Object.assign({
		module: 'cjs',
		eol: '\n',
		pack: true
	}, this.options.snakeskin));

	const
		eol = opts.eol,
		prettyPrint = opts.prettyPrint,
		nRgxp = /\r?\n|\r/g;

	if (opts.exec && opts.prettyPrint) {
		opts.prettyPrint = false;
	}

	opts.debug = {};
	opts.cache = false;
	opts.throws = true;

	const
		file = this.resourcePath,
		info = {file};

	const cache = () => {
		$C(opts.debug.files).forEach((bool, filePath) => this.addDependency(filePath));
	};

	if (opts.adapter || opts.jsx) {
		return require(opts.jsx ? 'ss2react' : opts.adapter).adapter(source, opts, info).then(
			(res) => {
				cache();
				cb(null, res);
			},

			(err) => {
				cb(err);
			}
		);
	}

	try {
		const
			tpls = {};

		if (opts.exec) {
			opts.module = 'cjs';
			opts.context = tpls;
		}

{'fraction_non_alphanumeric': 0.18763457397723776, 'fraction_numerical': 0.0006151953245155337, 'mean_word_length': 3.4065040650406506, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 4, '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': '1927838', 'n_tokens_mistral': 1351, 'n_tokens_neox': 1224, 'n_words': 224}