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

/**
 * 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;