Compare commits
1 Commits
temp/debug
...
temp/debug
Author | SHA1 | Date | |
---|---|---|---|
5573c45158 |
@@ -14,9 +14,13 @@ module.exports = {
|
|||||||
getSetting,
|
getSetting,
|
||||||
ignoreFiles,
|
ignoreFiles,
|
||||||
makeTOTP,
|
makeTOTP,
|
||||||
SettingScope,
|
expTest,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function expTest(foo) {
|
||||||
|
return foo * 2;
|
||||||
|
}
|
||||||
|
|
||||||
const SettingScope = {
|
const SettingScope = {
|
||||||
// query a setting first from the login, then the store, then globally
|
// query a setting first from the login, then the store, then globally
|
||||||
Login: "login",
|
Login: "login",
|
||||||
@@ -32,11 +36,10 @@ const SettingScope = {
|
|||||||
* @param string key Setting key
|
* @param string key Setting key
|
||||||
* @param object login Login object
|
* @param object login Login object
|
||||||
* @param object settings Settings object
|
* @param object settings Settings object
|
||||||
* @param string scope SettingScope value to specify where to search for the setting (optional)
|
|
||||||
* @return object Setting value
|
* @return object Setting value
|
||||||
*/
|
*/
|
||||||
function getSetting(key, login, settings, scope = SettingScope.Login) {
|
function getSetting(key, login, settings) {
|
||||||
if (scope === SettingScope.Login && typeof login.settings[key] !== "undefined") {
|
if (typeof login.settings[key] !== "undefined") {
|
||||||
return login.settings[key];
|
return login.settings[key];
|
||||||
}
|
}
|
||||||
if (typeof settings.stores[login.store.id].settings[key] !== "undefined") {
|
if (typeof settings.stores[login.store.id].settings[key] !== "undefined") {
|
||||||
|
Reference in New Issue
Block a user