From fba491592d7a9d992dd4518ae9a0ad564d7558ac Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 25 Apr 2018 10:57:23 -0400 Subject: [PATCH] add function to check if context has specified context --- lib/core/plugin.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/core/plugin.js b/lib/core/plugin.js index bd7aaf0bf..00abe240c 100644 --- a/lib/core/plugin.js +++ b/lib/core/plugin.js @@ -49,6 +49,10 @@ Plugin.prototype.isContextValid = function() { }); }; +Plugin.prototype.hasContext = function(context) { + return this.currentContext.includes(context); +}; + Plugin.prototype.loadPlugin = function() { if (!this.isContextValid()) { console.log(this.acceptedContext);