+1
-1
| { | ||
| "name": "js-plugin", | ||
| "version": "1.0.8", | ||
| "version": "1.0.9", | ||
| "repository": "rekit/js-plugin", | ||
@@ -5,0 +5,0 @@ "main": "plugin.js", |
+16
-0
@@ -5,2 +5,14 @@ var _plugins = []; | ||
| // Only support debug mode on browser and node, not web workers. | ||
| var isBrowser = | ||
| typeof window !== "undefined" && typeof window.document !== "undefined"; | ||
| var isNode = | ||
| typeof process !== "undefined" && | ||
| process.versions != null && | ||
| process.versions.node != null; | ||
| var isDebug = (isBrowser && document.location.search.includes('JS_PLUGIN_DEBUG')) | ||
| || (isNode && process.env && process.env.JS_PLUGIN_DEBUG); | ||
| function _isFunc(o) { | ||
@@ -110,2 +122,3 @@ return !!(o.constructor && o.call && o.apply); | ||
| var obj = arr.join('.'); | ||
| return this.getPlugins(prop).map(function(p) { | ||
@@ -115,2 +128,3 @@ var method = _get(p, prop); | ||
| try { | ||
| isDebug && console.log('Before', p.name, prop, args); | ||
| return method.apply(_get(p, obj), args); | ||
@@ -122,2 +136,4 @@ } catch (err) { | ||
| else console.log(err); | ||
| } finally { | ||
| isDebug && console.log('After ', p.name, prop, args); | ||
| } | ||
@@ -124,0 +140,0 @@ return null; |
+2
-0
@@ -7,2 +7,4 @@ # Overview | ||
| [<img src="https://opencollective.com/rekit/tiers/backers.svg?avatarHeight=60"/>](https://opencollective.com/rekit) | ||
| # Motivation | ||
@@ -9,0 +11,0 @@ Web applications are becoming more and more complicated nowadays. To separate concerns, decouple business logic, a large application should be well designed. One of best practices is plugin based architecture. Whenever you add a new feature, it should not add much complication to the system so that the project could be always maintainable when it grows. |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
18360
3.85%154
8.45%361
0.56%3
200%