config-util: Change return to a single return statement in isConfigItemExists.

Also add comments to describe the isConfigItemExists function.
This commit is contained in:
Abhigyan Khaund
2018-06-14 09:17:44 -07:00
committed by Akash Nimare
parent c742591471
commit 22d6c6a2f3

View File

@@ -48,15 +48,11 @@ class ConfigUtil {
return value;
}
}
// This function returns whether a key exists in the configuration file (settings.json)
isConfigItemExists(key) {
this.reloadDB();
const value = this.db.getData('/')[key];
if (value === undefined) {
return false;
} else {
return true;
}
return (value !== undefined);
}
setConfigItem(key, value) {