diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-06-07 00:56:24 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-06-07 00:56:24 +0200 |
commit | bf895b707e6cc4ca5fdf4ade5bb9235f1b1b99ca (patch) | |
tree | e5a8d3b5d5dc4d4ea91415a1c11b7041f72de7d2 /lib/modifiers/config/removePlugin.js | |
parent | 996170a4ade4f72df2efb6ee2e75edaab669809f (diff) | |
download | gitbook-bf895b707e6cc4ca5fdf4ade5bb9235f1b1b99ca.zip gitbook-bf895b707e6cc4ca5fdf4ade5bb9235f1b1b99ca.tar.gz gitbook-bf895b707e6cc4ca5fdf4ade5bb9235f1b1b99ca.tar.bz2 |
Improve addPlugin to not append default plugins to the list
Diffstat (limited to 'lib/modifiers/config/removePlugin.js')
-rw-r--r-- | lib/modifiers/config/removePlugin.js | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/modifiers/config/removePlugin.js b/lib/modifiers/config/removePlugin.js index 123be0b..dd7c248 100644 --- a/lib/modifiers/config/removePlugin.js +++ b/lib/modifiers/config/removePlugin.js @@ -1,5 +1,5 @@ -var DEFAULT_PLUGINS = require('../../constants/defaultPlugins'); var togglePlugin = require('./togglePlugin'); +var isDefaultPlugin = require('./isDefaultPlugin'); /** * Remove a plugin from a book's configuration @@ -10,12 +10,8 @@ var togglePlugin = require('./togglePlugin'); function removePlugin(config, pluginName) { var deps = config.getPluginDependencies(); - var isDefault = DEFAULT_PLUGINS.find(function(dep) { - return dep.getName() === pluginName; - }); - // For default plugin, we have to disable it instead of removing from the list - if (isDefault) { + if (isDefaultPlugin(pluginName)) { return togglePlugin(config, pluginName, false); } |