luciotato/waitfor — pull request #20 by ryuken (2014-08-15 08:28:10+00:00)
Title: Changed "resumeCallback", because when you have a function with a callba...

...ck parameter you currently only get the second parameter, but when the callback has more than two parameters there isn't any option to get them.

Example:
connection.query(sql, data, function(err, rows, columns){ });

function query has a callback with parameters err, rows and columns.

Currently:
try {
var result = wait.forMethod(connection, "query", options.sql, options.params); // << result = rows
} catch(err) {
console.log(err);
}
You can catch the first param "err" and get the second param "rows" as the result, but there is not option to get the columns parameter.

With my fix, you get every param after the first param
try {
var result = wait.forMethod(connection, "query", options.sql, options.params); // << result = [rows, columns]
} catch(err) {
console.log(err);
}