Skip to content

Commit

Permalink
refactor: Use Array.isArray() instead of instanceof Array
Browse files Browse the repository at this point in the history
It's faster in newer versions of V8.
  • Loading branch information
nwoltman committed Nov 2, 2019
1 parent a821775 commit 4e73a2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/MySQLTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class MySQLTable {
sqlString = '';
}

if (data instanceof Array) {
if (Array.isArray(data)) {
data = data.length > 1
? ' (' + this._db.escapeId(data[0]) + ') VALUES ' + this._db.escape(data[1])
: ' VALUES ' + this._db.escape(data[0]);
Expand Down

0 comments on commit 4e73a2e

Please sign in to comment.