diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-05-11 13:02:20 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-05-11 13:02:24 +0200 |
commit | ef589a6b133ac67a7904f8bb2cbec42c96dec914 (patch) | |
tree | d505c567cd80b0681bbf5f7b46b2a25ed591e28a /lib/models/config.js | |
parent | d5c4af337795ca5c3d4e6f516aeaef15d51c4e8c (diff) | |
download | gitbook-ef589a6b133ac67a7904f8bb2cbec42c96dec914.zip gitbook-ef589a6b133ac67a7904f8bb2cbec42c96dec914.tar.gz gitbook-ef589a6b133ac67a7904f8bb2cbec42c96dec914.tar.bz2 |
Switch tests to mocha while keeping jest structure
Diffstat (limited to 'lib/models/config.js')
-rw-r--r-- | lib/models/config.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/models/config.js b/lib/models/config.js index 3310a93..070fe92 100644 --- a/lib/models/config.js +++ b/lib/models/config.js @@ -69,13 +69,27 @@ Config.prototype.getPluginDependencies = function() { }; /** + Return a plugin dependency by its name + + @param {String} name + @return {PluginDependency} +*/ +Config.prototype.getPluginDependency = function(name) { + var plugins = this.getPluginDependencies(); + + return plugins.find(function(dep) { + return dep.getName() === name; + }); +}; + +/** Update the list of plugins dependencies @param {List<PluginDependency>} @return {Config} */ Config.prototype.setPluginDependencies = function(deps) { - var plugins = PluginDependency.listFromArray(deps); + var plugins = PluginDependency.listToArray(deps); return this.setValue('plugins', plugins); }; |