<commit_before>var config = module.exports = {};

var fs = require('fs');
config.data = require('../config.json');

config.update = function (req) {

	// Update the config object
	config.data[req.body.id - 1] = config.get(req);

	return config.data;
};

config.get = function(req) {
	return {
		id: req.body.id,
		name: req.body.name,
		setting: req.body.setting
	}
};
<commit_msg>added set function<commit_after>var config = module.exports = {};

var fs = require('fs');
config.data = [];

config.update = function (req) {

	var data = config.get(req);
	config.set()[data.id - 1] = data;
	
	return config.set();
};

config.get = function(req) {
	return {
		id: req.body.id,
		name: req.body.name,
		setting: req.body.setting
	};
};

config.set = function() {
	config.data = require('../config.json');
	return config.data;
};

{'fraction_non_alphanumeric': 0.1864406779661017, 'fraction_numerical': 0.002421307506053269, 'mean_word_length': 3.543956043956044, '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': '6313112', 'n_tokens_mistral': 309, 'n_tokens_neox': 295, 'n_words': 64}