Comparing version 1.1.2 to 1.1.3
14
index.js
@@ -199,3 +199,10 @@ 'use strict'; | ||
var _options = { error: error }; | ||
return instance.execPost(name, context, args, _options, function(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 typeof callback === 'function' && callback(error); | ||
@@ -213,3 +220,3 @@ }); | ||
var argsWithoutCb = typeof lastArg === 'function' ? | ||
args.slice(1) : | ||
args.slice(0, args.length - 1) : | ||
args; | ||
@@ -235,2 +242,3 @@ var _this = this; | ||
fn.apply(context, args.slice(0, end).concat(function() { | ||
var args = arguments; | ||
var argsWithoutError = Array.prototype.slice.call(arguments, 1); | ||
@@ -240,3 +248,3 @@ if (arguments[0]) { | ||
return _handleWrapError(_this, arguments[0], name, context, | ||
argsWithoutError, options, lastArg); | ||
args, options, lastArg); | ||
} else { | ||
@@ -243,0 +251,0 @@ if (useLegacyPost && typeof lastArg === 'function') { |
{ | ||
"name": "kareem", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"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
54047
1227