<commit_before>define([
	'../smartEvents'
], (ev) => {
	function init(){
		const toConvert = ["layers","nodeSizingModes","linkSizingModes"];
		const toInit = ["expandedLayers","hideLayers"];
		let used = false;
		ev.on("config.default", (preConfig)=>{
			used = true;
			for(let item of toConvert){
				if(!preConfig.hasOwnProperty(item)) preConfig[item] = [];
				preConfig[item] = parseCriteria(preConfig[item]);
			}
			for(let item of toInit){
				if(!preConfig.hasOwnProperty(item)) preConfig[item] = {dummyPlaceHolder: true};
			}
		});
		setTimeout(()=>{
			if(!used) ev.send('plugin.configParser.err', {
				'type': 'plugin.configParser.err',
				'value': 'configParse have never catch config.pre-ready. configLoader have probably finish before configParser start.'
			});
		},10000);
	}
	function parseCriteria(criteria) {
		for(let i = 0; i< criteria.length;i++) criteria[i] = parseCriterionTree(criteria[i]);
		return criteria;
	}

function parseCriterionTree(criterion) { //FIXME: duplication avec __parseEntry dans form.js
	if(criterion.name) return criterion;

	for (let unicKey in criterion) {
		if(Array.isArray(criterion[unicKey])) return {name:unicKey,sub:appendPrefix(unicKey,criterion[unicKey])};
		return {name:unicKey,criterion:criterion[unicKey]};
	}
}<commit_msg>fix toInit dummy value to avoid conflict<commit_after>define([
	'../smartEvents'
], (ev) => {
	function init(){
		const toConvert = ["layers","nodeSizingModes","linkSizingModes"];
		const toInit = ["expandedLayers","hideLayers"];
		let used = false;
		ev.on("config.default", (preConfig)=>{
			used = true;
			for(let item of toConvert){
				if(!preConfig.hasOwnProperty(item)) preConfig[item] = [];
				preConfig[item] = parseCriteria(preConfig[item]);
			}
			for(let item of toInit){
				if(!preConfig.hasOwnProperty(item)) preConfig[item] = {dummyPlaceHolder: 0};
			}
		});
		setTimeout(()=>{
			if(!used) ev.send('plugin.configParser.err', {
				'type': 'plugin.configParser.err',
				'value': 'configParse have never catch config.pre-ready. configLoader have probably finish before configParser start.'
			});
		},10000);
	}
	function parseCriteria(criteria) {
		for(let i = 0; i< criteria.length;i++) criteria[i] = parseCriterionTree(criteria[i]);
		return criteria;
	}

function parseCriterionTree(criterion) { //FIXME: duplication avec __parseEntry dans form.js
	if(criterion.name) return criterion;

	for (let unicKey in criterion) {
		if(Array.isArray(criterion[unicKey])) return {name:unicKey,sub:appendPrefix(unicKey,criterion[unicKey])};
		return {name:unicKey,criterion:criterion[unicKey]};
	}
}
{'fraction_non_alphanumeric': 0.1585835257890685, 'fraction_numerical': 0.0050038491147036184, 'mean_word_length': 5.2626506024096384, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2122742', 'n_tokens_mistral': 949, 'n_tokens_neox': 862, 'n_words': 176}