<commit_before>import postcss from 'postcss';
import balanced from 'balanced-match';
import _ from 'lodash';

const VAR_FUNC_IDENTIFIER = 'var';
const maps = {};

function resolveValue(value) {
	const start = value.indexOf(`${VAR_FUNC_IDENTIFIER}(`);
	if (start === -1) {
		return [value];
	}

	value.match(/var\(\S*\)/g).map(match => {
		const matches = balanced('(', ')', match);
		const reg = new RegExp(`${VAR_FUNC_IDENTIFIER}.(${matches.body}.)`, 'g');
		const property = maps[matches.body];

		value = value.replace(reg, property);
	});
	return value;
}
<commit_msg>Fixed #10, Wrong loop syntax<commit_after>import postcss from 'postcss';
import balanced from 'balanced-match';
import _ from 'lodash';

const VAR_FUNC_IDENTIFIER = 'var';
const maps = {};

function resolveValue(value) {
	const start = value.indexOf(`${VAR_FUNC_IDENTIFIER}(`);
	if (start === -1) {
		return value;
	}

	value.match(/var\(\S*\)/g).map(match => {
		const matches = balanced('(', ')', match);
		const reg = new RegExp(`${VAR_FUNC_IDENTIFIER}.(${matches.body}.)`, 'g');
		const property = maps[matches.body];

		value = value.replace(reg, property);
	});
	return value;
}

{'fraction_non_alphanumeric': 0.19014693171996544, 'fraction_numerical': 0.003457216940363008, 'mean_word_length': 4.819095477386934, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4071600', 'n_tokens_mistral': 414, 'n_tokens_neox': 395, 'n_words': 92}