Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Object.keys(obj).forEach(function(name) {
var pkg = allPlugins[name];
var newPkg = obj[name];
if (!pkg || pkg.path != newPkg.path || pkg.mtime != newPkg.mtime) {
++count;
fse.readJson(newPkg.pkgPath, function(err, result) {
if (result && result.version) {
var conf = result.whistleConfig || '';
var hintList = util.getHintList(conf);
var simpleName = name.slice(0, -1);
newPkg.version = result.version;
newPkg.priority = parseInt(conf.priority, 10) || parseInt(result.pluginPriority, 10) || 0;
newPkg.rulesUrl = util.getCgiUrl(conf.rulesUrl);
newPkg.valuesUrl = util.getCgiUrl(conf.valuesUrl);
newPkg.networkMenus = util.getPluginMenu(conf.networkMenus || conf.networkMenu, simpleName);
newPkg.rulesMenus = util.getPluginMenu(conf.rulesMenus || conf.rulesMenu, simpleName);
newPkg.valuesMenus = util.getPluginMenu(conf.valuesMenus || conf.valuesMenu, simpleName);
newPkg[util.PLUGIN_MENU_CONFIG] = util.getPluginMenuConfig(conf);
newPkg.hintUrl = hintList ? undefined : util.getCgiUrl(conf.hintUrl);
newPkg.hintList = hintList;
newPkg.hideShortProtocol = !!conf.hideShortProtocol,
newPkg.hideLongProtocol = !!conf.hideLongProtocol,