refactor(config) manage

This commit is contained in:
coderaiser 2016-12-05 15:38:29 +02:00
parent 10ecf62ed5
commit cc78d19fc9
2 changed files with 50 additions and 8 deletions

View file

@ -59,15 +59,13 @@ module.exports.listen = function(socket, authCheck) {
};
function manage(key, value) {
var result;
if (!key)
return;
if (value === undefined)
return config[key];
if (key)
if (value === undefined)
result = config[key];
else
config[key] = value;
return result;
config[key] = value;
}
function save(callback) {