mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
refactor(config) manage
This commit is contained in:
parent
10ecf62ed5
commit
cc78d19fc9
2 changed files with 50 additions and 8 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue