kareem 2.0.4 → 2.0.5

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 +4 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -304,6 +304,10 @@ Kareem.prototype.wrap = function(name, fn, context, args, options) {
304
304
 
305
305
  Kareem.prototype.createWrapper = function(name, fn, context, options) {
306
306
  var _this = this;
307
+ if (this._pres[name] == null && this._posts[name] == null) {
308
+ // Fast path: if there's no hooks for this function, just return the function
309
+ return fn;
310
+ }
307
311
  return function() {
308
312
  var _context = context || this;
309
313
  var args = Array.prototype.slice.call(arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kareem",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "Next-generation take on pre/post function hooks",
5
5
  "main": "index.js",
6
6
  "scripts": {