balderdashy/anchor — pull request #20 by joonho1101 (2013-08-31 10:57:20+00:00)
Title: Removed redundant if tests and fixed error info object construction

I believe what you were trying to do with _.reduce in function 'failure' to build error message was simply to join the arguments without the user input data, since data is passed as data property in error object.
So I simplified the process with args.join(',')

Also I removed (shifted) the user input data from args array, because I thought that is what you intended to do.
Otherwise, user input data is duplicated as both error.data and error.args[0].

I also removed and refactored some if / else if testings since it was doing some duplicate tests like calling isArray or isObject multiple times even if they were already checked previously.

I hope this commit helps! Thanks :)