<commit_before>var buildMoldsSelector = require('./build-molds-selector');

module.exports = function normalizeCondition(condition, alias) {

	var moldsSelector = buildMoldsSelector(alias);
	var moldSelected;
	var normalized;

	while(moldSelected = moldsSelector.exec(condition)) {
		normalized = condition.replace(
			moldSelected[0],
			'fillers.' + moldSelected[1]
		);
		if(!normalized) return condition;
		return normalized
	}

};
<commit_msg>Add support of multiple molds per condition<commit_after>var buildMoldsSelector = require('./build-molds-selector');

module.exports = function normalizeCondition(condition, alias) {

	var moldsSelector = buildMoldsSelector(alias);
	var moldSelected;

	while(moldSelected = moldsSelector.exec(condition)) {
		condition = condition.replace(
			new RegExp(moldSelected[0], 'g'),
			'fillers.' + moldSelected[1]
		);
	}

	return condition;

};

{'fraction_non_alphanumeric': 0.1203599550056243, 'fraction_numerical': 0.0044994375703037125, 'mean_word_length': 5.4963503649635035, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2730028', 'n_tokens_mistral': 287, 'n_tokens_neox': 265, 'n_words': 55}