Skip to content

Commit

Permalink
fix(insert): Support documented mysql promise based insert command.
Browse files Browse the repository at this point in the history
Adds the ability to call the insert function with 3 arguments without a callback.

fixes db-migrate/node-db-migrate#606
Signed-off-by: Roger Wakeman <rgrwkmn@gmail.com>
  • Loading branch information
rgrwkmn committed Jan 16, 2019
1 parent 7af3f80 commit 986b190
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@ var Base = Class.extend({

var columnNameArray = {};

if( arguments.length > 3 ) {
if( arguments.length > 3 || Array.isArray(callback)) {

columnNameArray = valueArray;
valueArray = callback;
callback = arguments[3];
callback = arguments[3] ? arguments[3] : throw;
}
else {

Expand Down

0 comments on commit 986b190

Please sign in to comment.