Comparing version 1.3.0 to 1.3.1
11
index.js
@@ -114,6 +114,10 @@ module.exports = chainit; | ||
var ctx = this; | ||
var callArguments = arguments; | ||
var callArguments = Array.prototype.slice.call(arguments); | ||
var args = Array.prototype.slice.call(arguments); | ||
var customCb; | ||
if (callArguments[callArguments.length - 1] instanceof Function) { | ||
callArguments.pop(); | ||
} | ||
if (typeof args[args.length - 1] === 'function') { | ||
@@ -138,7 +142,2 @@ customCb = args.pop(); | ||
if (arguments[0] instanceof Error) { | ||
callArguments = Array.prototype.slice.call(callArguments); | ||
if (callArguments[callArguments.length - 1] instanceof Function) { | ||
callArguments.pop(); | ||
} | ||
arguments[0].message = '[' + fnName + niceArgs(callArguments) + '] ' + arguments[0].message; | ||
@@ -145,0 +144,0 @@ } |
{ | ||
"name": "chainit", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Turn an asynchronous JavaScript api into an asynchronous chainable JavaScript api.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
24258
642