mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 15:45:13 +00:00
16 lines
372 B
JavaScript
16 lines
372 B
JavaScript
|
|
/**
|
|
* Test if a plugin is listed
|
|
* @param { {List<PluginDependency}} deps
|
|
* @param {String} plugin
|
|
* @param {String} version
|
|
* @return {Boolean}
|
|
*/
|
|
function hasPlugin(deps, pluginName, version) {
|
|
return !!deps.find(function(dep) {
|
|
return dep.getName() === pluginName && (!version || dep.getVersion() === version);
|
|
});
|
|
}
|
|
|
|
module.exports = hasPlugin;
|