Comparing version 1.4.2 to 1.5.0
16
index.js
@@ -149,3 +149,3 @@ 'use strict'; | ||
if (post.length === numArgs + 2) { | ||
post.apply(context, [firstError, null].concat(function(error) { | ||
post.apply(context, [firstError].concat(newArgs).concat(function(error) { | ||
if (error) { | ||
@@ -213,10 +213,3 @@ firstError = error; | ||
var _options = { error: error }; | ||
var newArgs = []; | ||
// Filter out trailing undefineds | ||
for (var i = args.length; i >= 0; --i) { | ||
if (newArgs.length > 0 || args[i] !== void 0) { | ||
newArgs.unshift(args[i]); | ||
} | ||
} | ||
return instance.execPost(name, context, newArgs, _options, function(error) { | ||
return instance.execPost(name, context, args, _options, function(error) { | ||
return typeof callback === 'function' && callback(error); | ||
@@ -262,6 +255,9 @@ }); | ||
var argsWithoutError = Array.prototype.slice.call(arguments, 1); | ||
if (options.nullResultByDefault && argsWithoutError.length === 0) { | ||
argsWithoutError.push(null); | ||
} | ||
if (arguments[0]) { | ||
// Assume error | ||
return _handleWrapError(_this, arguments[0], name, context, | ||
args, options, lastArg); | ||
argsWithoutError, options, lastArg); | ||
} else { | ||
@@ -268,0 +264,0 @@ if (useLegacyPost && typeof lastArg === 'function') { |
{ | ||
"name": "kareem", | ||
"version": "1.4.2", | ||
"version": "1.5.0", | ||
"description": "Next-generation take on pre/post function hooks", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
56201
1298