Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// use id as initial moduleName
var moduleName = module;
// customize module name
if (module === 'other') {
moduleName = i18n['selector.other'];
} else {
// fetch module name, if module is an moduleId
var moduleInfo = CMS.getModule(module);
if (moduleInfo) {
moduleName = moduleInfo.name;
}
// add All Modules selector
var allXModulesTitle = JSON.parse(JSON.stringify(i18n['selector.allXModules'])) || ['{moduleName}'];
Object.keys(allXModulesTitle).forEach(function (key) {
allXModulesTitle[key] = allXModulesTitle[key].replace('{moduleName}', moduleName);
});
var allXModulesSelector = '.' + module; // TODO: legacy modules added &.moduleId
selectors.unshift({title: allXModulesTitle, selector: allXModulesSelector});
}
// add to list
allModules.push([module, moduleName]);
// save selector by module and selector config by selector
selectorByModule[module] = [];
selectorConfigByModule[module] = {};
var addSelectors = function thisFn(module, moduleSelectors, hierarchy) {