mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-17 08:05:19 +00:00
23 lines
463 B
JavaScript
23 lines
463 B
JavaScript
|
|
/**
|
|
Remove a plugin from a book's configuration
|
|
|
|
@param {Book} book
|
|
@param {String} plugin
|
|
@return {Book}
|
|
*/
|
|
function removePlugin(book, pluginName) {
|
|
var config = book.getConfig();
|
|
var deps = config.getPluginDependencies();
|
|
|
|
|
|
deps = deps.filter(function(dep) {
|
|
return dep.getName() === pluginName;
|
|
});
|
|
config = config.setPluginDependencies(deps);
|
|
|
|
return book.setConfig(config);
|
|
}
|
|
|
|
module.exports = removePlugin;
|