nats-hemera
Advanced tools
Comparing version 0.2.7 to 0.2.8
@@ -313,6 +313,32 @@ // | ||
*/ | ||
ext(type, handler) { | ||
ext(type, handler, globalScoped) { | ||
this._extensions[type].subscribe(handler) | ||
let self = this | ||
this._extensions[type].subscribe(function (next) { | ||
let currentAct = this._actMeta.plugin | ||
let currentPlugin = self.plugin$.attributes | ||
// when we have a plugin context and the ext is plugin scoped only. | ||
if (!globalScoped && currentPlugin && currentPlugin.private) { | ||
if (currentAct && currentPlugin) { | ||
if (currentPlugin.name === currentAct.name) { | ||
return handler.call(this, next) | ||
} else { | ||
return next() | ||
} | ||
} | ||
return next() | ||
} else { | ||
return handler.call(this, next) | ||
} | ||
}) | ||
} | ||
@@ -656,3 +682,4 @@ /** | ||
pattern: origPattern, | ||
action: cb | ||
action: cb, | ||
plugin: this.plugin$.attributes | ||
} | ||
@@ -659,0 +686,0 @@ |
{ | ||
"name": "nats-hemera", | ||
"author": "Dustin Deus (https://github.com/StarpTech)", | ||
"version": "0.2.7", | ||
"version": "0.2.8", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "homepage": "https://hemerajs.github.io/hemera/", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
981
29539