diff options
Diffstat (limited to 'lib/models/pluginDependency.js')
-rw-r--r-- | lib/models/pluginDependency.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/models/pluginDependency.js b/lib/models/pluginDependency.js index e5deef0..f668013 100644 --- a/lib/models/pluginDependency.js +++ b/lib/models/pluginDependency.js @@ -2,6 +2,7 @@ var is = require('is'); var semver = require('semver'); var Immutable = require('immutable'); +var PREFIX = require('../constants/pluginPrefix'); var DEFAULT_VERSION = '*'; /* @@ -31,6 +32,15 @@ PluginDependency.prototype.isEnabled = function() { }; /** + Return NPM ID for the dependency + + @return {String} +*/ +PluginDependency.prototype.getNpmID = function() { + return PluginDependency.nameToNpmID(this.getName()); +}; + +/** Is the plugin using a git dependency @return {Boolean} @@ -140,4 +150,14 @@ PluginDependency.listToArray = function(list) { .toJS(); }; +/** + Return NPM id for a plugin name + + @param {String} + @return {String} +*/ +PluginDependency.nameToNpmID = function(s) { + return PREFIX + s; +}; + module.exports = PluginDependency; |