danglers: function()

in src/plugman/util/dependencies.js [82:98]


    danglers: function (plugin_id, plugins_dir, platformJson, pluginInfoProvider) {
        let depsInfo;
        if (typeof plugins_dir === 'object') { depsInfo = plugins_dir; } else { depsInfo = pkg.generateDependencyInfo(platformJson, plugins_dir, pluginInfoProvider); }

        const { graph, top_level_plugins } = depsInfo;

        // get plugin_id's dependencies
        const dependencies = graph.getChain(plugin_id);

        // Calculate the set of all top-level plugins and their transitive dependencies
        const otherTlps = top_level_plugins.filter(tlp => tlp !== plugin_id);
        const otherTlpDeps = otherTlps.map(tlp => graph.getChain(tlp));
        const remainingPlugins = new Set(otherTlps.concat(...otherTlpDeps));

        // dependencies - remainingPlugins
        return dependencies.filter(p => !remainingPlugins.has(p));
    }