summaryrefslogtreecommitdiffstats
path: root/lib/modifiers/config/removePlugin.js
blob: 70ec3b1ebe1d9bbf4ee9174605c5cf13899d6430 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

/**
 * Remove a plugin from a book's configuration
 * @param {Config} config
 * @param {String} plugin
 * @return {Config}
 */
function removePlugin(config, pluginName) {
    var deps = config.getPluginDependencies();

    deps = deps.filter(function(dep) {
        return dep.getName() === pluginName;
    });
    return config.setPluginDependencies(deps);
}

module.exports = removePlugin;