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.
Files changed (2) hide show
  1. package/index.js +5 -1
  2. 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._pres[name] == null && this._posts[name] == null) {
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() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kareem",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "Next-generation take on pre/post function hooks",
5
5
  "main": "index.js",
6
6
  "scripts": {