kareem 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -302,9 +302,13 @@ Kareem.prototype.wrap = function(name, fn, context, args, options) {
|
|
|
302
302
|
});
|
|
303
303
|
};
|
|
304
304
|
|
|
305
|
+
Kareem.prototype.hasHooks = function(name) {
|
|
306
|
+
return this._pres[name] != null || this._posts[name] != null;
|
|
307
|
+
};
|
|
308
|
+
|
|
305
309
|
Kareem.prototype.createWrapper = function(name, fn, context, options) {
|
|
306
310
|
var _this = this;
|
|
307
|
-
if (this.
|
|
311
|
+
if (!this.hasHooks(name)) {
|
|
308
312
|
// Fast path: if there's no hooks for this function, just return the
|
|
309
313
|
// function wrapped in a nextTick()
|
|
310
314
|
return function() {
|