A bit easier to read:
var installed = WindowController.getInstalledPlugins();
return {
installedPlugins: _.intersection(conf.SUPPORTED_EDITORS, installed),
uninstalledPlugins: _.difference(conf.SUPPORTED_EDITORS, installed),
}Slightly (negligibly) more efficient:
return _.groupBy(conf.SUPPORTED_EDITORS,
(e) => _.includes(WindowController.getInstalledPlugins(), e) ? 'installedPlugins' : 'uninstalledPlugins');I'd probably prefer the former, but wanted to see what it would look like to only iterate through conf.SUPPORTED_EDITORS once.
I rather like the latter, but the former is probably more readable.